51a32b6b by xukangle

fix : 标签管理相关问题

1 parent 82a6de26
...@@ -175,7 +175,7 @@ export const getLargeCategoryList = (params) => request({ ...@@ -175,7 +175,7 @@ export const getLargeCategoryList = (params) => request({
175 /** 175 /**
176 * 获取字段类型 176 * 获取字段类型
177 */ 177 */
178 export const getFieldTypeList = (params) => request({ 178 export const getNewDataTypeList = (params) => request({
179 url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${params.dictType}`, 179 url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${params.dictType}`,
180 method: 'get', 180 method: 'get',
181 }) 181 })
...@@ -740,6 +740,36 @@ export const createTableSql = (data) => request({ ...@@ -740,6 +740,36 @@ export const createTableSql = (data) => request({
740 data 740 data
741 }) 741 })
742 742
743 /**
744 * 导出分类分级目录列表
745 * @param {no params}
746 * @path /cg-dir/export
747 */
748 export const exportCgDir = () => request({
749 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-dir/export`,
750 method: 'post',
751 })
752
753 /**
754 * 数据库目录导出
755 * @param {no params}
756 * @path /db-dir/table/export
757 */
758 export const exportDbDirTable = () => request({
759 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/export`,
760 method: 'post',
761 })
762
763 /**
764 * 数据库目录详情
765 * @param {query}
766 * @path /db-dir/detail
767 *
768 */
769 export const getDbDirDetail = (params) => request({
770 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/detail?guid=${params.tableGuid}`,
771 method: 'get',
772 })
743 773
744 774
745 775
...@@ -756,14 +786,17 @@ export const getBizRuleConfigDetail = (params) => request({ ...@@ -756,14 +786,17 @@ export const getBizRuleConfigDetail = (params) => request({
756 method: 'get', 786 method: 'get',
757 }) 787 })
758 788
789
790
791 /**-----------------根据文件新建表-------------------------------------- */
792
759 /** 793 /**
760 * 业务规则配置-修改 794 * 根据字段中文名解析字段英文名
761 * @param {Object} 795 * @param {Object}
762 * @path /biz-rule-config/update 796 * @path /db-dir/field/get-field-en-name
763 * @returns
764 */ 797 */
765 export const updateBizRuleConfig = (data) => request({ 798 export const getFidldEnName = (data) => request({
766 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/update`, 799 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-field-en-name`,
767 method: 'post', 800 method: 'post',
768 data 801 data
769 }) 802 })
......
...@@ -33,6 +33,7 @@ const emits = defineEmits([ ...@@ -33,6 +33,7 @@ const emits = defineEmits([
33 "tableRowClick", 33 "tableRowClick",
34 "tableRowDblClick", 34 "tableRowDblClick",
35 "tableInputChange", 35 "tableInputChange",
36
36 ]); 37 ]);
37 38
38 const tableRef = ref(); 39 const tableRef = ref();
...@@ -198,6 +199,8 @@ const rowSelectable = (row, index) => { ...@@ -198,6 +199,8 @@ const rowSelectable = (row, index) => {
198 return row.selectable ?? true; 199 return row.selectable ?? true;
199 }; 200 };
200 201
202
203
201 const pageChange = (page) => { 204 const pageChange = (page) => {
202 let info = { ...page, id: props.tableInfo.id }; 205 let info = { ...page, id: props.tableInfo.id };
203 emits("tablePageChange", info); 206 emits("tablePageChange", info);
...@@ -277,7 +280,7 @@ onMounted(() => { ...@@ -277,7 +280,7 @@ onMounted(() => {
277 @show="() => popoverHover(scope, item)"> 280 @show="() => popoverHover(scope, item)">
278 <template #reference> 281 <template #reference>
279 <span :class="{ text_btn: item.checkName ? item.checkName(scope) : true }">{{ 282 <span :class="{ text_btn: item.checkName ? item.checkName(scope) : true }">{{
280 item.getName ? item.getName(scope):"详情" }}</span> 283 item.getName ? item.getName(scope) : "详情" }}</span>
281 </template> 284 </template>
282 <el-table :data="props.tableInfo.popoverData" v-loading="props.tableInfo.popoverloading" class="tablePover" 285 <el-table :data="props.tableInfo.popoverData" v-loading="props.tableInfo.popoverloading" class="tablePover"
283 :row-class-name="tableRowClassName1" border tooltip-effect="light" 286 :row-class-name="tableRowClassName1" border tooltip-effect="light"
......
...@@ -493,9 +493,14 @@ export const tagType = (row, type) => { ...@@ -493,9 +493,14 @@ export const tagType = (row, type) => {
493 case "R": 493 case "R":
494 state = 'danger' 494 state = 'danger'
495 break; 495 break;
496 case 0:
497 state = 'info';
498 break;
496 case 1: 499 case 1:
500 state = 'success';
501 break;
497 case 2: 502 case 2:
498 state = 'info'; 503 state = 'warning';
499 break; 504 break;
500 case 3: 505 case 3:
501 state = 'warning' 506 state = 'warning'
......
...@@ -77,7 +77,8 @@ const levelMap = { ...@@ -77,7 +77,8 @@ const levelMap = {
77 } 77 }
78 const currTableInfo = ref<any>({}); 78 const currTableInfo = ref<any>({});
79 const drawerRef = ref<any>(''); 79 const drawerRef = ref<any>('');
80 80 const currentRowKey = ref<any>(null);
81 const scopeRow = ref<any>(null);
81 const tableInfo = ref({ 82 const tableInfo = ref({
82 id: "data-class-standard-table", 83 id: "data-class-standard-table",
83 multiple: false, 84 multiple: false,
...@@ -108,6 +109,7 @@ const tableInfo = ref({ ...@@ -108,6 +109,7 @@ const tableInfo = ref({
108 ], 109 ],
109 data: [], 110 data: [],
110 rowKey: 'guid', 111 rowKey: 'guid',
112 currentRowKey: '',
111 showPage: false, 113 showPage: false,
112 actionInfo: { 114 actionInfo: {
113 label: "操作", 115 label: "操作",
...@@ -116,7 +118,7 @@ const tableInfo = ref({ ...@@ -116,7 +118,7 @@ const tableInfo = ref({
116 btns: [ 118 btns: [
117 { 119 {
118 label: "编辑", value: "edit", click: (scope) => { 120 label: "编辑", value: "edit", click: (scope) => {
119 console.log(scope.row); 121 scopeRow.value = scope.row;
120 currentEditingGuid.value = scope.row.guid; 122 currentEditingGuid.value = scope.row.guid;
121 selectParentEdit(scope.row.guid); 123 selectParentEdit(scope.row.guid);
122 currTableInfo.value = scope.row; 124 currTableInfo.value = scope.row;
...@@ -147,6 +149,8 @@ const tableInfo = ref({ ...@@ -147,6 +149,8 @@ const tableInfo = ref({
147 loading: false, 149 loading: false,
148 }); 150 });
149 151
152
153
150 const classEditFormItems = ref([{ 154 const classEditFormItems = ref([{
151 label: '分类名称', 155 label: '分类名称',
152 type: 'input', 156 type: 'input',
...@@ -218,38 +222,9 @@ const classEditFormItems = ref([{ ...@@ -218,38 +222,9 @@ const classEditFormItems = ref([{
218 block: true 222 block: true
219 }]); 223 }]);
220 224
221 // const validateUniqueClassifyName = (rule, value, callback) => {
222 // console.log('validateUniqueClassifyName', value);
223 // // 递归遍历treeListData,判断是否有重复的分类名称
224 // // 检查空值情况
225 // if (!value) {
226 // callback(new Error('请填写分类名称'));
227 // return;
228 // }
229
230 // // 递归检查函数
231 // const isExist = (data, value) => {
232 // return data.some(item => {
233 // if (item.classifyName === value) {
234 // return true;
235 // }
236 // return item.children && isExist(item.children, value);
237 // });
238 // };
239
240 // // 检查是否存在
241 // if (isExist(treeListData.value, value)) {
242 // callback(new Error('分类名称已存在,请填写其他名称'));
243 // } else {
244 // callback(); // 校验通过
245 // }
246 // }
247
248 let currentEditingGuid = ref<any>(''); 225 let currentEditingGuid = ref<any>('');
249 226
250 const validateUniqueClassifyName = (rule, value, callback) => { 227 const validateUniqueClassifyName = (rule, value, callback) => {
251 console.log('validateUniqueClassifyName', treeListData.value, value, currentEditingGuid);
252
253 // 检查空值情况 228 // 检查空值情况
254 if (!value) { 229 if (!value) {
255 callback(new Error('请填写分类名称')); 230 callback(new Error('请填写分类名称'));
...@@ -341,6 +316,7 @@ const drawerBtnClick = async (btn, info) => { ...@@ -341,6 +316,7 @@ const drawerBtnClick = async (btn, info) => {
341 } 316 }
342 } else { 317 } else {
343 // 编辑分类 318 // 编辑分类
319
344 drawerInfo.value.footer.btns.map((item: any) => (item.disabled = true)); 320 drawerInfo.value.footer.btns.map((item: any) => (item.disabled = true));
345 const params = { 321 const params = {
346 ...info, 322 ...info,
...@@ -357,8 +333,14 @@ const drawerBtnClick = async (btn, info) => { ...@@ -357,8 +333,14 @@ const drawerBtnClick = async (btn, info) => {
357 getTreeListData(); 333 getTreeListData();
358 // 清空当前编辑的guid 334 // 清空当前编辑的guid
359 currentEditingGuid.value = ''; 335 currentEditingGuid.value = '';
336 nextTick(() => {
337 console.log('tableRef进来了吗', scopeRow.value.guid);
338 tableInfo.value.currentRowKey = scopeRow.value.guid;
339 tableRef.value.tableRef.setCurrentRow(scopeRow.value.guid);
340 });
360 } else { 341 } else {
361 proxy.$ElMessage.error(res.msg); 342 proxy.$ElMessage.error(res.msg);
343 drawerInfo.value.footer.btns.map((item: any) => (item.disabled = false));
362 } 344 }
363 } 345 }
364 } 346 }
...@@ -387,7 +369,7 @@ const findStandardName = (guid: string) => { ...@@ -387,7 +369,7 @@ const findStandardName = (guid: string) => {
387 const item: any = classifyGradListData.value.find((item: any) => item.guid == guid); 369 const item: any = classifyGradListData.value.find((item: any) => item.guid == guid);
388 return item ? item.name : ''; 370 return item ? item.name : '';
389 } 371 }
390 const tableRef = ref(null); // 表格的 ref 372 const tableRef = ref<any>(null); // 表格的 ref
391 // 获取分类树形列表 373 // 获取分类树形列表
392 const treeListParams = ref({ 374 const treeListParams = ref({
393 pageIndex: 1, 375 pageIndex: 1,
...@@ -404,7 +386,6 @@ const getTreeListData = async () => { ...@@ -404,7 +386,6 @@ const getTreeListData = async () => {
404 classEditFormItems.value[2].options = treeListData.value; 386 classEditFormItems.value[2].options = treeListData.value;
405 shapeTreeListData.value = treeListData.value; 387 shapeTreeListData.value = treeListData.value;
406 tableInfo.value.loading = false; 388 tableInfo.value.loading = false;
407
408 } else { 389 } else {
409 proxy.$ElMessage.error(res.msg); 390 proxy.$ElMessage.error(res.msg);
410 } 391 }
...@@ -493,10 +474,10 @@ const saveUpdate = async () => { ...@@ -493,10 +474,10 @@ const saveUpdate = async () => {
493 type: 'C', 474 type: 'C',
494 description: formRef.value.formInline.description 475 description: formRef.value.formInline.description
495 } 476 }
496 console.log(params);
497 const res: any = await updateClassifyGrad(params); 477 const res: any = await updateClassifyGrad(params);
498 if (res.code == proxy.$passCode) { 478 if (res.code == proxy.$passCode) {
499 proxy.$ElMessage.success('修改分类成功'); 479 proxy.$ElMessage.success('修改分类成功');
480 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
500 router.push({ 481 router.push({
501 name: 'templateConfig' 482 name: 'templateConfig'
502 }); 483 });
...@@ -518,7 +499,6 @@ const updatedTreeData = ref<any>(); ...@@ -518,7 +499,6 @@ const updatedTreeData = ref<any>();
518 /** 切换是图形展示,还是表格展示。 */ 499 /** 切换是图形展示,还是表格展示。 */
519 const changeShowMethod = () => { 500 const changeShowMethod = () => {
520 dataShowMethod.value = dataShowMethod.value == 'table' ? 'shape' : 'table'; 501 dataShowMethod.value = dataShowMethod.value == 'table' ? 'shape' : 'table';
521 console.log(shapeTreeListData.value);
522 if (dataShowMethod.value == 'shape') { 502 if (dataShowMethod.value == 'shape') {
523 const tempArr = { 503 const tempArr = {
524 classifyName: router.currentRoute.value.query.classStandardName, 504 classifyName: router.currentRoute.value.query.classStandardName,
...@@ -526,13 +506,10 @@ const changeShowMethod = () => { ...@@ -526,13 +506,10 @@ const changeShowMethod = () => {
526 children: shapeTreeListData.value 506 children: shapeTreeListData.value
527 } 507 }
528 updatedTreeData.value = [tempArr]; 508 updatedTreeData.value = [tempArr];
529 console.log('updatedTreeData', [tempArr]);
530 } 509 }
531 } 510 }
532 511
533 const cancel = () => { 512 const cancel = () => {
534 console.log(userStore.tabbar);
535 console.log(fullPath);
536 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => { 513 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
537 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 514 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
538 router.push({ 515 router.push({
...@@ -823,6 +800,19 @@ const expand = (item) => { ...@@ -823,6 +800,19 @@ const expand = (item) => {
823 isExpand1.value = item 800 isExpand1.value = item
824 } 801 }
825 802
803 onActivated(() => {
804 const classClassifyGradName = route.query.classClassifyGradName;
805 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
806 if (tab) {
807 if (classClassifyGradName) {
808 tab.meta.title = `编辑-${classClassifyGradName}`;
809 }
810 if (fullPath === route.fullPath) {
811 document.title = tab.meta.title;
812 }
813 }
814 });
815
826 </script> 816 </script>
827 817
828 <template> 818 <template>
...@@ -832,14 +822,16 @@ const expand = (item) => { ...@@ -832,14 +822,16 @@ const expand = (item) => {
832 :isExpand="isExpand"> 822 :isExpand="isExpand">
833 <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> 823 <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" />
834 </ContentWrap> 824 </ContentWrap>
835 <ContentWrap id="id-classStandard" class="detail-content" title="分类规则" description="" 825 <ContentWrap id="id-classStandard" class="class-content" title="分类规则" description="" style="margin-top:16px; "
836 style="margin-top:16px; height: calc(100% - 161px)" :expandSwicth="true" :isExpand="isExpand1" @expand="expand"> 826 :expandSwicth="true" :isExpand="isExpand1" @expand="expand">
837 <div class="tools_btns"> 827 <div class="tools_btns">
838 <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加规则</el-button> 828 <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加规则</el-button>
839 <!-- <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> --> 829 <!-- <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> -->
840 <el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button> 830 <!-- <el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button> -->
831 </div>
832 <div class="table_panel">
833 <Table v-show="dataShowMethod == 'table'" :tableInfo="tableInfo" ref="tableRef" />
841 </div> 834 </div>
842 <Table v-show="dataShowMethod == 'table'" :tableInfo="tableInfo" :ref="tableRef" />
843 <div ref="shapeMain" class="shape-main" v-show="dataShowMethod != 'table'"></div> 835 <div ref="shapeMain" class="shape-main" v-show="dataShowMethod != 'table'"></div>
844 <div v-if="showNodeDetails" class="node-details-popup" 836 <div v-if="showNodeDetails" class="node-details-popup"
845 :style="{ top: popupPosition.top + 'px', left: popupPosition.left + 'px' }"> 837 :style="{ top: popupPosition.top + 'px', left: popupPosition.left + 'px' }">
...@@ -890,9 +882,10 @@ const expand = (item) => { ...@@ -890,9 +882,10 @@ const expand = (item) => {
890 } 882 }
891 883
892 :deep(.detail-content) { 884 :deep(.detail-content) {
885 height: calc(100% - 50px);
893 886
894 .el-card__body { 887 .el-card__body {
895 height: calc(100% - 50px) !important; 888 height: calc(100% - 50px);
896 889
897 .card-body-content { 890 .card-body-content {
898 height: 100%; 891 height: 100%;
...@@ -916,7 +909,7 @@ const expand = (item) => { ...@@ -916,7 +909,7 @@ const expand = (item) => {
916 } 909 }
917 910
918 .table_panel { 911 .table_panel {
919 height: calc(100% - 44px) !important; 912 height: 500px
920 } 913 }
921 914
922 .node-details-popup { 915 .node-details-popup {
......
...@@ -137,7 +137,6 @@ const tableInfo = ref({ ...@@ -137,7 +137,6 @@ const tableInfo = ref({
137 btns: [ 137 btns: [
138 { 138 {
139 label: "编辑", value: "edit", click: (scope) => { 139 label: "编辑", value: "edit", click: (scope) => {
140 console.log(scope);
141 filterDataGradeEdit(scope.row.dataGrade); 140 filterDataGradeEdit(scope.row.dataGrade);
142 newCreateGradeStandardDialogInfo.value.visible = true; 141 newCreateGradeStandardDialogInfo.value.visible = true;
143 newCreateGradeStandardDialogInfo.value.title = '编辑规则'; 142 newCreateGradeStandardDialogInfo.value.title = '编辑规则';
...@@ -364,6 +363,7 @@ const saveUpdate = async () => { ...@@ -364,6 +363,7 @@ const saveUpdate = async () => {
364 const res: any = await updateClassifyGrad(params); 363 const res: any = await updateClassifyGrad(params);
365 if (res.code == proxy.$passCode) { 364 if (res.code == proxy.$passCode) {
366 proxy.$ElMessage.success('修改分级成功'); 365 proxy.$ElMessage.success('修改分级成功');
366 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
367 router.push({ 367 router.push({
368 name: 'templateConfig' 368 name: 'templateConfig'
369 }); 369 });
...@@ -385,6 +385,20 @@ const cancel = () => { ...@@ -385,6 +385,20 @@ const cancel = () => {
385 }); 385 });
386 } 386 }
387 387
388 onActivated(() => {
389 const classClassifyGradName = route.query.classClassifyGradName;
390 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
391 console.log(tab, '-----------');
392 if (tab) {
393 if (classClassifyGradName) {
394 tab.meta.title = `编辑-${classClassifyGradName}`;
395 }
396 if (fullPath === route.fullPath) {
397 document.title = tab.meta.title;
398 }
399 }
400 });
401
388 </script> 402 </script>
389 403
390 <template> 404 <template>
......
...@@ -9,10 +9,15 @@ import { ...@@ -9,10 +9,15 @@ import {
9 getCgDirTreeList, getCgDirFieldPageList, getDictionary, saveBizRuleConfig, 9 getCgDirTreeList, getCgDirFieldPageList, getDictionary, saveBizRuleConfig,
10 getDbDirTreeList, getDbDirTablePageList, getDbDirFieldPageList, getExecGuidAndName, 10 getDbDirTreeList, getDbDirTablePageList, getDbDirFieldPageList, getExecGuidAndName,
11 getClassifyTreeList, getCgLabelPageList, execTaskFieldList, execTaskSheetList, getTaskExeTreeList, 11 getClassifyTreeList, getCgLabelPageList, execTaskFieldList, execTaskSheetList, getTaskExeTreeList,
12 getDbFieldList 12 getDbFieldList, exportCgDir,
13 getGradeList,
14 exportDbDirTable,
15 getDbDirDetail
13 } from '@/api/modules/dataInventory'; 16 } from '@/api/modules/dataInventory';
14 import { TableColumnWidth } from "@/utils/enum"; 17 import { TableColumnWidth } from "@/utils/enum";
15 import router from "@/router"; 18 import router from "@/router";
19 import { download } from "@/utils/common";
20 import { getLabelList } from "@/api/modules/dataLabel";
16 21
17 const currentPath = ref<string[]>([]); 22 const currentPath = ref<string[]>([]);
18 const { proxy } = getCurrentInstance() as any; 23 const { proxy } = getCurrentInstance() as any;
...@@ -99,6 +104,7 @@ onMounted(async () => { ...@@ -99,6 +104,7 @@ onMounted(async () => {
99 }); 104 });
100 getDictionaryList(); 105 getDictionaryList();
101 getSearchTableList(); 106 getSearchTableList();
107 getLabelListData();
102 108
103 }) 109 })
104 110
...@@ -140,7 +146,7 @@ const searchItemList = ref([ ...@@ -140,7 +146,7 @@ const searchItemList = ref([
140 default: '', 146 default: '',
141 options: [], 147 options: [],
142 props: { 148 props: {
143 label: 'name', 149 label: 'label',
144 value: 'guid', 150 value: 'guid',
145 }, 151 },
146 clearable: true, 152 clearable: true,
...@@ -178,27 +184,34 @@ const searchItemList = ref([ ...@@ -178,27 +184,34 @@ const searchItemList = ref([
178 clearable: true, 184 clearable: true,
179 }, 185 },
180 ]) 186 ])
181 const searchParams = ref({}) 187
188 // 搜索
189 const searchCount = ref(0);
182 const toSearch = (val: any, clear: boolean = false) => { 190 const toSearch = (val: any, clear: boolean = false) => {
183 if (clear) { 191 if (clear) {
192 selectedA.value = null;
193 selectedB.value = null;
194 selectedC.value = null;
184 searchItemList.value.map(item => item.default = '') 195 searchItemList.value.map(item => item.default = '')
185 searchParams.value = {}
186 } 196 }
187 197 // 差一个label标签 -- 未完成
188 if (Object.keys(val).length) { 198 getCgDirFieldPage({
189 searchParams.value = { ...val } 199 pageIndex: 1,
190 } 200 pageSize: 50,
191 // let params: any = { ...searchParams.value } 201 execGuid: execGuidInfo.value.execGuid,
192 // params.pageIndex = page.value.curr; 202 classifyDetail: val.classifyName,
193 // params.pageSize = page.value.limit; 203 gradeDetailGuid: val.levelName,
194 // //params.standardSetGuid = standardSetGuid.value; 204 databaseGuid: selectedA.value,
195 // params.standardSetLevelCode = standardSetLevelCode.value; 205 tableGuid: selectedB.value,
196 // return getTableData(params); 206 fieldGuid: selectedC.value,
207 });
197 }; 208 };
198 209
210
199 const nodeClick = async (data: any) => { 211 const nodeClick = async (data: any) => {
200 console.log('nodeClick', data); 212 console.log('nodeClick', data);
201 const { guid, classifyDetailGuid } = data 213 const { guid, classifyDetailGuid, refGradeGuid } = data
214 getGradeData(refGradeGuid);
202 searchItemList.value[1].default = data.classifyName; 215 searchItemList.value[1].default = data.classifyName;
203 await getCgDirFieldPage({ 216 await getCgDirFieldPage({
204 execGuid: execGuidInfo.value.execGuid, 217 execGuid: execGuidInfo.value.execGuid,
...@@ -230,6 +243,26 @@ const findPath = (data: any[], targetGuid: string, path: string[] = []) => { ...@@ -230,6 +243,26 @@ const findPath = (data: any[], targetGuid: string, path: string[] = []) => {
230 }; 243 };
231 244
232 245
246 // 根据选择的分类获取分级
247
248 const getGradeData = async (refGradeGuid) => {
249 const res: any = await getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 });
250 if (res.code == proxy.$passCode) {
251 searchItemList.value[2].options = res.data.records || [];
252 } else {
253 proxy.$ElMessage.error(res.msg);
254 }
255 }
256 // 获取标签
257 const getLabelListData = async () => {
258 const res: any = await getLabelList({ label: '' });
259 if (res.code == proxy.$passCode) {
260 searchItemList.value[0].options = res.data || [];
261 } else {
262 proxy.$ElMessage.error(res.msg);
263 }
264 }
265
233 // btns-area 266 // btns-area
234 const checked = ref(false); 267 const checked = ref(false);
235 const changeCheck = (val) => { 268 const changeCheck = (val) => {
...@@ -245,7 +278,7 @@ const page = ref({ ...@@ -245,7 +278,7 @@ const page = ref({
245 curr: 1, 278 curr: 1,
246 sizes: [ 279 sizes: [
247 { label: "10", value: 10 }, 280 { label: "10", value: 10 },
248 { label: "20", value: 20 }, 281 { label: "50", value: 50 },
249 { label: "100", value: 100 }, 282 { label: "100", value: 100 },
250 { label: "150", value: 150 }, 283 { label: "150", value: 150 },
251 { label: "200", value: 200 }, 284 { label: "200", value: 200 },
...@@ -258,10 +291,10 @@ const tableInfo = ref({ ...@@ -258,10 +291,10 @@ const tableInfo = ref({
258 fields: [ 291 fields: [
259 { label: "序号", type: "index", width: 56, align: "center" }, 292 { label: "序号", type: "index", width: 56, align: "center" },
260 { label: "字段名", field: "fieldName", width: 140 }, 293 { label: "字段名", field: "fieldName", width: 140 },
261 { label: "分类", field: "classifyName", width: 180 }, 294 { label: "分类", field: "classifyDetailName", width: 180 },
262 { label: "分级", field: "gradeDetailName", width: 120 }, 295 { label: "分级", field: "gradeDetailName", width: 120 },
263 { label: "标签", field: "label", width: 140 }, 296 { label: "标签", field: "label", width: 140 },
264 { label: "规则", field: "rulesName", width: 180 }, 297 { label: "规则", field: "ruleDetail", width: 180 },
265 { label: "表名", field: "tableName", width: 120, align: 'center' }, 298 { label: "表名", field: "tableName", width: 120, align: 'center' },
266 { label: "表中文名", field: "tableChName", width: 120, align: 'center' }, 299 { label: "表中文名", field: "tableChName", width: 120, align: 'center' },
267 { label: "数据库名", field: "database", width: 120, align: 'center' }, 300 { label: "数据库名", field: "database", width: 120, align: 'center' },
...@@ -285,7 +318,8 @@ const tablePageChange = (info) => { ...@@ -285,7 +318,8 @@ const tablePageChange = (info) => {
285 page.value.limit = Number(info.limit); 318 page.value.limit = Number(info.limit);
286 getCgDirFieldPage({ 319 getCgDirFieldPage({
287 pageIndex: info.curr, 320 pageIndex: info.curr,
288 pageSize: info.limit 321 pageSize: info.limit,
322 execGuid: execGuidInfo.value.execGuid
289 }); 323 });
290 } 324 }
291 325
...@@ -355,7 +389,7 @@ const dataBasePage = ref({ ...@@ -355,7 +389,7 @@ const dataBasePage = ref({
355 curr: 1, 389 curr: 1,
356 sizes: [ 390 sizes: [
357 { label: "10", value: 10 }, 391 { label: "10", value: 10 },
358 { label: "20", value: 20 }, 392 { label: "50", value: 50 },
359 { label: "100", value: 100 }, 393 { label: "100", value: 100 },
360 { label: "150", value: 150 }, 394 { label: "150", value: 150 },
361 { label: "200", value: 200 }, 395 { label: "200", value: 200 },
...@@ -423,6 +457,30 @@ const dataBaseTableInfo = ref({ ...@@ -423,6 +457,30 @@ const dataBaseTableInfo = ref({
423 { 457 {
424 label: "编辑表结构", value: "edit", click: (scope) => { 458 label: "编辑表结构", value: "edit", click: (scope) => {
425 console.log('复制', scope); 459 console.log('复制', scope);
460 getDbDirDetail({
461 tableGuid: scope.row.tableGuid
462 }).then((res: any) => {
463 if (res.code == proxy.$passCode) {
464 console.log('res', res);
465 router.push({
466 name: 'tableCreateExisting',
467 query: {
468 execGuid: execGuidInfo.value.execGuid,
469 foundMode: 1,
470 database: res.data.database,
471 databaseChName: res.data.databaseChName,
472 databaseGuid: res.data.databaseGuid,
473 tableGuid: scope.row.tableGuid,
474 tableName: scope.row.tableName,
475 tableChName: scope.row.tableChName,
476 description: scope.row.description,
477 }
478 });
479 } else {
480 proxy.$ElMessage.error(res.msg);
481 }
482 })
483
426 }, 484 },
427 disabled: scope.row.state !== 2 ? false : true 485 disabled: scope.row.state !== 2 ? false : true
428 } 486 }
...@@ -483,7 +541,7 @@ const classEditFormItems = ref([{ ...@@ -483,7 +541,7 @@ const classEditFormItems = ref([{
483 type: 'input', 541 type: 'input',
484 placeholder: '请选择', 542 placeholder: '请选择',
485 field: 'fieldPrecision', 543 field: 'fieldPrecision',
486 maxlength: 6, 544 maxlength: 2,
487 regexp: /\D/g, 545 regexp: /\D/g,
488 required: true, 546 required: true,
489 clearable: true, 547 clearable: true,
...@@ -708,7 +766,7 @@ const getDataBaseTableData = async (params = {}) => { ...@@ -708,7 +766,7 @@ const getDataBaseTableData = async (params = {}) => {
708 dataBaseTableInfo.value.loading = true; 766 dataBaseTableInfo.value.loading = true;
709 const dataBaseParams = { 767 const dataBaseParams = {
710 pageIndex: 1, 768 pageIndex: 1,
711 pageSize: 10, 769 pageSize: 50,
712 databaseGuid: "", 770 databaseGuid: "",
713 isDataAsset: '', 771 isDataAsset: '',
714 execGuid: execGuidInfo.value.execGuid, 772 execGuid: execGuidInfo.value.execGuid,
...@@ -719,9 +777,8 @@ const getDataBaseTableData = async (params = {}) => { ...@@ -719,9 +777,8 @@ const getDataBaseTableData = async (params = {}) => {
719 if (res.code == proxy.$passCode) { 777 if (res.code == proxy.$passCode) {
720 dataBaseTableDataList.value = res.data.records; 778 dataBaseTableDataList.value = res.data.records;
721 dataBaseTableInfo.value.page.rows = res.data.totalRows; 779 dataBaseTableInfo.value.page.rows = res.data.totalRows;
780 dataBaseTableInfo.value.page.limit = res.data.pageSize
722 dataBaseTableInfo.value.data = res.data.records; 781 dataBaseTableInfo.value.data = res.data.records;
723 dataBasePage.value.limit = res.data.pageSize
724 dataBasePage.value.curr = res.data.pageIndex
725 } else { 782 } else {
726 proxy.$ElMessage.error(res.msg); 783 proxy.$ElMessage.error(res.msg);
727 } 784 }
...@@ -746,7 +803,7 @@ const getDataBaseFieldData = async (params = {}) => { ...@@ -746,7 +803,7 @@ const getDataBaseFieldData = async (params = {}) => {
746 tableFieldsLoading.value = true; 803 tableFieldsLoading.value = true;
747 const dataBaseParams = { 804 const dataBaseParams = {
748 pageIndex: 1, 805 pageIndex: 1,
749 pageSize: 10, 806 pageSize: 50,
750 tableGuid: "", 807 tableGuid: "",
751 execGuid: execGuidInfo.value.execGuid, 808 execGuid: execGuidInfo.value.execGuid,
752 databaseGuid: "", 809 databaseGuid: "",
...@@ -778,8 +835,8 @@ const tableFieldsDataInfo = ref({ ...@@ -778,8 +835,8 @@ const tableFieldsDataInfo = ref({
778 { label: "表中文名", field: "tableChName", width: 140, }, 835 { label: "表中文名", field: "tableChName", width: 140, },
779 { label: "数据库名称", field: "database", width: 120 }, 836 { label: "数据库名称", field: "database", width: 120 },
780 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME }, 837 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
781 { label: "分类", field: "description", width: 120, align: 'center' }, 838 { label: "分类", field: "classifyDetailName", width: 120, align: 'center' },
782 { label: "分级", field: "isDataAsset", width: 120, align: 'center' }, 839 { label: "分级", field: "gradeDetailName", width: 120, align: 'center' },
783 { label: "标签", field: "label", width: 120, align: 'center' }, 840 { label: "标签", field: "label", width: 120, align: 'center' },
784 ], 841 ],
785 data: [], 842 data: [],
...@@ -857,7 +914,8 @@ const handleSubjectTableCommand = (command: string) => { ...@@ -857,7 +914,8 @@ const handleSubjectTableCommand = (command: string) => {
857 name: 'tableCreateFile', 914 name: 'tableCreateFile',
858 query: { 915 query: {
859 type: 'tableCreateFile', 916 type: 'tableCreateFile',
860 foundMode: 2 917 foundMode: 2,
918 execGuid: execGuidInfo.value.execGuid,
861 } 919 }
862 }); 920 });
863 } else if (command === 'existingCreate') { 921 } else if (command === 'existingCreate') {
...@@ -894,7 +952,7 @@ const setActiveTab = (tab) => { ...@@ -894,7 +952,7 @@ const setActiveTab = (tab) => {
894 activeTab.value = tab; 952 activeTab.value = tab;
895 }; 953 };
896 954
897 // 模拟后端接口 955
898 // 获取查询的数据库名 execTaskSheetList 956 // 获取查询的数据库名 execTaskSheetList
899 957
900 const getSearchTableList = async (type = 1, dbGuid = '') => { 958 const getSearchTableList = async (type = 1, dbGuid = '') => {
...@@ -943,30 +1001,37 @@ const onBChange = async () => { ...@@ -943,30 +1001,37 @@ const onBChange = async () => {
943 1001
944 // 导出 1002 // 导出
945 const btnClick = async () => { 1003 const btnClick = async () => {
946 1004 exportCgDir().then((res: any) => {
1005 download(res, '分类分级目录数据.xlsx', 'excel')
1006 });
947 }; 1007 };
1008 // 数据库导出
1009 const exportDB = async () => {
1010 exportDbDirTable().then((res: any) => {
1011 download(res, '数据库目录数据.xlsx', 'excel')
1012 });
1013 }
948 1014
949 // 分类选择 1015 // 分类选择
950 const treeSelectNodeChange = (node, item) => { 1016 const treeSelectNodeChange = (node, item) => {
951 console.log('treeSelectNodeChange', node, item); 1017 const { refGradeGuid } = node;
1018 getGradeData(refGradeGuid);
952 } 1019 }
953
954
955 </script> 1020 </script>
956 1021
957 <template> 1022 <template>
958 <div class="classification-template-content"> 1023 <div class="classification-template-content">
959 <div class="v-table-tools"> 1024 <div class="v-table-tools">
960 <el-select v-model="selectedA" placeholder="选择数据库名" @change="onAChange" style="width: 140px; margin-right: 8px" 1025 <el-select v-model="selectedA" placeholder="选择数据库名" @change="onAChange" style="width: 140px; margin-right: 8px"
961 clearable> 1026 :clearable="false">
962 <el-option v-for="item in optionsA" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> 1027 <el-option v-for="item in optionsA" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
963 </el-select> 1028 </el-select>
964 <el-select v-model="selectedB" placeholder="选择表名" :disabled="!selectedA" @change="onBChange" 1029 <el-select v-model="selectedB" placeholder="选择表名" :disabled="!selectedA" @change="onBChange"
965 style="width: 140px; margin-right: 8px" clearable> 1030 style="width: 140px; margin-right: 8px" :clearable="false">
966 <el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> 1031 <el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
967 </el-select> 1032 </el-select>
968 <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px" 1033 <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px"
969 clearable> 1034 :clearable="false">
970 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> 1035 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
971 </el-select> 1036 </el-select>
972 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" 1037 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch"
...@@ -1078,7 +1143,7 @@ const treeSelectNodeChange = (node, item) => { ...@@ -1078,7 +1143,7 @@ const treeSelectNodeChange = (node, item) => {
1078 </template> 1143 </template>
1079 </el-dropdown> 1144 </el-dropdown>
1080 </div> 1145 </div>
1081 <el-button>导出</el-button> 1146 <el-button @click="exportDB">导出</el-button>
1082 <el-button>查看已生产报告</el-button> 1147 <el-button>查看已生产报告</el-button>
1083 <el-button>查看质量规则</el-button> 1148 <el-button>查看质量规则</el-button>
1084 </div> 1149 </div>
...@@ -1111,6 +1176,7 @@ const treeSelectNodeChange = (node, item) => { ...@@ -1111,6 +1176,7 @@ const treeSelectNodeChange = (node, item) => {
1111 .v-table-tools { 1176 .v-table-tools {
1112 display: flex; 1177 display: flex;
1113 align-items: center; 1178 align-items: center;
1179 flex-wrap: wrap;
1114 padding: 8px 12px; 1180 padding: 8px 12px;
1115 } 1181 }
1116 1182
...@@ -1225,21 +1291,21 @@ const treeSelectNodeChange = (node, item) => { ...@@ -1225,21 +1291,21 @@ const treeSelectNodeChange = (node, item) => {
1225 1291
1226 .table_panel_wrap { 1292 .table_panel_wrap {
1227 width: 100%; 1293 width: 100%;
1228 height: calc(100% - 175px); 1294 height: calc(100% - 117px);
1229 min-height: 210px; 1295 min-height: 210px;
1230 overflow: visible; 1296 overflow: visible;
1231 } 1297 }
1232 1298
1233 .table_panel_wrap_database { 1299 .table_panel_wrap_database {
1234 width: 100%; 1300 width: 100%;
1235 height: calc(100% - 215px); 1301 height: calc(100% - 155px);
1236 min-height: 210px; 1302 min-height: 210px;
1237 overflow: visible; 1303 overflow: visible;
1238 } 1304 }
1239 1305
1240 .table_field { 1306 .table_field {
1241 width: 100%; 1307 width: 100%;
1242 height: calc(100% - 180px); 1308 height: calc(100% - 150px);
1243 min-height: 210px; 1309 min-height: 210px;
1244 overflow: visible; 1310 overflow: visible;
1245 } 1311 }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 <script lang="ts" setup name="configureRules"> 5 <script lang="ts" setup name="configureRules">
6 import { ref } from "vue"; 6 import { ref } from "vue";
7 import router from "@/router"; 7 import router from "@/router";
8 import { getBizRuleConfigDetail, updateBizRuleConfig } from '@/api/modules/dataInventory' 8 import { getBizRuleConfigDetail, saveBizRuleConfig, } from '@/api/modules/dataInventory'
9 const { proxy } = getCurrentInstance() as any; 9 const { proxy } = getCurrentInstance() as any;
10 const bizRuleConfigData = ref<any>() 10 const bizRuleConfigData = ref<any>()
11 const getBizRuleConfigDetailData = async () => { 11 const getBizRuleConfigDetailData = async () => {
...@@ -52,85 +52,73 @@ const editableFields = { ...@@ -52,85 +52,73 @@ const editableFields = {
52 } 52 }
53 53
54 const tableFieldsLoading = ref(false) 54 const tableFieldsLoading = ref(false)
55 // 当前选中的行
55 const selectedRows = ref([]); 56 const selectedRows = ref([]);
56 // 监听选中行 57
58 // 监听选中行变化
57 const selectionFieldsChange = (selection) => { 59 const selectionFieldsChange = (selection) => {
58 console.log('selection', selection)
59 selectedRows.value = selection; 60 selectedRows.value = selection;
60 }; 61 };
61 62
62 // 上移功能 63 // 上移操作
63 const moveUp = () => { 64 const moveUp = () => {
64 // 1. 找到选中行在 tableData 中的索引 65 if (selectedRows.value.length === 0) {
65 const selectedIds = selectedRows.value.map((row: any) => row.id); 66 proxy.$message.warning("请选择数据!");
66 67 return;
67 // 2. 遍历选中行,按顺序上移
68 for (let i = 0; i < tableData.value.length; i++) {
69 const currentRow = tableData.value[i];
70
71 // 如果当前行被选中,且不是第一行,则交换位置
72 if (selectedIds.includes(currentRow.id) && i > 0) {
73 const previousRow = tableData.value[i - 1];
74
75 // 如果上一行没有被选中,交换位置
76 if (!selectedIds.includes(previousRow.id)) {
77 [tableData.value[i], tableData.value[i - 1]] = [tableData.value[i - 1], tableData.value[i]];
78 }
79 } 68 }
69 selectedRows.value.forEach((row: any) => {
70 const index = tableData.value.findIndex((item) => item.guid === row.guid);
71 if (index > 0) {
72 [tableData.value[index - 1], tableData.value[index]] = [
73 tableData.value[index],
74 tableData.value[index - 1],
75 ];
80 } 76 }
77 });
81 }; 78 };
82 79
83 // 下移功能 80 // 下移操作
84 const moveDown = () => { 81 const moveDown = () => {
85 // 1. 找到选中行在 tableData 中的索引 82 if (selectedRows.value.length === 0) {
86 const selectedIds = selectedRows.value.map((row: any) => row.id); 83 proxy.$message.warning("请选择数据!");
87 84 return;
88 // 2. 遍历选中行,倒序下移
89 for (let i = tableData.value.length - 1; i >= 0; i--) {
90 const currentRow = tableData.value[i];
91
92 // 如果当前行被选中,且不是最后一行,则交换位置
93 if (selectedIds.includes(currentRow.id) && i < tableData.value.length - 1) {
94 const nextRow = tableData.value[i + 1];
95
96 // 如果下一行没有被选中,交换位置
97 if (!selectedIds.includes(nextRow.id)) {
98 [tableData.value[i], tableData.value[i + 1]] = [tableData.value[i + 1], tableData.value[i]];
99 }
100 } 85 }
86 // 倒序遍历选中行
87 [...selectedRows.value].reverse().forEach((row: any) => {
88 const index = tableData.value.findIndex((item) => item.guid === row.guid);
89 if (index < tableData.value.length - 1) {
90 [tableData.value[index], tableData.value[index + 1]] = [
91 tableData.value[index + 1],
92 tableData.value[index],
93 ];
101 } 94 }
95 });
102 }; 96 };
103 97
104 // 编辑行 98 // 编辑行
105 const editRow = (row) => { 99 const editRow = (row) => {
106 if (!row.isEdit) {
107 // 编辑fieldLengthCondition
108 if (row.fieldLengthCondition) { 100 if (row.fieldLengthCondition) {
109 const [symbol, value] = row.fieldLengthCondition.split('#'); 101 const arr = row.fieldLengthCondition.split('#')
110 row.lengthSymbol = symbol; // 初始化符号部分 102 row.lengthSymbol = arr[0]
111 row.lengthValue = value; // 初始化数值部分 103 row.lengthValue = arr[1]
112 } else {
113 row.lengthSymbol = ''; // 默认值
114 row.lengthValue = ''; // 默认值
115 } 104 }
116 //编辑fieldValueRange
117 if (row.fieldValueRange) { 105 if (row.fieldValueRange) {
118 const [start, end] = row.fieldValueRange.split('-'); 106 const arr = row.fieldValueRange.split('#')
119 row.rangeStart = start; // 初始化符号部分 107 row.rangeStart = arr[0]
120 row.rangeEnd = end; // 初始化数值部分 108 row.rangeEnd = arr[1]
121 } else {
122 row.rangeStart = ''; // 默认值
123 row.rangeEnd = ''; // 默认值
124 } 109 }
125
126 row.isEdit = true; // 进入编辑模式 110 row.isEdit = true; // 进入编辑模式
127 } 111
128 }; 112 };
129 113
130 // 保存数据 114 // 保存数据
131 const saveRow = (row) => { 115 const saveRow = (row) => {
132 row.fieldLengthCondition = `${row.lengthSymbol}#${row.lengthValue}`; 116 if (row.lengthSymbol && row.lengthValue) {
133 row.fieldValueRange = [row.rangeStart || '', row.rangeEnd || '']; 117 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
118 }
119 if (row.rangeStart && row.rangeEnd) {
120 row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd
121 }
134 row.isEdit = false 122 row.isEdit = false
135 } 123 }
136 124
...@@ -234,6 +222,7 @@ const saveData = async () => { ...@@ -234,6 +222,7 @@ const saveData = async () => {
234 const obj = { 222 const obj = {
235 guid: router.currentRoute.value.query.tableGuid, 223 guid: router.currentRoute.value.query.tableGuid,
236 fieldGuid: item.fieldGuid, 224 fieldGuid: item.fieldGuid,
225 execGuid: router.currentRoute.value.query.execGuid,
237 fieldLengthCondition: item.fieldLengthCondition, 226 fieldLengthCondition: item.fieldLengthCondition,
238 fieldPrecision: item.fieldPrecision, 227 fieldPrecision: item.fieldPrecision,
239 dictionaryGuid: item.dictionaryGuid, 228 dictionaryGuid: item.dictionaryGuid,
...@@ -245,7 +234,7 @@ const saveData = async () => { ...@@ -245,7 +234,7 @@ const saveData = async () => {
245 }) 234 })
246 235
247 console.log('finalParams', inParams) 236 console.log('finalParams', inParams)
248 const res: any = await updateBizRuleConfig(inParams) 237 const res: any = await saveBizRuleConfig(inParams)
249 if (res.code === proxy.$passCode) { 238 if (res.code === proxy.$passCode) {
250 proxy.$message.success('修改配置规则成功!') 239 proxy.$message.success('修改配置规则成功!')
251 router.back() 240 router.back()
...@@ -323,7 +312,8 @@ const cancel = () => { ...@@ -323,7 +312,8 @@ const cancel = () => {
323 <!-- 长度列 fieldLengthCondition: '>#10',--> 312 <!-- 长度列 fieldLengthCondition: '>#10',-->
324 <el-table-column prop="fieldLengthCondition" label="长度" width="240" align="center"> 313 <el-table-column prop="fieldLengthCondition" label="长度" width="240" align="center">
325 <template #default="scope"> 314 <template #default="scope">
326 <span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition || '--' }}</span> 315 <span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition
316 ? scope.row.fieldLengthCondition.replace('#', '') : '--' }}</span>
327 <div v-else> 317 <div v-else>
328 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;"> 318 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;">
329 <el-option label="大于" value=">"></el-option> 319 <el-option label="大于" value=">"></el-option>
...@@ -334,21 +324,6 @@ const cancel = () => { ...@@ -334,21 +324,6 @@ const cancel = () => {
334 </div> 324 </div>
335 </template> 325 </template>
336 </el-table-column> 326 </el-table-column>
337
338 <!-- 精度列 -->
339 <!-- <el-table-column prop="fieldPrecision" label="精度" width="240" align="center">
340 <template #default="scope">
341 <span v-if="!scope.row.isEdit">{{ scope.row.fieldPrecision || '--' }}</span>
342 <div v-else>
343 <el-select v-model="scope.row.fieldPrecision" placeholder="请选择" style="width: 50%;margin-right: 8px;">
344 <el-option label="<=500" value="<=500"></el-option>
345 <el-option label=">500" value=">500"></el-option>
346 </el-select>
347 <el-input v-model="scope.row.precisionValue" placeholder="请输入" style="width: 45%;" />
348 </div>
349 </template>
350 </el-table-column> -->
351 <!-- 精度(可编辑)fieldPrecision -->
352 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 327 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
353 <template #default="scope"> 328 <template #default="scope">
354 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ 329 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{
...@@ -393,7 +368,8 @@ const cancel = () => { ...@@ -393,7 +368,8 @@ const cancel = () => {
393 <template #default="scope"> 368 <template #default="scope">
394 <!-- 非编辑模式,展示取值范围 --> 369 <!-- 非编辑模式,展示取值范围 -->
395 <span v-if="!scope.row.isEdit"> 370 <span v-if="!scope.row.isEdit">
396 {{ scope.row.fieldValueRange ? scope.row.fieldValueRange.join('-') : '--' }} 371 {{ scope.row.fieldValueRange
372 ? scope.row.fieldValueRange.replace('#', '-') : '--' }}
397 </span> 373 </span>
398 <!-- 编辑模式,显示两个输入框 --> 374 <!-- 编辑模式,显示两个输入框 -->
399 <div v-else style="display: flex; gap: 5px; align-items: center;"> 375 <div v-else style="display: flex; gap: 5px; align-items: center;">
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
6 import TableTools from '@/components/Tools/table_tools.vue'; 6 import TableTools from '@/components/Tools/table_tools.vue';
7 import { getGradeList } from "@/api/modules/dataInventory"; 7 import { getGradeList } from "@/api/modules/dataInventory";
8 import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, deleteLabel, updateLabel } from "@/api/modules/dataLabel"; 8 import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, deleteLabel, updateLabel } from "@/api/modules/dataLabel";
9 import { CirclePlus, Delete } from "@element-plus/icons-vue"; 9 import { CirclePlus, Delete, Warning } from "@element-plus/icons-vue";
10
11 10
12 11
13 const { proxy } = getCurrentInstance() as any; 12 const { proxy } = getCurrentInstance() as any;
...@@ -78,8 +77,8 @@ const getLabelPageData = async () => { ...@@ -78,8 +77,8 @@ const getLabelPageData = async () => {
78 refCount.value++; 77 refCount.value++;
79 tableInfo.value.loading = true; 78 tableInfo.value.loading = true;
80 const params = { 79 const params = {
81 pageIndex: page.value.curr, 80 pageIndex: 1,
82 pageSize: page.value.limit, 81 pageSize: 50,
83 classifyGuid: classifyGuid.value, 82 classifyGuid: classifyGuid.value,
84 detailGuid: classifyDetailGuid.value 83 detailGuid: classifyDetailGuid.value
85 } 84 }
...@@ -152,6 +151,10 @@ const findTopParentNode = (node: any) => { ...@@ -152,6 +151,10 @@ const findTopParentNode = (node: any) => {
152 if (isLastLayer.value) { 151 if (isLastLayer.value) {
153 atGradeinfo.value = node.data; 152 atGradeinfo.value = node.data;
154 } 153 }
154 if (!node.parent.parent) {
155 findNodeDetails.value = node.data;
156 return;
157 }
155 158
156 // 递归向上查找符合条件的祖先节点 159 // 递归向上查找符合条件的祖先节点
157 const findCParent = (currentNode: any): any => { 160 const findCParent = (currentNode: any): any => {
...@@ -174,7 +177,7 @@ const findTopParentNode = (node: any) => { ...@@ -174,7 +177,7 @@ const findTopParentNode = (node: any) => {
174 177
175 178
176 const nodeClick = (data, node) => { 179 const nodeClick = (data, node) => {
177 180 console.log('nodeClick', data, node);
178 findTopParentNode(node); 181 findTopParentNode(node);
179 newCreateGradeFormItems.value[1].options = transformDataForTree([findNodeDetails.value]) 182 newCreateGradeFormItems.value[1].options = transformDataForTree([findNodeDetails.value])
180 183
...@@ -208,7 +211,7 @@ const page = ref({ ...@@ -208,7 +211,7 @@ const page = ref({
208 curr: 1, 211 curr: 1,
209 sizes: [ 212 sizes: [
210 { label: "10", value: 10 }, 213 { label: "10", value: 10 },
211 { label: "20", value: 20 }, 214 { label: "50", value: 50 },
212 { label: "100", value: 100 }, 215 { label: "100", value: 100 },
213 { label: "150", value: 150 }, 216 { label: "150", value: 150 },
214 { label: "200", value: 200 }, 217 { label: "200", value: 200 },
...@@ -227,7 +230,7 @@ const tableInfo = ref({ ...@@ -227,7 +230,7 @@ const tableInfo = ref({
227 return tempInfo.join('/') 230 return tempInfo.join('/')
228 }, 231 },
229 }, 232 },
230 { label: "分级", field: "gradeDetailName", width: 140 }, 233 { label: "分级", field: "gradeDetailName", width: 80 },
231 { 234 {
232 label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' 235 label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center'
233 }, 236 },
...@@ -243,7 +246,7 @@ const tableInfo = ref({ ...@@ -243,7 +246,7 @@ const tableInfo = ref({
243 actionInfo: { 246 actionInfo: {
244 label: "操作", 247 label: "操作",
245 type: "btn", 248 type: "btn",
246 width: 300, 249 width: 120,
247 fixed: 'right', 250 fixed: 'right',
248 btns: [ 251 btns: [
249 { 252 {
...@@ -264,6 +267,10 @@ const tableInfo = ref({ ...@@ -264,6 +267,10 @@ const tableInfo = ref({
264 item.default = scope.row[item.field]; 267 item.default = scope.row[item.field];
265 item.disabled = false; 268 item.disabled = false;
266 }); 269 });
270 matchChValue.value.value = scope.row.matchChValue;
271 matchChValue.value.disabled = false;
272 matchEnValue.value.value = scope.row.matchEnValue;
273 matchEnValue.value.disabled = false;
267 if (scope.row.vagueMatchRule) { 274 if (scope.row.vagueMatchRule) {
268 // formRows进行回显 275 // formRows进行回显
269 formRows.value = scope.row.vagueMatchRule.map((item) => ({ 276 formRows.value = scope.row.vagueMatchRule.map((item) => ({
...@@ -374,6 +381,10 @@ const tableBtnClick = async (scope, value) => { ...@@ -374,6 +381,10 @@ const tableBtnClick = async (scope, value) => {
374 item.default = scope.row[item.field]; 381 item.default = scope.row[item.field];
375 item.disabled = true; 382 item.disabled = true;
376 }); 383 });
384 matchChValue.value.value = scope.row.matchChValue;
385 matchChValue.value.disabled = true;
386 matchEnValue.value.value = scope.row.matchEnValue;
387 matchEnValue.value.disabled = true;
377 if (scope.row.vagueMatchRule) { 388 if (scope.row.vagueMatchRule) {
378 // formRows进行回显 389 // formRows进行回显
379 formRows.value = scope.row.vagueMatchRule.map((item) => ({ 390 formRows.value = scope.row.vagueMatchRule.map((item) => ({
...@@ -444,34 +455,34 @@ const newCreateGradeFormItems = ref<any>([{ ...@@ -444,34 +455,34 @@ const newCreateGradeFormItems = ref<any>([{
444 required: true, 455 required: true,
445 block: true, 456 block: true,
446 }, 457 },
447 // { 458 // {
448 // label: ' ', 459 // label: ' ',
449 // type: 'label', 460 // type: 'label',
450 // default: '规则配置', 461 // default: '规则配置',
451 // block: true, 462 // block: true,
452 // col: 'title-label' 463 // col: 'title-label'
453 // }, 464 // },
454 { 465 // {
455 label: '精确匹配', 466 // label: '精确匹配',
456 type: 'textarea', 467 // type: 'textarea',
457 maxlength: 260, 468 // maxlength: 200,
458 placeholder: '请输入字段中文,中间用英文“,”分号隔开', 469 // placeholder: '请输入字段中文,中间用英文“,”分号隔开',
459 field: 'matchChValue', 470 // field: 'matchChValue',
460 default: '', 471 // default: '',
461 clearable: true, 472 // clearable: true,
462 required: false, 473 // required: false,
463 474
464 }, 475 // },
465 { 476 // {
466 label: '', 477 // label: '',
467 type: 'textarea', 478 // type: 'textarea',
468 maxlength: 260, 479 // maxlength: 200,
469 placeholder: '请输入字段中文,中间用英文“,”分号隔开', 480 // placeholder: '请输入字段中文,中间用英文“,”分号隔开',
470 field: 'matchEnValue', 481 // field: 'matchEnValue',
471 default: '', 482 // default: '',
472 clearable: true, 483 // clearable: true,
473 required: false, 484 // required: false,
474 } 485 // }
475 ]); 486 ]);
476 487
477 const newCreateGradeFormRules = ref({ 488 const newCreateGradeFormRules = ref({
...@@ -526,7 +537,9 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -526,7 +537,9 @@ const newCreateGradeStandardDialogInfo = ref({
526 ...info, 537 ...info,
527 classifyGuid: classifyGuid.value, 538 classifyGuid: classifyGuid.value,
528 gradeGuid: tempRefGradeGuid.value, 539 gradeGuid: tempRefGradeGuid.value,
529 vagueMatchRule: tempParams 540 vagueMatchRule: tempParams,
541 matchChValue: matchChValue.value.value,
542 matchEnValue: matchEnValue.value.value
530 } 543 }
531 console.log('submit', params); 544 console.log('submit', params);
532 const res: any = await saveLabel(params); 545 const res: any = await saveLabel(params);
...@@ -554,6 +567,8 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -554,6 +567,8 @@ const newCreateGradeStandardDialogInfo = ref({
554 vagueMatchRule: tempParams, 567 vagueMatchRule: tempParams,
555 classifyGuid: classifyGuid.value, 568 classifyGuid: classifyGuid.value,
556 gradeGuid: tempRefGradeGuid.value, 569 gradeGuid: tempRefGradeGuid.value,
570 matchChValue: matchChValue.value.value,
571 matchEnValue: matchEnValue.value.value
557 } 572 }
558 console.log('submit', params); 573 console.log('submit', params);
559 const res: any = await updateLabel(params); 574 const res: any = await updateLabel(params);
...@@ -579,6 +594,10 @@ const addNewLabel = async () => { ...@@ -579,6 +594,10 @@ const addNewLabel = async () => {
579 item.default = ''; 594 item.default = '';
580 item.disabled = false; 595 item.disabled = false;
581 }); 596 });
597 matchChValue.value.value = '';
598 matchChValue.value.disabled = false;
599 matchEnValue.value.value = '';
600 matchEnValue.value.disabled = false;
582 formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; 601 formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }];
583 602
584 // 603 //
...@@ -653,8 +672,8 @@ const searchClass = async (val: any, clear: boolean = false) => { ...@@ -653,8 +672,8 @@ const searchClass = async (val: any, clear: boolean = false) => {
653 if (val?.labelName?.length !== 0 || refCount.value >= 1) { 672 if (val?.labelName?.length !== 0 || refCount.value >= 1) {
654 tableInfo.value.loading = true; 673 tableInfo.value.loading = true;
655 const params = { 674 const params = {
656 pageIndex: page.value.curr, 675 pageIndex: 1,
657 pageSize: page.value.limit, 676 pageSize: 50,
658 guids: guids.value, 677 guids: guids.value,
659 } 678 }
660 const res: any = await getLabelPageList(params); 679 const res: any = await getLabelPageList(params);
...@@ -691,8 +710,6 @@ const handleSelectChange = async (val, row, info) => { ...@@ -691,8 +710,6 @@ const handleSelectChange = async (val, row, info) => {
691 newCreateGradeFormItems.value[2].default = matchedGrade.guid; 710 newCreateGradeFormItems.value[2].default = matchedGrade.guid;
692 newCreateGradeFormItems.value[0].default = tempFormData.value.label; 711 newCreateGradeFormItems.value[0].default = tempFormData.value.label;
693 newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid; 712 newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid;
694 newCreateGradeFormItems.value[3].default = tempFormData.value.matchChValue;
695 newCreateGradeFormItems.value[4].default = tempFormData.value.matchEnValue;
696 } 713 }
697 } 714 }
698 }; 715 };
...@@ -769,9 +786,18 @@ const addRow = () => { ...@@ -769,9 +786,18 @@ const addRow = () => {
769 const deleteRow = (index: number) => { 786 const deleteRow = (index: number) => {
770 formRows.value.splice(index, 1); 787 formRows.value.splice(index, 1);
771 }; 788 };
789 const matchChValue = ref({
790 value: '',
791 disabled: false
792 })
793 const matchEnValue = ref({
794 value: '',
795 disabled: false
796 })
772 797
773 </script> 798 </script>
774 799
800
775 <template> 801 <template>
776 <div class="data-label"> 802 <div class="data-label">
777 <div class="container_wrap full flex"> 803 <div class="container_wrap full flex">
...@@ -805,13 +831,37 @@ const deleteRow = (index: number) => { ...@@ -805,13 +831,37 @@ const deleteRow = (index: number) => {
805 <Dialog_form ref="dialogLabelFormRef" :dialogConfigInfo="newCreateGradeStandardDialogInfo" class="v-dialog-form" 831 <Dialog_form ref="dialogLabelFormRef" :dialogConfigInfo="newCreateGradeStandardDialogInfo" class="v-dialog-form"
806 @treeSelectNodeChange='handleTreeSelectNodeChange' @selectChange="handleSelectChange"> 832 @treeSelectNodeChange='handleTreeSelectNodeChange' @selectChange="handleSelectChange">
807 <template v-slot:default> 833 <template v-slot:default>
808 834 <div>
809 <div class="dim-label">模糊匹配</div> 835 <div class="dim-label">
836 <span class="front">模糊匹配</span>
837 <el-icon>
838 <Warning />
839 </el-icon>
840 <span class="tip">
841 精确匹配使用中文;分隔每个规则
842 </span>
843 </div>
844 <div class="v-match">
845 <el-input v-model="matchChValue.value" :disabled="matchChValue.disabled" maxlength="200"
846 style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" />
847 <el-input v-model="matchEnValue.value" :disabled="matchEnValue.disabled" maxlength="200"
848 style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" />
849 </div>
850 </div>
851 <div class="dim-label" style="margin-top: 16px;">
852 <span class="front">模糊匹配</span>
853 <el-icon>
854 <Warning />
855 </el-icon>
856 <span class="tip">
857 模糊匹配是或的关系,可配置多个模糊匹配规则
858 </span>
859 </div>
810 <!-- 渲染行 --> 860 <!-- 渲染行 -->
811 <div v-for="(row, index) in formRows" :key="index" class="match-content-wrapper"> 861 <div v-for="(row, index) in formRows" :key="index" class="match-content-wrapper">
812 <div class="match-content" @mouseenter="handleMouseEnter(index)" @mouseleave="handleMouseLeave()"> 862 <div class="match-content" @mouseenter="handleMouseEnter(index)" @mouseleave="handleMouseLeave()">
813 <!-- 位置映射下拉框 --> 863 <!-- 位置映射下拉框 -->
814 <el-select v-model="row.name" placeholder="请选语言类型" :disabled=row.disabled class="v-select"> 864 <el-select v-model="row.name" placeholder="请选择中文名/英文名" :disabled=row.disabled class="v-select">
815 <el-option v-for="option in languageOptions" :key="option.value" :label="option.label" 865 <el-option v-for="option in languageOptions" :key="option.value" :label="option.label"
816 :value="option.value" /> 866 :value="option.value" />
817 </el-select> 867 </el-select>
...@@ -911,6 +961,16 @@ const deleteRow = (index: number) => { ...@@ -911,6 +961,16 @@ const deleteRow = (index: number) => {
911 .dim-label { 961 .dim-label {
912 height: 10px; 962 height: 10px;
913 display: flex; 963 display: flex;
964 align-items: center;
965 margin-top: 6px;
966
967 .front {
968 margin-right: 8px;
969 }
970
971 .tip {
972 margin-left: 3px;
973 }
914 } 974 }
915 975
916 .match-content-wrapper { 976 .match-content-wrapper {
...@@ -965,5 +1025,21 @@ const deleteRow = (index: number) => { ...@@ -965,5 +1025,21 @@ const deleteRow = (index: number) => {
965 overflow: auto; 1025 overflow: auto;
966 } 1026 }
967 } 1027 }
1028
1029 .v-match {
1030 display: flex;
1031 justify-content: space-between;
1032 margin-top: 10px;
1033 margin-bottom: 10px;
1034 }
1035
1036 :deep(.no-resize) {
1037 height: 94px;
1038
1039 .el-textarea__inner {
1040 min-height: 94px !important;
1041 resize: none;
1042 }
1043 }
968 } 1044 }
969 </style> 1045 </style>
......
...@@ -17,9 +17,10 @@ import { ...@@ -17,9 +17,10 @@ import {
17 getDbDirTableSelectList, 17 getDbDirTableSelectList,
18 getTaskExeTreeList, 18 getTaskExeTreeList,
19 getGradeList, 19 getGradeList,
20 getFieldTypeList, 20 getNewDataTypeList,
21 } from "@/api/modules/dataInventory"; 21 } from "@/api/modules/dataInventory";
22 import existingTableSelect from "./existingTableSelect.vue"; 22 import existingTableSelect from "./existingTableSelect.vue";
23 import { ro } from "element-plus/es/locale";
23 24
24 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/ 25 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/
25 26
...@@ -59,16 +60,13 @@ const treeSelectProps = { ...@@ -59,16 +60,13 @@ const treeSelectProps = {
59 children: "children", 60 children: "children",
60 }; 61 };
61 const treeSelectOptions = ref<any>([]); 62 const treeSelectOptions = ref<any>([]);
62 // 存储引用的refGradeGuid 63
63 const refGradeGuid = ref<any>();
64 const getFieldTree = () => { 64 const getFieldTree = () => {
65 getTaskExeTreeList({ execGuid: execGuid.value }).then((res: any) => { 65 getTaskExeTreeList({ execGuid: execGuid.value }).then((res: any) => {
66 if (res.code == proxy.$passCode) { 66 if (res.code == proxy.$passCode) {
67 const data = res.data || []; 67 const data = res.data || [];
68 classifyList.value = data; 68 classifyList.value = data;
69 treeSelectOptions.value = data; 69 treeSelectOptions.value = data;
70 // 遍历data,找到refGradeGuid,不用递归,找第一层
71
72 } else { 70 } else {
73 ElMessage.error(res.msg); 71 ElMessage.error(res.msg);
74 } 72 }
...@@ -94,7 +92,7 @@ const getFieldTypeData = async () => { ...@@ -94,7 +92,7 @@ const getFieldTypeData = async () => {
94 const params = { 92 const params = {
95 dictType: "字段类型" 93 dictType: "字段类型"
96 } 94 }
97 const res: any = await getFieldTypeList(params); 95 const res: any = await getNewDataTypeList(params);
98 if (res.code == proxy.$passCode) { 96 if (res.code == proxy.$passCode) {
99 fieldData.value = res.data; 97 fieldData.value = res.data;
100 } else { 98 } else {
...@@ -108,7 +106,7 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => { ...@@ -108,7 +106,7 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => {
108 for (const item of data) { 106 for (const item of data) {
109 // 判断当前节点是否匹配 107 // 判断当前节点是否匹配
110 if (item.classifyDetailGuid === targetClassifyDetailGuid) { 108 if (item.classifyDetailGuid === targetClassifyDetailGuid) {
111 return item.refGradeGuid; // 找到匹配的,返回 refGradeGuid 109 return item; // 找到匹配的,返回 refGradeGuid
112 } 110 }
113 111
114 // 如果当前节点有 children,则递归查找子节点 112 // 如果当前节点有 children,则递归查找子节点
...@@ -121,16 +119,19 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => { ...@@ -121,16 +119,19 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => {
121 } 119 }
122 return null; // 没有找到匹配项时返回 null 120 return null; // 没有找到匹配项时返回 null
123 }; 121 };
122 const refGradeGuid = ref<any>('');
124 const editRow = (row) => { 123 const editRow = (row) => {
125 // 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid 124 // 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid
126 let refGradeGuid = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid); 125 refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
127 getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => { 126 if (refGradeGuid.value) {
127 getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
128 if (res.code === proxy.$passCode) { 128 if (res.code === proxy.$passCode) {
129 row.gradeOptions = res.data.records || []; 129 row.gradeOptions = res.data.records || [];
130 } else { 130 } else {
131 ElMessage.error(res.msg); 131 ElMessage.error(res.msg);
132 } 132 }
133 }); 133 });
134 }
134 // 这个是指定是否能编辑的字段 135 // 这个是指定是否能编辑的字段
135 editableFields.sourceFieldName = false; 136 editableFields.sourceFieldName = false;
136 row.isEdit = true 137 row.isEdit = true
...@@ -146,7 +147,14 @@ const handleGradeChange = (row) => { ...@@ -146,7 +147,14 @@ const handleGradeChange = (row) => {
146 }; 147 };
147 // 保存数据 148 // 保存数据
148 const saveRow = (row) => { 149 const saveRow = (row) => {
149 console.log('保存数据', row) 150 if (!row.fieldName) {
151 ElMessage({
152 type: "error",
153 message: "字段英文名不能为空!",
154 });
155 return;
156 }
157 refGradeGuid.value = '';
150 editableFields.sourceFieldName = true; 158 editableFields.sourceFieldName = true;
151 row.isEdit = false 159 row.isEdit = false
152 } 160 }
...@@ -209,20 +217,25 @@ const getNextTableInfo = async (params) => { ...@@ -209,20 +217,25 @@ const getNextTableInfo = async (params) => {
209 217
210 218
211 219
212 const handleClassifyChange = (row) => { 220 const handleClassifyChange = (row, value) => {
221 console.log('分类改变', row, value)
213 if (!row.classifyDetailGuid) { 222 if (!row.classifyDetailGuid) {
214 row.gradeGuid = null; 223 row.gradeGuid = null;
215 row.gradeOptions = []; 224 row.gradeOptions = [];
216 return; 225 return;
217 } 226 }
218 227
219 getGradeList({ classifyGradeGuid: row.classifyDetailGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => { 228 refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
220 if (res.code === 200) { 229 console.log('refGradeGuid', refGradeGuid.value)
230 row.classifyDetailName = refGradeGuid.value.classifyName;
231 getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
232 if (res.code === proxy.$passCode) {
221 row.gradeOptions = res.data.records || []; 233 row.gradeOptions = res.data.records || [];
222 } else { 234 } else {
223 ElMessage.error(res.msg); 235 ElMessage.error(res.msg);
224 } 236 }
225 }); 237 });
238
226 }; 239 };
227 240
228 const isPrevious = ref(false); 241 const isPrevious = ref(false);
...@@ -258,53 +271,47 @@ const editableFields = { ...@@ -258,53 +271,47 @@ const editableFields = {
258 } 271 }
259 272
260 const tableFieldsLoading = ref(false) 273 const tableFieldsLoading = ref(false)
274 // 当前选中的行
261 const selectedRows = ref([]); 275 const selectedRows = ref([]);
262 // 监听选中行 276
277 // 监听选中行变化
263 const selectionFieldsChange = (selection) => { 278 const selectionFieldsChange = (selection) => {
264 console.log('selection', selection)
265 selectedRows.value = selection; 279 selectedRows.value = selection;
266 }; 280 };
267 281
268 // 上移功能 282 // 上移操作
269 const moveUp = () => { 283 const moveUp = () => {
270 // 1. 找到选中行在 tableData 中的索引 284 if (selectedRows.value.length === 0) {
271 const selectedIds = selectedRows.value.map((row: any) => row.id); 285 proxy.$message.warning("请选择数据!");
272 286 return;
273 // 2. 遍历选中行,按顺序上移
274 for (let i = 0; i < tableDataDetailInfo.value.length; i++) {
275 const currentRow = tableDataDetailInfo.value[i];
276
277 // 如果当前行被选中,且不是第一行,则交换位置
278 if (selectedIds.includes(currentRow.id) && i > 0) {
279 const previousRow = tableDataDetailInfo.value[i - 1];
280
281 // 如果上一行没有被选中,交换位置
282 if (!selectedIds.includes(previousRow.id)) {
283 [tableDataDetailInfo.value[i], tableDataDetailInfo.value[i - 1]] = [tableDataDetailInfo.value[i - 1], tableDataDetailInfo.value[i]];
284 }
285 } 287 }
288 selectedRows.value.forEach((row: any) => {
289 const index = tableDataDetailInfo.value.findIndex((item) => item.guid === row.guid);
290 if (index > 0) {
291 [tableDataDetailInfo.value[index - 1], tableDataDetailInfo.value[index]] = [
292 tableDataDetailInfo.value[index],
293 tableDataDetailInfo.value[index - 1],
294 ];
286 } 295 }
296 });
287 }; 297 };
288 298
289 // 下移功能 299 // 下移操作
290 const moveDown = () => { 300 const moveDown = () => {
291 // 1. 找到选中行在 tableData 中的索引 301 if (selectedRows.value.length === 0) {
292 const selectedIds = selectedRows.value.map((row: any) => row.id); 302 proxy.$message.warning("请选择数据!");
293 303 return;
294 // 2. 遍历选中行,倒序下移
295 for (let i = tableDataDetailInfo.value.length - 1; i >= 0; i--) {
296 const currentRow = tableDataDetailInfo.value[i];
297
298 // 如果当前行被选中,且不是最后一行,则交换位置
299 if (selectedIds.includes(currentRow.id) && i < tableDataDetailInfo.value.length - 1) {
300 const nextRow = tableDataDetailInfo.value[i + 1];
301
302 // 如果下一行没有被选中,交换位置
303 if (!selectedIds.includes(nextRow.id)) {
304 [tableDataDetailInfo.value[i], tableDataDetailInfo.value[i + 1]] = [tableDataDetailInfo.value[i + 1], tableDataDetailInfo.value[i]];
305 }
306 } 304 }
305 // 倒序遍历选中行
306 [...selectedRows.value].reverse().forEach((row: any) => {
307 const index = tableDataDetailInfo.value.findIndex((item) => item.guid === row.guid);
308 if (index < tableDataDetailInfo.value.length - 1) {
309 [tableDataDetailInfo.value[index], tableDataDetailInfo.value[index + 1]] = [
310 tableDataDetailInfo.value[index + 1],
311 tableDataDetailInfo.value[index],
312 ];
307 } 313 }
314 });
308 }; 315 };
309 316
310 317
...@@ -336,6 +343,7 @@ const batchDelete = () => { ...@@ -336,6 +343,7 @@ const batchDelete = () => {
336 343
337 // 新增一行 344 // 新增一行
338 const addRow = () => { 345 const addRow = () => {
346 refGradeGuid.value = '';
339 tableDataDetailInfo.value.push({ 347 tableDataDetailInfo.value.push({
340 id: tableDataDetailInfo.value.length + 1, 348 id: tableDataDetailInfo.value.length + 1,
341 fieldName: '', 349 fieldName: '',
...@@ -349,6 +357,8 @@ const addRow = () => { ...@@ -349,6 +357,8 @@ const addRow = () => {
349 dictionaryGuid: '', 357 dictionaryGuid: '',
350 isEdit: true, 358 isEdit: true,
351 gradeOptions: [], 359 gradeOptions: [],
360 classifyDetailName: '',
361 gradeDetailName: '',
352 }) 362 })
353 } 363 }
354 364
...@@ -651,7 +661,19 @@ const createNewSql = () => { ...@@ -651,7 +661,19 @@ const createNewSql = () => {
651 newCreateSqlDialogInfo.value.visible = true; 661 newCreateSqlDialogInfo.value.visible = true;
652 } 662 }
653 663
654 664 const inputLengthKeyUp = (regexp, scope, field, max: any = null, min: any = null) => {
665 scope.row[field] = scope.row[field].replace(regexp, '');
666 if (field == 'fieldLength' && scope.row.dataType == 'decimal') {
667 max = 65;
668 }
669 /** 最大值设置2000 */
670 if (max && scope.row[field] > max) {
671 scope.row[field] = max;
672 }
673 if (min !== null && scope.row[field] != '' && scope.row[field] <= min) {
674 scope.row[field] = min;
675 }
676 }
655 </script> 677 </script>
656 678
657 <template> 679 <template>
...@@ -734,7 +756,8 @@ const createNewSql = () => { ...@@ -734,7 +756,8 @@ const createNewSql = () => {
734 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? 756 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ?
735 scope.row.fieldName 757 scope.row.fieldName
736 : '--' }}</span> 758 : '--' }}</span>
737 <el-input v-else v-model="scope.row.fieldName" placeholder="请输入" /> 759 <el-input v-else v-model="scope.row.fieldName" placeholder="必填"
760 @input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'fieldName')" />
738 </template> 761 </template>
739 </el-table-column> 762 </el-table-column>
740 <!-- 源数据库 --> 763 <!-- 源数据库 -->
...@@ -784,21 +807,36 @@ const createNewSql = () => { ...@@ -784,21 +807,36 @@ const createNewSql = () => {
784 <!-- 长度(可编辑) --> 807 <!-- 长度(可编辑) -->
785 <el-table-column prop="fieldLength" label="长度" width="120" align="center"> 808 <el-table-column prop="fieldLength" label="长度" width="120" align="center">
786 <template #default="scope"> 809 <template #default="scope">
787 <span v-if="!scope.row.isEdit || !editableFields.fieldLength">{{ scope.row.fieldLength ? 810 <!-- 非编辑状态 -->
788 scope.row.fieldLength 811 <span v-if="!scope.row.isEdit">
789 : '--' }}</span> 812 {{ ['varchar', 'decimal', 'char'].includes(scope.row.fieldType) ? scope.row.fieldLength || '--' : '--'
790 <el-input v-else v-model="scope.row.fieldLength" placeholder="请输入长度" /> 813 }}
814 </span>
815 <!-- 编辑状态 -->
816 <div v-else>
817 <el-input v-if="['varchar', 'decimal', 'char'].includes(scope.row.fieldType)"
818 v-model="scope.row.fieldLength" placeholder="请输入长度"
819 @input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" />
820 <span v-else>--</span>
821 </div>
791 </template> 822 </template>
792 </el-table-column> 823 </el-table-column>
793 <!-- 精度(可编辑)fieldPrecision --> 824
825 <!-- 精度(可编辑) -->
794 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 826 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
795 <template #default="scope"> 827 <template #default="scope">
796 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ scope.row.fieldPrecision ? 828 <!-- 非编辑状态 -->
797 scope.row.fieldPrecision : '--' }}</span> 829 <span v-if="!scope.row.isEdit">
798 <el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" /> 830 {{ scope.row.fieldType === 'decimal' ? scope.row.fieldPrecision || '--' : '--' }}
831 </span>
832 <!-- 编辑状态 -->
833 <div v-else>
834 <el-input v-if="scope.row.fieldType === 'decimal'" v-model="scope.row.fieldPrecision"
835 placeholder="请输入精度" @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
836 <span v-else>--</span>
837 </div>
799 </template> 838 </template>
800 </el-table-column> 839 </el-table-column>
801
802 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 --> 840 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
803 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center"> 841 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center">
804 <template #default="scope"> 842 <template #default="scope">
...@@ -839,7 +877,7 @@ const createNewSql = () => { ...@@ -839,7 +877,7 @@ const createNewSql = () => {
839 <div v-if="scope.row.isEdit"> 877 <div v-if="scope.row.isEdit">
840 <el-tree-select v-model="scope.row.classifyDetailGuid" :data="treeSelectOptions" 878 <el-tree-select v-model="scope.row.classifyDetailGuid" :data="treeSelectOptions"
841 :props="treeSelectProps" placeholder="请选择分类" clearable filterable 879 :props="treeSelectProps" placeholder="请选择分类" clearable filterable
842 @change="handleClassifyChange(scope.row)"> 880 @change="(value) => handleClassifyChange(scope.row, value)">
843 </el-tree-select> 881 </el-tree-select>
844 </div> 882 </div>
845 <!-- 否则直接显示分类名称 --> 883 <!-- 否则直接显示分类名称 -->
......
...@@ -33,6 +33,7 @@ import { ...@@ -33,6 +33,7 @@ import {
33 getSubjectTableDetail, 33 getSubjectTableDetail,
34 checkSubjectTableData 34 checkSubjectTableData
35 } from "@/api/modules/dataCatalogService"; 35 } from "@/api/modules/dataCatalogService";
36 import { getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList } from "@/api/modules/dataInventory";
36 import { useDefault } from "@/hooks/useDefault"; 37 import { useDefault } from "@/hooks/useDefault";
37 import uploadExcelFile from "./components/uploadExcelFile.vue"; 38 import uploadExcelFile from "./components/uploadExcelFile.vue";
38 39
...@@ -47,6 +48,7 @@ const isDimTable = route.query.isDim; ...@@ -47,6 +48,7 @@ const isDimTable = route.query.isDim;
47 const subjectDomainGuid: any = ref(route.query.domainGuid); 48 const subjectDomainGuid: any = ref(route.query.domainGuid);
48 const fullPath = route.fullPath; 49 const fullPath = route.fullPath;
49 const standardSetGuids = ref([]); 50 const standardSetGuids = ref([]);
51 const execGuid = ref(route.query.execGuid);
50 //记录已入库的表创建信息。 52 //记录已入库的表创建信息。
51 const originTableCreateInfo = ref({}); 53 const originTableCreateInfo = ref({});
52 54
...@@ -111,7 +113,7 @@ const uploadFileRef = ref(); ...@@ -111,7 +113,7 @@ const uploadFileRef = ref();
111 113
112 const getSubjectField = () => { 114 const getSubjectField = () => {
113 tableFieldsLoading.value = true; 115 tableFieldsLoading.value = true;
114 getSubjectFieldByFile(fileTableFields.value.map(f => f.chName), tableCreateInfo.value.tableData[0].subjectDomainGuid).then((res: any) => { 116 getFidldEnName(fileTableFields.value.map(f => f.chName)).then((res: any) => {
115 tableFieldsLoading.value = false; 117 tableFieldsLoading.value = false;
116 if (res.code == proxy.$passCode) { 118 if (res.code == proxy.$passCode) {
117 tableCreateInfo.value.tableFields = res.data?.map((field, i) => { 119 tableCreateInfo.value.tableFields = res.data?.map((field, i) => {
...@@ -127,6 +129,72 @@ const getSubjectField = () => { ...@@ -127,6 +129,72 @@ const getSubjectField = () => {
127 }); 129 });
128 } 130 }
129 131
132 // 定义分类选择器的属性
133 const treeSelectProps = {
134 label: "classifyName",
135 value: "classifyDetailGuid",
136 children: "children",
137 };
138 const treeSelectOptions = ref<any>([]);
139
140 const getFieldTree = () => {
141 getTaskExeTreeList({ execGuid: execGuid.value }).then((res: any) => {
142 if (res.code == proxy.$passCode) {
143 treeSelectOptions.value = res.data || [];
144 } else {
145 ElMessage.error(res.msg);
146 }
147 }).catch(() => {
148 ElMessage.error('获取分类树形数据失败');
149 })
150 }
151 const handleClassifyChange = (row, value) => {
152 // 查找选中的节点
153 const selectedNode = getTreeNode(treeSelectOptions.value, value);
154
155 if (selectedNode) {
156 getGradeList({ classifyGradeGuid: selectedNode.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
157 if (res.code === proxy.$passCode) {
158 row.gradeOptions = res.data.records || [];
159 } else {
160 ElMessage.error(res.msg);
161 }
162 });
163 console.log("选中的节点信息:", selectedNode);
164 row.classifyName = selectedNode.classifyName; // 假设树节点的 `label` 是分类名
165 } else {
166 console.error("未找到对应的节点");
167 row.classifyName = ""; // 重置分类名
168 }
169 };
170 const getTreeNode = (tree, value) => {
171 for (const node of tree) {
172 if (node.classifyDetailGuid === value) {
173 return node; // 找到对应节点
174 }
175 if (node.children) {
176 const found = getTreeNode(node.children, value);
177 if (found) return found; // 如果子节点中找到,返回子节点
178 }
179 }
180 return null; // 如果未找到,返回 null
181 };
182
183 const handleGradeChange = (row) => {
184 console.log('分级改变', row)
185 const gradeOptions = row.gradeOptions || [];
186 const matchedItem = gradeOptions.find((item) => item.guid === row.gradeDetailGuid);
187 if (matchedItem) {
188 row.gradeDetailName = matchedItem.name;
189 }
190 };
191
192 // 分级的数据props
193 const gradeSelectProps = {
194 value: 'guid',
195 label: 'name',
196 }
197
130 const nextStep = () => { 198 const nextStep = () => {
131 uploadFileRef.value.fileFormRef.ruleFormRef.validate((valid) => { 199 uploadFileRef.value.fileFormRef.ruleFormRef.validate((valid) => {
132 if (valid) { 200 if (valid) {
...@@ -156,6 +224,7 @@ const nextStep = () => { ...@@ -156,6 +224,7 @@ const nextStep = () => {
156 if (!tableCreateInfo.value.tableFields.length) { 224 if (!tableCreateInfo.value.tableFields.length) {
157 getSubjectField(); 225 getSubjectField();
158 } 226 }
227 getFieldTree();
159 } 228 }
160 }); 229 });
161 }; 230 };
...@@ -478,7 +547,10 @@ const getDimListData = () => { ...@@ -478,7 +547,10 @@ const getDimListData = () => {
478 }; 547 };
479 548
480 const getFieldTypeList = () => { 549 const getFieldTypeList = () => {
481 getDataTypeList().then((res: any) => { 550 const params = {
551 dictType: "字段类型"
552 }
553 getNewDataTypeList(params).then((res: any) => {
482 fieldTypes.value = []; 554 fieldTypes.value = [];
483 if (res.code == proxy.$passCode) { 555 if (res.code == proxy.$passCode) {
484 fieldTypes.value = res.data || []; 556 fieldTypes.value = res.data || [];
...@@ -973,14 +1045,14 @@ const handleFieldClickEdit = (scope) => { ...@@ -973,14 +1045,14 @@ const handleFieldClickEdit = (scope) => {
973 1045
974 //点击保存按钮 1046 //点击保存按钮
975 const handleFieldClickSave = (scope) => { 1047 const handleFieldClickSave = (scope) => {
976 if (isOpenStandard.value && !scope.row.fieldStandardCode) { 1048 // if (isOpenStandard.value && !scope.row.fieldStandardCode) {
977 ElMessage({ 1049 // ElMessage({
978 type: "error", 1050 // type: "error",
979 message: "该主题域开启了字段标准,当前行字段标准不能为空!", 1051 // message: "该主题域开启了字段标准,当前行字段标准不能为空!",
980 }); 1052 // });
981 return; 1053 // return;
982 } 1054 // }
983 if (!scope.row.enName) { 1055 if (!scope.row.fieldName) {
984 ElMessage({ 1056 ElMessage({
985 type: "error", 1057 type: "error",
986 message: "字段英文名不能为空!", 1058 message: "字段英文名不能为空!",
...@@ -1130,13 +1202,13 @@ const saveTable = () => { ...@@ -1130,13 +1202,13 @@ const saveTable = () => {
1130 }); 1202 });
1131 return; 1203 return;
1132 } 1204 }
1133 if (!tableData.dataServerName) { 1205 // if (!tableData.dataServerName) {
1134 ElMessage({ 1206 // ElMessage({
1135 type: "error", 1207 // type: "error",
1136 message: "数据源不能为空!", 1208 // message: "数据源不能为空!",
1137 }); 1209 // });
1138 return; 1210 // return;
1139 } 1211 // }
1140 if (tableData.dataServerName.indexOf('-') > -1) { 1212 if (tableData.dataServerName.indexOf('-') > -1) {
1141 ElMessage.error('数据库表名称不能包含中划线,可以改为下划线!'); 1213 ElMessage.error('数据库表名称不能包含中划线,可以改为下划线!');
1142 return; 1214 return;
...@@ -1179,26 +1251,26 @@ const saveTable = () => { ...@@ -1179,26 +1251,26 @@ const saveTable = () => {
1179 const regex = /^[a-zA-Z]/; 1251 const regex = /^[a-zA-Z]/;
1180 let index = 1; 1252 let index = 1;
1181 for (const field of tableFields) { 1253 for (const field of tableFields) {
1182 if (!field.enName) { 1254 if (!field.fieldName) {
1183 ElMessage.error(`第 ${index} 个字段的英文名称不能为空!`); 1255 ElMessage.error(`第 ${index} 个字段的英文名称不能为空!`);
1184 return; 1256 return;
1185 } 1257 }
1186 if (!regex.test(field.enName)) { 1258 if (!regex.test(field.fieldName)) {
1187 ElMessage.error(`第 ${index} 个字段的英文名称必须以英文字符开头`); 1259 ElMessage.error(`第 ${index} 个字段的英文名称必须以英文字符开头`);
1188 return; 1260 return;
1189 } 1261 }
1190 if (enNames.indexOf(field.enName) > -1) { 1262 if (enNames.indexOf(field.fieldName) > -1) {
1191 ElMessage.error(`字段的英文名称 ${field.enName} 不能重复!`); 1263 ElMessage.error(`字段的英文名称 ${field.fieldName} 不能重复!`);
1192 return; 1264 return;
1193 } 1265 }
1194 if (chNames.indexOf(field.chName) > -1) { 1266 if (chNames.indexOf(field.fieldChName) > -1) {
1195 ElMessage.error(`字段的英文名称 ${field.chName} 不能重复!`); 1267 ElMessage.error(`字段的英文名称 ${field.fieldChName} 不能重复!`);
1196 return;
1197 }
1198 if (isOpenStandard.value && !field.fieldStandardCode) {
1199 ElMessage.error(`开启了字段强标准,第 ${index} 个字段的标准不能为空!`);
1200 return; 1268 return;
1201 } 1269 }
1270 // if (isOpenStandard.value && !field.fieldStandardCode) {
1271 // ElMessage.error(`开启了字段强标准,第 ${index} 个字段的标准不能为空!`);
1272 // return;
1273 // }
1202 if (field.dataType === "decimal" && (!field.fieldPrecision && field.fieldPrecision != 0)) { 1274 if (field.dataType === "decimal" && (!field.fieldPrecision && field.fieldPrecision != 0)) {
1203 ElMessage.error(`第 ${index} 个字段的字段类型为浮点型时,精度不能为空`); 1275 ElMessage.error(`第 ${index} 个字段的字段类型为浮点型时,精度不能为空`);
1204 return; 1276 return;
...@@ -1505,7 +1577,7 @@ const tableSelectFields = computed(() => { ...@@ -1505,7 +1577,7 @@ const tableSelectFields = computed(() => {
1505 <el-input v-model.trim="scope.row['chName']" placeholder="必填" :maxlength="50" /> 1577 <el-input v-model.trim="scope.row['chName']" placeholder="必填" :maxlength="50" />
1506 </template> 1578 </template>
1507 </el-table-column> 1579 </el-table-column>
1508 <el-table-column prop="subjectDomain" label="主题域" width="180px" align="left" show-overflow-tooltip> 1580 <!-- <el-table-column prop="subjectDomain" label="主题域" width="180px" align="left" show-overflow-tooltip>
1509 <template #default="scope"> 1581 <template #default="scope">
1510 <el-input disabled v-model.trim="scope.row['subjectDomain']" /> 1582 <el-input disabled v-model.trim="scope.row['subjectDomain']" />
1511 </template> 1583 </template>
...@@ -1576,7 +1648,7 @@ const tableSelectFields = computed(() => { ...@@ -1576,7 +1648,7 @@ const tableSelectFields = computed(() => {
1576 :value="opt['paramValue']" /> 1648 :value="opt['paramValue']" />
1577 </el-select> 1649 </el-select>
1578 </template> 1650 </template>
1579 </el-table-column> 1651 </el-table-column> -->
1580 <el-table-column prop="description" label="描述" width="220px" align="left" show-overflow-tooltip> 1652 <el-table-column prop="description" label="描述" width="220px" align="left" show-overflow-tooltip>
1581 <template #default="scope"> 1653 <template #default="scope">
1582 <el-input v-model.trim="scope.row['description']" /> 1654 <el-input v-model.trim="scope.row['description']" />
...@@ -1631,22 +1703,21 @@ const tableSelectFields = computed(() => { ...@@ -1631,22 +1703,21 @@ const tableSelectFields = computed(() => {
1631 <span v-else>{{ scope.row["fieldStandardName"] || "--" }}</span> 1703 <span v-else>{{ scope.row["fieldStandardName"] || "--" }}</span>
1632 </template> 1704 </template>
1633 </el-table-column> 1705 </el-table-column>
1634 <el-table-column prop="chName" label="目标字段名" width="150px" align="left" show-overflow-tooltip> 1706 <el-table-column prop="fieldChName" label="目标字段名" width="150px" align="left" show-overflow-tooltip>
1635 <template #default="scope"> 1707 <template #default="scope">
1636 <el-input v-if="scope.row['isEdit'] && !isOpenStandard" 1708 <el-input v-if="scope.row['isEdit']" :placeholder="fieldStandardSetGuids?.length ? '输入匹配标准' : ''"
1637 :placeholder="fieldStandardSetGuids?.length ? '输入匹配标准' : ''" v-model.trim="scope.row['chName']" 1709 v-model.trim="scope.row['fieldChName']" @change="(v) => handleFieldChineseNameChange(v, scope)" />
1638 @change="(v) => handleFieldChineseNameChange(v, scope)" /> 1710 <span v-else>{{ scope.row["fieldChName"] || '--' }}</span>
1639 <span v-else>{{ scope.row["chName"] || '--' }}</span>
1640 </template> 1711 </template>
1641 </el-table-column> 1712 </el-table-column>
1642 <el-table-column prop="enName" label="目标字段英文名" width="150px" align="left" show-overflow-tooltip> 1713 <el-table-column prop="fieldName" label="目标字段英文名" width="150px" align="left" show-overflow-tooltip>
1643 <template #default="scope"> 1714 <template #default="scope">
1644 <el-input v-if="scope.row['isEdit'] && !isOpenStandard" v-model.trim="scope.row['enName']" 1715 <el-input v-if="scope.row['isEdit']" v-model.trim="scope.row['fieldName']" placeholder="必填"
1645 placeholder="必填" @input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'enName')" /> 1716 @input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'fieldName')" />
1646 <span v-else>{{ scope.row["enName"] || '--' }}</span> 1717 <span v-else>{{ scope.row["fieldName"] || '--' }}</span>
1647 </template> 1718 </template>
1648 </el-table-column> 1719 </el-table-column>
1649 <el-table-column prop="fileFieldName" label="文件字段名" width="150px" align="left" show-overflow-tooltip> 1720 <!-- <el-table-column prop="fileFieldName" label="文件字段名" width="150px" align="left" show-overflow-tooltip>
1650 <template #default="scope"> 1721 <template #default="scope">
1651 <el-select v-if="scope.row['isEdit']" v-model="scope.row['fileFieldName']" clearable filterable 1722 <el-select v-if="scope.row['isEdit']" v-model="scope.row['fileFieldName']" clearable filterable
1652 placeholder="请选择"> 1723 placeholder="请选择">
...@@ -1655,13 +1726,13 @@ const tableSelectFields = computed(() => { ...@@ -1655,13 +1726,13 @@ const tableSelectFields = computed(() => {
1655 </el-select> 1726 </el-select>
1656 <span v-else>{{ scope.row['fileFieldName'] || "--" }}</span> 1727 <span v-else>{{ scope.row['fileFieldName'] || "--" }}</span>
1657 </template> 1728 </template>
1658 </el-table-column> 1729 </el-table-column> -->
1659 <el-table-column prop="dataType" label="字段类型" width="120px" align="left" show-overflow-tooltip> 1730 <el-table-column prop="dataType" label="字段类型" width="120px" align="left" show-overflow-tooltip>
1660 <template #default="scope"> 1731 <template #default="scope">
1661 <el-select v-if="scope.row['isEdit'] && !isOpenStandard" v-model="scope.row['dataType']" 1732 <el-select v-if="scope.row['isEdit']" v-model="scope.row['dataType']"
1662 @change="(val) => dataTypeChange(val, scope)" placeholder="请选择"> 1733 @change="(val) => dataTypeChange(val, scope)" placeholder="请选择">
1663 <el-option v-for="opt in fieldTypes" :key="opt['paramValue']" :label="opt['paramName']" 1734 <el-option v-for="opt in fieldTypes" :key="opt['value']" :label="opt['label']"
1664 :value="opt['paramValue']" /> 1735 :value="opt['value']" />
1665 </el-select> 1736 </el-select>
1666 <span v-else>{{ fieldTypes.find(f => f.paramValue === scope.row["dataType"])?.paramName || "--" 1737 <span v-else>{{ fieldTypes.find(f => f.paramValue === scope.row["dataType"])?.paramName || "--"
1667 }}</span> 1738 }}</span>
...@@ -1670,7 +1741,7 @@ const tableSelectFields = computed(() => { ...@@ -1670,7 +1741,7 @@ const tableSelectFields = computed(() => {
1670 <el-table-column prop="fieldLength" label="长度" width="115px" align="left" show-overflow-tooltip> 1741 <el-table-column prop="fieldLength" label="长度" width="115px" align="left" show-overflow-tooltip>
1671 <template #default="scope"> 1742 <template #default="scope">
1672 <el-input 1743 <el-input
1673 v-if="scope.row['isEdit'] && !isOpenStandard && (scope.row['dataType'] == 'varchar' || scope.row['dataType'] == 'decimal' || scope.row['dataType'] == 'char')" 1744 v-if="scope.row['isEdit'] && (scope.row['dataType'] == 'varchar' || scope.row['dataType'] == 'decimal' || scope.row['dataType'] == 'char')"
1674 v-model.trim="scope.row['fieldLength']" placeholder="必填" 1745 v-model.trim="scope.row['fieldLength']" placeholder="必填"
1675 @input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" /> 1746 @input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" />
1676 <span v-else>{{ scope.row["fieldLength"] == null ? '--' : scope.row["fieldLength"] }}</span> 1747 <span v-else>{{ scope.row["fieldLength"] == null ? '--' : scope.row["fieldLength"] }}</span>
...@@ -1678,7 +1749,7 @@ const tableSelectFields = computed(() => { ...@@ -1678,7 +1749,7 @@ const tableSelectFields = computed(() => {
1678 </el-table-column> 1749 </el-table-column>
1679 <el-table-column prop="fieldPrecision" label="精度" width="115px" align="left" show-overflow-tooltip> 1750 <el-table-column prop="fieldPrecision" label="精度" width="115px" align="left" show-overflow-tooltip>
1680 <template #default="scope"> 1751 <template #default="scope">
1681 <el-input v-if="scope.row['isEdit'] && !isOpenStandard && scope.row['dataType'] == 'decimal'" 1752 <el-input v-if="scope.row['isEdit'] && scope.row['dataType'] == 'decimal'"
1682 v-model.trim="scope.row['fieldPrecision']" placeholder="必填" 1753 v-model.trim="scope.row['fieldPrecision']" placeholder="必填"
1683 @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" /> 1754 @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
1684 <span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span> 1755 <span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span>
...@@ -1734,11 +1805,43 @@ const tableSelectFields = computed(() => { ...@@ -1734,11 +1805,43 @@ const tableSelectFields = computed(() => {
1734 <span v-else>{{ scope.row["notNull"] || '--' }}</span> 1805 <span v-else>{{ scope.row["notNull"] || '--' }}</span>
1735 </template> 1806 </template>
1736 </el-table-column> 1807 </el-table-column>
1737 <el-table-column prop="defaultValue" label="默认值" width="205px" align="left" show-overflow-tooltip> 1808 <!-- 分类 -->
1809 <el-table-column prop="classifyDetailGuid" label="分类" width="120px" align="center" show-overflow-tooltip>
1738 <template #default="scope"> 1810 <template #default="scope">
1739 <tableDefaultValue :scope="scope" :dbType="dbType"></tableDefaultValue> 1811 <!-- 如果当前行是编辑状态,显示 tree-select -->
1812 <div v-if="scope.row.isEdit">
1813 <el-tree-select v-if="scope.row['isEdit']" v-model="scope.row['classifyDetailGuid']" placeholder="请选择"
1814 :data="treeSelectOptions" :props="treeSelectProps" clearable filterable
1815 @change="(value) => handleClassifyChange(scope.row, value)">
1816 </el-tree-select>
1817 </div>
1818 <!-- 显示treeSelectOptions classifyDetailGuid所在itemclassifyName-->
1819 <div v-else>{{ scope.row.classifyName || '--' }}</div>
1820 </template>
1821 </el-table-column>
1822
1823 <!-- 分级 -->
1824 <el-table-column prop="gradeDetailGuid" label="分级" width="120" align="center" show-overflow-tooltip>
1825 <template #default="scope">
1826 <div v-if="scope.row.isEdit">
1827 <el-select v-if="scope.row['isEdit']" v-model="scope.row['gradeDetailGuid']" placeholder="请选择分级"
1828 clearable filterable :props="gradeSelectProps" @change="handleGradeChange(scope.row)">
1829 <el-option v-for="(item, index) in scope.row.gradeOptions || []" :key="index" :label="item.name"
1830 :value="item.guid"></el-option>
1831 </el-select>
1832 </div>
1833 <div v-else>
1834 {{ scope.row.gradeDetailName || '--' }}
1835 </div>
1740 </template> 1836 </template>
1741 </el-table-column> 1837 </el-table-column>
1838
1839
1840 <!-- <el-table-column prop="defaultValue" label="默认值" width="205px" align="left" show-overflow-tooltip>
1841 <template #default="scope">
1842 <tableDefaultValue :scope="scope" :dbType="dbType"></tableDefaultValue>
1843 </template>
1844 </el-table-column> -->
1742 <el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip> 1845 <el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip>
1743 <template #default="scope"> 1846 <template #default="scope">
1744 <span class="text_btn" v-if="!scope.row['isEdit']" @click="handleFieldClickEdit(scope)" 1847 <span class="text_btn" v-if="!scope.row['isEdit']" @click="handleFieldClickEdit(scope)"
......
...@@ -87,8 +87,8 @@ const tabsInfo = ref({ ...@@ -87,8 +87,8 @@ const tabsInfo = ref({
87 activeName: 'gradeStandard', 87 activeName: 'gradeStandard',
88 tabs: [ 88 tabs: [
89 // { label: '分类分级模板', name: 'classTemplate' }, 89 // { label: '分类分级模板', name: 'classTemplate' },
90 { label: '分级标准', name: 'gradeStandard' }, 90 { label: '分级规则', name: 'gradeStandard' },
91 { label: '分类标准', name: 'classStandard' }, 91 { label: '分类规则', name: 'classStandard' },
92 ] 92 ]
93 }); 93 });
94 94
...@@ -106,7 +106,7 @@ const classSearchItemList = ref([ ...@@ -106,7 +106,7 @@ const classSearchItemList = ref([
106 field: 'classStandardName', 106 field: 'classStandardName',
107 default: '', 107 default: '',
108 maxlength: 50, 108 maxlength: 50,
109 placeholder: '分类标准名称', 109 placeholder: '分类名称',
110 clearable: true, 110 clearable: true,
111 visible: true 111 visible: true
112 } 112 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!