fix : 修改分类分级和标签管理问题
Showing
9 changed files
with
313 additions
and
176 deletions
| ... | @@ -603,7 +603,7 @@ export const getDictionary = (params) => request({ | ... | @@ -603,7 +603,7 @@ export const getDictionary = (params) => request({ |
| 603 | * @path /biz-rule-config/save | 603 | * @path /biz-rule-config/save |
| 604 | */ | 604 | */ |
| 605 | export const saveBizRuleConfig = (data) => request({ | 605 | export const saveBizRuleConfig = (data) => request({ |
| 606 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/save`, | 606 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/save-or-update`, |
| 607 | method: 'post', | 607 | method: 'post', |
| 608 | data | 608 | data |
| 609 | }) | 609 | }) | ... | ... |
| ... | @@ -99,8 +99,9 @@ onMounted(() => { | ... | @@ -99,8 +99,9 @@ onMounted(() => { |
| 99 | <el-form-item v-if="item.visible ?? true" :key="'item_' + index" | 99 | <el-form-item v-if="item.visible ?? true" :key="'item_' + index" |
| 100 | :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field"> | 100 | :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field"> |
| 101 | <template v-if="item.type == 'select'"> | 101 | <template v-if="item.type == 'select'"> |
| 102 | <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]" | 102 | <el-select collapse-tags collapse-tags-tooltip :class="{ 'is-multiple': item.multiple }" |
| 103 | :placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable" | 103 | v-model="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable" |
| 104 | :filterable="item.filterable" :multiple="item.multiple" :max-collapse-tags="3" | ||
| 104 | :disabled="item.disabled ?? false" @change="(val) => selectChange(val, item)"> | 105 | :disabled="item.disabled ?? false" @change="(val) => selectChange(val, item)"> |
| 105 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" | 106 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" |
| 106 | :value="item.props?.value ? opt[item.props.value] : opt.value" /> | 107 | :value="item.props?.value ? opt[item.props.value] : opt.value" /> | ... | ... |
| ... | @@ -82,7 +82,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -82,7 +82,7 @@ const routes: RouteRecordRaw[] = [ |
| 82 | name: 'templateConfig', | 82 | name: 'templateConfig', |
| 83 | component: () => import('@/views/data_inventory/templateConfig.vue'), | 83 | component: () => import('@/views/data_inventory/templateConfig.vue'), |
| 84 | meta: { | 84 | meta: { |
| 85 | title: '分类分级标准', | 85 | title: '分类分级规则', |
| 86 | breadcrumb: false, | 86 | breadcrumb: false, |
| 87 | cache: true | 87 | cache: true |
| 88 | }, | 88 | }, | ... | ... |
| ... | @@ -42,7 +42,7 @@ const classStandardFormItems = ref([{ | ... | @@ -42,7 +42,7 @@ const classStandardFormItems = ref([{ |
| 42 | // clearable: true, | 42 | // clearable: true, |
| 43 | // disabled: false, | 43 | // disabled: false, |
| 44 | // visible: true, | 44 | // visible: true, |
| 45 | label: '分级标准', | 45 | label: '分级名称', |
| 46 | type: 'select', | 46 | type: 'select', |
| 47 | placeholder: '请选择', | 47 | placeholder: '请选择', |
| 48 | field: 'gradeStandard', | 48 | field: 'gradeStandard', |
| ... | @@ -83,7 +83,7 @@ const tableInfo = ref({ | ... | @@ -83,7 +83,7 @@ const tableInfo = ref({ |
| 83 | multiple: false, | 83 | multiple: false, |
| 84 | fields: [ | 84 | fields: [ |
| 85 | { label: "序号", type: "index", width: 56, align: "center" }, | 85 | { label: "序号", type: "index", width: 56, align: "center" }, |
| 86 | { label: "分类", field: "classifyName", width: 160, type: 'expand' }, | 86 | { label: "规则名称", field: "classifyName", width: 160, type: 'expand' }, |
| 87 | { | 87 | { |
| 88 | label: "层级", field: "level", width: 120, getName: (scope) => { | 88 | label: "层级", field: "level", width: 120, getName: (scope) => { |
| 89 | let level = scope.row.level; | 89 | let level = scope.row.level; |
| ... | @@ -121,7 +121,7 @@ const tableInfo = ref({ | ... | @@ -121,7 +121,7 @@ const tableInfo = ref({ |
| 121 | selectParentEdit(scope.row.guid); | 121 | selectParentEdit(scope.row.guid); |
| 122 | currTableInfo.value = scope.row; | 122 | currTableInfo.value = scope.row; |
| 123 | drawerInfo.value.visible = true; | 123 | drawerInfo.value.visible = true; |
| 124 | drawerInfo.value.header.title = '编辑分类'; | 124 | drawerInfo.value.header.title = '编辑规则'; |
| 125 | classEditFormItems.value.forEach(item => { | 125 | classEditFormItems.value.forEach(item => { |
| 126 | item.default = scope.row[item.field] | 126 | item.default = scope.row[item.field] |
| 127 | }) | 127 | }) |
| ... | @@ -210,7 +210,7 @@ const classEditFormItems = ref([{ | ... | @@ -210,7 +210,7 @@ const classEditFormItems = ref([{ |
| 210 | }, { | 210 | }, { |
| 211 | label: '定义说明', | 211 | label: '定义说明', |
| 212 | type: 'textarea', | 212 | type: 'textarea', |
| 213 | placeholder: '请输入', | 213 | placeholder: '分类规则的描述说明', |
| 214 | field: 'description', | 214 | field: 'description', |
| 215 | default: '', | 215 | default: '', |
| 216 | clearable: true, | 216 | clearable: true, |
| ... | @@ -305,7 +305,7 @@ const drawerInfo = ref({ | ... | @@ -305,7 +305,7 @@ const drawerInfo = ref({ |
| 305 | direction: 'rtl', | 305 | direction: 'rtl', |
| 306 | size: 600, | 306 | size: 600, |
| 307 | header: { | 307 | header: { |
| 308 | title: '添加分类', | 308 | title: '添加规则', |
| 309 | }, | 309 | }, |
| 310 | type: '', | 310 | type: '', |
| 311 | container: { | 311 | container: { |
| ... | @@ -324,7 +324,7 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -324,7 +324,7 @@ const drawerBtnClick = async (btn, info) => { |
| 324 | if (btn.value == 'cancel') { | 324 | if (btn.value == 'cancel') { |
| 325 | drawerInfo.value.visible = false; | 325 | drawerInfo.value.visible = false; |
| 326 | } else { | 326 | } else { |
| 327 | if (drawerInfo.value.header.title == '添加分类') { | 327 | if (drawerInfo.value.header.title == '添加规则') { |
| 328 | drawerInfo.value.footer.btns.map((item: any) => (item.disabled = true)); | 328 | drawerInfo.value.footer.btns.map((item: any) => (item.disabled = true)); |
| 329 | const params = { | 329 | const params = { |
| 330 | ...info, | 330 | ...info, |
| ... | @@ -332,7 +332,7 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -332,7 +332,7 @@ const drawerBtnClick = async (btn, info) => { |
| 332 | } | 332 | } |
| 333 | const res: any = await saveClassify(params); | 333 | const res: any = await saveClassify(params); |
| 334 | if (res.code == proxy.$passCode) { | 334 | if (res.code == proxy.$passCode) { |
| 335 | proxy.$ElMessage.success('添加成功!'); | 335 | proxy.$ElMessage.success('添加规则成功!'); |
| 336 | drawerInfo.value.visible = false; | 336 | drawerInfo.value.visible = false; |
| 337 | getTreeListData(); | 337 | getTreeListData(); |
| 338 | drawerInfo.value.footer.btns.map((item: any) => delete item.disabled); | 338 | drawerInfo.value.footer.btns.map((item: any) => delete item.disabled); |
| ... | @@ -351,7 +351,7 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -351,7 +351,7 @@ const drawerBtnClick = async (btn, info) => { |
| 351 | } | 351 | } |
| 352 | const res: any = await updateClassify(params); | 352 | const res: any = await updateClassify(params); |
| 353 | if (res.code == proxy.$passCode) { | 353 | if (res.code == proxy.$passCode) { |
| 354 | proxy.$ElMessage.success('修改成功!'); | 354 | proxy.$ElMessage.success('编辑规则成功!'); |
| 355 | drawerInfo.value.visible = false; | 355 | drawerInfo.value.visible = false; |
| 356 | drawerInfo.value.footer.btns.map((item: any) => delete item.disabled); | 356 | drawerInfo.value.footer.btns.map((item: any) => delete item.disabled); |
| 357 | getTreeListData(); | 357 | getTreeListData(); |
| ... | @@ -462,7 +462,7 @@ const newCreateClass = () => { | ... | @@ -462,7 +462,7 @@ const newCreateClass = () => { |
| 462 | 462 | ||
| 463 | drawerInfo.value.visible = true; | 463 | drawerInfo.value.visible = true; |
| 464 | classEditFormItems.value[2].options = treeListData.value; | 464 | classEditFormItems.value[2].options = treeListData.value; |
| 465 | drawerInfo.value.header.title = '添加分类'; | 465 | drawerInfo.value.header.title = '添加规则'; |
| 466 | classEditFormItems.value.forEach(item => { | 466 | classEditFormItems.value.forEach(item => { |
| 467 | if (item.field == 'status') { | 467 | if (item.field == 'status') { |
| 468 | item.default = 'Y'; | 468 | item.default = 'Y'; |
| ... | @@ -481,7 +481,7 @@ const saveUpdate = async () => { | ... | @@ -481,7 +481,7 @@ const saveUpdate = async () => { |
| 481 | return; | 481 | return; |
| 482 | } | 482 | } |
| 483 | if (!formRef.value.formInline.gradeStandard) { | 483 | if (!formRef.value.formInline.gradeStandard) { |
| 484 | proxy.$ElMessage.error('分级标准不能为空'); | 484 | proxy.$ElMessage.error('分级名称不能为空'); |
| 485 | return; | 485 | return; |
| 486 | } | 486 | } |
| 487 | saveLoading.value = true; | 487 | saveLoading.value = true; |
| ... | @@ -495,7 +495,7 @@ const saveUpdate = async () => { | ... | @@ -495,7 +495,7 @@ const saveUpdate = async () => { |
| 495 | console.log(params); | 495 | console.log(params); |
| 496 | const res: any = await updateClassifyGrad(params); | 496 | const res: any = await updateClassifyGrad(params); |
| 497 | if (res.code == proxy.$passCode) { | 497 | if (res.code == proxy.$passCode) { |
| 498 | proxy.$ElMessage.success('修改成功'); | 498 | proxy.$ElMessage.success('修改分类成功'); |
| 499 | router.push({ | 499 | router.push({ |
| 500 | name: 'templateConfig' | 500 | name: 'templateConfig' |
| 501 | }); | 501 | }); |
| ... | @@ -512,9 +512,21 @@ const importClass = () => { | ... | @@ -512,9 +512,21 @@ const importClass = () => { |
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | const dataShowMethod = ref('table'); | 514 | const dataShowMethod = ref('table'); |
| 515 | // 创建聚合数据 | ||
| 516 | const updatedTreeData = ref<any>(); | ||
| 515 | /** 切换是图形展示,还是表格展示。 */ | 517 | /** 切换是图形展示,还是表格展示。 */ |
| 516 | const changeShowMethod = () => { | 518 | const changeShowMethod = () => { |
| 517 | dataShowMethod.value = dataShowMethod.value == 'table' ? 'shape' : 'table'; | 519 | dataShowMethod.value = dataShowMethod.value == 'table' ? 'shape' : 'table'; |
| 520 | console.log(shapeTreeListData.value); | ||
| 521 | if (dataShowMethod.value == 'shape') { | ||
| 522 | const tempArr = { | ||
| 523 | classifyName: router.currentRoute.value.query.classStandardName, | ||
| 524 | guid: "1", | ||
| 525 | children: shapeTreeListData.value | ||
| 526 | } | ||
| 527 | updatedTreeData.value = [tempArr]; | ||
| 528 | console.log('updatedTreeData', [tempArr]); | ||
| 529 | } | ||
| 518 | } | 530 | } |
| 519 | 531 | ||
| 520 | const cancel = () => { | 532 | const cancel = () => { |
| ... | @@ -679,10 +691,11 @@ const initGraph = () => { | ... | @@ -679,10 +691,11 @@ const initGraph = () => { |
| 679 | }, | 691 | }, |
| 680 | } | 692 | } |
| 681 | }); | 693 | }); |
| 682 | graph.data(shapeTreeListData.value[0]); | 694 | graph.data(updatedTreeData.value[0]); |
| 683 | graph.on('node:mouseenter', (e) => { | 695 | graph.on('node:mouseenter', (e) => { |
| 684 | const nodeItem = e.item; // 获取鼠标进入的节点元素对象 | 696 | const nodeItem = e.item; // 获取鼠标进入的节点元素对象 |
| 685 | const nodeModel = nodeItem.getModel(); | 697 | const nodeModel = nodeItem.getModel(); |
| 698 | if (nodeModel.guid == '1') return; // 根节点不显示 | ||
| 686 | // 更新弹窗位置和显示节点详情 | 699 | // 更新弹窗位置和显示节点详情 |
| 687 | nodeDetails.value = nodeModel; | 700 | nodeDetails.value = nodeModel; |
| 688 | showNodeDetails.value = true; | 701 | showNodeDetails.value = true; |
| ... | @@ -804,7 +817,6 @@ onMounted(() => { | ... | @@ -804,7 +817,6 @@ onMounted(() => { |
| 804 | 817 | ||
| 805 | const isExpand = ref<boolean>(router.currentRoute.value.query.isExpand == 'true'); | 818 | const isExpand = ref<boolean>(router.currentRoute.value.query.isExpand == 'true'); |
| 806 | 819 | ||
| 807 | |||
| 808 | </script> | 820 | </script> |
| 809 | 821 | ||
| 810 | <template> | 822 | <template> |
| ... | @@ -814,10 +826,10 @@ const isExpand = ref<boolean>(router.currentRoute.value.query.isExpand == 'true' | ... | @@ -814,10 +826,10 @@ const isExpand = ref<boolean>(router.currentRoute.value.query.isExpand == 'true' |
| 814 | :isExpand="isExpand"> | 826 | :isExpand="isExpand"> |
| 815 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> | 827 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> |
| 816 | </ContentWrap> | 828 | </ContentWrap> |
| 817 | <ContentWrap id="id-classStandard" class="detail-content" title="分类标准" description="" | 829 | <ContentWrap id="id-classStandard" class="detail-content" title="分类规则" description="" |
| 818 | style="margin-top:16px; height: calc(100% - 161px)"> | 830 | style="margin-top:16px; height: calc(100% - 161px)"> |
| 819 | <div class="tools_btns"> | 831 | <div class="tools_btns"> |
| 820 | <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加分类</el-button> | 832 | <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加规则</el-button> |
| 821 | <!-- <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> --> | 833 | <!-- <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> --> |
| 822 | <el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button> | 834 | <el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button> |
| 823 | </div> | 835 | </div> | ... | ... |
| ... | @@ -127,7 +127,7 @@ const tableInfo = ref({ | ... | @@ -127,7 +127,7 @@ const tableInfo = ref({ |
| 127 | return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; | 127 | return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; |
| 128 | } | 128 | } |
| 129 | }, | 129 | }, |
| 130 | { label: "分级描述", field: "gradeDesc", align: "left" }, | 130 | { label: "规则描述", field: "gradeDesc", align: "left" }, |
| 131 | 131 | ||
| 132 | ], | 132 | ], |
| 133 | actionInfo: { | 133 | actionInfo: { |
| ... | @@ -242,10 +242,10 @@ const newCreateGradeFormItems = ref([{ | ... | @@ -242,10 +242,10 @@ const newCreateGradeFormItems = ref([{ |
| 242 | regexp: /\D/g | 242 | regexp: /\D/g |
| 243 | }, | 243 | }, |
| 244 | { | 244 | { |
| 245 | label: '分级描述', | 245 | label: '规则描述', |
| 246 | type: 'textarea', | 246 | type: 'textarea', |
| 247 | maxlength: 500, | 247 | maxlength: 500, |
| 248 | placeholder: '分类分级的描述说明', | 248 | placeholder: '分级规则的描述说明', |
| 249 | field: 'gradeDesc', | 249 | field: 'gradeDesc', |
| 250 | default: '', | 250 | default: '', |
| 251 | clearable: true, | 251 | clearable: true, |
| ... | @@ -326,6 +326,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -326,6 +326,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 326 | 326 | ||
| 327 | const newStandard = () => { | 327 | const newStandard = () => { |
| 328 | filterDataGrade(); | 328 | filterDataGrade(); |
| 329 | newCreateGradeStandardDialogInfo.value.title = '新增标准'; | ||
| 329 | newCreateGradeStandardDialogInfo.value.visible = true; | 330 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 330 | newCreateGradeFormItems.value.forEach(item => item.default = ''); | 331 | newCreateGradeFormItems.value.forEach(item => item.default = ''); |
| 331 | } | 332 | } |
| ... | @@ -362,7 +363,7 @@ const saveUpdate = async () => { | ... | @@ -362,7 +363,7 @@ const saveUpdate = async () => { |
| 362 | console.log(params); | 363 | console.log(params); |
| 363 | const res: any = await updateClassifyGrad(params); | 364 | const res: any = await updateClassifyGrad(params); |
| 364 | if (res.code == proxy.$passCode) { | 365 | if (res.code == proxy.$passCode) { |
| 365 | proxy.$ElMessage.success('修改成功'); | 366 | proxy.$ElMessage.success('修改分级成功'); |
| 366 | router.push({ | 367 | router.push({ |
| 367 | name: 'templateConfig' | 368 | name: 'templateConfig' |
| 368 | }); | 369 | }); |
| ... | @@ -392,7 +393,7 @@ const cancel = () => { | ... | @@ -392,7 +393,7 @@ const cancel = () => { |
| 392 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;"> | 393 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;"> |
| 393 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> | 394 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> |
| 394 | </ContentWrap> | 395 | </ContentWrap> |
| 395 | <ContentWrap id="id-grade-info" title="分级标准" class="detail-content" description="" style="margin-top: 8px;"> | 396 | <ContentWrap id="id-grade-info" title="分级规则" class="detail-content" description="" style="margin-top: 8px;"> |
| 396 | <div class="content" v-loading="fullscreenLoading"> | 397 | <div class="content" v-loading="fullscreenLoading"> |
| 397 | <div class="table-top-btns"> | 398 | <div class="table-top-btns"> |
| 398 | <el-button type="primary" @click="newStandard">新增标准</el-button> | 399 | <el-button type="primary" @click="newStandard">新增标准</el-button> | ... | ... |
| ... | @@ -7,7 +7,9 @@ import { Warning } from "@element-plus/icons-vue"; | ... | @@ -7,7 +7,9 @@ import { Warning } from "@element-plus/icons-vue"; |
| 7 | import TableTools from '@/components/Tools/table_tools.vue'; | 7 | import TableTools from '@/components/Tools/table_tools.vue'; |
| 8 | import { | 8 | 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, | ||
| 12 | getDbFieldList | ||
| 11 | } from '@/api/modules/dataInventory'; | 13 | } from '@/api/modules/dataInventory'; |
| 12 | import { TableColumnWidth } from "@/utils/enum"; | 14 | import { TableColumnWidth } from "@/utils/enum"; |
| 13 | import router from "@/router"; | 15 | import router from "@/router"; |
| ... | @@ -20,15 +22,16 @@ const CgDirTreeList = ref(); | ... | @@ -20,15 +22,16 @@ const CgDirTreeList = ref(); |
| 20 | const getCgDirTreeData = async () => { | 22 | const getCgDirTreeData = async () => { |
| 21 | treeInfo.value.loading = true; | 23 | treeInfo.value.loading = true; |
| 22 | const params = { | 24 | const params = { |
| 23 | classifyName: '', | 25 | execGuid: execGuidInfo.value.execGuid |
| 24 | } | 26 | } |
| 25 | const res: any = await getCgDirTreeList(params); | 27 | const res: any = await getTaskExeTreeList(params); |
| 26 | if (res.code == proxy.$passCode) { | 28 | if (res.code == proxy.$passCode) { |
| 27 | CgDirTreeList.value = res.data; | 29 | CgDirTreeList.value = res.data; |
| 28 | treeInfo.value.data = res.data; | 30 | treeInfo.value.data = res.data; |
| 29 | currentPath.value = [res.data[0].classifyName]; | 31 | currentPath.value = [res.data[0].classifyName]; |
| 30 | treeInfo.value.expandedKey = [res.data[0].guid]; | 32 | treeInfo.value.expandedKey = [res.data[0].guid]; |
| 31 | treeInfo.value.currentNodeKey = res.data[0].guid; | 33 | treeInfo.value.currentNodeKey = res.data[0].guid; |
| 34 | searchItemList.value[1].options = res.data; | ||
| 32 | treeInfo.value.loading = false; | 35 | treeInfo.value.loading = false; |
| 33 | } else { | 36 | } else { |
| 34 | proxy.$ElMessage.error(res.msg); | 37 | proxy.$ElMessage.error(res.msg); |
| ... | @@ -41,18 +44,16 @@ const getCgDirFieldPage = async (params = {}) => { | ... | @@ -41,18 +44,16 @@ const getCgDirFieldPage = async (params = {}) => { |
| 41 | // 在这里你可以根据需要扩展或修改 params | 44 | // 在这里你可以根据需要扩展或修改 params |
| 42 | const defaultParams = { | 45 | const defaultParams = { |
| 43 | pageIndex: 1, | 46 | pageIndex: 1, |
| 44 | pageSize: 10, | 47 | pageSize: 50, |
| 45 | dirGuid: '', | 48 | execGuid: '', |
| 46 | label: '', | 49 | classifyDetail: '', |
| 47 | fieldName: '', | 50 | gradeDetailGuid: '', |
| 48 | classifyName: '', | 51 | databaseGuid: '', |
| 49 | gradeDetailName: '', | 52 | tableGuid: '', |
| 50 | tableName: '', | 53 | fieldGuid: '', |
| 51 | database: '', | ||
| 52 | dirGuids: [], | ||
| 53 | }; | 54 | }; |
| 54 | const finalParams = { ...defaultParams, ...params }; | 55 | const finalParams = { ...defaultParams, ...params }; |
| 55 | const res: any = await getCgDirFieldPageList(finalParams); | 56 | const res: any = await execTaskFieldList(finalParams); |
| 56 | if (res.code == proxy.$passCode) { | 57 | if (res.code == proxy.$passCode) { |
| 57 | CgDirFieldPageList.value = res.data.records; | 58 | CgDirFieldPageList.value = res.data.records; |
| 58 | tableInfo.value.page.rows = res.data.totalRows; | 59 | tableInfo.value.page.rows = res.data.totalRows; |
| ... | @@ -90,15 +91,15 @@ const getExecGuid = async () => { | ... | @@ -90,15 +91,15 @@ const getExecGuid = async () => { |
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | 93 | ||
| 93 | // | 94 | onMounted(async () => { |
| 94 | 95 | await getExecGuid(); | |
| 95 | 96 | await getCgDirTreeData(); | |
| 96 | 97 | await getCgDirFieldPage({ | |
| 97 | onMounted(() => { | 98 | execGuid: execGuidInfo.value.execGuid |
| 98 | getCgDirTreeData(); | 99 | }); |
| 99 | getCgDirFieldPage(); | ||
| 100 | getDictionaryList(); | 100 | getDictionaryList(); |
| 101 | getExecGuid(); | 101 | getSearchTableList(); |
| 102 | |||
| 102 | }) | 103 | }) |
| 103 | 104 | ||
| 104 | // 左侧tree-list | 105 | // 左侧tree-list |
| ... | @@ -108,12 +109,12 @@ const treeInfo = ref({ | ... | @@ -108,12 +109,12 @@ const treeInfo = ref({ |
| 108 | editTreeItem: false, | 109 | editTreeItem: false, |
| 109 | queryValue: "", | 110 | queryValue: "", |
| 110 | className: 'tree-list', | 111 | className: 'tree-list', |
| 111 | queryPlaceholder: "输入标准集名称搜索", | 112 | queryPlaceholder: "输入名称搜索", |
| 112 | props: { | 113 | props: { |
| 113 | label: "classifyName", | 114 | label: "classifyName", |
| 114 | value: "guid", | 115 | value: "classifyDetailGuid", |
| 115 | }, | 116 | }, |
| 116 | nodeKey: 'guid', | 117 | nodeKey: 'classifyDetailGuid', |
| 117 | expandedKey: ['0'], | 118 | expandedKey: ['0'], |
| 118 | currentNodeKey: '', | 119 | currentNodeKey: '', |
| 119 | expandOnNodeClick: false, | 120 | expandOnNodeClick: false, |
| ... | @@ -121,6 +122,7 @@ const treeInfo = ref({ | ... | @@ -121,6 +122,7 @@ const treeInfo = ref({ |
| 121 | loading: false | 122 | loading: false |
| 122 | }); | 123 | }); |
| 123 | 124 | ||
| 125 | |||
| 124 | const addStandardSet = () => { | 126 | const addStandardSet = () => { |
| 125 | console.log('addStandardSet'); | 127 | console.log('addStandardSet'); |
| 126 | } | 128 | } |
| ... | @@ -143,33 +145,24 @@ const searchItemList = ref([ | ... | @@ -143,33 +145,24 @@ const searchItemList = ref([ |
| 143 | }, | 145 | }, |
| 144 | clearable: true, | 146 | clearable: true, |
| 145 | }, | 147 | }, |
| 146 | // { | ||
| 147 | // label: '字段名', | ||
| 148 | // type: 'select', | ||
| 149 | // maxlength: 19, | ||
| 150 | // placeholder: '选择字段名', | ||
| 151 | // field: 'fieldName', | ||
| 152 | // default: '', | ||
| 153 | // options: [], | ||
| 154 | // props: { | ||
| 155 | // label: 'name', | ||
| 156 | // value: 'guid', | ||
| 157 | // }, | ||
| 158 | // clearable: true, | ||
| 159 | // }, | ||
| 160 | { | 148 | { |
| 161 | label: '分类', | 149 | label: "", |
| 162 | type: 'select', | 150 | placeholder: '分类', |
| 163 | maxlength: 19, | ||
| 164 | placeholder: '选择分类', | ||
| 165 | field: 'classifyName', | 151 | field: 'classifyName', |
| 152 | type: 'tree-select', | ||
| 166 | default: '', | 153 | default: '', |
| 167 | options: [], | 154 | options: [], |
| 155 | showAllLevels: false, | ||
| 156 | checkStrictly: true, | ||
| 157 | lazy: false, | ||
| 168 | props: { | 158 | props: { |
| 169 | label: 'name', | 159 | label: "classifyName", |
| 170 | value: 'guid', | 160 | value: "classifyDetailGuid", |
| 171 | }, | 161 | }, |
| 172 | clearable: true, | 162 | block: false, |
| 163 | filterable: false, | ||
| 164 | clearable: false, | ||
| 165 | required: false | ||
| 173 | }, { | 166 | }, { |
| 174 | label: '分级', | 167 | label: '分级', |
| 175 | type: 'select', | 168 | type: 'select', |
| ... | @@ -203,8 +196,14 @@ const toSearch = (val: any, clear: boolean = false) => { | ... | @@ -203,8 +196,14 @@ const toSearch = (val: any, clear: boolean = false) => { |
| 203 | // return getTableData(params); | 196 | // return getTableData(params); |
| 204 | }; | 197 | }; |
| 205 | 198 | ||
| 206 | const nodeClick = (data: any) => { | 199 | const nodeClick = async (data: any) => { |
| 207 | const { guid, classifyName } = data | 200 | console.log('nodeClick', data); |
| 201 | const { guid, classifyDetailGuid } = data | ||
| 202 | searchItemList.value[1].default = data.classifyName; | ||
| 203 | await getCgDirFieldPage({ | ||
| 204 | execGuid: execGuidInfo.value.execGuid, | ||
| 205 | classifyDetail: classifyDetailGuid, | ||
| 206 | }); | ||
| 208 | // 递归tempData找到所有祖先元素的standardName,存入currentPath中 | 207 | // 递归tempData找到所有祖先元素的standardName,存入currentPath中 |
| 209 | const path = findPath(CgDirTreeList.value, guid); | 208 | const path = findPath(CgDirTreeList.value, guid); |
| 210 | if (path) { | 209 | if (path) { |
| ... | @@ -214,6 +213,7 @@ const nodeClick = (data: any) => { | ... | @@ -214,6 +213,7 @@ const nodeClick = (data: any) => { |
| 214 | console.error('未找到路径'); | 213 | console.error('未找到路径'); |
| 215 | } | 214 | } |
| 216 | } | 215 | } |
| 216 | |||
| 217 | const findPath = (data: any[], targetGuid: string, path: string[] = []) => { | 217 | const findPath = (data: any[], targetGuid: string, path: string[] = []) => { |
| 218 | for (const item of data) { | 218 | for (const item of data) { |
| 219 | path.push(item.classifyName); // 添加当前节点名称 | 219 | path.push(item.classifyName); // 添加当前节点名称 |
| ... | @@ -296,7 +296,7 @@ const tableCheckboxSelectChange = (select, row) => { | ... | @@ -296,7 +296,7 @@ const tableCheckboxSelectChange = (select, row) => { |
| 296 | let rulesName: any = []; | 296 | let rulesName: any = []; |
| 297 | let rulesGuid: any = []; | 297 | let rulesGuid: any = []; |
| 298 | select.forEach((item: any) => { | 298 | select.forEach((item: any) => { |
| 299 | rulesName.push(item.classifyName); | 299 | rulesName.push(item.fieldName); |
| 300 | rulesGuid.push(item.guid); | 300 | rulesGuid.push(item.guid); |
| 301 | }); | 301 | }); |
| 302 | selectedRulesData.value = { | 302 | selectedRulesData.value = { |
| ... | @@ -309,7 +309,7 @@ const tableCheckboxAllSelectChange = (select) => { | ... | @@ -309,7 +309,7 @@ const tableCheckboxAllSelectChange = (select) => { |
| 309 | let rulesName: any = []; | 309 | let rulesName: any = []; |
| 310 | let rulesGuid: any = []; | 310 | let rulesGuid: any = []; |
| 311 | select.forEach((item: any) => { | 311 | select.forEach((item: any) => { |
| 312 | rulesName.push(item.classifyName); | 312 | rulesName.push(item.fieldName); |
| 313 | rulesGuid.push(item.guid); | 313 | rulesGuid.push(item.guid); |
| 314 | }); | 314 | }); |
| 315 | selectedRulesData.value = { | 315 | selectedRulesData.value = { |
| ... | @@ -603,17 +603,31 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -603,17 +603,31 @@ const drawerBtnClick = async (btn, info) => { |
| 603 | proxy.$ElMessage.error('字段取值范围结束值不能小于开始值'); | 603 | proxy.$ElMessage.error('字段取值范围结束值不能小于开始值'); |
| 604 | return; | 604 | return; |
| 605 | } | 605 | } |
| 606 | fieldValueRange = [numberStart, numberEnd]; | 606 | fieldValueRange = numberStart + '#' + numberEnd; |
| 607 | } | 607 | } |
| 608 | const params = { | 608 | const params: any = []; |
| 609 | selectedRulesData.value.guids.forEach((item: any) => { | ||
| 610 | params.push({ | ||
| 609 | fieldPrecision, | 611 | fieldPrecision, |
| 610 | dictionaryGuid, | 612 | dictionaryGuid, |
| 611 | isUnique, | 613 | isUnique, |
| 612 | isNotNull, | 614 | isNotNull, |
| 613 | fieldLengthCondition, | 615 | fieldLengthCondition, |
| 614 | fieldValueRange, | 616 | fieldValueRange, |
| 615 | fieldGuid: selectedRulesData.value.guids | 617 | fieldGuid: item, |
| 616 | } | 618 | execGuid: execGuidInfo.value.execGuid |
| 619 | }) | ||
| 620 | }); | ||
| 621 | // const params = { | ||
| 622 | // fieldPrecision, | ||
| 623 | // dictionaryGuid, | ||
| 624 | // isUnique, | ||
| 625 | // isNotNull, | ||
| 626 | // fieldLengthCondition, | ||
| 627 | // fieldValueRange, | ||
| 628 | // fieldGuid: selectedRulesData.value.guids, | ||
| 629 | // execGuid: execGuidInfo.value.execGuid | ||
| 630 | // } | ||
| 617 | const res: any = await saveBizRuleConfig(params); | 631 | const res: any = await saveBizRuleConfig(params); |
| 618 | if (res.code == proxy.$passCode) { | 632 | if (res.code == proxy.$passCode) { |
| 619 | btn.loading = false; | 633 | btn.loading = false; |
| ... | @@ -621,6 +635,7 @@ const drawerBtnClick = async (btn, info) => { | ... | @@ -621,6 +635,7 @@ const drawerBtnClick = async (btn, info) => { |
| 621 | drawerInfo.value.visible = false; | 635 | drawerInfo.value.visible = false; |
| 622 | getCgDirFieldPage(); | 636 | getCgDirFieldPage(); |
| 623 | } else { | 637 | } else { |
| 638 | btn.loading = false; | ||
| 624 | proxy.$ElMessage.error(res.msg); | 639 | proxy.$ElMessage.error(res.msg); |
| 625 | } | 640 | } |
| 626 | 641 | ||
| ... | @@ -880,53 +895,27 @@ const setActiveTab = (tab) => { | ... | @@ -880,53 +895,27 @@ const setActiveTab = (tab) => { |
| 880 | }; | 895 | }; |
| 881 | 896 | ||
| 882 | // 模拟后端接口 | 897 | // 模拟后端接口 |
| 883 | const fetchOptionsA = () => { | 898 | // 获取查询的数据库名 execTaskSheetList |
| 884 | return new Promise((resolve) => { | ||
| 885 | setTimeout(() => { | ||
| 886 | resolve([ | ||
| 887 | { label: "选项 A1", value: "a1" }, | ||
| 888 | { label: "选项 A2", value: "a2" }, | ||
| 889 | ]); | ||
| 890 | }, 500); | ||
| 891 | }); | ||
| 892 | }; | ||
| 893 | 899 | ||
| 894 | const fetchOptionsB = (aValue) => { | 900 | const getSearchTableList = async (type = 1, dbGuid = '') => { |
| 895 | return new Promise((resolve) => { | ||
| 896 | setTimeout(() => { | ||
| 897 | const data = { | ||
| 898 | a1: [ | ||
| 899 | { label: "B1-1", value: "b1" }, | ||
| 900 | { label: "B1-2", value: "b2" }, | ||
| 901 | ], | ||
| 902 | a2: [ | ||
| 903 | { label: "B2-1", value: "b3" }, | ||
| 904 | { label: "B2-2", value: "b4" }, | ||
| 905 | ], | ||
| 906 | }; | ||
| 907 | resolve(data[aValue] || []); | ||
| 908 | }, 500); | ||
| 909 | }); | ||
| 910 | }; | ||
| 911 | 901 | ||
| 912 | const fetchOptionsC = (bValue) => { | 902 | const res: any = await getDbFieldList({ |
| 913 | return new Promise((resolve) => { | 903 | execGuid: execGuidInfo.value.execGuid, |
| 914 | setTimeout(() => { | 904 | dbGuid, |
| 915 | const data = { | 905 | type, |
| 916 | b1: [ | ||
| 917 | { label: "C1-1", value: "c1" }, | ||
| 918 | { label: "C1-2", value: "c2" }, | ||
| 919 | ], | ||
| 920 | b3: [ | ||
| 921 | { label: "C2-1", value: "c3" }, | ||
| 922 | { label: "C2-2", value: "c4" }, | ||
| 923 | ], | ||
| 924 | }; | ||
| 925 | resolve(data[bValue] || []); | ||
| 926 | }, 500); | ||
| 927 | }); | 906 | }); |
| 907 | if (res.code == proxy.$passCode) { | ||
| 908 | if (type == 1) { | ||
| 909 | optionsA.value = res.data; | ||
| 910 | } else if (type == 2) { | ||
| 911 | optionsB.value = res.data; | ||
| 912 | } else { | ||
| 913 | optionsC.value = res.data; | ||
| 914 | } | ||
| 915 | } else { | ||
| 916 | proxy.$ElMessage.error(res.msg); | ||
| 917 | } | ||
| 928 | }; | 918 | }; |
| 929 | |||
| 930 | const selectedA = ref<any>(null); | 919 | const selectedA = ref<any>(null); |
| 931 | const selectedB = ref<any>(null); | 920 | const selectedB = ref<any>(null); |
| 932 | const selectedC = ref<any>(null); | 921 | const selectedC = ref<any>(null); |
| ... | @@ -935,29 +924,33 @@ const optionsA = ref<any>([]); | ... | @@ -935,29 +924,33 @@ const optionsA = ref<any>([]); |
| 935 | const optionsB = ref<any>([]); | 924 | const optionsB = ref<any>([]); |
| 936 | const optionsC = ref<any>([]); | 925 | const optionsC = ref<any>([]); |
| 937 | 926 | ||
| 938 | // 初始化加载第一个下拉框的选项 | ||
| 939 | const loadOptionsA = async () => { | ||
| 940 | optionsA.value = await fetchOptionsA(); | ||
| 941 | }; | ||
| 942 | |||
| 943 | // 第一个下拉框值改变时 | 927 | // 第一个下拉框值改变时 |
| 944 | const onAChange = async () => { | 928 | const onAChange = async () => { |
| 945 | selectedB.value = null; | 929 | selectedB.value = null; |
| 946 | selectedC.value = null; | 930 | selectedC.value = null; |
| 947 | optionsB.value = []; | 931 | optionsB.value = []; |
| 948 | optionsC.value = []; | 932 | optionsC.value = []; |
| 949 | optionsB.value = await fetchOptionsB(selectedA.value); // 根据 A 动态加载 B 的选项 | 933 | await getSearchTableList(2, selectedA.value); // 根据 A 动态加载 B 的选项 |
| 950 | }; | 934 | }; |
| 951 | 935 | ||
| 952 | // 第二个下拉框值改变时 | 936 | // 第二个下拉框值改变时 |
| 953 | const onBChange = async () => { | 937 | const onBChange = async () => { |
| 938 | console.log('onBChange', selectedB.value); | ||
| 954 | selectedC.value = null; | 939 | selectedC.value = null; |
| 955 | optionsC.value = []; | 940 | optionsC.value = []; |
| 956 | optionsC.value = await fetchOptionsC(selectedB.value); // 根据 B 动态加载 C 的选项 | 941 | await getSearchTableList(3, selectedB.value); // 根据 B 动态加载 C 的选项 |
| 957 | }; | 942 | }; |
| 958 | 943 | ||
| 959 | // 页面加载时初始化 A 的数据 | 944 | // 导出 |
| 960 | loadOptionsA(); | 945 | const btnClick = async () => { |
| 946 | |||
| 947 | }; | ||
| 948 | |||
| 949 | // 分类选择 | ||
| 950 | const treeSelectNodeChange = (node, item) => { | ||
| 951 | console.log('treeSelectNodeChange', node, item); | ||
| 952 | } | ||
| 953 | |||
| 961 | 954 | ||
| 962 | </script> | 955 | </script> |
| 963 | 956 | ||
| ... | @@ -966,23 +959,25 @@ loadOptionsA(); | ... | @@ -966,23 +959,25 @@ loadOptionsA(); |
| 966 | <div class="v-table-tools"> | 959 | <div class="v-table-tools"> |
| 967 | <el-select v-model="selectedA" placeholder="选择数据库名" @change="onAChange" style="width: 140px; margin-right: 8px" | 960 | <el-select v-model="selectedA" placeholder="选择数据库名" @change="onAChange" style="width: 140px; margin-right: 8px" |
| 968 | clearable> | 961 | clearable> |
| 969 | <el-option v-for="item in optionsA" :key="item.value" :label="item.label" :value="item.value" /> | 962 | <el-option v-for="item in optionsA" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> |
| 970 | </el-select> | 963 | </el-select> |
| 971 | <el-select v-model="selectedB" placeholder="选择表名" :disabled="!selectedA" @change="onBChange" | 964 | <el-select v-model="selectedB" placeholder="选择表名" :disabled="!selectedA" @change="onBChange" |
| 972 | style="width: 140px; margin-right: 8px" clearable> | 965 | style="width: 140px; margin-right: 8px" clearable> |
| 973 | <el-option v-for="item in optionsB" :key="item.value" :label="item.label" :value="item.value" /> | 966 | <el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> |
| 974 | </el-select> | 967 | </el-select> |
| 975 | <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px" | 968 | <el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px" |
| 976 | clearable> | 969 | clearable> |
| 977 | <el-option v-for="item in optionsC" :key="item.value" :label="item.label" :value="item.value" /> | 970 | <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> |
| 978 | </el-select> | 971 | </el-select> |
| 979 | <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" /> | 972 | <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" |
| 973 | @treeSelectNodeChange="treeSelectNodeChange" /> | ||
| 980 | </div> | 974 | </div> |
| 981 | <div class="container_wrap full flex"> | 975 | <div class="container_wrap full flex"> |
| 982 | <div class="aside_wrap"> | 976 | <div class="aside_wrap"> |
| 983 | <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick"> | 977 | <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick"> |
| 984 | <el-tab-pane label="分类分级目录" name="first"> | 978 | <el-tab-pane label="分类分级目录" name="first"> |
| 985 | <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" /> | 979 | <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" /> |
| 980 | <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> --> | ||
| 986 | </el-tab-pane> | 981 | </el-tab-pane> |
| 987 | <el-tab-pane label="数据库目录" name="second"> | 982 | <el-tab-pane label="数据库目录" name="second"> |
| 988 | <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange' /> | 983 | <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange' /> |
| ... | @@ -1012,7 +1007,7 @@ loadOptionsA(); | ... | @@ -1012,7 +1007,7 @@ loadOptionsA(); |
| 1012 | <div class="btns-area"> | 1007 | <div class="btns-area"> |
| 1013 | <div class="left-btns"> | 1008 | <div class="left-btns"> |
| 1014 | <el-button type="primary" @click="addStandardSet">查看已生产报告</el-button> | 1009 | <el-button type="primary" @click="addStandardSet">查看已生产报告</el-button> |
| 1015 | <el-button>导出</el-button> | 1010 | <el-button @click="btnClick()">导出</el-button> |
| 1016 | <el-button @click="batchControlRules">批量配置业务规则</el-button> | 1011 | <el-button @click="batchControlRules">批量配置业务规则</el-button> |
| 1017 | </div> | 1012 | </div> |
| 1018 | </div> | 1013 | </div> | ... | ... |
| ... | @@ -9,6 +9,7 @@ import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, de | ... | @@ -9,6 +9,7 @@ import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, de |
| 9 | import { CirclePlus, Delete } from "@element-plus/icons-vue"; | 9 | import { CirclePlus, Delete } from "@element-plus/icons-vue"; |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | |||
| 12 | const { proxy } = getCurrentInstance() as any; | 13 | const { proxy } = getCurrentInstance() as any; |
| 13 | const dialogLabelFormRef = ref(); | 14 | const dialogLabelFormRef = ref(); |
| 14 | 15 | ||
| ... | @@ -74,6 +75,7 @@ const transformDataForTree = (data: any[]) => { | ... | @@ -74,6 +75,7 @@ const transformDataForTree = (data: any[]) => { |
| 74 | const labelPageList = ref<any>() | 75 | const labelPageList = ref<any>() |
| 75 | 76 | ||
| 76 | const getLabelPageData = async () => { | 77 | const getLabelPageData = async () => { |
| 78 | refCount.value++; | ||
| 77 | tableInfo.value.loading = true; | 79 | tableInfo.value.loading = true; |
| 78 | const params = { | 80 | const params = { |
| 79 | pageIndex: page.value.curr, | 81 | pageIndex: page.value.curr, |
| ... | @@ -111,7 +113,7 @@ const getLabelListData = async () => { | ... | @@ -111,7 +113,7 @@ const getLabelListData = async () => { |
| 111 | } | 113 | } |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | onMounted(async () => { | 116 | onBeforeMount(async () => { |
| 115 | await getClassifyGradeTree(); | 117 | await getClassifyGradeTree(); |
| 116 | await getLabelPageData(); | 118 | await getLabelPageData(); |
| 117 | await getLabelListData(); | 119 | await getLabelListData(); |
| ... | @@ -136,8 +138,45 @@ const treeInfo = ref<any>({ | ... | @@ -136,8 +138,45 @@ const treeInfo = ref<any>({ |
| 136 | loading: false | 138 | loading: false |
| 137 | }); | 139 | }); |
| 138 | // 点击树节点修改分类guid 和 分类明细guid | 140 | // 点击树节点修改分类guid 和 分类明细guid |
| 139 | const nodeClick = (data: any) => { | 141 | // 存储大类的数据。 |
| 140 | console.log('nodeClick', data); | 142 | const findNodeDetails = ref<any>(''); |
| 143 | const isLastLayer = ref<boolean>(false); | ||
| 144 | // 所在层级的info | ||
| 145 | const atGradeinfo = ref<any>(''); | ||
| 146 | |||
| 147 | const findTopParentNode = (node: any) => { | ||
| 148 | if (!node) return; | ||
| 149 | |||
| 150 | // 判断是否为最后一层 | ||
| 151 | if (node.childNodes.length === 0) { | ||
| 152 | isLastLayer.value = true; | ||
| 153 | atGradeinfo.value = node.data; | ||
| 154 | } else { | ||
| 155 | isLastLayer.value = false; | ||
| 156 | } | ||
| 157 | |||
| 158 | // 如果当前节点的父节点符合条件 | ||
| 159 | if (node.parent && node.parent.data.type === 'C') { | ||
| 160 | findNodeDetails.value = node.parent.data; | ||
| 161 | return; // 停止递归 | ||
| 162 | } | ||
| 163 | |||
| 164 | // 如果当前节点的祖父节点符合条件 | ||
| 165 | if (node.parent?.parent && node.parent.parent.data.type === 'C') { | ||
| 166 | findNodeDetails.value = node.parent.parent.data; | ||
| 167 | return; // 停止递归 | ||
| 168 | } | ||
| 169 | |||
| 170 | // 如果未找到,继续递归向上查找 | ||
| 171 | if (node.parent) { | ||
| 172 | findTopParentNode(node.parent); | ||
| 173 | } | ||
| 174 | }; | ||
| 175 | |||
| 176 | const nodeClick = (data, node) => { | ||
| 177 | findTopParentNode(node); | ||
| 178 | newCreateGradeFormItems.value[1].options = transformDataForTree([findNodeDetails.value]) | ||
| 179 | |||
| 141 | // 分类guid | 180 | // 分类guid |
| 142 | if (Object.keys(data).includes("type")) { | 181 | if (Object.keys(data).includes("type")) { |
| 143 | classifyGuid.value = data.guid; | 182 | classifyGuid.value = data.guid; |
| ... | @@ -180,8 +219,13 @@ const tableInfo = ref({ | ... | @@ -180,8 +219,13 @@ const tableInfo = ref({ |
| 180 | fixedSelection: true, | 219 | fixedSelection: true, |
| 181 | fields: [ | 220 | fields: [ |
| 182 | { label: "序号", type: "index", width: 56, align: "center" }, | 221 | { label: "序号", type: "index", width: 56, align: "center" }, |
| 183 | { label: "标签名", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 120, value: 'detail', columClass: 'text_btn' }, | 222 | { label: "标签名", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 160, value: 'detail', columClass: 'text_btn' }, |
| 184 | { label: "分类", field: "classifyDetailName", width: 140 }, | 223 | { |
| 224 | label: "分类", field: "classifyNames", getName: (scope) => { | ||
| 225 | let tempInfo = scope.row.classifyNames; | ||
| 226 | return tempInfo.join('/') | ||
| 227 | }, | ||
| 228 | }, | ||
| 185 | { label: "分级", field: "gradeDetailName", width: 140 }, | 229 | { label: "分级", field: "gradeDetailName", width: 140 }, |
| 186 | { | 230 | { |
| 187 | label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' | 231 | label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' |
| ... | @@ -280,7 +324,6 @@ const batchRemobe = async () => { | ... | @@ -280,7 +324,6 @@ const batchRemobe = async () => { |
| 280 | message: '已取消删除' | 324 | message: '已取消删除' |
| 281 | }); | 325 | }); |
| 282 | }); | 326 | }); |
| 283 | |||
| 284 | }; | 327 | }; |
| 285 | 328 | ||
| 286 | const tableSwitchBeforeChange = (scope, field, callback) => { | 329 | const tableSwitchBeforeChange = (scope, field, callback) => { |
| ... | @@ -410,7 +453,7 @@ const newCreateGradeFormItems = ref<any>([{ | ... | @@ -410,7 +453,7 @@ const newCreateGradeFormItems = ref<any>([{ |
| 410 | { | 453 | { |
| 411 | label: '精确匹配', | 454 | label: '精确匹配', |
| 412 | type: 'textarea', | 455 | type: 'textarea', |
| 413 | maxlength: 500, | 456 | maxlength: 260, |
| 414 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', | 457 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', |
| 415 | field: 'matchChValue', | 458 | field: 'matchChValue', |
| 416 | default: '', | 459 | default: '', |
| ... | @@ -421,7 +464,7 @@ const newCreateGradeFormItems = ref<any>([{ | ... | @@ -421,7 +464,7 @@ const newCreateGradeFormItems = ref<any>([{ |
| 421 | { | 464 | { |
| 422 | label: '', | 465 | label: '', |
| 423 | type: 'textarea', | 466 | type: 'textarea', |
| 424 | maxlength: 500, | 467 | maxlength: 260, |
| 425 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', | 468 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', |
| 426 | field: 'matchEnValue', | 469 | field: 'matchEnValue', |
| 427 | default: '', | 470 | default: '', |
| ... | @@ -459,7 +502,18 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -459,7 +502,18 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 459 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | 502 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| 460 | }, | 503 | }, |
| 461 | submit: async (btn, info) => { | 504 | submit: async (btn, info) => { |
| 462 | console.log(info); | 505 | |
| 506 | for (let i = 0; i < formRows.value.length; i++) { | ||
| 507 | const row = formRows.value[i]; | ||
| 508 | // 如果某一条数据的 matchValue, position, name 都为空,则跳过,不校验 | ||
| 509 | if (!row.matchValue && !row.position && !row.name) { | ||
| 510 | continue; // 如果全为空,跳过这一行的校验 | ||
| 511 | } | ||
| 512 | if (!row.matchValue || !row.position || !row.name) { | ||
| 513 | proxy.$ElMessage.error('请填写完整的模糊匹配规则'); | ||
| 514 | return; | ||
| 515 | } | ||
| 516 | } | ||
| 463 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; | 517 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; |
| 464 | if (newCreateGradeStandardDialogInfo.value.title === "添加标签") { | 518 | if (newCreateGradeStandardDialogInfo.value.title === "添加标签") { |
| 465 | const tempParams = formRows.value.map((item) => ({ | 519 | const tempParams = formRows.value.map((item) => ({ |
| ... | @@ -482,6 +536,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -482,6 +536,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 482 | getLabelPageData(); | 536 | getLabelPageData(); |
| 483 | getLabelListData(); | 537 | getLabelListData(); |
| 484 | } else { | 538 | } else { |
| 539 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 485 | proxy.$ElMessage.error(res.msg); | 540 | proxy.$ElMessage.error(res.msg); |
| 486 | } | 541 | } |
| 487 | } | 542 | } |
| ... | @@ -508,6 +563,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -508,6 +563,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 508 | getLabelPageData(); | 563 | getLabelPageData(); |
| 509 | getLabelListData(); | 564 | getLabelListData(); |
| 510 | } else { | 565 | } else { |
| 566 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 511 | proxy.$ElMessage.error(res.msg); | 567 | proxy.$ElMessage.error(res.msg); |
| 512 | } | 568 | } |
| 513 | } | 569 | } |
| ... | @@ -516,30 +572,63 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -516,30 +572,63 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 516 | }) | 572 | }) |
| 517 | 573 | ||
| 518 | // 新增标签 | 574 | // 新增标签 |
| 519 | const addNewLabel = () => { | 575 | const addNewLabel = async () => { |
| 520 | console.log('addNewLabel'); | 576 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| 521 | newCreateGradeFormItems.value.forEach(item => { | 577 | newCreateGradeFormItems.value.forEach(item => { |
| 522 | item.default = ''; | 578 | item.default = ''; |
| 523 | item.disabled = false; | 579 | item.disabled = false; |
| 524 | }); | 580 | }); |
| 525 | formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; | 581 | formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; |
| 582 | |||
| 583 | // | ||
| 584 | if (isLastLayer.value) { | ||
| 585 | // 选择了最后一级 | ||
| 586 | newCreateGradeFormItems.value[1].default = atGradeinfo.value.guid; | ||
| 587 | treeInfo.value.expandedKey = []; | ||
| 588 | treeInfo.value.currentNodeKey = atGradeinfo.value.guid; | ||
| 589 | treeInfo.value.expandedKey.push(atGradeinfo.value.classifyGradeGuid); | ||
| 590 | if (atGradeinfo.value?.classifyGradeGuid) { | ||
| 591 | classifyGuid.value = atGradeinfo.value.classifyGradeGuid; | ||
| 592 | tempName.value = atGradeinfo.value.name; | ||
| 593 | classifyDetailGuid.value = atGradeinfo.value.guid; | ||
| 594 | } | ||
| 595 | // 遍历classGradeTreeData 找到对应的guid item的refGradeGuid | ||
| 596 | classGradeTreeData.value.forEach((element: any) => { | ||
| 597 | if (element.guid === classifyGuid.value) { | ||
| 598 | tempRefGradeGuid.value = element.refGradeGuid; | ||
| 599 | } | ||
| 600 | }); | ||
| 601 | |||
| 602 | if (tempRefGradeGuid.value) { | ||
| 603 | await getGradeListData(tempRefGradeGuid.value); | ||
| 604 | const matchedGrade = gradeListData.value.find( | ||
| 605 | (element: any) => element.name === tempName.value | ||
| 606 | ); | ||
| 607 | if (matchedGrade) { | ||
| 608 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; | ||
| 609 | } | ||
| 610 | } | ||
| 611 | } | ||
| 612 | |||
| 526 | newCreateGradeStandardDialogInfo.value.title = '添加标签'; | 613 | newCreateGradeStandardDialogInfo.value.title = '添加标签'; |
| 527 | newCreateGradeStandardDialogInfo.value.visible = true; | 614 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 615 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 528 | } | 616 | } |
| 529 | 617 | ||
| 530 | 618 | ||
| 531 | const classSearchItemList = ref<any>([ | 619 | const classSearchItemList = ref<any>([ |
| 532 | { | 620 | { |
| 533 | type: 'select-slots', | 621 | type: 'select', |
| 534 | multiple: true, | 622 | multiple: true, |
| 535 | label: '', | 623 | label: '', |
| 536 | field: 'labelName', | 624 | field: 'labelName', |
| 537 | default: [], | 625 | default: [], |
| 538 | options: [], | 626 | options: [], |
| 539 | placeholder: '请选择标签名称', | 627 | placeholder: '请选择标签名称', |
| 540 | clearable: false, | 628 | clearable: true, |
| 541 | filterable: true, | 629 | filterable: true, |
| 542 | visible: true | 630 | visible: true |
| 631 | |||
| 543 | } | 632 | } |
| 544 | ]); | 633 | ]); |
| 545 | 634 | ||
| ... | @@ -551,6 +640,7 @@ const selectChange = async (val: any, row: any) => { | ... | @@ -551,6 +640,7 @@ const selectChange = async (val: any, row: any) => { |
| 551 | }; | 640 | }; |
| 552 | 641 | ||
| 553 | /** 搜索查询分类标准 */ | 642 | /** 搜索查询分类标准 */ |
| 643 | const refCount = ref(0); | ||
| 554 | const searchClass = async (val: any, clear: boolean = false) => { | 644 | const searchClass = async (val: any, clear: boolean = false) => { |
| 555 | console.log('searchClass', val, clear); | 645 | console.log('searchClass', val, clear); |
| 556 | if (clear) { | 646 | if (clear) { |
| ... | @@ -559,7 +649,7 @@ const searchClass = async (val: any, clear: boolean = false) => { | ... | @@ -559,7 +649,7 @@ const searchClass = async (val: any, clear: boolean = false) => { |
| 559 | getLabelPageData(); | 649 | getLabelPageData(); |
| 560 | return; | 650 | return; |
| 561 | } | 651 | } |
| 562 | if (val?.labelName?.length !== 0) { | 652 | if (val?.labelName?.length !== 0 || refCount.value >= 1) { |
| 563 | tableInfo.value.loading = true; | 653 | tableInfo.value.loading = true; |
| 564 | const params = { | 654 | const params = { |
| 565 | pageIndex: page.value.curr, | 655 | pageIndex: page.value.curr, |
| ... | @@ -579,7 +669,6 @@ const searchClass = async (val: any, clear: boolean = false) => { | ... | @@ -579,7 +669,6 @@ const searchClass = async (val: any, clear: boolean = false) => { |
| 579 | } | 669 | } |
| 580 | } | 670 | } |
| 581 | 671 | ||
| 582 | |||
| 583 | }; | 672 | }; |
| 584 | 673 | ||
| 585 | 674 | ||
| ... | @@ -601,12 +690,13 @@ const handleSelectChange = async (val, row, info) => { | ... | @@ -601,12 +690,13 @@ const handleSelectChange = async (val, row, info) => { |
| 601 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; | 690 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; |
| 602 | newCreateGradeFormItems.value[0].default = tempFormData.value.label; | 691 | newCreateGradeFormItems.value[0].default = tempFormData.value.label; |
| 603 | newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid; | 692 | newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid; |
| 693 | newCreateGradeFormItems.value[3].default = tempFormData.value.matchChValue; | ||
| 694 | newCreateGradeFormItems.value[4].default = tempFormData.value.matchEnValue; | ||
| 604 | } | 695 | } |
| 605 | } | 696 | } |
| 606 | }; | 697 | }; |
| 607 | 698 | ||
| 608 | const handleTreeSelectNodeChange = (node, item, nodeObj) => { | 699 | const handleTreeSelectNodeChange = (node, item, nodeObj) => { |
| 609 | console.log('handleTreeSelectNodeChange', node, item, nodeObj); | ||
| 610 | treeInfo.value.expandedKey = []; | 700 | treeInfo.value.expandedKey = []; |
| 611 | treeInfo.value.currentNodeKey = node.guid; | 701 | treeInfo.value.currentNodeKey = node.guid; |
| 612 | treeInfo.value.expandedKey.push(node.classifyGradeGuid); | 702 | treeInfo.value.expandedKey.push(node.classifyGradeGuid); |
| ... | @@ -702,8 +792,8 @@ const deleteRow = (index: number) => { | ... | @@ -702,8 +792,8 @@ const deleteRow = (index: number) => { |
| 702 | </div> | 792 | </div> |
| 703 | <div> | 793 | <div> |
| 704 | <el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button> | 794 | <el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button> |
| 705 | <el-button class="v-import">导入</el-button> | 795 | <!-- <el-button class="v-import">导入</el-button> |
| 706 | <el-button>导出</el-button> | 796 | <el-button>导出</el-button> --> |
| 707 | </div> | 797 | </div> |
| 708 | <div class="table_panel_wrap"> | 798 | <div class="table_panel_wrap"> |
| 709 | <Table :tableInfo="tableInfo" @tableSwitchBeforeChange="tableSwitchBeforeChange" | 799 | <Table :tableInfo="tableInfo" @tableSwitchBeforeChange="tableSwitchBeforeChange" |
| ... | @@ -868,6 +958,11 @@ const deleteRow = (index: number) => { | ... | @@ -868,6 +958,11 @@ const deleteRow = (index: number) => { |
| 868 | line-height: 24px; | 958 | line-height: 24px; |
| 869 | font-weight: 600; | 959 | font-weight: 600; |
| 870 | } | 960 | } |
| 961 | |||
| 962 | .el-dialog__body { | ||
| 963 | height: 510px; | ||
| 964 | overflow: auto; | ||
| 965 | } | ||
| 871 | } | 966 | } |
| 872 | } | 967 | } |
| 873 | </style> | 968 | </style> | ... | ... |
| ... | @@ -96,7 +96,7 @@ const getFieldTypeData = async () => { | ... | @@ -96,7 +96,7 @@ const getFieldTypeData = async () => { |
| 96 | } | 96 | } |
| 97 | const res: any = await getFieldTypeList(params); | 97 | const res: any = await getFieldTypeList(params); |
| 98 | if (res.code == proxy.$passCode) { | 98 | if (res.code == proxy.$passCode) { |
| 99 | fieldData.value = options; | 99 | fieldData.value = res.data; |
| 100 | } else { | 100 | } else { |
| 101 | proxy.$ElMessage.error(res.msg); | 101 | proxy.$ElMessage.error(res.msg); |
| 102 | } | 102 | } |
| ... | @@ -253,6 +253,8 @@ const editableFields = { | ... | @@ -253,6 +253,8 @@ const editableFields = { |
| 253 | gradeDetailName: true, // 分级可编辑 | 253 | gradeDetailName: true, // 分级可编辑 |
| 254 | sourceFieldName: true, // 源字段英文名可编辑 | 254 | sourceFieldName: true, // 源字段英文名可编辑 |
| 255 | classifyDetailGuid: true, // 分类可编辑 | 255 | classifyDetailGuid: true, // 分类可编辑 |
| 256 | fieldType: true, // 字段类型可编辑 | ||
| 257 | fieldChName: true, // 字段中文名可编辑 | ||
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | const tableFieldsLoading = ref(false) | 260 | const tableFieldsLoading = ref(false) |
| ... | @@ -542,7 +544,6 @@ const saveOrUpdate = async (params: any = {}, type) => { | ... | @@ -542,7 +544,6 @@ const saveOrUpdate = async (params: any = {}, type) => { |
| 542 | database: '', | 544 | database: '', |
| 543 | databaseChName: '', | 545 | databaseChName: '', |
| 544 | foundMode: 0, | 546 | foundMode: 0, |
| 545 | state: 0, | ||
| 546 | isDraft: '', | 547 | isDraft: '', |
| 547 | fieldRQVOList: tableDataDetailInfo.value | 548 | fieldRQVOList: tableDataDetailInfo.value |
| 548 | } | 549 | } |
| ... | @@ -716,16 +717,24 @@ const createNewSql = () => { | ... | @@ -716,16 +717,24 @@ const createNewSql = () => { |
| 716 | <el-table-column type="selection" :width="32" align="center" /> | 717 | <el-table-column type="selection" :width="32" align="center" /> |
| 717 | <!-- 排序列(不可编辑) --> | 718 | <!-- 排序列(不可编辑) --> |
| 718 | <el-table-column type="index" label="排序" width="80" align="center" /> | 719 | <el-table-column type="index" label="排序" width="80" align="center" /> |
| 719 | <!-- 字段中文名(不可编辑)fieldChName --> | 720 | <!-- 字段中文名(可编辑)fieldChName --> |
| 720 | <el-table-column prop="fieldChName" label="目标字段中文名" width="150"> | 721 | <el-table-column prop="fieldChName" label="目标字段中文名" width="150"> |
| 722 | <!-- 可以编辑 --> | ||
| 721 | <template #default="scope"> | 723 | <template #default="scope"> |
| 722 | {{ scope.row.fieldChName ? scope.row.fieldChName : '--' }} | 724 | <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ? |
| 725 | scope.row.fieldChName | ||
| 726 | : '--' }}</span> | ||
| 727 | <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" /> | ||
| 723 | </template> | 728 | </template> |
| 729 | |||
| 724 | </el-table-column> | 730 | </el-table-column> |
| 725 | <!-- 字段英文名(不可编辑) --> | 731 | <!-- 字段英文名(可编辑) --> |
| 726 | <el-table-column prop="fieldName" label="目标字段英文名" width="150"> | 732 | <el-table-column prop="fieldName" label="目标字段英文名" width="150"> |
| 727 | <template #default="scope"> | 733 | <template #default="scope"> |
| 728 | {{ scope.row.fieldName ? scope.row.fieldName : '--' }} | 734 | <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? |
| 735 | scope.row.fieldName | ||
| 736 | : '--' }}</span> | ||
| 737 | <el-input v-else v-model="scope.row.fieldName" placeholder="请输入" /> | ||
| 729 | </template> | 738 | </template> |
| 730 | </el-table-column> | 739 | </el-table-column> |
| 731 | <!-- 源数据库 --> | 740 | <!-- 源数据库 --> |
| ... | @@ -756,10 +765,19 @@ const createNewSql = () => { | ... | @@ -756,10 +765,19 @@ const createNewSql = () => { |
| 756 | <el-input v-else v-model="scope.row.sourceFieldName" placeholder="请输入长度" /> | 765 | <el-input v-else v-model="scope.row.sourceFieldName" placeholder="请输入长度" /> |
| 757 | </template> | 766 | </template> |
| 758 | </el-table-column> | 767 | </el-table-column> |
| 759 | <!-- 源端字段 fieldType--> | 768 | <!-- 源端字段 fieldType fieldTypeProps--> |
| 760 | <el-table-column prop="fieldType" label="源端字段类型" width="150"> | 769 | <el-table-column prop="fieldType" label="源端字段类型" width="150"> |
| 761 | <template #default="scope"> | 770 | <template #default="scope"> |
| 762 | {{ scope.row.fieldType ? scope.row.fieldType : '--' }} | 771 | <div v-if="scope.row.isEdit"> |
| 772 | <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable | ||
| 773 | :props="fieldTypeProps"> | ||
| 774 | <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label" | ||
| 775 | :value="item.value"></el-option> | ||
| 776 | </el-select> | ||
| 777 | </div> | ||
| 778 | <div v-else> | ||
| 779 | {{ fieldData.find(item => item.value === scope.row.fieldType)?.label || '--' }} | ||
| 780 | </div> | ||
| 763 | </template> | 781 | </template> |
| 764 | </el-table-column> | 782 | </el-table-column> |
| 765 | 783 | ... | ... |
| ... | @@ -57,9 +57,18 @@ const getClassifyGradListData = async () => { | ... | @@ -57,9 +57,18 @@ const getClassifyGradListData = async () => { |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | //获取分类列表 | 59 | //获取分类列表 |
| 60 | const getClassListData = async () => { | 60 | const getClassListData = async (params = {}) => { |
| 61 | const inParams = { | ||
| 62 | type: 'C', | ||
| 63 | pageIndex: 1, | ||
| 64 | pageSize: -1 | ||
| 65 | } | ||
| 66 | const finalParams = { | ||
| 67 | ...inParams, | ||
| 68 | ...params | ||
| 69 | } | ||
| 61 | classListDataLoading.value = true; | 70 | classListDataLoading.value = true; |
| 62 | const res: any = await getClassifyGradList(refClassifyPageParams.value); | 71 | const res: any = await getClassifyGradList(finalParams); |
| 63 | if (res.code == proxy.$passCode) { | 72 | if (res.code == proxy.$passCode) { |
| 64 | classListData.value = res.data.records || []; | 73 | classListData.value = res.data.records || []; |
| 65 | classListDataLoading.value = false; | 74 | classListDataLoading.value = false; |
| ... | @@ -70,7 +79,7 @@ const getClassListData = async () => { | ... | @@ -70,7 +79,7 @@ const getClassListData = async () => { |
| 70 | 79 | ||
| 71 | onMounted(() => { | 80 | onMounted(() => { |
| 72 | getClassifyGradListData(); | 81 | getClassifyGradListData(); |
| 73 | getClassListData(); | 82 | // getClassListData(); |
| 74 | }) | 83 | }) |
| 75 | 84 | ||
| 76 | 85 | ||
| ... | @@ -108,24 +117,30 @@ const cardBtnVisible: any = ref(false); | ... | @@ -108,24 +117,30 @@ const cardBtnVisible: any = ref(false); |
| 108 | 117 | ||
| 109 | /** 搜索查询分类标准 */ | 118 | /** 搜索查询分类标准 */ |
| 110 | const searchClass = async (val: any, clear: boolean = false) => { | 119 | const searchClass = async (val: any, clear: boolean = false) => { |
| 120 | console.log(val, 'val'); | ||
| 121 | |||
| 111 | if (clear) { | 122 | if (clear) { |
| 112 | classSearchItemList.value.map(item => item.default = '') | 123 | classSearchItemList.value.map(item => item.default = '') |
| 113 | getClassListData(); | 124 | getClassListData(); |
| 114 | return; | 125 | return; |
| 115 | } | 126 | } |
| 116 | const params = { | 127 | // const params = { |
| 117 | type: 'C', | 128 | // type: 'C', |
| 118 | name: val.classStandardName, | 129 | // name: val.classStandardName, |
| 119 | pageIndex: 1, | 130 | // pageIndex: 1, |
| 120 | pageSize: -1 | 131 | // pageSize: -1 |
| 121 | } | 132 | // } |
| 122 | const res: any = await getClassifyGradList(params); | 133 | // const res: any = await getClassifyGradList(params); |
| 123 | if (res.code == proxy.$passCode) { | 134 | // if (res.code == proxy.$passCode) { |
| 124 | classListData.value = res.data.records || []; | 135 | // classListData.value = res.data.records || []; |
| 125 | } else { | 136 | // } else { |
| 126 | proxy.$ElMessage.error(res.msg); | 137 | // proxy.$ElMessage.error(res.msg); |
| 138 | // } | ||
| 139 | getClassListData( | ||
| 140 | { | ||
| 141 | name: val.classStandardName | ||
| 127 | } | 142 | } |
| 128 | 143 | ); | |
| 129 | }; | 144 | }; |
| 130 | 145 | ||
| 131 | /** 编辑分类 */ | 146 | /** 编辑分类 */ |
| ... | @@ -232,7 +247,7 @@ const classStandardFormItems = ref([{ | ... | @@ -232,7 +247,7 @@ const classStandardFormItems = ref([{ |
| 232 | 247 | ||
| 233 | const classStandardFormRules = ref({ | 248 | const classStandardFormRules = ref({ |
| 234 | classStandardName: [required('请填写分类名称')], | 249 | classStandardName: [required('请填写分类名称')], |
| 235 | gradeStandard: [required('请选择分级标准')] | 250 | refGradeGuid: [required('请选择分级标准')] |
| 236 | }); | 251 | }); |
| 237 | 252 | ||
| 238 | const newCreateClassStandardDialogInfo = ref({ | 253 | const newCreateClassStandardDialogInfo = ref({ | ... | ... |
-
Please register or sign in to post a comment