ec743969 by xukangle

fix : 修改分类分级

1 parent 3f73d0f0
...@@ -4,7 +4,7 @@ import router from '@/router' ...@@ -4,7 +4,7 @@ import router from '@/router'
4 import { ElMessage } from 'element-plus' 4 import { ElMessage } from 'element-plus'
5 import apiUser from '@/api/modules/user' 5 import apiUser from '@/api/modules/user'
6 import { getCurrentTime } from '@/utils/common' 6 import { getCurrentTime } from '@/utils/common'
7 import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface } from '@/api/modules/queryService' 7 import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface, getCurrentUserInfo } from '@/api/modules/queryService'
8 8
9 const useUserStore = defineStore( 9 const useUserStore = defineStore(
10 // 唯一ID 10 // 唯一ID
...@@ -56,6 +56,14 @@ const useUserStore = defineStore( ...@@ -56,6 +56,14 @@ const useUserStore = defineStore(
56 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; 56 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
57 localStorage.setItem('currentTenantGuid', currentTenantGuid.value); 57 localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
58 let currentTenant = res.data.tenantInfoList?.[0]; 58 let currentTenant = res.data.tenantInfoList?.[0];
59 getCurrentUserInfo(currentTenantGuid.value).then((res: any) => {
60 console.log(res, 'getCurrentUserInfo');
61 if (res.code == '00000') {
62 localStorage.setItem('userData', JSON.stringify(res.data));
63 } else {
64 ElMessage.error(res.msg)
65 }
66 })
59 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { 67 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
60 if (info.code == '00000') { 68 if (info.code == '00000') {
61 localStorage.setItem('userName', currentTenant?.name) 69 localStorage.setItem('userName', currentTenant?.name)
......
...@@ -492,18 +492,17 @@ const importTableEditIndex: any = ref(null); ...@@ -492,18 +492,17 @@ const importTableEditIndex: any = ref(null);
492 const addAssetTable = () => { 492 const addAssetTable = () => {
493 importTableFieldVisible.value = true; 493 importTableFieldVisible.value = true;
494 } 494 }
495 const stuffInfo = ref<any>({}); 495
496 onBeforeMount(() => { 496 onBeforeMount(() => {
497 const currentTenantGuid = localStorage.getItem('currentTenantGuid'); 497 // const currentTenantGuid = localStorage.getItem('currentTenantGuid');
498 getCurrentUserInfo(currentTenantGuid).then((res: any) => { 498 // getCurrentUserInfo(currentTenantGuid).then((res: any) => {
499 console.log(res, 'getCurrentUserInfo'); 499 // console.log(res, 'getCurrentUserInfo');
500 if (res.code == '00000') { 500 // if (res.code == '00000') {
501 localStorage.setItem('userData', JSON.stringify(res.data)); 501 // localStorage.setItem('userData', JSON.stringify(res.data));
502 stuffInfo.value = res.data; 502 // } else {
503 } else { 503 // ElMessage.error(res.msg)
504 ElMessage.error(res.msg) 504 // }
505 } 505 // })
506 })
507 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => { 506 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
508 if (res?.code == proxy.$passCode) { 507 if (res?.code == proxy.$passCode) {
509 parentAreaData.value = res.data ?? []; 508 parentAreaData.value = res.data ?? [];
...@@ -662,10 +661,6 @@ const save = () => { ...@@ -662,10 +661,6 @@ const save = () => {
662 }); 661 });
663 } else { 662 } else {
664 params.damCatalogTableInfo = assetDataTableInfo.value.data; 663 params.damCatalogTableInfo = assetDataTableInfo.value.data;
665 params.damCatalogTableInfo = {
666 ...assetDataTableInfo.value.data,
667 stuffGuid: stuffInfo.value.staffGuid
668 };
669 fullscreenLoading.value = true; 664 fullscreenLoading.value = true;
670 registerCatalogSave(params).then((res: any) => { 665 registerCatalogSave(params).then((res: any) => {
671 fullscreenLoading.value = false; 666 fullscreenLoading.value = false;
......
...@@ -26,7 +26,13 @@ const assetStore = useDataAssetStore(); ...@@ -26,7 +26,13 @@ const assetStore = useDataAssetStore();
26 const router = useRouter(); 26 const router = useRouter();
27 const { proxy } = getCurrentInstance() as any; 27 const { proxy } = getCurrentInstance() as any;
28 const damTypes: any = ref([]); 28 const damTypes: any = ref([]);
29 const dataSources: any = ref([]);
29 const subjectDomainListData: any = ref([]) 30 const subjectDomainListData: any = ref([])
31 // 登记状态 Y 已登记 N 未登记
32 const isRegisterOptions = ref<any>([
33 { label: "已登记", value: "Y" },
34 { label: "未登记", value: "N" },
35 ])
30 const searchItemList = ref([ 36 const searchItemList = ref([
31 { 37 {
32 type: "input", 38 type: "input",
...@@ -73,23 +79,37 @@ const searchItemList = ref([ ...@@ -73,23 +79,37 @@ const searchItemList = ref([
73 showCheckbox: true 79 showCheckbox: true
74 }, 80 },
75 { 81 {
76 type: "input", 82 type: "select",
77 label: "", 83 label: "",
78 field: "damName", 84 field: "dataSources",
79 default: "", 85 default: "",
80 placeholder: "来源", 86 placeholder: "数据来源",
81 clearable: true, 87 clearable: true,
88 filterable: true,
89 options: dataSources.value,
90 props: {
91 value: 'value',
92 label: 'label'
93 }
82 }, 94 },
83 { 95 {
84 type: "input", 96 type: "select",
85 label: "", 97 label: "",
86 field: "damName", 98 field: "isRegister",
87 default: "", 99 default: "",
88 placeholder: "登记状态", 100 placeholder: "登记状态",
89 clearable: true, 101 clearable: true,
102 filterable: true,
103 options: isRegisterOptions.value,
104 props: {
105 value: 'value',
106 label: 'label'
107 }
90 }, 108 },
91 ]); 109 ]);
92 110
111
112
93 const pageInfo = ref({ 113 const pageInfo = ref({
94 ...commonPageConfig, 114 ...commonPageConfig,
95 rows: 0, 115 rows: 0,
...@@ -218,6 +238,18 @@ onActivated(() => { ...@@ -218,6 +238,18 @@ onActivated(() => {
218 238
219 onBeforeMount(() => { 239 onBeforeMount(() => {
220 getDamTypesList({ 240 getDamTypesList({
241 dictType: "数据来源",
242 }).then((res: any) => {
243 if (res.code == proxy.$passCode) {
244 dataSources.value = res.data || [];
245 let item = searchItemList.value.find(item => item.field == 'dataSources');
246 item && (item.options = dataSources.value);
247 } else {
248 proxy.$ElMessage.error(res.msg);
249 }
250 })
251
252 getDamTypesList({
221 dictType: "资产类型", 253 dictType: "资产类型",
222 }).then((res: any) => { 254 }).then((res: any) => {
223 if (res.code == proxy.$passCode) { 255 if (res.code == proxy.$passCode) {
...@@ -284,6 +316,8 @@ const handleCreate = () => { ...@@ -284,6 +316,8 @@ const handleCreate = () => {
284 <div class="type-btn"> 316 <div class="type-btn">
285 <div class="type">{{ item.subjectDomainName || item.subjectDomain }}</div> 317 <div class="type">{{ item.subjectDomainName || item.subjectDomain }}</div>
286 <div class="type">{{ item.damTypeName || '--' }}</div> 318 <div class="type">{{ item.damTypeName || '--' }}</div>
319 <div class="type">{{ item.isRegister == 'Y' ? '已登记' : '未登记' }}</div>
320 <div class="type">{{ item.foundMode == '1' ? '自建' : '加工交付' }}</div>
287 </div> 321 </div>
288 <div class="desc">{{ item.propertyDescription }}</div> 322 <div class="desc">{{ item.propertyDescription }}</div>
289 <el-popover v-model="cardBtnVisible" placement="bottom" width="96" trigger="click" 323 <el-popover v-model="cardBtnVisible" placement="bottom" width="96" trigger="click"
......
...@@ -25,12 +25,13 @@ import { ...@@ -25,12 +25,13 @@ import {
25 getDbDirTableSelectList, 25 getDbDirTableSelectList,
26 getDbDirFieldSelectList, 26 getDbDirFieldSelectList,
27 updateDataAsset, 27 updateDataAsset,
28 getDictionaryAll 28 getDictionaryAll,
29 getNewDataTypeList
29 } from '@/api/modules/dataInventory'; 30 } from '@/api/modules/dataInventory';
30 import { TableColumnWidth } from "@/utils/enum"; 31 import { TableColumnWidth } from "@/utils/enum";
31 import router from "@/router"; 32 import router from "@/router";
32 import { download } from "@/utils/common"; 33 import { download } from "@/utils/common";
33 34 import { vi } from "element-plus/es/locale";
34 const currentPath = ref<string[]>([]); 35 const currentPath = ref<string[]>([]);
35 const currentDatabasePath = ref<string[]>([]); 36 const currentDatabasePath = ref<string[]>([]);
36 const { proxy } = getCurrentInstance() as any; 37 const { proxy } = getCurrentInstance() as any;
...@@ -122,6 +123,22 @@ const getExecGuid = async () => { ...@@ -122,6 +123,22 @@ const getExecGuid = async () => {
122 } 123 }
123 } 124 }
124 125
126 // 获取字段类型
127 const optionsD = ref<any>();
128 const selectedD = ref<any>();
129 const fieldData = ref<any>();
130 const getFieldTypeData = async () => {
131 const params = {
132 dictType: "字段类型"
133 }
134 const res: any = await getNewDataTypeList(params);
135 if (res.code == proxy.$passCode) {
136 fieldData.value = res.data;
137 optionsD.value = res.data;
138 } else {
139 proxy.$ElMessage.error(res.msg);
140 }
141 }
125 142
126 onMounted(async () => { 143 onMounted(async () => {
127 await getExecGuid(); 144 await getExecGuid();
...@@ -134,6 +151,7 @@ onMounted(async () => { ...@@ -134,6 +151,7 @@ onMounted(async () => {
134 getSearchTableList(); 151 getSearchTableList();
135 // getLabelListData(); 152 // getLabelListData();
136 getGradeData(refGradeGuid.value); 153 getGradeData(refGradeGuid.value);
154 getFieldTypeData();
137 155
138 }) 156 })
139 157
...@@ -213,23 +231,33 @@ const searchItemList = ref([ ...@@ -213,23 +231,33 @@ const searchItemList = ref([
213 // 搜索 231 // 搜索
214 const searchCount = ref(0); 232 const searchCount = ref(0);
215 const toSearch = (val: any, clear: boolean = false) => { 233 const toSearch = (val: any, clear: boolean = false) => {
234 console.log('toSearch', val, clear);
216 if (clear) { 235 if (clear) {
217 selectedA.value = null; 236 selectedA.value = null;
218 selectedB.value = null; 237 selectedB.value = null;
219 selectedC.value = null; 238 selectedC.value = null;
239 levelGuidInfo.value = '';
240 val.levelName = '';
241 val.classfiyName = '';
220 searchItemList.value.map(item => item.default = '') 242 searchItemList.value.map(item => item.default = '')
221 if (activeName.value === 'first') { 243 if (activeName.value === 'first') {
222 treeInfo.value.expandedKey = []; 244 treeInfo.value.expandedKey = [];
223 currentPath.value = [CgDirTreeList.value[0].classifyName]; 245 currentPath.value = [CgDirTreeList.value[0].classifyName];
224 treeInfo.value.expandedKey.push(CgDirTreeList.value[0].classifyDetailGuid); 246 treeInfo.value.expandedKey.push(CgDirTreeList.value[0].classifyDetailGuid);
225 treeInfo.value.currentNodeKey = CgDirTreeList.value[0].classifyDetailGuid; 247 treeInfo.value.currentNodeKey = CgDirTreeList.value[0].classifyDetailGuid;
226 console.log('clear', treeInfo.value.expandedKey, clear);
227 getCgDirFieldPage({ 248 getCgDirFieldPage({
228 execGuid: execGuidInfo.value.execGuid, 249 execGuid: execGuidInfo.value.execGuid,
229 classifyDetail: CgDirTreeList.value[0].classifyDetailGuid, 250 classifyDetail: CgDirTreeList.value[0].classifyDetailGuid,
230 }); 251 });
231 } 252 }
232 if (activeName.value === 'second') { 253 if (activeName.value === 'second') {
254 dataBaseTreeInfo.value.expandedKey = [];
255 dataBaseTreeInfo.value.expandedKey.push(dataBaseTreeData.value[0].guid);
256 dataBaseTreeInfo.value.currentNodeKey = dataBaseTreeData.value[0].guid;
257 dataBaseGuid.value = dataBaseTreeData.value[0].databaseGuid;
258 currentDatabasePath.value = [dataBaseTreeData.value[0].name];
259 selectedA.value = dataBaseTreeData.value[0].databaseGuid;
260 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" })
233 getDataBaseTableData({ 261 getDataBaseTableData({
234 pageIndex: 1, 262 pageIndex: 1,
235 pageSize: 50, 263 pageSize: 50,
...@@ -248,14 +276,15 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -248,14 +276,15 @@ const toSearch = (val: any, clear: boolean = false) => {
248 tableGuid: selectedB.value || tableGuid.value || '', 276 tableGuid: selectedB.value || tableGuid.value || '',
249 databaseGuid: selectedA.value || dataBaseGuid.value || '', 277 databaseGuid: selectedA.value || dataBaseGuid.value || '',
250 fieldGuid: '', 278 fieldGuid: '',
251 classifyDetailGuid: '', 279 classifyDetailGuid: val.classifyName,
252 gradeDetailGuid: '', 280 gradeDetailGuid: '',
253 labelGuid: '', 281 labelGuid: '',
254 }); 282 });
255 283
256 } 284 }
285 return;
257 } 286 }
258 console.log('toSearch', val, classifyDetailGuidInfo.value); 287
259 if (activeName.value === 'first' && !clear) { 288 if (activeName.value === 'first' && !clear) {
260 getCgDirFieldPage({ 289 getCgDirFieldPage({
261 pageIndex: 1, 290 pageIndex: 1,
...@@ -276,8 +305,8 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -276,8 +305,8 @@ const toSearch = (val: any, clear: boolean = false) => {
276 execGuid: execGuidInfo.value.execGuid, 305 execGuid: execGuidInfo.value.execGuid,
277 tableGuid: selectedB.value || tableGuid.value || '', 306 tableGuid: selectedB.value || tableGuid.value || '',
278 databaseGuid: selectedA.value || dataBaseGuid.value || '', 307 databaseGuid: selectedA.value || dataBaseGuid.value || '',
279 classifyDetailGuid: val.classifyName, 308 classifyDetailGuid: val.classifyName || '',
280 gradeDetailGuid: val.levelName, 309 gradeDetailGuid: val.levelName || '',
281 labelGuid: val.labelName, 310 labelGuid: val.labelName,
282 }); 311 });
283 } 312 }
...@@ -289,8 +318,8 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -289,8 +318,8 @@ const toSearch = (val: any, clear: boolean = false) => {
289 tableGuid: selectedB.value || tableGuid.value || '', 318 tableGuid: selectedB.value || tableGuid.value || '',
290 databaseGuid: selectedA.value || dataBaseGuid.value || '', 319 databaseGuid: selectedA.value || dataBaseGuid.value || '',
291 fieldGuid: selectedC.value || '', 320 fieldGuid: selectedC.value || '',
292 classifyDetailGuid: val.classifyName, 321 classifyDetailGuid: val.classifyName || '',
293 gradeDetailGuid: val.levelName, 322 gradeDetailGuid: val.levelName || '',
294 labelGuid: val.labelName, 323 labelGuid: val.labelName,
295 }); 324 });
296 } 325 }
...@@ -312,6 +341,9 @@ const nodeClick = async (data: any) => { ...@@ -312,6 +341,9 @@ const nodeClick = async (data: any) => {
312 execGuid: execGuidInfo.value.execGuid, 341 execGuid: execGuidInfo.value.execGuid,
313 classifyDetail: classifyDetailGuid, 342 classifyDetail: classifyDetailGuid,
314 gradeDetailGuid: levelGuidInfo.value, 343 gradeDetailGuid: levelGuidInfo.value,
344 databaseGuid: selectedA.value,
345 tableGuid: selectedB.value,
346 fieldGuid: selectedC.value,
315 }); 347 });
316 // 递归tempData找到所有祖先元素的standardName,存入currentPath中 348 // 递归tempData找到所有祖先元素的standardName,存入currentPath中
317 const path = findPath(CgDirTreeList.value, guid); 349 const path = findPath(CgDirTreeList.value, guid);
...@@ -389,7 +421,8 @@ const tableInfo = ref({ ...@@ -389,7 +421,8 @@ const tableInfo = ref({
389 fields: [ 421 fields: [
390 { label: "序号", type: "index", width: 56, align: "center" }, 422 { label: "序号", type: "index", width: 56, align: "center" },
391 { label: "字段名", field: "fieldName", width: 140 }, 423 { label: "字段名", field: "fieldName", width: 140 },
392 { label: "字段中文名", field: "fieldChName", width: 180 }, 424 { label: "字段中文名", field: "fieldChName", width: 140 },
425 { label: "字段类型", field: "fieldTypeName", width: 120 },
393 { 426 {
394 label: "分类", field: "classifyDetailNameRoutes", width: 120, getName: (scope) => { 427 label: "分类", field: "classifyDetailNameRoutes", width: 120, getName: (scope) => {
395 return scope.row.classifyDetailNameRoutes.join('/'); 428 return scope.row.classifyDetailNameRoutes.join('/');
...@@ -427,9 +460,25 @@ const tablePageChange = (info) => { ...@@ -427,9 +460,25 @@ const tablePageChange = (info) => {
427 }); 460 });
428 } 461 }
429 462
463 // 判断是否为单文本框
464 const isSingleInput = (fieldType: string) => {
465 // 定义单文本框的字段类型
466 const singleInputTypes = ['text', 'varchar', 'json', 'bit', 'char'];
467 return singleInputTypes.includes(fieldType) || !fieldType; // 如果fieldType为空,默认为单文本框
468 };
469 //time tinyint decimal timestamp datetime date int varchar text json bit char
470 //剩下判断是为单文本框
471
472 const isDoubleInput = (fieldType: string) => {
473 // 定义单文本框的字段类型
474 const doubleInputTypes = ['time', 'decimal', 'tinyint', 'timestamp', 'datetime', 'date', 'int'];
475 return doubleInputTypes.includes(fieldType);
476 };
430 // 选中配置的业务规则 477 // 选中配置的业务规则
431 const selectedRulesData = ref(); 478 const selectedRulesData = ref();
479 const selectedRulesDataList = ref([]);
432 const tableCheckboxSelectChange = (select, row) => { 480 const tableCheckboxSelectChange = (select, row) => {
481 selectedRulesDataList.value = select;
433 // 遍历选中的数据,存入selectedRulesData 482 // 遍历选中的数据,存入selectedRulesData
434 let rulesName: any = []; 483 let rulesName: any = [];
435 let rulesGuid: any = []; 484 let rulesGuid: any = [];
...@@ -443,6 +492,7 @@ const tableCheckboxSelectChange = (select, row) => { ...@@ -443,6 +492,7 @@ const tableCheckboxSelectChange = (select, row) => {
443 }; 492 };
444 } 493 }
445 const tableCheckboxAllSelectChange = (select) => { 494 const tableCheckboxAllSelectChange = (select) => {
495 selectedRulesDataList.value = select;
446 // 遍历选中的数据,存入selectedRulesData 496 // 遍历选中的数据,存入selectedRulesData
447 let rulesName: any = []; 497 let rulesName: any = [];
448 let rulesGuid: any = []; 498 let rulesGuid: any = [];
...@@ -457,16 +507,51 @@ const tableCheckboxAllSelectChange = (select) => { ...@@ -457,16 +507,51 @@ const tableCheckboxAllSelectChange = (select) => {
457 } 507 }
458 508
459 // 批量配置业务规则 509 // 批量配置业务规则
510
460 const batchControlRules = () => { 511 const batchControlRules = () => {
461 console.log('selectedRulesData', selectedRulesData.value);
462 // 判断是否选中数据 512 // 判断是否选中数据
463 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) { 513 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) {
464 proxy.$ElMessage.warning('请选择数据'); 514 proxy.$ElMessage.warning('请选择数据');
465 return; 515 return;
466 } 516 }
517 // 标志变量,分别用于存储单文本框和双文本框的字段
518 let isSingleInputField = false;
519 let isDoubleInputField = false;
520 let isValid = true;
521 // 遍历 selectedRulesDataList,检查每个 fieldType 是否符合单文本框或双文本框
522 selectedRulesDataList.value.forEach((item: any) => {
523 if (isSingleInput(item.fieldType)) {
524 isSingleInputField = true; // 如果是单文本框,标记为单文本框
525 } else if (isDoubleInput(item.fieldType)) {
526 isDoubleInputField = true; // 如果是双文本框,标记为双文本框
527 } else {
528 // 如果不是单文本框也不是双文本框,标记为无效
529 isValid = false;
530 }
531 });
532 // 如果有无效的字段类型,则返回 false 并提示警告
533 if (!isValid) {
534 proxy.$ElMessage.warning('请选择单文本框或双文本框类型的字段');
535 return false;
536 }
467 537
468 drawerInfo.value.visible = true; 538 // 判断字段类型是否一致
539 if (isSingleInputField && isDoubleInputField) {
540 // 如果既有单文本框也有双文本框,提示错误
541 proxy.$ElMessage.warning('请选择相同类型的字段');
542 return false;
543 }
544
545 // 如果全都是单文本框或者全都是双文本框,则继续后续操作
546 if (isSingleInputField) {
547 classEditFormItems.value[5].visible = true;
548 classEditFormItems.value[6].visible = false;
549 } else if (isDoubleInputField) {
550 classEditFormItems.value[5].visible = false;
551 classEditFormItems.value[6].visible = true;
552 }
469 classEditFormItems.value[0].default = selectedRulesData.value.rulesName; 553 classEditFormItems.value[0].default = selectedRulesData.value.rulesName;
554 drawerInfo.value.visible = true;
470 } 555 }
471 556
472 // 数据库目录 557 // 数据库目录
...@@ -662,10 +747,13 @@ const selectLength = ref([ ...@@ -662,10 +747,13 @@ const selectLength = ref([
662 { label: '大于', value: '>', }, 747 { label: '大于', value: '>', },
663 { label: '小于', value: '<', }, 748 { label: '小于', value: '<', },
664 { label: '等于', value: '=', }, 749 { label: '等于', value: '=', },
750 { label: '大于等于', value: '>=', },
751 { label: '小于等于', value: '<=', },
752 { label: '介于', value: 'between', },
665 ] 753 ]
666 ) 754 )
667 755
668 const classEditFormItems = ref([{ 756 const classEditFormItems = ref<any>([{
669 label: '已选字段', 757 label: '已选字段',
670 type: 'input', 758 type: 'input',
671 maxlength: 50, 759 maxlength: 50,
...@@ -695,7 +783,37 @@ const classEditFormItems = ref([{ ...@@ -695,7 +783,37 @@ const classEditFormItems = ref([{
695 required: false, 783 required: false,
696 clearable: true, 784 clearable: true,
697 col: 'numberClass', 785 col: 'numberClass',
786 visable: true,
698 }, 787 },
788 // {
789 // label: '',
790 // type: 'input-group',
791 // placeholder: '请输入',
792 // field: 'orderNum1',
793 // default: '',
794 // children: [
795 // {
796 // type: 'input',
797 // placeholder: '请输入',
798 // field: 'startNumber',
799 // default: '',
800 // clearable: true,
801 // required: false,
802
803 // },
804 // {
805 // type: 'input',
806 // placeholder: '请输入',
807 // field: 'endNumber',
808 // default: '',
809 // clearable: true,
810 // required: false,
811 // },
812 // ],
813 // col: 'col2',
814 // clearable: true,
815 // visable: false,
816 // },
699 { 817 {
700 label: '精度', 818 label: '精度',
701 type: 'input', 819 type: 'input',
...@@ -723,6 +841,18 @@ const classEditFormItems = ref([{ ...@@ -723,6 +841,18 @@ const classEditFormItems = ref([{
723 }, 841 },
724 { 842 {
725 label: '字段取值范围', 843 label: '字段取值范围',
844 type: 'input',
845 maxlength: 20,
846 placeholder: '请输入',
847 field: 'fieldValueRange',
848 default: '',
849 clearable: true,
850 block: false,
851 disabled: false,
852 visable: true,
853 },
854 {
855 label: '字段取值范围',
726 type: 'input-group', 856 type: 'input-group',
727 placeholder: '请输入', 857 placeholder: '请输入',
728 field: 'fieldValueRange', 858 field: 'fieldValueRange',
...@@ -731,7 +861,7 @@ const classEditFormItems = ref([{ ...@@ -731,7 +861,7 @@ const classEditFormItems = ref([{
731 { 861 {
732 type: 'input', 862 type: 'input',
733 placeholder: '请输入', 863 placeholder: '请输入',
734 field: 'numberStart', 864 field: 'startValue',
735 default: '', 865 default: '',
736 clearable: true, 866 clearable: true,
737 required: true, 867 required: true,
...@@ -739,7 +869,7 @@ const classEditFormItems = ref([{ ...@@ -739,7 +869,7 @@ const classEditFormItems = ref([{
739 { 869 {
740 type: 'input', 870 type: 'input',
741 placeholder: '请输入', 871 placeholder: '请输入',
742 field: 'numberEnd', 872 field: 'endValue',
743 default: '', 873 default: '',
744 clearable: true, 874 clearable: true,
745 required: true, 875 required: true,
...@@ -747,10 +877,12 @@ const classEditFormItems = ref([{ ...@@ -747,10 +877,12 @@ const classEditFormItems = ref([{
747 ], 877 ],
748 col: 'col2', 878 col: 'col2',
749 clearable: true, 879 clearable: true,
880 visable: true,
750 }, 881 },
882 // 替换为下拉
751 { 883 {
752 label: '数据是否唯一', 884 label: '数据是否唯一',
753 type: "radio-group", 885 type: "select",
754 field: "isUnique", 886 field: "isUnique",
755 disabled: false, 887 disabled: false,
756 default: 'N', 888 default: 'N',
...@@ -758,10 +890,23 @@ const classEditFormItems = ref([{ ...@@ -758,10 +890,23 @@ const classEditFormItems = ref([{
758 { label: "是", value: "Y", disabled: false }, 890 { label: "是", value: "Y", disabled: false },
759 { label: "否", value: "N", disabled: false }, 891 { label: "否", value: "N", disabled: false },
760 ], 892 ],
893 clearable: true,
761 }, 894 },
895
896 // {
897 // label: '数据是否唯一',
898 // type: "radio-group",
899 // field: "isUnique",
900 // disabled: false,
901 // default: 'N',
902 // options: [
903 // { label: "是", value: "Y", disabled: false },
904 // { label: "否", value: "N", disabled: false },
905 // ],
906 // },
762 { 907 {
763 label: '是否必填', 908 label: '是否必填',
764 type: "radio-group", 909 type: "select",
765 field: "isNotNull", 910 field: "isNotNull",
766 disabled: false, 911 disabled: false,
767 default: 'N', 912 default: 'N',
...@@ -769,7 +914,21 @@ const classEditFormItems = ref([{ ...@@ -769,7 +914,21 @@ const classEditFormItems = ref([{
769 { label: "是", value: "Y", disabled: false }, 914 { label: "是", value: "Y", disabled: false },
770 { label: "否", value: "N", disabled: false }, 915 { label: "否", value: "N", disabled: false },
771 ], 916 ],
917 clearable: true,
772 } 918 }
919
920 // ,
921 // {
922 // label: '是否必填',
923 // type: "radio-group",
924 // field: "isNotNull",
925 // disabled: false,
926 // default: 'N',
927 // options: [
928 // { label: "是", value: "Y", disabled: false },
929 // { label: "否", value: "N", disabled: false },
930 // ],
931 // }
773 ]); 932 ]);
774 const classEditFormRules = ref({ 933 const classEditFormRules = ref({
775 // classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], 934 // classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
...@@ -813,7 +972,8 @@ const drawerBtnClick = async (btn, info) => { ...@@ -813,7 +972,8 @@ const drawerBtnClick = async (btn, info) => {
813 drawerInfo.value.visible = false; 972 drawerInfo.value.visible = false;
814 } else { 973 } else {
815 btn.loading = true; 974 btn.loading = true;
816 const { orderNumLength, orderNum, numberStart, numberEnd, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info; 975 console.log('drawerBtnClick', info);
976 const { orderNumLength, orderNum, fieldValueRange, startValue, endValue, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info;
817 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒 977 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
818 if (orderNumLength && !orderNum) { 978 if (orderNumLength && !orderNum) {
819 proxy.$ElMessage.error('请填写长度'); 979 proxy.$ElMessage.error('请填写长度');
...@@ -825,40 +985,40 @@ const drawerBtnClick = async (btn, info) => { ...@@ -825,40 +985,40 @@ const drawerBtnClick = async (btn, info) => {
825 btn.loading = false; 985 btn.loading = false;
826 return; 986 return;
827 } 987 }
828 let fieldLengthCondition = orderNumLength + '#' + orderNum; 988 let fieldLengthCondition: any = '';
829 let fieldValueRange: any = []; 989 if (!orderNumLength && !orderNum) {
830 // 字段取值范围也是要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒 990 fieldLengthCondition = '';
831 if (numberStart && !numberEnd) {
832 proxy.$ElMessage.error('请填写字段取值范围结束值');
833 btn.loading = false;
834 return;
835 }
836 if (!numberStart && numberEnd) {
837 proxy.$ElMessage.error('请填写字段取值范围开始值');
838 btn.loading = false;
839 return;
840 } 991 }
841 if (numberStart && numberEnd) { 992 if (orderNumLength && orderNum) {
842 if (Number(numberEnd) < Number(numberStart)) { 993 fieldLengthCondition = orderNumLength + '#' + orderNum;
843 proxy.$ElMessage.error('字段取值范围结束值不能小于开始值');
844 btn.loading = false;
845 return;
846 }
847 fieldValueRange = numberStart + '#' + numberEnd;
848 } 994 }
849 995
850 const params: any = []; 996 const params: any = [];
851 selectedRulesData.value.guids.forEach((item: any) => { 997 selectedRulesData.value.guids.forEach((item: any) => {
852 params.push({ 998 if (fieldValueRange) {
853 fieldPrecision, 999 params.push({
854 dictionaryGuid, 1000 fieldPrecision,
855 isUnique, 1001 dictionaryGuid,
856 isNotNull, 1002 isUnique,
857 fieldLengthCondition, 1003 isNotNull,
858 fieldValueRange, 1004 fieldLengthCondition,
859 fieldGuid: item, 1005 fieldValueRange,
860 execGuid: execGuidInfo.value.execGuid 1006 fieldGuid: item,
861 }) 1007 execGuid: execGuidInfo.value.execGuid
1008 })
1009 } else {
1010 params.push({
1011 fieldPrecision,
1012 dictionaryGuid,
1013 isUnique,
1014 isNotNull,
1015 fieldLengthCondition,
1016 fieldGuid: item,
1017 execGuid: execGuidInfo.value.execGuid,
1018 startValue,
1019 endValue
1020 })
1021 }
862 }); 1022 });
863 const res: any = await saveBizRuleConfig(params); 1023 const res: any = await saveBizRuleConfig(params);
864 if (res.code == proxy.$passCode) { 1024 if (res.code == proxy.$passCode) {
...@@ -882,27 +1042,34 @@ const drawerBtnClick = async (btn, info) => { ...@@ -882,27 +1042,34 @@ const drawerBtnClick = async (btn, info) => {
882 } 1042 }
883 } 1043 }
884 1044
885 const handleTreeItemMenuClick = (data: any, type) => { 1045 const drawerSelectChange = (val, row, info) => {
886 console.log('handleTreeItemMenuClick', data, type); 1046 console.log('drawerSelectChange', val, row, info);
1047 if (val === 'between') {
1048 classEditFormItems.value.forEach(item => {
1049 if (item.field === 'orderNum') {
1050 item.visable = false;
1051 }
1052 if (item.field === 'orderNum1') {
1053 item.visable = true;
1054 }
1055 });
1056 }
887 } 1057 }
888 1058
889
890
891 // tab切换 1059 // tab切换
892 const activeName = ref('first'); 1060 const activeName = ref('first');
893 const handleClick = async (tab: any) => { 1061 const handleClick = async (tab: any) => {
894 // 切换时选中的配置业务规则清空 1062 // 切换时选中的配置业务规则清空
895 selectedRulesData.value = {}; 1063 selectedRulesData.value = {};
896 console.log(tab.props.name);
897 activeName.value = tab.props.name; 1064 activeName.value = tab.props.name;
898 if (tab.props.name === 'second') { 1065 if (tab.props.name === 'second') {
899 classifyDetailGuidInfo.value = ''; 1066 classifyDetailGuidInfo.value = '';
900 if (activeTab.value === 'table') { 1067 // if (activeTab.value === 'table') {
901 searchItemList.value[0].visible = false; 1068 // searchItemList.value[0].visible = false;
902 searchItemList.value[1].visible = false; 1069 // searchItemList.value[1].visible = false;
903 searchItemList.value[0].default = ''; 1070 // searchItemList.value[0].default = '';
904 searchItemList.value[1].default = ''; 1071 // searchItemList.value[1].default = '';
905 } 1072 // }
906 selectedA.value = null; 1073 selectedA.value = null;
907 selectedB.value = null; 1074 selectedB.value = null;
908 selectedC.value = null; 1075 selectedC.value = null;
...@@ -910,9 +1077,11 @@ const handleClick = async (tab: any) => { ...@@ -910,9 +1077,11 @@ const handleClick = async (tab: any) => {
910 optionsB.value = []; 1077 optionsB.value = [];
911 optionsC.value = []; 1078 optionsC.value = [];
912 await getDataBaseTreeData(); 1079 await getDataBaseTreeData();
1080 await getDbDirTableSelectData(1, {});
913 await getDataBaseTableData(); 1081 await getDataBaseTableData();
914 await getDataBaseFieldData(); 1082 await getDataBaseFieldData();
915 getDbDirTableSelectData(1, {}); 1083 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1084
916 } else { 1085 } else {
917 searchItemList.value[0].visible = true; 1086 searchItemList.value[0].visible = true;
918 searchItemList.value[1].visible = true; 1087 searchItemList.value[1].visible = true;
...@@ -963,6 +1132,7 @@ const getDataBaseTreeData = async () => { ...@@ -963,6 +1132,7 @@ const getDataBaseTreeData = async () => {
963 dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid; 1132 dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid;
964 dataBaseGuid.value = dataArray[0].databaseGuid; 1133 dataBaseGuid.value = dataArray[0].databaseGuid;
965 currentDatabasePath.value = [dataArray[0].name]; 1134 currentDatabasePath.value = [dataArray[0].name];
1135 selectedA.value = dataArray[0].databaseGuid;
966 if (dataArray[0].dicType === 1) { 1136 if (dataArray[0].dicType === 1) {
967 isShowCreateBtn.value = true; 1137 isShowCreateBtn.value = true;
968 } 1138 }
...@@ -1130,7 +1300,6 @@ const onActiveInfo = ref<any>({}); ...@@ -1130,7 +1300,6 @@ const onActiveInfo = ref<any>({});
1130 1300
1131 const dataBasenodeClick = (data: any) => { 1301 const dataBasenodeClick = (data: any) => {
1132 isShowCreateBtn.value = false; 1302 isShowCreateBtn.value = false;
1133 console.log('dataBasenodeClick', data.databaseGuid, dataBaseTreeData.value);
1134 // 找到data.databaseGuid 在dataBaseTreeData.value 中的下标索引,普通数组遍历就行 1303 // 找到data.databaseGuid 在dataBaseTreeData.value 中的下标索引,普通数组遍历就行
1135 const dbindex = dataBaseTreeData.value.findIndex((item) => { 1304 const dbindex = dataBaseTreeData.value.findIndex((item) => {
1136 return item.guid === data.databaseGuid; 1305 return item.guid === data.databaseGuid;
...@@ -1144,8 +1313,6 @@ const dataBasenodeClick = (data: any) => { ...@@ -1144,8 +1313,6 @@ const dataBasenodeClick = (data: any) => {
1144 1313
1145 if (path) { 1314 if (path) {
1146 currentDatabasePath.value = path; 1315 currentDatabasePath.value = path;
1147 } else {
1148 console.error('未找到路径');
1149 } 1316 }
1150 if (data.databaseGuid) { 1317 if (data.databaseGuid) {
1151 dataBaseInfo.value = data; 1318 dataBaseInfo.value = data;
...@@ -1160,10 +1327,13 @@ const dataBasenodeClick = (data: any) => { ...@@ -1160,10 +1327,13 @@ const dataBasenodeClick = (data: any) => {
1160 getDataBaseFieldData({ 1327 getDataBaseFieldData({
1161 databaseGuid: data.databaseGuid, 1328 databaseGuid: data.databaseGuid,
1162 gradeDetailGuid: levelGuidInfo.value, 1329 gradeDetailGuid: levelGuidInfo.value,
1330 tableGuid: tableGuid.value || selectedB.value || '',
1331 fieldGuid: selectedC.value || '',
1163 }); 1332 });
1164 getDataBaseTableData({ 1333 getDataBaseTableData({
1165 databaseGuid: data.databaseGuid,
1166 gradeDetailGuid: levelGuidInfo.value, 1334 gradeDetailGuid: levelGuidInfo.value,
1335 databaseGuid: data.databaseGuid || selectedA.value || '',
1336 tableGuid: tableGuid.value || selectedB.value || '',
1167 }); 1337 });
1168 } 1338 }
1169 if (data.tableGuid) { 1339 if (data.tableGuid) {
...@@ -1171,19 +1341,26 @@ const dataBasenodeClick = (data: any) => { ...@@ -1171,19 +1341,26 @@ const dataBasenodeClick = (data: any) => {
1171 dataBaseGuid.value = ''; 1341 dataBaseGuid.value = '';
1172 getDataBaseFieldData({ 1342 getDataBaseFieldData({
1173 tableGuid: data.tableGuid, 1343 tableGuid: data.tableGuid,
1174 gradeDetailGuid: levelGuidInfo.value, 1344 gradeDetailGuid: levelGuidInfo.value || '',
1345 databaseGuid: data.databaseGuid || selectedA.value || '',
1346 fieldGuid: data.fieldGuid || selectedC.value || '',
1347 });
1348 getDataBaseTableData({
1349 gradeDetailGuid: levelGuidInfo.value || '',
1350 databaseGuid: data.databaseGuid || selectedA.value || '',
1351 tableGuid: tableGuid.value || selectedB.value || '',
1175 }); 1352 });
1176 1353
1177 } 1354 }
1178 1355
1179 if (data.databaseGuid || data.cgDirName) { 1356 // if (data.databaseGuid || data.cgDirName) {
1180 showTableOrDatabase.value = true; 1357 // showTableOrDatabase.value = true;
1181 return; 1358 // return;
1182 } 1359 // }
1183 if (data.tableGuid) { 1360 // if (data.tableGuid) {
1184 showTableOrDatabase.value = false; 1361 // showTableOrDatabase.value = false;
1185 return; 1362 // return;
1186 } 1363 // }
1187 1364
1188 } 1365 }
1189 1366
...@@ -1202,8 +1379,38 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = []) ...@@ -1202,8 +1379,38 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = [])
1202 return null; // 未找到目标节点 1379 return null; // 未找到目标节点
1203 }; 1380 };
1204 1381
1205 const nodeSelectChange = (data: any) => { 1382 const nodeSelectChange = (node, checked, checkedChildren) => {
1206 console.log('nodeSelectChange', data); 1383 console.log('nodeSelectChange', node, node.parent.data, checkedChildren);
1384 if (node.parent.data.databaseGuid) {
1385 selectedA.value = node.parent.data.databaseGuid;
1386 selectedB.value = '';
1387 if (activeName.value == 'second') {
1388 if (activeTab.value === 'word') {
1389 getDbDirFieldSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1390 } else {
1391 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1392 }
1393 }
1394 // 选中的是数据库
1395 }
1396 if (node.data.databaseGuid) {
1397 // 选中的是字段
1398 selectedA.value = node.data.databaseGuid;
1399 selectedB.value = '';
1400 if (activeName.value == 'second') {
1401 if (activeTab.value === 'word') {
1402 getDbDirFieldSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1403 } else {
1404 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1405 }
1406 }
1407 }
1408 if (node.data.tableGuid) {
1409 // 选中的是表
1410 selectedB.value = node.data.tableGuid || '';
1411 getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" });
1412 }
1413
1207 } 1414 }
1208 1415
1209 const handleSubjectTableCommand = (command: string) => { 1416 const handleSubjectTableCommand = (command: string) => {
...@@ -1258,27 +1465,16 @@ const activeTab = ref('table'); ...@@ -1258,27 +1465,16 @@ const activeTab = ref('table');
1258 const isShowWordSearch = ref(true); 1465 const isShowWordSearch = ref(true);
1259 const setActiveTab = (tab) => { 1466 const setActiveTab = (tab) => {
1260 activeTab.value = tab; 1467 activeTab.value = tab;
1261 if (tab === 'word' && activeName.value === 'second') { 1468 // if (tab === 'word' && activeName.value === 'second') {
1262 searchItemList.value[0].visible = true; 1469 // searchItemList.value[0].visible = true;
1263 searchItemList.value[1].visible = true; 1470 // searchItemList.value[1].visible = true;
1264 searchItemList.value[0].default = ''; 1471 // searchItemList.value[0].default = '';
1265 searchItemList.value[1].default = ''; 1472 // searchItemList.value[1].default = '';
1266 isShowWordSearch.value = false; 1473 // isShowWordSearch.value = false;
1267 optionsA.value = []; 1474 // optionsA.value = [];
1268 optionsB.value = []; 1475 // optionsB.value = [];
1269 optionsC.value = []; 1476 // optionsC.value = [];
1270 getDbDirFieldSelectData(1); 1477 // }
1271 } else {
1272 searchItemList.value[0].visible = false;
1273 searchItemList.value[1].visible = false;
1274 searchItemList.value[0].default = '';
1275 searchItemList.value[1].default = '';
1276 isShowWordSearch.value = true;
1277 optionsA.value = [];
1278 optionsB.value = [];
1279 optionsC.value = [];
1280 getDbDirTableSelectData(1, {});
1281 }
1282 }; 1478 };
1283 1479
1284 // 数据库字段搜索联动 getDbDirFieldSelectList 1480 // 数据库字段搜索联动 getDbDirFieldSelectList
...@@ -1359,7 +1555,6 @@ const getDbDirTableSelectData = async (type, params = {}) => { ...@@ -1359,7 +1555,6 @@ const getDbDirTableSelectData = async (type, params = {}) => {
1359 } 1555 }
1360 if (type == 2) { 1556 if (type == 2) {
1361 if (activeTab.value === 'word') { 1557 if (activeTab.value === 'word') {
1362 console.log('进来了吗', res.data);
1363 optionsC.value = res.data.map((item) => ({ 1558 optionsC.value = res.data.map((item) => ({
1364 dbGuid: item.fieldName, // 字段标识 1559 dbGuid: item.fieldName, // 字段标识
1365 name: item.fieldName, // 字段名称 1560 name: item.fieldName, // 字段名称
...@@ -1384,6 +1579,7 @@ const getDbDirTableSelectData = async (type, params = {}) => { ...@@ -1384,6 +1579,7 @@ const getDbDirTableSelectData = async (type, params = {}) => {
1384 }; 1579 };
1385 1580
1386 1581
1582
1387 const selectedA = ref<any>(null); 1583 const selectedA = ref<any>(null);
1388 const selectedB = ref<any>(null); 1584 const selectedB = ref<any>(null);
1389 const selectedC = ref<any>(null); 1585 const selectedC = ref<any>(null);
...@@ -1453,7 +1649,6 @@ const exportDB = async () => { ...@@ -1453,7 +1649,6 @@ const exportDB = async () => {
1453 const levelGuidInfo = ref(''); 1649 const levelGuidInfo = ref('');
1454 // 标签选择 1650 // 标签选择
1455 const selectChange = (val, row, info) => { 1651 const selectChange = (val, row, info) => {
1456
1457 if (info) { 1652 if (info) {
1458 levelGuidInfo.value = info.levelName; 1653 levelGuidInfo.value = info.levelName;
1459 } 1654 }
...@@ -1492,9 +1687,42 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1492,9 +1687,42 @@ const treeSelectNodeClick = (node, item) => {
1492 } else { 1687 } else {
1493 console.error('未找到路径'); 1688 console.error('未找到路径');
1494 } 1689 }
1495 console.log('treeSelectNodeClick', treeInfo.value.expandedKey); 1690 if (activeName.value === 'second' && activeTab.value === 'word') {
1691
1692 }
1496 } 1693 }
1497 1694
1695 watchEffect(() => {
1696 console.log(`count 的值是: ${selectedA.value}`);
1697 if (activeName.value === 'second') {
1698 dataBaseTreeInfo.value.expandedKey = [];
1699 dataBaseTreeInfo.value.expandedKey.push(selectedA.value);
1700 dataBaseTreeInfo.value.currentNodeKey = selectedA.value;
1701 if (selectedB.value) {
1702 dataBaseTreeInfo.value.currentNodeKey = selectedB.value;
1703 }
1704 }
1705 if (activeName.value === 'second' && activeTab.value === 'table') {
1706 searchItemList.value[0].visible = false;
1707 searchItemList.value[1].visible = false;
1708 searchItemList.value[0].default = '';
1709 searchItemList.value[1].default = '';
1710 }
1711 if (activeName.value === 'first') {
1712 searchItemList.value[0].visible = true;
1713 searchItemList.value[1].visible = true;
1714 searchItemList.value[0].default = '';
1715 searchItemList.value[1].default = '';
1716 }
1717 if (activeName.value === 'second' && activeTab.value === 'word') {
1718 searchItemList.value[0].visible = true;
1719 searchItemList.value[1].visible = true;
1720 searchItemList.value[0].default = '';
1721 searchItemList.value[1].default = '';
1722 }
1723 });
1724
1725
1498 </script> 1726 </script>
1499 1727
1500 <template> 1728 <template>
...@@ -1512,6 +1740,10 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1512,6 +1740,10 @@ const treeSelectNodeClick = (node, item) => {
1512 :clearable="true" v-if="!(activeTab === 'table' && activeName === 'second')"> 1740 :clearable="true" v-if="!(activeTab === 'table' && activeName === 'second')">
1513 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> 1741 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
1514 </el-select> 1742 </el-select>
1743 <!-- <el-select v-model="selectedD" placeholder="选择字段类型" style="width: 140px;margin-right: 8px" :clearable="true"
1744 v-if="activeName === 'first'">
1745 <el-option v-for="item in optionsD" :key="item.value" :label="item.label" :value="item.value" />
1746 </el-select> -->
1515 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" 1747 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch"
1516 @selectChange="selectChange" @treeSelectNodeClick="treeSelectNodeClick" /> 1748 @selectChange="selectChange" @treeSelectNodeClick="treeSelectNodeClick" />
1517 </div> 1749 </div>
...@@ -1594,8 +1826,8 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1594,8 +1826,8 @@ const treeSelectNodeClick = (node, item) => {
1594 </div> 1826 </div>
1595 </div> 1827 </div>
1596 1828
1597 1829 <!-- v-if="!tableGuid && activeTab === 'table'" -->
1598 <div class="btns-area" v-if="!tableGuid && activeTab === 'table'"> 1830 <div class="btns-area" v-if="activeName === 'second' && activeTab === 'table'">
1599 <div class="left-btns"> 1831 <div class="left-btns">
1600 <div class="dropdown_btn" v-if="isShowCreateBtn"> 1832 <div class="dropdown_btn" v-if="isShowCreateBtn">
1601 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand" 1833 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand"
...@@ -1636,16 +1868,16 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1636,16 +1868,16 @@ const treeSelectNodeClick = (node, item) => {
1636 </div> 1868 </div>
1637 </div> 1869 </div>
1638 <div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }" 1870 <div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }"
1639 v-if="!tableGuid && activeTab === 'table'"> 1871 v-if="activeTab === 'table'">
1640 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" 1872 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange"
1641 @tableSwitchBeforeChange="tableSwitchBeforeChange" /> 1873 @tableSwitchBeforeChange="tableSwitchBeforeChange" />
1642 </div> 1874 </div>
1643 <div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }" 1875 <div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }" v-if="activeTab === 'word'">
1644 v-if="tableGuid || activeTab === 'word'">
1645 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" /> 1876 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" />
1646 </div> 1877 </div>
1647 </div> 1878 </div>
1648 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer" /> 1879 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer"
1880 @drawerSelectChange="drawerSelectChange" />
1649 1881
1650 </div> 1882 </div>
1651 </div> 1883 </div>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 import { ref } from "vue"; 6 import { ref } from "vue";
7 import useUserStore from "@/store/modules/user"; 7 import useUserStore from "@/store/modules/user";
8 import { getBizRuleConfigDetail, getDictionaryAll, getNewDataTypeList, saveBizRuleConfig, } from '@/api/modules/dataInventory' 8 import { getBizRuleConfigDetail, getDictionaryAll, getNewDataTypeList, saveBizRuleConfig, } from '@/api/modules/dataInventory'
9 import { el, ro } from "element-plus/es/locale";
9 const { proxy } = getCurrentInstance() as any; 10 const { proxy } = getCurrentInstance() as any;
10 const router = useRouter(); 11 const router = useRouter();
11 const route = useRoute(); 12 const route = useRoute();
...@@ -167,13 +168,22 @@ const editRow = (row) => { ...@@ -167,13 +168,22 @@ const editRow = (row) => {
167 } 168 }
168 if (row.fieldLengthCondition) { 169 if (row.fieldLengthCondition) {
169 const arr = row.fieldLengthCondition.split('#') 170 const arr = row.fieldLengthCondition.split('#')
170 row.lengthSymbol = arr[0] 171 // 遍历找到arr中是否存在等于between
171 row.lengthValue = arr[1] 172 arr.forEach((item) => {
173 if (item === 'between') {
174 row.lengthSymbol = 'between'
175 row.numberRangeStart = arr[1]
176 row.numberRangeEnd = arr[2]
177 } else {
178 row.lengthSymbol = arr[0]
179 row.lengthValue = arr[1]
180 }
181 })
172 } 182 }
173 if (row.fieldValueRange) { 183 if (row.fieldValueRange && !isSingleInput(row.fieldType)) {
174 const arr = row.fieldValueRange.split('#') 184 const arr = row.fieldValueRange.split('#')
175 row.rangeStart = arr[0] 185 row.startValue = arr[0]
176 row.rangeEnd = arr[1] 186 row.endValue = arr[1]
177 } 187 }
178 row.isEdit = true; // 进入编辑模式 188 row.isEdit = true; // 进入编辑模式
179 189
...@@ -181,40 +191,43 @@ const editRow = (row) => { ...@@ -181,40 +191,43 @@ const editRow = (row) => {
181 191
182 // 保存数据 192 // 保存数据
183 const saveRow = (row) => { 193 const saveRow = (row) => {
184 if (row.lengthSymbol && row.lengthValue) { 194 if (row.lengthSymbol === 'between') {
185 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue 195 // 校验不能为空,其中一个为空则提示
186 } 196 if (!row.numberRangeStart || !row.numberRangeStart) {
187 if (row.lengthSymbol && !row.lengthValue) { 197 proxy.$message.error('请输入完整的长度范围');
188 proxy.$ElMessage.error('请填写字段长度值'); 198 return;
189 return 199 }
190 } 200 if (row.numberRangeStart && !row.numberRangeStart) {
191 if (!row.lengthSymbol && row.lengthValue) { 201 proxy.$ElMessage.error('请输入完整的长度范围');
192 proxy.$ElMessage.error('请选择字段长度符号'); 202 return
193 return 203 }
204 if (!row.numberRangeStart && row.numberRangeStart) {
205 proxy.$ElMessage.error('请输入完整的长度范围');
206 return
207 }
208 row.fieldLengthCondition = row.lengthSymbol + '#' + row.numberRangeStart + '#' + row.numberRangeEnd
209 } else {
210 if (!row.lengthValue && row.lengthSymbol) {
211 proxy.$message.error('请输入完整的长度范围');
212 return;
213 }
214 if (!row.lengthSymbol && row.lengthValue) {
215 proxy.$message.error('请输入完整的长度范围');
216 return;
217 }
194 } 218 }
219
195 if (!row.lengthSymbol && !row.lengthValue) { 220 if (!row.lengthSymbol && !row.lengthValue) {
196 row.fieldLengthCondition = '' 221 row.fieldLengthCondition = ''
197 } 222 }
198 if (row.rangeStart && row.rangeEnd) { 223 if (row.lengthSymbol && row.lengthValue) {
199 row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd 224 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
200 }
201 if (row.rangeStart && !row.rangeEnd) {
202 proxy.$ElMessage.error('请填写字段取值范围结束值');
203 return
204 }
205 if (!row.rangeStart && row.rangeEnd) {
206 proxy.$ElMessage.error('请填写字段取值范围开始值');
207 return
208 }
209 if (!row.rangeStart && !row.rangeEnd) {
210 row.fieldValueRange = ''
211 }
212 if (row.rangeStart > row.rangeEnd) {
213 proxy.$ElMessage.error('字段取值范围开始值不能大于结束值');
214 return
215 } 225 }
226 // 字段范围 双文本情况
216 227
217 228 if (!isSingleInput(row.fieldType)) {
229 row.fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '')
230 }
218 row.isEdit = false 231 row.isEdit = false
219 } 232 }
220 const data = [ 233 const data = [
...@@ -291,32 +304,58 @@ const data = [ ...@@ -291,32 +304,58 @@ const data = [
291 const loading = ref(false) 304 const loading = ref(false)
292 const saveData = async () => { 305 const saveData = async () => {
293 loading.value = true 306 loading.value = true
294 /**入参 307 let inParams = [] as any
295 * "guid": "string",
296 "fieldGuid": "string",
297 "fieldLengthCondition": "string",
298 "fieldPrecision": 0,
299 "dictionaryGuid": "string",
300 "isUnique": "string",
301 "isNotNull": "string",
302 "fieldValueRange": "string"
303 */
304 const inParams = [] as any
305 tableData.value.forEach((item: any) => { 308 tableData.value.forEach((item: any) => {
306 const obj = { 309 if (item.startValue || item.endValue) {
307 fieldGuid: item.fieldGuid, 310 inParams.push(
308 execGuid: router.currentRoute.value.query.execGuid, 311 {
309 fieldLengthCondition: item.fieldLengthCondition, 312 fieldGuid: item.fieldGuid,
310 fieldPrecision: item.fieldPrecision, 313 execGuid: router.currentRoute.value.query.execGuid,
311 dictionaryGuid: item.dictionaryGuid, 314 fieldLengthCondition: item.fieldLengthCondition,
312 isUnique: item.isUnique, 315 fieldPrecision: item.fieldPrecision,
313 notNull: item.notNull, 316 dictionaryGuid: item.dictionaryGuid,
314 fieldValueRange: item.fieldValueRange 317 isUnique: item.isUnique,
318 notNull: item.notNull,
319 startValue: item.startValue,
320 endValue: item.endValue
321 }
322 )
323 } else {
324 inParams.push(
325 {
326 fieldGuid: item.fieldGuid,
327 execGuid: router.currentRoute.value.query.execGuid,
328 fieldLengthCondition: item.fieldLengthCondition,
329 fieldPrecision: item.fieldPrecision,
330 dictionaryGuid: item.dictionaryGuid,
331 isUnique: item.isUnique,
332 notNull: item.notNull,
333 fieldValueRange: item.fieldValueRange
334 }
335 )
315 } 336 }
316 inParams.push(obj)
317 }) 337 })
338 // 克隆一份 inParams,用于遍历
339 const cloneInParams = JSON.parse(JSON.stringify(inParams));
340
341 // 遍历 cloneInParams,检查每一项的字段
342 let allFieldsEmpty = true; // 标记所有字段是否都为空
343 for (let i = 0; i < cloneInParams.length; i++) {
344 // 判断每项中除 fieldGuid 和 execGuid 外的字段是否都为空
345 const item = cloneInParams[i];
346 const isEmpty = !item.notNull && !item.fieldValueRange && !item.isUnique && !item.dictionaryGuid && !item.fieldLengthCondition && !item.fieldPrecision;
347
348 // 如果有有效的字段,则不清空 inParams
349 if (!isEmpty) {
350 allFieldsEmpty = false;
351 break;
352 }
353 }
354 // 如果所有项的字段都为空,则清空 inParams
355 if (allFieldsEmpty) {
356 inParams = [];
357 }
318 358
319 // console.log('finalParams', inParams)
320 const res: any = await saveBizRuleConfig(inParams) 359 const res: any = await saveBizRuleConfig(inParams)
321 if (res.code === proxy.$passCode) { 360 if (res.code === proxy.$passCode) {
322 loading.value = false 361 loading.value = false
...@@ -353,6 +392,27 @@ const cancelEdit = (row) => { ...@@ -353,6 +392,27 @@ const cancelEdit = (row) => {
353 row.isEdit = false; // 退出编辑状态 392 row.isEdit = false; // 退出编辑状态
354 } 393 }
355 394
395 // 判断是否为单文本框
396 const isSingleInput = (fieldType: string) => {
397 // 定义单文本框的字段类型
398 const singleInputTypes = ['string', 'text', 'varchar', 'json', 'bit', 'char'];
399 return singleInputTypes.includes(fieldType) || !fieldType; // 如果fieldType为空,默认为单文本框
400 };
401
402 // 验证是否为大于0的整数
403 const validatePositiveInteger = (row: any, field: string) => {
404 const value = row[field];
405
406 // 将输入值转为整数并检查是否大于0
407 if (value && !/^\d+$/.test(value)) {
408 // 如果不是整数或是负数,将值清空或者给出提示
409 row[field] = '';
410 } else if (value && parseInt(value) <= 0) {
411 // 如果小于或等于0,也清空值
412 row[field] = '';
413 }
414 };
415
356 </script> 416 </script>
357 <template> 417 <template>
358 <div class="configure-rules"> 418 <div class="configure-rules">
...@@ -421,23 +481,43 @@ const cancelEdit = (row) => { ...@@ -421,23 +481,43 @@ const cancelEdit = (row) => {
421 </el-table-column> 481 </el-table-column>
422 482
423 <!-- 长度列 fieldLengthCondition: '>#10',--> 483 <!-- 长度列 fieldLengthCondition: '>#10',-->
424 <el-table-column prop="fieldLengthCondition" label="长度" width="240" align="center"> 484 <el-table-column prop="fieldLengthCondition" label="长度" width="340" align="center">
425 <template #default="scope"> 485 <template #default="scope">
426 <span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition 486 <span v-if="!scope.row.isEdit">
427 ? scope.row.fieldLengthCondition.replace('#', '') : '--' }}</span> 487 {{ scope.row.fieldLengthCondition ? scope.row.fieldLengthCondition : '--' }}
488 </span>
428 <div v-else> 489 <div v-else>
429 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;" 490 <div style="display: flex; align-items: center;">
430 clearable> 491 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;"
431 <el-option label="大于" value=">"></el-option> 492 clearable>
432 <el-option label="等于" value="="></el-option> 493 <el-option label="大于" value=">"></el-option>
433 <el-option label="小于" value="<"></el-option> 494 <el-option label="等于" value="="></el-option>
434 <el-option label="大于等于" value=">="></el-option> 495 <el-option label="小于" value="<"></el-option>
435 <el-option label="小于等于" value="<="></el-option> 496 <el-option label="大于等于" value=">="></el-option>
436 </el-select> 497 <el-option label="小于等于" value="<="></el-option>
437 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" clearable /> 498 <!-- 介于 -->
499 <el-option label="介于" value="between"></el-option>
500 </el-select>
501
502 <!-- 当选择"介于"时,显示两个输入框 -->
503 <div v-if="scope.row.lengthSymbol === 'between'" style="display: flex; gap: 5px; align-items: center;">
504 <el-input v-model="scope.row.numberRangeStart" placeholder="请输入" style="width: 45%;" type="number"
505 clearable @input="validatePositiveInteger(scope.row, 'rangeStart')" />
506 <span>-</span>
507 <el-input v-model="scope.row.numberRangeEnd" placeholder="请输入" style="width: 45%;" type="number"
508 clearable @input="validatePositiveInteger(scope.row, 'rangeEnd')" />
509 </div>
510
511 <!-- 其他符号时显示一个输入框 -->
512 <div v-else>
513 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 90%;" clearable
514 @input="validatePositiveInteger(scope.row, 'lengthValue')" type="number" />
515 </div>
516 </div>
438 </div> 517 </div>
439 </template> 518 </template>
440 </el-table-column> 519 </el-table-column>
520
441 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 521 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
442 <template #default="scope"> 522 <template #default="scope">
443 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ 523 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{
...@@ -490,11 +570,19 @@ const cancelEdit = (row) => { ...@@ -490,11 +570,19 @@ const cancelEdit = (row) => {
490 {{ scope.row.fieldValueRange 570 {{ scope.row.fieldValueRange
491 ? scope.row.fieldValueRange.replace('#', '-') : '--' }} 571 ? scope.row.fieldValueRange.replace('#', '-') : '--' }}
492 </span> 572 </span>
493 <!-- 编辑模式,显示两个输入框 --> 573 <!-- 编辑模式,显示不同的输入框 -->
494 <div v-else style="display: flex; gap: 5px; align-items: center;"> 574 <div v-else style="display: flex; gap: 5px; align-items: center;">
495 <el-input v-model="scope.row.rangeStart" placeholder="最小值" style="width: 45%;" type="number" clearable /> 575 <!-- 判断字段类型并渲染对应的输入框 -->
496 <span>-</span> 576 <template v-if="isSingleInput(scope.row.fieldType)">
497 <el-input v-model="scope.row.rangeEnd" placeholder="最大值" style="width: 45%;" type="number" clearable /> 577 <!-- 单文本框:字符型、大字段型、单字符型、JSON类型、布尔类型 -->
578 <el-input v-model="scope.row.fieldValueRange" placeholder="请输入" clearable />
579 </template>
580 <template v-else>
581 <!-- 双文本框:整型、日期型、日期时间型、时间戳、浮点型、一字节整型、时间类型 -->
582 <el-input v-model="scope.row.startValue" placeholder="请输入开始值" style="width: 45%;" clearable />
583 <span>-</span>
584 <el-input v-model="scope.row.endValue" placeholder="请输入结束值" style="width: 45%;" clearable />
585 </template>
498 </div> 586 </div>
499 </template> 587 </template>
500 </el-table-column> 588 </el-table-column>
......
...@@ -146,7 +146,7 @@ const orginItems = [ ...@@ -146,7 +146,7 @@ const orginItems = [
146 { 146 {
147 label: '字典中文名', 147 label: '字典中文名',
148 type: 'input', 148 type: 'input',
149 maxlength: 50, 149 maxlength: 20,
150 placeholder: '请输入', 150 placeholder: '请输入',
151 field: 'chName', 151 field: 'chName',
152 clearable: true, 152 clearable: true,
...@@ -155,7 +155,7 @@ const orginItems = [ ...@@ -155,7 +155,7 @@ const orginItems = [
155 }, { 155 }, {
156 label: '字典英文名', 156 label: '字典英文名',
157 type: 'input', 157 type: 'input',
158 maxlength: 50, 158 maxlength: 20,
159 placeholder: '请输入', 159 placeholder: '请输入',
160 field: 'enName', 160 field: 'enName',
161 clearable: true, 161 clearable: true,
......
...@@ -7,7 +7,7 @@ import Moment from 'moment'; ...@@ -7,7 +7,7 @@ import Moment from 'moment';
7 import { 7 import {
8 getDsTableByDs, 8 getDsTableByDs,
9 getDsData, 9 getDsData,
10 getDsTableStructure, 10 getDsTableStructures,
11 } from "@/api/modules/dataInventory"; 11 } from "@/api/modules/dataInventory";
12 12
13 13
...@@ -199,14 +199,14 @@ const getTableStructure = () => { ...@@ -199,14 +199,14 @@ const getTableStructure = () => {
199 console.log('tableName'); 199 console.log('tableName');
200 currDsTableStructureLoading.value = true; 200 currDsTableStructureLoading.value = true;
201 currDsTableStructure.value = []; 201 currDsTableStructure.value = [];
202 getDsTableStructure({ 202 getDsTableStructures([{
203 // tableName: tableName, 203 // tableName: tableName,
204 // dataSourceGuid: databaseInfo.value.guid, 204 // dataSourceGuid: databaseInfo.value.guid,
205 // database: databaseInfo.value.databaseNameEn, 205 // database: databaseInfo.value.databaseNameEn,
206 // databaseType: databaseInfo.value.databaseType, 206 // databaseType: databaseInfo.value.databaseType,
207 tableGuid: currDatasourceSelect.value.tableGuid, 207 tableGuid: currDatasourceSelect.value.tableGuid,
208 execGuid: props.execGuid 208 execGuid: props.execGuid
209 }).then((res: any) => { 209 }]).then((res: any) => {
210 currDsTableStructureLoading.value = false; 210 currDsTableStructureLoading.value = false;
211 if (res.code == proxy.$passCode) { 211 if (res.code == proxy.$passCode) {
212 currDsTableStructure.value = res.data || []; 212 currDsTableStructure.value = res.data || [];
...@@ -438,6 +438,21 @@ const getTextAlign = (field) => { ...@@ -438,6 +438,21 @@ const getTextAlign = (field) => {
438 <el-table-column prop="fieldName" label="字段英文名" width="150px" align="left" header-align="left" 438 <el-table-column prop="fieldName" label="字段英文名" width="150px" align="left" header-align="left"
439 show-overflow-tooltip> 439 show-overflow-tooltip>
440 </el-table-column> 440 </el-table-column>
441 <!-- 分类 -->
442 <el-table-column prop="classifyDetailNameRoutes" label="分类" width="150px" align="left" header-align="left"
443 show-overflow-tooltip>
444 <template #default="scope">
445 {{ scope.row['classifyDetailNameRoutes'] ? scope.row['classifyDetailNameRoutes'].join('/') : '--' }}
446 </template>
447 </el-table-column>
448 <el-table-column prop="gradeDetailName" label="分级" width="80px" align="left" header-align="left"
449 show-overflow-tooltip>
450 <template #default="scope">
451 <span>{{ scope.row['gradeDetailName'] ?? '--' }}</span>
452 </template>
453 </el-table-column>
454
455
441 <el-table-column prop="fieldChName" label="字段名" width="150px" align="left" header-align="left" 456 <el-table-column prop="fieldChName" label="字段名" width="150px" align="left" header-align="left"
442 show-overflow-tooltip> 457 show-overflow-tooltip>
443 <template #default="scope"> 458 <template #default="scope">
...@@ -472,9 +487,9 @@ const getTextAlign = (field) => { ...@@ -472,9 +487,9 @@ const getTextAlign = (field) => {
472 <span>{{ scope.row['isPrimary'] ?? '--' }}</span> 487 <span>{{ scope.row['isPrimary'] ?? '--' }}</span>
473 </template> 488 </template>
474 </el-table-column> 489 </el-table-column>
475 <el-table-column prop="isNotNull" label="是否必填" width="100px" align="left" header-align="left" 490 <el-table-column prop="notNull" label="是否必填" width="100px" align="left" header-align="left"
476 show-overflow-tooltip> 491 show-overflow-tooltip>
477 <template #default="scope">{{ scope.row['isNotNull'] === 'Y' ? 'N' : 'Y' }}</template> 492 <template #default="scope">{{ scope.row['notNull'] ?? '--' }}</template>
478 </el-table-column> 493 </el-table-column>
479 <el-table-column prop="isFk" label="是否外键" width="100px" align="left" header-align="left" 494 <el-table-column prop="isFk" label="是否外键" width="100px" align="left" header-align="left"
480 show-overflow-tooltip> 495 show-overflow-tooltip>
......
...@@ -1459,7 +1459,7 @@ const saveTable = async () => { ...@@ -1459,7 +1459,7 @@ const saveTable = async () => {
1459 gradeDetailName: item.gradeDetailName, 1459 gradeDetailName: item.gradeDetailName,
1460 guid: item.guid, 1460 guid: item.guid,
1461 isFk: item.isFk, 1461 isFk: item.isFk,
1462 notNull: item.isNotNull, 1462 notNull: item.notNull,
1463 isPrimary: item.isPrimary, 1463 isPrimary: item.isPrimary,
1464 sortValue: item.sortValue, 1464 sortValue: item.sortValue,
1465 tableChName: addInfo.chName, 1465 tableChName: addInfo.chName,
...@@ -1584,7 +1584,7 @@ const saveDraftTable = async () => { ...@@ -1584,7 +1584,7 @@ const saveDraftTable = async () => {
1584 gradeDetailName: item.gradeDetailName, 1584 gradeDetailName: item.gradeDetailName,
1585 guid: item.guid, 1585 guid: item.guid,
1586 isFk: item.isFk, 1586 isFk: item.isFk,
1587 isNotNull: item.isNotNull, 1587 isNotNull: item.notNull,
1588 isPrimary: item.isPrimary, 1588 isPrimary: item.isPrimary,
1589 sortValue: item.sortValue, 1589 sortValue: item.sortValue,
1590 tableChName: addInfo.chName, 1590 tableChName: addInfo.chName,
......
...@@ -16,6 +16,9 @@ import TableTools from "@/components/Tools/table_tools.vue"; ...@@ -16,6 +16,9 @@ import TableTools from "@/components/Tools/table_tools.vue";
16 import Table from "@/components/Table/index.vue"; 16 import Table from "@/components/Table/index.vue";
17 import Dialog from "@/components/Dialog/index.vue"; 17 import Dialog from "@/components/Dialog/index.vue";
18 import { getDamTypesList } from "@/api/modules/dataAsset"; 18 import { getDamTypesList } from "@/api/modules/dataAsset";
19 import {
20 changeNum,
21 } from "@/utils/common";
19 22
20 const { proxy } = getCurrentInstance() as any; 23 const { proxy } = getCurrentInstance() as any;
21 const router = useRouter(); 24 const router = useRouter();
...@@ -226,6 +229,17 @@ const toPatn = (type) => { ...@@ -226,6 +229,17 @@ const toPatn = (type) => {
226 }); 229 });
227 } 230 }
228 } 231 }
232 const toPatn1 = (type, type1) => {
233 if (type == 'add') {
234 router.push({
235 name: "productListingDetail",
236 query: {
237 type,
238 type1
239 },
240 });
241 }
242 }
229 243
230 const tablePageChange = (info) => { 244 const tablePageChange = (info) => {
231 page.value.curr = Number(info.curr); 245 page.value.curr = Number(info.curr);
...@@ -298,6 +312,16 @@ onBeforeMount(() => { ...@@ -298,6 +312,16 @@ onBeforeMount(() => {
298 }) 312 })
299 }) 313 })
300 314
315 const defaultItemLogo = new URL('@/assets/images/home-finance-product.png', import.meta.url).href
316 const demandListData: any = ref([
317 { companyName: '北数所', listedNum: 16, processNum: 1235 },
318 { companyName: '深数所', listedNum: 16, processNum: 1235 },
319 { companyName: '苏数所', listedNum: 16, processNum: 1235 },
320 ]);
321 const btnClick = (btn) => {
322 }
323
324
301 </script> 325 </script>
302 326
303 <template> 327 <template>
...@@ -306,6 +330,32 @@ onBeforeMount(() => { ...@@ -306,6 +330,32 @@ onBeforeMount(() => {
306 <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" /> 330 <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" />
307 <div class="tools_btns"> 331 <div class="tools_btns">
308 <el-button type="primary" @click="toPatn('add')" v-preReClick>新建</el-button> 332 <el-button type="primary" @click="toPatn('add')" v-preReClick>新建</el-button>
333 <el-button type="primary" @click="toPatn1('add', 'add1')" v-preReClick>新建</el-button>
334 </div>
335 </div>
336 <div class="list-content">
337 <div class="card-content" v-for="item in demandListData" :key="item.guid">
338 <div class="header">
339 <img class="left-img" :src="(item.picUrl && typeof item.picUrl == 'string') ? item.picUrl : defaultItemLogo"
340 alt="" />
341 <div class="right-main">
342 <div class="title">{{ item.companyName ?? '--' }}</div>
343 <div class="count-group">
344 <div class="count-item">
345 <div class="item-label">已上架产品数</div>
346 <div class="item-num">{{ changeNum(item.listedNum) }}</div>
347 </div>
348 <div class="count-item">
349 <div class="item-label">审批中产品数</div>
350 <div class="item-num">{{ changeNum(item.processNum) }}</div>
351 </div>
352 </div>
353 </div>
354 </div>
355 <div class="operator-btn">
356 <div class="left-btn borderRight" @click="btnClick(item)">更新模板</div>
357 <div class="left-btn" @click="btnClick(item)">资产登记</div>
358 </div>
309 </div> 359 </div>
310 </div> 360 </div>
311 <div class="table_panel_wrap"> 361 <div class="table_panel_wrap">
...@@ -328,7 +378,87 @@ onBeforeMount(() => { ...@@ -328,7 +378,87 @@ onBeforeMount(() => {
328 378
329 .table_panel_wrap { 379 .table_panel_wrap {
330 width: 100%; 380 width: 100%;
331 height: calc(100% - 84px); 381 height: calc(100% - 270px);
332 padding: 0px 8px 0; 382 padding: 0px 8px 0;
333 } 383 }
384
385 .list-content {
386 display: flex;
387 justify-content: space-between;
388 flex-wrap: wrap;
389 margin-bottom: 8px;
390 padding: 0 8px;
391
392 .card-content {
393 width: calc(33.33% - 10px);
394 padding: 16px;
395 box-shadow: 0 0 0 1px #d9d9d9;
396
397 .header {
398 display: flex;
399 margin-bottom: 16px;
400
401 img {
402 width: 80px;
403 margin-right: 16px;
404 }
405
406 .title {
407 font-size: 16px;
408 color: #212121;
409 font-weight: 600;
410 margin-bottom: 8px;
411 }
412
413 .right-main {
414 width: calc(100% - 96px);
415 display: flex;
416 flex-direction: column;
417 justify-content: space-between;
418
419 .count-group {
420 display: flex;
421 justify-content: space-between;
422
423 .item-num {
424 font-size: 20px;
425 font-weight: 600;
426 color: #212121;
427 margin-top: 8px;
428 }
429 }
430 }
431 }
432
433 .operator-btn {
434 display: flex;
435 justify-content: space-between;
436 align-items: center;
437 box-shadow: 0 0 0 1px #d9d9d9;
438 position: relative;
439
440 &::after {
441 content: '';
442 width: 0;
443 height: 100%;
444 border-left: 1px solid #d9d9d9;
445 position: absolute;
446 left: 50%;
447 transform: translateX(-50%);
448 }
449
450 >.left-btn {
451 width: 50%;
452 height: 40px;
453 line-height: 40px;
454 text-align: center;
455 cursor: pointer;
456
457 &:hover {
458 color: #4fa1a4;
459 }
460 }
461 }
462 }
463 }
334 </style> 464 </style>
......
...@@ -167,6 +167,17 @@ const formInfo = ref({ ...@@ -167,6 +167,17 @@ const formInfo = ref({
167 required: true, 167 required: true,
168 }, 168 },
169 { 169 {
170 label: '证书编号',
171 type: 'input',
172 maxlength: 50,
173 placeholder: '请输入',
174 field: 'damCode',
175 default: '',
176 disabled: true,
177 required: true,
178 visible: true
179 },
180 {
170 label: "数据时间范围", 181 label: "数据时间范围",
171 type: "date-picker", 182 type: "date-picker",
172 field: "dateRange", 183 field: "dateRange",
...@@ -194,16 +205,7 @@ const formInfo = ref({ ...@@ -194,16 +205,7 @@ const formInfo = ref({
194 // default: '', 205 // default: '',
195 // required: true 206 // required: true
196 // }, 207 // },
197 // { 208
198 // label: '证书编号',
199 // type: 'input',
200 // maxlength: 50,
201 // placeholder: '请输入',
202 // field: 'damCode',
203 // default: '',
204 // disabled: true,
205 // required: true,
206 // },
207 { 209 {
208 label: '数据规模(条)', 210 label: '数据规模(条)',
209 type: 'input', 211 type: 'input',
...@@ -360,25 +362,26 @@ const formInfo = ref({ ...@@ -360,25 +362,26 @@ const formInfo = ref({
360 // clearable: false, 362 // clearable: false,
361 // required: true, 363 // required: true,
362 // }, 364 // },
363 // { 365 {
364 // label: "上架交易所", 366 label: "上架交易所",
365 // type: "select", 367 type: "select",
366 // placeholder: "请选择", 368 placeholder: "请选择",
367 // field: "exchangeGuids", 369 field: "exchangeGuids",
368 // default: [], 370 default: [],
369 // options: exchangeList.value, 371 options: exchangeList.value,
370 // props: { 372 props: {
371 // value: "guid", 373 value: "guid",
372 // label: "tenantName", 374 label: "tenantName",
373 // }, 375 },
374 // filterable: true, 376 filterable: true,
375 // clearable: true, 377 clearable: true,
376 // multiple: true, 378 multiple: true,
377 // tagsTooltip: true, 379 tagsTooltip: true,
378 // collapse: true, 380 collapse: true,
379 // disabled: false, 381 disabled: false,
380 // required: true, 382 required: true,
381 // }, 383 visible: true
384 },
382 { 385 {
383 label: '产品描述', 386 label: '产品描述',
384 type: 'textarea-rich', 387 type: 'textarea-rich',
...@@ -411,9 +414,125 @@ const formInfo = ref({ ...@@ -411,9 +414,125 @@ const formInfo = ref({
411 field: 'productImg', 414 field: 'productImg',
412 default: [], 415 default: [],
413 limit: 1, 416 limit: 1,
414 block: true, 417 block: false,
415 required: false, 418 required: false,
416 }, { 419 },
420 {
421 label: '登记证',
422 tip: '支持扩展名:.jpg .png .jpeg',
423 accept: '.jpg, .png, .jpeg ',
424 type: 'upload-file',
425 placeholder: '请选择',
426 field: 'registerImg',
427 default: [],
428 limit: 1,
429 block: false,
430 required: false,
431 visible: true
432 },
433 {
434 label: '质量评估报告',
435 tip: '支持扩展名:.png .pdf',
436 accept: '.png, .pdf',
437 type: 'upload-file',
438 placeholder: '请选择',
439 field: 'qualityReport',
440 default: [],
441 limit: 1,
442 block: false,
443 required: false,
444 visible: true
445 },
446 {
447 label: "质量评估机构",
448 type: "select",
449 placeholder: "请选择",
450 field: "qualityOrg",
451 default: '',
452 options: [],
453 props: {
454 value: 'value',
455 label: 'label'
456 },
457 filterable: true,
458 clearable: true,
459 disabled: false,
460 required: true,
461 visible: true
462 },
463 {
464 label: '价值评估报告',
465 tip: '支持扩展名:.png .pdf',
466 accept: '.png, .pdf',
467 type: 'upload-file',
468 placeholder: '请选择',
469 field: 'valueReport',
470 default: [],
471 limit: 1,
472 block: false,
473 required: false,
474 visible: true
475 },
476 {
477 label: "价值评估机构",
478 type: "select",
479 placeholder: "请选择",
480 field: "valueOrg",
481 default: '',
482 options: [],
483 props: {
484 value: 'value',
485 label: 'label'
486 },
487 filterable: true,
488 clearable: true,
489 disabled: false,
490 required: true,
491 visible: true
492 },
493 {
494 label: '承诺函',
495 tip: '支持扩展名:.png .pdf',
496 accept: '.png, .pdf',
497 type: 'upload-file',
498 placeholder: '请选择',
499 field: 'commitment',
500 templateUrl: 'http://www.baidu.com',
501 default: [],
502 limit: 1,
503 block: true,
504 required: true,
505 visible: true
506 },
507 {
508 label: '授权文件',
509 tip: '支持扩展名:.png .pdf',
510 accept: '.png, .pdf',
511 type: 'upload-file',
512 placeholder: '请选择',
513 field: 'authorization',
514 templateUrl: 'http://www.baidu.com',
515 default: [],
516 limit: 1,
517 block: true,
518 required: true,
519 visible: true
520 },
521 {
522 label: '商品详细介绍(签章版)',
523 tip: '支持扩展名:.png .pdf',
524 accept: '.png, .pdf',
525 type: 'upload-file',
526 placeholder: '请选择',
527 field: 'productDetail',
528 templateUrl: 'http://www.baidu.com',
529 default: [],
530 limit: 1,
531 block: true,
532 required: true,
533 visible: true
534 },
535 {
417 label: "", 536 label: "",
418 type: "input", 537 type: "input",
419 placeholder: "请输入", 538 placeholder: "请输入",
...@@ -996,6 +1115,14 @@ onActivated(() => { ...@@ -996,6 +1115,14 @@ onActivated(() => {
996 }; 1115 };
997 }) 1116 })
998 onBeforeMount(() => { 1117 onBeforeMount(() => {
1118 if (route.query.type == 'add' && !route.query.type1) {
1119 formInfo.value.items.forEach(item => {
1120 if (item.field == 'damCode' || item.field == 'exchangeGuids' || item.field == 'registerImg' || item.field == 'qualityReport' || item.field == 'qualityOrg' || item.field == 'valueReport' || item.field == 'valueOrg' || item.field == 'commitment' || item.field == 'authorization' || item.field == 'productDetail') {
1121 item.visible = false;
1122 }
1123 })
1124 }
1125
999 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => { 1126 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
1000 if (res?.code == proxy.$passCode) { 1127 if (res?.code == proxy.$passCode) {
1001 parentAreaData.value = res.data ?? []; 1128 parentAreaData.value = res.data ?? [];
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!