2c58d9fe by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 19a713f9 6429bf56
......@@ -49,11 +49,11 @@ export const checkDeleteDictionaryScheme = (params) => request({
data: params
})
// 分页查询
// export const getDictionary = (params) => request({
// url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`,
// method: 'post',
// data: params
// })
export const getDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`,
method: 'post',
data: params
})
// 查询数据字典启用状态的数据
export const getDictionaryAll = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all`,
......@@ -598,10 +598,10 @@ export const filterVal = (val, type) => {
/** 获取字典列表
* VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据
*/
export const getDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
method: 'post'
})
// export const getDictionary = (params) => request({
// url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
// method: 'post'
// })
......
......@@ -5,7 +5,7 @@
<script lang="ts" setup name="configureRules">
import { ref } from "vue";
import useUserStore from "@/store/modules/user";
import { getBizRuleConfigDetail, getNewDataTypeList, saveBizRuleConfig, } from '@/api/modules/dataInventory'
import { getBizRuleConfigDetail, getDictionaryAll, getNewDataTypeList, saveBizRuleConfig, } from '@/api/modules/dataInventory'
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
......@@ -45,9 +45,24 @@ const getFieldTypeData = async () => {
}
}
// 获取字典
const dictionaryList = ref([]);
const getDictionaryList = () => {
getDictionaryAll({ state: 1 }).then((res: any) => {
dictionaryList.value = [];
if (res.code == proxy.$passCode) {
dictionaryList.value = res.data || [];
} else {
proxy.$ElMessage.error(res.msg);
}
})
};
onMounted(async () => {
await getFieldTypeData()
await getBizRuleConfigDetailData()
getDictionaryList()
})
......@@ -78,6 +93,7 @@ const selectedRows = ref([]);
// 监听选中行变化
const selectionFieldsChange = (selection) => {
selectedRows.value = selection;
console.log('selectedRows', selectedRows.value)
};
// 上移操作
......@@ -87,7 +103,7 @@ const moveUp = () => {
return;
}
selectedRows.value.forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.tableData === row.tableData);
const index = tableData.value.findIndex((item) => item.fieldGuid === row.fieldGuid);
if (index > 0) {
[tableData.value[index - 1], tableData.value[index]] = [
tableData.value[index],
......@@ -105,7 +121,7 @@ const moveDown = () => {
}
// 倒序遍历选中行
[...selectedRows.value].reverse().forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.tableData === row.tableData);
const index = tableData.value.findIndex((item) => item.fieldGuid === row.fieldGuid);
if (index < tableData.value.length - 1) {
[tableData.value[index], tableData.value[index + 1]] = [
tableData.value[index + 1],
......@@ -383,10 +399,13 @@ const cancel = () => {
<!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
<el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.dictionaryGuid">{{ scope.row.isDict ? scope.row.isDict :
'--' }}</span>
<el-tree-select v-else v-model="scope.row.isDict" :data="data" placeholder="请选择" />
<span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
<el-select v-else v-model="scope.row.dictionaryGuid" placeholder="请选择">
<el-option v-for="item in dictionaryList" :key="item?.guid" :label="item.chName" :value="item.guid" />
</el-select>
</template>
</el-table-column>
<!-- 数据是否唯一(可编辑) -->
......
......@@ -677,7 +677,7 @@ const treePromise = ref();
// 获取数据字典树形数据
const getTreeData = (needClick = false, currData = {}) => {
const params = {
paramCode: 'data_structure_code'
paramCode: '数据字典类型'
}
treeInfo.value.loading = true
treePromise.value = getDictionaryTree(params).then((res: any) => {
......
......@@ -17,6 +17,7 @@ import {
getGradeList,
getNewDataTypeList,
getDbDirDetail,
getDictionaryAll,
} from "@/api/modules/dataInventory";
import existingTableSelect from "./existingTableSelect.vue";
import useUserStore from "@/store/modules/user";
......@@ -30,6 +31,21 @@ const fullPath = route.fullPath;
const userStore = useUserStore();
const execGuid: any = ref(route.query.execGuid);
// 获取字典
const dictionaryList = ref([]);
const getDictionaryList = () => {
getDictionaryAll({ state: 1 }).then((res: any) => {
dictionaryList.value = [];
if (res.code == proxy.$passCode) {
dictionaryList.value = res.data || [];
} else {
proxy.$ElMessage.error(res.msg);
}
})
};
// 获取数据库列表
const databaseList: any = ref([]);
const getDbDirDataSourceListData = async () => {
......@@ -189,6 +205,7 @@ onMounted(async () => {
await getDbDirDataSourceListData();
}
await getFieldTypeData();
getDictionaryList();
});
const stepsInfo = ref({
......@@ -1034,10 +1051,13 @@ onActivated(() => {
<!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
<el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.dictionaryGuid">{{ scope.row.isDict ? scope.row.isDict
: '--' }}</span>
<el-tree-select v-else v-model="scope.row.isDict" :data="data" placeholder="请选择" />
<span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
<el-select v-else v-model="scope.row.dictionaryGuid" placeholder="请选择">
<el-option v-for="item in dictionaryList" :key="item?.guid" :label="item.chName" :value="item.guid" />
</el-select>
</template>
</el-table-column>
<!-- 数据是否唯一(可编辑) -->
......
......@@ -33,7 +33,7 @@ import {
getSubjectTableDetail,
checkSubjectTableData
} from "@/api/modules/dataCatalogService";
import { getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList, saveDbDirTable } from "@/api/modules/dataInventory";
import { getDictionaryAll, getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList, saveDbDirTable } from "@/api/modules/dataInventory";
import { useDefault } from "@/hooks/useDefault";
import uploadExcelFile from "./components/uploadExcelFile.vue";
import { add } from "lodash-es";
......@@ -131,6 +131,20 @@ const getSubjectField = () => {
});
}
// 获取字典
const dictionaryList1 = ref([]);
const getDictionaryList1 = () => {
getDictionaryAll({ state: 1 }).then((res: any) => {
dictionaryList.value = [];
if (res.code == proxy.$passCode) {
dictionaryList1.value = res.data || [];
} else {
proxy.$ElMessage.error(res.msg);
}
})
};
// 定义分类选择器的属性
const treeSelectProps = {
label: "classifyName",
......@@ -213,6 +227,7 @@ const nextStep = () => {
tableCreateInfo.value.isSync = 'Y';
}
stepsInfo.value.step = 1;
getDictionaryList1()
// getDictionaryList();
// getDimListData();
if (!fieldTypes.value.length) {
......@@ -1861,7 +1876,7 @@ const tableSelectFields = computed(() => {
<span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span>
</template>
</el-table-column>
<el-table-column prop="dimOrdictionaryGuid" v-if="!isDimTable" label="关联维度/字典" width="130px" align="left"
<!-- <el-table-column prop="dimOrdictionaryGuid" v-if="!isDimTable" label="关联维度/字典" width="130px" align="left"
show-overflow-tooltip>
<template #default="scope">
<el-tree-select ref="dimOrDictSelectRef" v-if="scope.row['isEdit']" filterable clearable
......@@ -1883,7 +1898,35 @@ const tableSelectFields = computed(() => {
<span v-else>{{ (scope.row['dictionaryGuid'] ? scope.row["dictionaryChName"] : (scope.row['dimGuid'] ?
scope.row['dimChName'] : '--')) || '--' }}</span>
</template>
</el-table-column> -->
<!-- <el-table-column prop="dimOrdictionaryGuid" v-if="!isDimTable" label="关联字典" width="120px" align="left"
show-overflow-tooltip>
<template #default="scope">
<el-select v-if="scope.row['dimOrdictionaryGuid']" v-model="scope.row['dimOrdictionaryGuid']"
placeholder="请选择">
<el-option v-for="opt in dictionaryList" :key="opt['guid']" :label="opt['chName']"
:value="opt['guid']" />
</el-select>
<span v-else>{{ dictionaryList.find(d => d.guid === scope.row['dimOrdictionaryGuid'])?.chName || '--'
}}</span>
</template>
</el-table-column> -->
<el-table-column prop="dictionaryGuid" label="关联字典" width="120" align="center" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.isEdit">
<el-select v-if="scope.row['isEdit']" v-model="scope.row['dictionaryGuid']" placeholder="请选择分级"
clearable filterable>
<el-option v-for="opt in dictionaryList1" :key="opt['guid']" :label="opt['chName']"
:value="opt['guid']" />
</el-select>
</div>
<div v-else>
{{ dictionaryList1.find(d => d.guid === scope.row['dictionaryGuid'])?.chName || '--' }}
</div>
</template>
</el-table-column>
<el-table-column prop="isPrimary" label="是否主键" width="90px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="scope.row['isEdit']" v-model="scope.row['isPrimary']" placeholder="请选择">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!