Merge branch 'dev_20241202_xukangle' into develop
Showing
12 changed files
with
378 additions
and
212 deletions
| ... | @@ -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" | ... | ... |
| ... | @@ -503,9 +503,14 @@ export const tagType = (row, type) => { | ... | @@ -503,9 +503,14 @@ export const tagType = (row, type) => { |
| 503 | case "R": | 503 | case "R": |
| 504 | state = 'danger' | 504 | state = 'danger' |
| 505 | break; | 505 | break; |
| 506 | case 0: | ||
| 507 | state = 'info'; | ||
| 508 | break; | ||
| 506 | case 1: | 509 | case 1: |
| 510 | state = 'success'; | ||
| 511 | break; | ||
| 507 | case 2: | 512 | case 2: |
| 508 | state = 'info'; | 513 | state = 'warning'; |
| 509 | break; | 514 | break; |
| 510 | case 3: | 515 | case 3: |
| 511 | state = 'warning' | 516 | 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> | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| ... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment