6429bf56 by xukangle

Merge branch 'dev_20241202_xukangle' into develop

2 parents ffbc9c7e bf7dfb69
......@@ -31,7 +31,6 @@ import { TableColumnWidth } from "@/utils/enum";
import router from "@/router";
import { download } from "@/utils/common";
import { getLabelList } from "@/api/modules/dataLabel";
import { da } from "element-plus/es/locale";
const currentPath = ref<string[]>([]);
const { proxy } = getCurrentInstance() as any;
......@@ -188,7 +187,7 @@ const searchItemList = ref([
lazy: false,
props: {
label: "classifyName",
value: "guid",
value: "classifyDetailGuid",
},
block: false,
filterable: false,
......@@ -219,8 +218,7 @@ const toSearch = (val: any, clear: boolean = false) => {
selectedC.value = null;
searchItemList.value.map(item => item.default = '')
}
console.log('toSearch', val);
// 差一个label标签 -- 未完成
console.log('toSearch', val, classifyDetailGuidInfo.value);
if (activeName.value === 'first') {
getCgDirFieldPage({
pageIndex: 1,
......@@ -239,8 +237,8 @@ const toSearch = (val: any, clear: boolean = false) => {
pageIndex: 1,
pageSize: 50,
execGuid: execGuidInfo.value.execGuid,
tableGuid: selectedB.value || '',
databaseGuid: selectedA.value || '',
tableGuid: selectedB.value || tableGuid.value || '',
databaseGuid: selectedA.value || dataBaseGuid.value || '',
classifyDetailGuid: val.classifyName,
gradeDetailGuid: val.levelName,
labelGuid: val.labelName,
......@@ -251,8 +249,8 @@ const toSearch = (val: any, clear: boolean = false) => {
pageIndex: 1,
pageSize: 50,
execGuid: execGuidInfo.value.execGuid,
tableGuid: selectedB.value || '',
databaseGuid: selectedA.value || '',
tableGuid: selectedB.value || tableGuid.value || '',
databaseGuid: selectedA.value || dataBaseGuid.value || '',
fieldGuid: selectedC.value || '',
classifyDetailGuid: val.classifyName,
gradeDetailGuid: val.levelName,
......@@ -382,7 +380,8 @@ const tablePageChange = (info) => {
getCgDirFieldPage({
pageIndex: info.curr,
pageSize: info.limit,
execGuid: execGuidInfo.value.execGuid
execGuid: execGuidInfo.value.execGuid,
classifyDetail: classifyDetailGuidInfo.value
});
}
......@@ -1318,6 +1317,12 @@ onActivated(async () => {
}
});
const treeSelectNodeClick = (node, item) => {
treeInfo.value.expandedKey = [];
treeInfo.value.expandedKey.push(node.classifyDetailGuid);
treeInfo.value.currentNodeKey = node.classifyDetailGuid;
}
</script>
<template>
......@@ -1332,11 +1337,11 @@ onActivated(async () => {
<el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
</el-select>
<el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px"
:clearable="true" v-if="!isShowWordSearch">
:clearable="true" v-if="!(activeTab === 'table' && activeName === 'second')">
<el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
</el-select>
<TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch"
@selectChange="selectChange" />
@selectChange="selectChange" @treeSelectNodeClick="treeSelectNodeClick" />
</div>
<div class="container_wrap full flex">
<div class="aside_wrap">
......
......@@ -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>
<!-- 数据是否唯一(可编辑) -->
......
......@@ -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!