f278ba6b by xukangle

fix:修改分级分类标准的相关问题

1 parent 751d9bbf
...@@ -36,6 +36,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory ...@@ -36,6 +36,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
36 # 数据字典接口地址 36 # 数据字典接口地址
37 VITE_APP_CONFIG_URL = 'ms-daop-configure-service' 37 VITE_APP_CONFIG_URL = 'ms-daop-configure-service'
38 38
39 # 文件上传下载接口地址
40 VITE_APP_COMMON_URL = 'ms-daop-common-service'
41
39 42
40 #门户接口 43 #门户接口
41 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal 44 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
......
1 import request from "@/utils/request";
2 //获取下载签名
3 export const getDownFileSignByUrl = (params) => {
4 return request({
5 url: `${
6 import.meta.env.VITE_APP_COMMON_URL
7 }/obs/generate-download-file-signature?fileName=${params.fileName}`,
8 method: "get",
9 });
10 };
11 //obs下载
12 export const obsDownloadRequest = (params) => {
13 return request({
14 withCredentials: false,
15 headers: params.actualSignedRequestHeaders
16 ? {
17 "Content-Type": params.actualSignedRequestHeaders["Content-Type"],
18 }
19 : {},
20 validateStatus: function (status) {
21 return status >= 200;
22 },
23 url: params.signedUrl,
24 responseType: "blob",
25 maxRedirects: 0,
26 data: { unused: 0 },
27 method: "get",
28 });
29 };
30 //获取上传签名
31 export const getUpFileSignByUrl = (params) => {
32 return request({
33 url: `${
34 import.meta.env.VITE_APP_COMMON_URL
35 }/obs/generate-file-signature?fileName=${params.fileName}`,
36 method: "get",
37 });
38 };
39 //obs上传
40 export const obsUploadRequest = (params) => {
41 return request({
42 withCredentials: false,
43 headers: params.actualSignedRequestHeaders ? {
44 "Content-Type": params.actualSignedRequestHeaders[
45 "Content-Type"
46 ]
47 } : {},
48 validateStatus: function (status) {
49 return status >= 200;
50 },
51
52 url: params.signedUrl,
53 method: "put",
54 data: params.file,
55 });
56 };
57 export const getImageContent = (params) => request({
58 url: `${import.meta.env.VITE_APP_COMMON_URL}/obs/view-pic?filePath=${params.split("?")[0]}`,
59 method: 'get',
60 responseType: 'blob'
61 });
...@@ -19,10 +19,15 @@ import Schedule from "../Schedule/index.vue"; ...@@ -19,10 +19,15 @@ import Schedule from "../Schedule/index.vue";
19 import { setFormFields, setItemsDisabled, getDownloadUrl, download } from '@/utils/common'; 19 import { setFormFields, setItemsDisabled, getDownloadUrl, download } from '@/utils/common';
20 import { ElMessage, ElMessageBox } from 'element-plus'; 20 import { ElMessage, ElMessageBox } from 'element-plus';
21 import useUserStore from "@/store/modules/user"; 21 import useUserStore from "@/store/modules/user";
22 // import {
23 // getFileUrl,
24 // getImageContent
25 // } from '@/api/modules/queryService';
22 import { 26 import {
23 getFileUrl, 27 getImageContent,
24 getImageContent 28 getUpFileSignByUrl,
25 } from '@/api/modules/queryService'; 29 obsUploadRequest
30 } from "@/api/modules/obsSerivice";
26 import { Editor, EditorExpose } from '@/components/Editor' 31 import { Editor, EditorExpose } from '@/components/Editor'
27 32
28 const userStore = useUserStore() 33 const userStore = useUserStore()
...@@ -444,29 +449,35 @@ const uploadFile = (file, item) => { ...@@ -444,29 +449,35 @@ const uploadFile = (file, item) => {
444 return Promise.resolve(); 449 return Promise.resolve();
445 } 450 }
446 ruleFormRef.value?.clearValidate([item.field]); 451 ruleFormRef.value?.clearValidate([item.field]);
447 let formData = new FormData(); 452 // let formData = new FormData();
448 formData.append('file', file.file); 453 // formData.append('file', file.file);
449 formData.append('fileName', file.file.name); 454 // formData.append('fileName', file.file.name);
450 return getFileUrl(formData) 455 return getUpFileSignByUrl({ fileName: file.file.name })
451 .then((res: any) => { 456 .then((res: any) => {
452 if (res.code == '00000') { 457 obsUploadRequest({
453 let fileItem = { 458 signedUrl: res.data.signedUrl,
454 name: file.file.name, 459 file: file.file,
455 url: res.data, 460 actualsignedRequestHeaders: res.data.actualsignedRequestHeaders
456 file: file.file 461 }).then(() => {
457 }; 462 if (res.code == '00000') {
458 if (item.limit === 1) { 463 let fileItem = {
459 formInline.value[item.field] = [fileItem]; 464 name: file.file.name,
465 url: res.data.signedUrl,
466 file: file.file
467 };
468 if (item.limit === 1) {
469 formInline.value[item.field] = [fileItem];
470 } else {
471 formInline.value[item.field].push(fileItem);
472 }
473 ruleFormRef.value?.validateField([item.field]);
474 ElMessage.success('上传成功');
475 emits("uploadFileChange", formInline.value[item.field]);
460 } else { 476 } else {
461 formInline.value[item.field].push(fileItem); 477 uploadRef.value['ref' + item.field].handleRemove(file);
478 ElMessage.error('上传失败,请重新上传!');
462 } 479 }
463 ruleFormRef.value?.validateField([item.field]); 480 })
464 ElMessage.success('上传成功');
465 emits("uploadFileChange", formInline.value[item.field]);
466 } else {
467 uploadRef.value['ref' + item.field].handleRemove(file);
468 ElMessage.error('上传失败,请重新上传!');
469 }
470 }) 481 })
471 .catch(() => { 482 .catch(() => {
472 uploadRef.value['ref' + item.field].handleRemove(file); 483 uploadRef.value['ref' + item.field].handleRemove(file);
......
...@@ -206,7 +206,7 @@ export const getDbDirTreeList = { ...@@ -206,7 +206,7 @@ export const getDbDirTreeList = {
206 return { 206 return {
207 code: '00000', 207 code: '00000',
208 message: '成功', 208 message: '成功',
209 'data|10-30': [{ 209 'data|10-30': {
210 cgDirName: '@cword(3, 5)', 210 cgDirName: '@cword(3, 5)',
211 'children|1-3': [{ 211 'children|1-3': [{
212 databaseGuid: '@guid', 212 databaseGuid: '@guid',
...@@ -218,7 +218,7 @@ export const getDbDirTreeList = { ...@@ -218,7 +218,7 @@ export const getDbDirTreeList = {
218 tableChName: '@cword(3, 5)' 218 tableChName: '@cword(3, 5)'
219 }] 219 }]
220 }] 220 }]
221 }] 221 }
222 } 222 }
223 } 223 }
224 } 224 }
...@@ -616,8 +616,221 @@ export const createTableSql = { ...@@ -616,8 +616,221 @@ export const createTableSql = {
616 } 616 }
617 } 617 }
618 618
619 /** 获取已有数据库目录字段信息 入参是数组
620 export const getDsTableStructures= (data) => request({
621 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`,
622 method: 'post',
623 data
624 });
625 * "data": [
626 {
627 "guid": "string",
628 "sourceTableName": "string",
629 "sourceDatabase": "string",
630 "sourceFieldName": "string",
631 "sourceFieldChName": "string",
632 "fieldGuid": "string",
633 "fieldName": "string",
634 "fieldChName": "string",
635 "fieldType": "string",
636 "fieldLength": 0,
637 "fieldPrecision": 0,
638 "dimGuid": "string",
639 "dictionaryGuid": "string",
640 "sortValue": 0,
641 "isPrimary": "string",
642 "isFk": "string",
643 "isNotNull": "string",
644 "classifyDetailGuid": "string",
645 "classifyDetailName": "string",
646 "gradeDetailGuid": "string",
647 "gradeDetailName": "string"
648 }
649 ],
650 */
651
652 // 模拟 getDsTableStructures 接口
653 export const getDsTableStructures = {
654 url: '/mock/db-dir/field/list-by-table-guids',
655 method: 'post',
656 response: ({ body }: { body: any }) => {
657 return {
658 code: '00000',
659 message: '成功',
660 'data|2-5': [
661 {
662 guid: '@guid',
663 sourceTableName: '@cword(3, 5)',
664 sourceDatabase: '@cword(3, 5)',
665 sourceFieldName: '@cword(3, 5)',
666 sourceFieldChName: '@cword(3, 5)',
667 fieldGuid: '@guid',
668 fieldName: '@cword(3, 5)',
669 fieldChName: '@cword(3, 5)',
670 fieldType: '@cword(3, 5)',
671 fieldLength: '@integer(1, 100)',
672 fieldPrecision: '@integer(1, 100)',
673 dimGuid: '@guid',
674 dictionaryGuid: '@guid',
675 sortValue: '@integer(1, 100)',
676 isPrimary: 'Y',
677 isFk: 'Y',
678 isNotNull: 'Y',
679 classifyDetailGuid: () => {
680 return Math.floor(Math.random() * 2) + 3; // 随机生成 3 或 4
681 },
682 classifyDetailName: '@cword(3, 5)',
683 gradeDetailGuid: '@guid',
684 gradeDetailName: '@cword(3, 5)'
685 }
686 ]
687 };
688 }
689 };
690
691 // 模拟 getGradeDetails 接口
692 export const getGradeDetails = {
693 url: '/mock/grade-details',
694 method: 'post',
695 response: ({ body }: { body: any }) => {
696 return {
697 code: '00000',
698 message: '成功',
699 data: [{
700
701 }]
702 };
703 }
704 };
705
706 let currentGuid = 2;
707 // 模拟 getTaskExeTreeList 接口
708 export const getTaskExeTreeList = {
709 url: '/mock/cg-task-exec/classify/tree-list',
710 method: 'get',
711 response: ({ body }: { body: any }) => {
712 return {
713 code: '00000',
714 message: '成功',
715 data: [{
716 "guid": 1,
717 "classifyName": "听参我完",
718 "parentGuid": 1,
719 "gradeGuid":1,
720 "parentGuids": [
721 "39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C",
722 "14be757b-8f0e-3DB9-5AaE-8cfeC18B2322"
723 ],
724 "children": [
725 {
726 "classifyName": "素新议白",
727 "parentGuid": 4,
728 "gradeGuid":2,
729 "parentGuids": [
730 "de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C"
731 ],
732 "children": [
733 {
734 "classifyName": "置表京革",
735 "parentGuid": 5,
736 "gradeGuid":3,
737 "parentGuids": [
738 "E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE",
739 "18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB"
740 ],
741 "guid": 3
742 }
743 ],
744 "guid": 10
745 }
746 ],
747 },
748 {
749 "guid": 7,
750 "classifyName": "大头儿子",
751 "parentGuid": 1,
752 "gradeGuid":4,
753 "parentGuids": [
754 "39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C",
755 "14be757b-8f0e-3DB9-5AaE-8cfeC18B2322"
756 ],
757 "children": [
758 {
759 "classifyName": "小头把把",
760 "parentGuid": 4,
761 "gradeGuid":5,
762 "parentGuids": [
763 "de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C"
764 ],
765 "children": [
766 {
767 "classifyName": "喜羊羊",
768 "parentGuid": 5,
769 "gradeGuid":6,
770 "parentGuids": [
771 "E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE",
772 "18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB"
773 ],
774 "guid": 9
775 }
776 ],
777 "guid": 8
778 }
779 ],
780 },
781 ]
782 };
783 }
784 };
785
786 // 模拟 getGradeList 分级接口 用于获取分级列表
787
788 export const getGradeList = {
789 url: '/mock/grade/page-list',
790 method: 'post',
791 response: ({ body }: { body: any }) => {
792 return {
793 code: '00000',
794 message: '成功',
795 data: {
796 records:[{
797 "guid": '1',
798 "name": "一级",
799 "parentGuid": 0,
800 },
801 {
802 "guid": '2',
803 "name": "二级",
804 "parentGuid": 1,
805 },
806 {
807 "guid": '3',
808 "name": "三级",
809 "parentGuid": 2,
810 },
811 {
812 "guid": '4',
813 "name": "四级",
814 "parentGuid": 3,
815 },
816 {
817 "guid": '5',
818 "name": "五级",
819 "parentGuid": 4,
820 },
821 {
822 "guid": '6',
823 "name": "六级",
824 "parentGuid": 5,
825 },
826 ]
827 }}
828 }
829 };
830
831
619 export default [getCgDirTreeList,getCgDirFieldPageList, 832 export default [getCgDirTreeList,getCgDirFieldPageList,
620 getDictionary,saveBizRuleConfig, getDbDirTreeList, 833 getDictionary,saveBizRuleConfig, getDbDirTreeList,
621 getDbDirTablePageList,getDbDirDataSourceList,getDsTableByDs, 834 getDbDirTablePageList,getDbDirDataSourceList,getDsTableByDs,
622 getDsTableStructure,getDbDirFieldPageList,getBizRuleConfigDetail, 835 getDsTableStructure,getDbDirFieldPageList,getBizRuleConfigDetail,
623 updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable] as MockMethod[] 836 updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable,getDsTableStructures,getGradeDetails,getTaskExeTreeList,getGradeList] as MockMethod[]
......
...@@ -6,10 +6,9 @@ ...@@ -6,10 +6,9 @@
6 import { ref, onMounted } from "vue"; 6 import { ref, onMounted } from "vue";
7 import useUserStore from "@/store/modules/user"; 7 import useUserStore from "@/store/modules/user";
8 import { useValidator } from '@/hooks/useValidator'; 8 import { useValidator } from '@/hooks/useValidator';
9 import { TableColumnWidth } from '@/utils/enum';
10 import G6 from '@antv/g6'; 9 import G6 from '@antv/g6';
11 import { IGroup, ModelConfig } from '@antv/g6'; 10 import { IGroup, ModelConfig } from '@antv/g6';
12 import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify } from "@/api/modules/dataInventory"; 11 import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify, updateClassifyGrad } from "@/api/modules/dataInventory";
13 12
14 13
15 const { required, orderNum } = useValidator(); 14 const { required, orderNum } = useValidator();
...@@ -30,19 +29,43 @@ const classStandardFormItems = ref([{ ...@@ -30,19 +29,43 @@ const classStandardFormItems = ref([{
30 field: 'classStandardName', 29 field: 'classStandardName',
31 default: router.currentRoute.value.query.classStandardName, 30 default: router.currentRoute.value.query.classStandardName,
32 clearable: true, 31 clearable: true,
33 disabled: true, 32 disabled: false,
34 required: true 33 required: true
35 }, { 34 }, {
35 // label: '分级标准',
36 // type: 'input',
37 // placeholder: '请选择',
38 // field: 'gradeStandard',
39 // default: '',
40 // required: true,
41 // filterable: true,
42 // clearable: true,
43 // disabled: false,
44 // visible: true,
36 label: '分级标准', 45 label: '分级标准',
37 type: 'input', 46 type: 'select',
38 placeholder: '请选择', 47 placeholder: '请选择',
39 field: 'gradeStandard', 48 field: 'gradeStandard',
49 options: [],
50 props: {
51 label: "name",
52 value: "guid",
53 },
54 filterable: true,
55 clearable: true,
40 default: '', 56 default: '',
41 required: true, 57 required: true,
42 filterable: true, 58 block: false,
59 },
60 {
61 label: '分类描述',
62 type: 'textarea',
63 placeholder: '请输入',
64 field: 'description',
65 default: '',
43 clearable: true, 66 clearable: true,
44 disabled: true, 67 required: false,
45 visible: true, 68 block: true
46 }]); 69 }]);
47 70
48 // 定义层级映射1->一级,2->二级,3->三级,4->四级 71 // 定义层级映射1->一级,2->二级,3->三级,4->四级
...@@ -77,7 +100,7 @@ const tableInfo = ref({ ...@@ -77,7 +100,7 @@ const tableInfo = ref({
77 { 100 {
78 label: "最低安全级别参考", field: "name", width: 140, getName: (scope) => { 101 label: "最低安全级别参考", field: "name", width: 140, getName: (scope) => {
79 let dataGrade = scope.row.dataGrade; 102 let dataGrade = scope.row.dataGrade;
80 return dataGrade + '级'; 103 return dataGrade ? dataGrade + '级' : '--';
81 } 104 }
82 }, 105 },
83 { label: "修改人", field: "updateUserName", width: 140 }, 106 { label: "修改人", field: "updateUserName", width: 140 },
...@@ -165,7 +188,7 @@ const classEditFormItems = ref([{ ...@@ -165,7 +188,7 @@ const classEditFormItems = ref([{
165 type: 'select', 188 type: 'select',
166 placeholder: '请选择', 189 placeholder: '请选择',
167 field: 'gradeGuid', 190 field: 'gradeGuid',
168 default: 1, 191 default: '',
169 options: [], //TODO 192 options: [], //TODO
170 props: { 193 props: {
171 label: "name", 194 label: "name",
...@@ -322,7 +345,9 @@ const drawerBtnClick = async (btn, info) => { ...@@ -322,7 +345,9 @@ const drawerBtnClick = async (btn, info) => {
322 const params = { 345 const params = {
323 ...info, 346 ...info,
324 classifyGradeGuid: router.currentRoute.value.query.guid, 347 classifyGradeGuid: router.currentRoute.value.query.guid,
325 guid: currTableInfo.value.guid 348 guid: currTableInfo.value.guid,
349 gradeGuid: info.gradeGuid || '',
350 parentGuid: info.parentGuid || '',
326 } 351 }
327 const res: any = await updateClassify(params); 352 const res: any = await updateClassify(params);
328 if (res.code == proxy.$passCode) { 353 if (res.code == proxy.$passCode) {
...@@ -350,8 +375,10 @@ const getClassifyGradListData = async () => { ...@@ -350,8 +375,10 @@ const getClassifyGradListData = async () => {
350 const res: any = await getClassifyGradList(refGradePageParams.value); 375 const res: any = await getClassifyGradList(refGradePageParams.value);
351 if (res.code == proxy.$passCode) { 376 if (res.code == proxy.$passCode) {
352 classifyGradListData.value = res.data.records || []; 377 classifyGradListData.value = res.data.records || [];
353 const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any); 378 classStandardFormItems.value[1].options = classifyGradListData.value;
354 classStandardFormItems.value[1].default = gradeName; 379 // const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any);
380 classStandardFormItems.value[1].default = router.currentRoute.value.query.refGradeGuid;
381 classStandardFormItems.value[2].default = router.currentRoute.value.query.description;
355 } else { 382 } else {
356 proxy.$ElMessage.error(res.msg); 383 proxy.$ElMessage.error(res.msg);
357 } 384 }
...@@ -445,6 +472,39 @@ const newCreateClass = () => { ...@@ -445,6 +472,39 @@ const newCreateClass = () => {
445 }) 472 })
446 } 473 }
447 474
475
476 const saveLoading = ref(false);
477 const saveUpdate = async () => {
478 console.log(formRef.value.formInline);
479 if (!formRef.value.formInline.classStandardName) {
480 proxy.$ElMessage.error('分类名称不能为空');
481 return;
482 }
483 if (!formRef.value.formInline.gradeStandard) {
484 proxy.$ElMessage.error('分级标准不能为空');
485 return;
486 }
487 saveLoading.value = true;
488 const params = {
489 guid: router.currentRoute.value.query.guid,
490 name: formRef.value.formInline.classStandardName,
491 refGradeGuid: formRef.value.formInline.gradeStandard,
492 type: 'C',
493 description: formRef.value.formInline.description
494 }
495 console.log(params);
496 const res: any = await updateClassifyGrad(params);
497 if (res.code == proxy.$passCode) {
498 proxy.$ElMessage.success('修改成功');
499 router.push({
500 name: 'templateConfig'
501 });
502 saveLoading.value = false;
503 } else {
504 proxy.$ElMessage.error(res.msg);
505 }
506 }
507
448 /** 导入分类。 */ 508 /** 导入分类。 */
449 const importClass = () => { 509 const importClass = () => {
450 510
...@@ -778,6 +838,7 @@ onMounted(() => { ...@@ -778,6 +838,7 @@ onMounted(() => {
778 </div> 838 </div>
779 <div class="bottom_tool_wrap"> 839 <div class="bottom_tool_wrap">
780 <el-button @click="cancel">取消</el-button> 840 <el-button @click="cancel">取消</el-button>
841 <el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
781 </div> 842 </div>
782 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef" /> 843 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef" />
783 </div> 844 </div>
...@@ -824,11 +885,11 @@ onMounted(() => { ...@@ -824,11 +885,11 @@ onMounted(() => {
824 } 885 }
825 886
826 .shape-main { 887 .shape-main {
827 height: calc(100% - 58px); 888 height: calc(100% - 160px);
828 } 889 }
829 890
830 .table_panel { 891 .table_panel {
831 height: calc(100% - 58px) !important; 892 height: calc(100% - 160px) !important;
832 } 893 }
833 894
834 .node-details-popup { 895 .node-details-popup {
......
...@@ -6,8 +6,11 @@ ...@@ -6,8 +6,11 @@
6 6
7 import router from "@/router"; 7 import router from "@/router";
8 import { ref } from "vue"; 8 import { ref } from "vue";
9 import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade } from '@/api/modules/dataInventory'; 9 import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade, updateClassifyGrad } from '@/api/modules/dataInventory';
10 10 import useUserStore from "@/store/modules/user";
11 const userStore = useUserStore();
12 const route = useRoute();
13 const fullPath = route.query.fullPath;
11 onBeforeMount(() => { 14 onBeforeMount(() => {
12 getGradeListData(); 15 getGradeListData();
13 getDataGrade(); 16 getDataGrade();
...@@ -16,7 +19,6 @@ onBeforeMount(() => { ...@@ -16,7 +19,6 @@ onBeforeMount(() => {
16 19
17 // 获取分级列表 20 // 获取分级列表
18 const getGradeListData = async () => { 21 const getGradeListData = async () => {
19 console.log('调用了吗~~~');
20 tableInfo.value.loading = true; 22 tableInfo.value.loading = true;
21 const params = { 23 const params = {
22 pageIndex: 1, 24 pageIndex: 1,
...@@ -111,7 +113,8 @@ const tableInfo = ref({ ...@@ -111,7 +113,8 @@ const tableInfo = ref({
111 id: "data-class-standard-table", 113 id: "data-class-standard-table",
112 multiple: true, 114 multiple: true,
113 fields: [ 115 fields: [
114 { label: "序号", field: 'orderNum', width: 56, align: "center" }, 116 { label: "序号", type: 'index', width: 56, align: "center" },
117 { label: "排序", field: 'orderNum', width: 56, align: "center" },
115 { 118 {
116 label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => { 119 label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => {
117 let dataGrade = scope.row.dataGrade; 120 let dataGrade = scope.row.dataGrade;
...@@ -124,7 +127,7 @@ const tableInfo = ref({ ...@@ -124,7 +127,7 @@ const tableInfo = ref({
124 return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; 127 return classDataRef.value.find((item: any) => item.value === dataClassify)?.label;
125 } 128 }
126 }, 129 },
127 { label: "分级描述", field: "gradeDesc", align: "left", width: 480 }, 130 { label: "分级描述", field: "gradeDesc", align: "left" },
128 131
129 ], 132 ],
130 actionInfo: { 133 actionInfo: {
...@@ -328,18 +331,80 @@ const newStandard = () => { ...@@ -328,18 +331,80 @@ const newStandard = () => {
328 newCreateGradeFormItems.value.forEach(item => item.default = ''); 331 newCreateGradeFormItems.value.forEach(item => item.default = '');
329 } 332 }
330 333
334 const formRef = ref<any>();
335
336 const classStandardFormItems = ref([{
337 label: '分级名称',
338 type: 'input',
339 maxlength: 50,
340 placeholder: '请输入',
341 field: 'name',
342 default: router.currentRoute.value.query.classClassifyGradName,
343 block: false,
344 clearable: true,
345 required: true
346 }]);
347
348
349 const saveLoading = ref(false);
350 const saveUpdate = async () => {
351 console.log(formRef.value.formInline);
352 if (!formRef.value.formInline.name) {
353 proxy.$ElMessage.error('分级名称不能为空');
354 return;
355 }
331 356
357 saveLoading.value = true;
358 const params = {
359 guid: router.currentRoute.value.query.guid,
360 name: formRef.value.formInline.name,
361 type: 'G',
362 }
363 console.log(params);
364 const res: any = await updateClassifyGrad(params);
365 if (res.code == proxy.$passCode) {
366 proxy.$ElMessage.success('修改成功');
367 router.push({
368 name: 'templateConfig'
369 });
370 saveLoading.value = false;
371 } else {
372 proxy.$ElMessage.error(res.msg);
373 }
374 }
375
376 const cancel = () => {
377 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
378 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
379 router.push({
380 name: 'templateConfig'
381 });
382 }, () => {
383 proxy.$ElMessage.info("已取消");
384 });
385 }
332 386
333 </script> 387 </script>
334 388
335 <template> 389 <template>
336 <div class="container_wrap" v-loading="fullscreenLoading"> 390 <div class="container_wrap">
337 <div class="content_main"> 391 <div class="content_main">
338 <div class="table-top-btns"> 392 <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;">
339 <el-button type="primary" @click="newStandard">新增标准</el-button> 393 <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" />
340 <el-button @click="batchRemobe">批量删除</el-button> 394 </ContentWrap>
341 </div> 395 <ContentWrap id="id-grade-info" title="分级标准" class="detail-content" description="" style="margin-top: 8px;">
342 <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> 396 <div class="content" v-loading="fullscreenLoading">
397 <div class="table-top-btns">
398 <el-button type="primary" @click="newStandard">新增标准</el-button>
399 <el-button @click="batchRemobe">批量删除</el-button>
400 </div>
401 <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" />
402 </div>
403 </ContentWrap>
404 </div>
405 <div class="bottom_tool_wrap">
406 <el-button @click="cancel">取消</el-button>
407 <el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
343 </div> 408 </div>
344 <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" /> 409 <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" />
345 </div> 410 </div>
...@@ -351,11 +416,48 @@ const newStandard = () => { ...@@ -351,11 +416,48 @@ const newStandard = () => {
351 416
352 .content_main { 417 .content_main {
353 height: calc(100% - 44px); 418 height: calc(100% - 44px);
354 padding: 17px 16px 10px 16px; 419 padding: 10px 16px;
355 420
356 .table-top-btns { 421 .table-top-btns {
357 display: flex;
358 margin-bottom: 12px; 422 margin-bottom: 12px;
359 } 423 }
360 } 424 }
425
426 .bottom_tool_wrap {
427 height: 44px;
428 padding: 0 16px;
429 border-top: 1px solid #d9d9d9;
430 display: flex;
431 justify-content: center;
432 align-items: center;
433 }
434
435 :deep(.detail-content) {
436
437 .el-card__body {
438 height: calc(100% - 50px) !important;
439
440 .card-body-content {
441 height: 100%;
442 }
443 }
444 }
445
446 .tools_btns {
447 position: relative;
448 margin-bottom: 16px;
449
450 .show-change-btn {
451 position: absolute;
452 right: 0px;
453 }
454 }
455
456 .shape-main {
457 height: calc(100% - 40px);
458 }
459
460 .table_panel {
461 height: calc(100% - 40px) !important;
462 }
361 </style> 463 </style>
......
...@@ -149,6 +149,7 @@ const handleClassDataEdit = (params) => { ...@@ -149,6 +149,7 @@ const handleClassDataEdit = (params) => {
149 149
150 // 配置分类 150 // 配置分类
151 const handleClassDataClick = (item, des = '') => { 151 const handleClassDataClick = (item, des = '') => {
152 console.log(item, 'i111tem');
152 // 获取分级标准 153 // 获取分级标准
153 router.push({ 154 router.push({
154 name: 'classStandardEdit', 155 name: 'classStandardEdit',
...@@ -156,7 +157,8 @@ const handleClassDataClick = (item, des = '') => { ...@@ -156,7 +157,8 @@ const handleClassDataClick = (item, des = '') => {
156 guid: item.guid, 157 guid: item.guid,
157 type: des === '' ? '配置' : des, 158 type: des === '' ? '配置' : des,
158 classStandardName: item.name, 159 classStandardName: item.name,
159 refGradeGuid: item.refGradeGuid 160 refGradeGuid: item.refGradeGuid,
161 description: item.description
160 } 162 }
161 }); 163 });
162 } 164 }
...@@ -248,6 +250,7 @@ const newCreateClassStandardDialogInfo = ref({ ...@@ -248,6 +250,7 @@ const newCreateClassStandardDialogInfo = ref({
248 newCreateClassStandardDialogInfo.value.visible = false; 250 newCreateClassStandardDialogInfo.value.visible = false;
249 }, 251 },
250 submit: async (btn, info) => { 252 submit: async (btn, info) => {
253
251 if (newCreateClassStandardDialogInfo.value.title === '新增分类') { 254 if (newCreateClassStandardDialogInfo.value.title === '新增分类') {
252 newCreateClassStandardDialogInfo.value.submitBtnLoading = true; 255 newCreateClassStandardDialogInfo.value.submitBtnLoading = true;
253 const params = { 256 const params = {
...@@ -263,6 +266,22 @@ const newCreateClassStandardDialogInfo = ref({ ...@@ -263,6 +266,22 @@ const newCreateClassStandardDialogInfo = ref({
263 type: 'success', 266 type: 'success',
264 message: '新增分类成功' 267 message: '新增分类成功'
265 }) 268 })
269
270 nextTick(() => {
271 // 拿到新增的分类数据,跳转到配置页面
272 const item = classListData.value.find(item => item.name === info.classStandardName);
273 console.log(item, 'item---------------');
274 if (item) {
275 const params = {
276 name: item.name,
277 guid: item.guid,
278 refGradeGuid: item.refGradeGuid,
279 description: item.description
280 }
281 handleClassDataClick(params, '');
282 }
283 })
284
266 newCreateClassStandardDialogInfo.value.submitBtnLoading = false; 285 newCreateClassStandardDialogInfo.value.submitBtnLoading = false;
267 newCreateClassStandardDialogInfo.value.visible = false; 286 newCreateClassStandardDialogInfo.value.visible = false;
268 } else { 287 } else {
...@@ -343,7 +362,7 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -343,7 +362,7 @@ const newCreateGradeStandardDialogInfo = ref({
343 await getClassifyGradListData(); 362 await getClassifyGradListData();
344 proxy.$ElMessage({ 363 proxy.$ElMessage({
345 type: 'success', 364 type: 'success',
346 message: '新增分成功' 365 message: '新增分成功'
347 }) 366 })
348 367
349 // 拿到新增的分级数据,跳转到配置页面 368 // 拿到新增的分级数据,跳转到配置页面
...@@ -372,7 +391,7 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -372,7 +391,7 @@ const newCreateGradeStandardDialogInfo = ref({
372 getClassifyGradListData(); 391 getClassifyGradListData();
373 proxy.$ElMessage({ 392 proxy.$ElMessage({
374 type: 'success', 393 type: 'success',
375 message: '修改分成功' 394 message: '修改分成功'
376 }) 395 })
377 newCreateGradeStandardDialogInfo.value.visible = false; 396 newCreateGradeStandardDialogInfo.value.visible = false;
378 } else { 397 } else {
...@@ -437,6 +456,7 @@ const handleClassifyGradDataClick = (item) => { ...@@ -437,6 +456,7 @@ const handleClassifyGradDataClick = (item) => {
437 } 456 }
438 457
439 const newCreateGrade = () => { 458 const newCreateGrade = () => {
459 newCreateGradeStandardDialogInfo.value.submitBtnLoading = false;
440 newCreateGradeStandardDialogInfo.value.visible = true; 460 newCreateGradeStandardDialogInfo.value.visible = true;
441 newCreateGradeFormItems.value.forEach(item => item.default = ''); 461 newCreateGradeFormItems.value.forEach(item => item.default = '');
442 } 462 }
...@@ -539,7 +559,7 @@ const newCreateGrade = () => { ...@@ -539,7 +559,7 @@ const newCreateGrade = () => {
539 </template> 559 </template>
540 <div class="levitation-ul"> 560 <div class="levitation-ul">
541 <span class="levitation-li" @click="handleClassDataClick(item)">配置</span> 561 <span class="levitation-li" @click="handleClassDataClick(item)">配置</span>
542 <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> 562 <!-- <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> -->
543 <span class="levitation-li" @click="handleClassDataDel(item)">删除</span> 563 <span class="levitation-li" @click="handleClassDataDel(item)">删除</span>
544 </div> 564 </div>
545 </el-popover> 565 </el-popover>
...@@ -572,7 +592,7 @@ const newCreateGrade = () => { ...@@ -572,7 +592,7 @@ const newCreateGrade = () => {
572 </template> 592 </template>
573 <div class="levitation-ul"> 593 <div class="levitation-ul">
574 <span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span> 594 <span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span>
575 <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> 595 <!-- <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> -->
576 <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span> 596 <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span>
577 </div> 597 </div>
578 </el-popover> 598 </el-popover>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!