ae2ab82f by xukangle

update:增加stuffGuid接口

1 parent ae104e1a
...@@ -58,7 +58,8 @@ VITE_API_MESSAGE = ms-swzl-message-notification-service ...@@ -58,7 +58,8 @@ VITE_API_MESSAGE = ms-swzl-message-notification-service
58 #新门户接口 58 #新门户接口
59 VITE_API_NEW_PORTAL = ms-daop-zcgl-asset-dam-service 59 VITE_API_NEW_PORTAL = ms-daop-zcgl-asset-dam-service
60 60
61 61 #人员服务
62 VITE_APP_PERSONAL_URL = 'ms-daop-personel-service'
62 63
63 # 是否在打包时生成 sourcemap 64 # 是否在打包时生成 sourcemap
64 VITE_BUILD_SOURCEMAP = false 65 VITE_BUILD_SOURCEMAP = false
......
...@@ -34,6 +34,13 @@ export const getSystemMenu = (params) => { ...@@ -34,6 +34,13 @@ export const getSystemMenu = (params) => {
34 }); 34 });
35 }; 35 };
36 36
37 export const getCurrentUserInfo = (tenantGuid) => {
38 return request({
39 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/staff/data/get-current-staff?tenantGuid=${tenantGuid}`,
40 method: "post",
41 });
42 };
43
37 // 获取当前用户对应的产品和菜单 44 // 获取当前用户对应的产品和菜单
38 export const getUserInfo = () => { 45 export const getUserInfo = () => {
39 return request({ 46 return request({
......
...@@ -7,7 +7,8 @@ import { ref } from 'vue'; ...@@ -7,7 +7,8 @@ import { ref } from 'vue';
7 import { useRouter, useRoute } from "vue-router"; 7 import { useRouter, useRoute } from "vue-router";
8 import useUserStore from "@/store/modules/user"; 8 import useUserStore from "@/store/modules/user";
9 import { 9 import {
10 getAreaData 10 getAreaData,
11 getCurrentUserInfo
11 } from "@/api/modules/queryService"; 12 } from "@/api/modules/queryService";
12 import { 13 import {
13 getDamTypesList, 14 getDamTypesList,
...@@ -29,6 +30,7 @@ import importTableField from "./importTableField.vue"; ...@@ -29,6 +30,7 @@ import importTableField from "./importTableField.vue";
29 import { useValidator } from '@/hooks/useValidator'; 30 import { useValidator } from '@/hooks/useValidator';
30 import useDataAssetStore from "@/store/modules/dataAsset"; 31 import useDataAssetStore from "@/store/modules/dataAsset";
31 import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; 32 import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common';
33 import { ElMessage } from 'element-plus';
32 34
33 const { proxy } = getCurrentInstance() as any; 35 const { proxy } = getCurrentInstance() as any;
34 const { required, checkExistName } = useValidator(); 36 const { required, checkExistName } = useValidator();
...@@ -490,8 +492,18 @@ const importTableEditIndex: any = ref(null); ...@@ -490,8 +492,18 @@ const importTableEditIndex: any = ref(null);
490 const addAssetTable = () => { 492 const addAssetTable = () => {
491 importTableFieldVisible.value = true; 493 importTableFieldVisible.value = true;
492 } 494 }
493 495 const stuffInfo = ref<any>({});
494 onBeforeMount(() => { 496 onBeforeMount(() => {
497 const currentTenantGuid = localStorage.getItem('currentTenantGuid');
498 getCurrentUserInfo(currentTenantGuid).then((res: any) => {
499 console.log(res, 'getCurrentUserInfo');
500 if (res.code == '00000') {
501 localStorage.setItem('userData', JSON.stringify(res.data));
502 stuffInfo.value = res.data;
503 } else {
504 ElMessage.error(res.msg)
505 }
506 })
495 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => { 507 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
496 if (res?.code == proxy.$passCode) { 508 if (res?.code == proxy.$passCode) {
497 parentAreaData.value = res.data ?? []; 509 parentAreaData.value = res.data ?? [];
...@@ -650,6 +662,10 @@ const save = () => { ...@@ -650,6 +662,10 @@ const save = () => {
650 }); 662 });
651 } else { 663 } else {
652 params.damCatalogTableInfo = assetDataTableInfo.value.data; 664 params.damCatalogTableInfo = assetDataTableInfo.value.data;
665 params.damCatalogTableInfo = {
666 ...assetDataTableInfo.value.data,
667 stuffGuid: stuffInfo.value.staffGuid
668 };
653 fullscreenLoading.value = true; 669 fullscreenLoading.value = true;
654 registerCatalogSave(params).then((res: any) => { 670 registerCatalogSave(params).then((res: any) => {
655 fullscreenLoading.value = false; 671 fullscreenLoading.value = false;
......
...@@ -220,16 +220,42 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -220,16 +220,42 @@ const toSearch = (val: any, clear: boolean = false) => {
220 selectedB.value = null; 220 selectedB.value = null;
221 selectedC.value = null; 221 selectedC.value = null;
222 searchItemList.value.map(item => item.default = '') 222 searchItemList.value.map(item => item.default = '')
223 console.log('clear', CgDirTreeList.value); 223 if (activeName.value === 'first') {
224 treeInfo.value.expandedKey = []; 224 treeInfo.value.expandedKey = [];
225 currentPath.value = [CgDirTreeList.value[0].classifyName]; 225 currentPath.value = [CgDirTreeList.value[0].classifyName];
226 treeInfo.value.expandedKey.push(CgDirTreeList.value[0].classifyDetailGuid); 226 treeInfo.value.expandedKey.push(CgDirTreeList.value[0].classifyDetailGuid);
227 treeInfo.value.currentNodeKey = CgDirTreeList.value[0].classifyDetailGuid; 227 treeInfo.value.currentNodeKey = CgDirTreeList.value[0].classifyDetailGuid;
228 console.log('clear', treeInfo.value.expandedKey, clear); 228 console.log('clear', treeInfo.value.expandedKey, clear);
229 getCgDirFieldPage({ 229 getCgDirFieldPage({
230 execGuid: execGuidInfo.value.execGuid, 230 execGuid: execGuidInfo.value.execGuid,
231 classifyDetail: CgDirTreeList.value[0].classifyDetailGuid, 231 classifyDetail: CgDirTreeList.value[0].classifyDetailGuid,
232 }); 232 });
233 }
234 if (activeName.value === 'second') {
235 getDataBaseTableData({
236 pageIndex: 1,
237 pageSize: 50,
238 execGuid: execGuidInfo.value.execGuid,
239 tableGuid: selectedB.value || tableGuid.value || '',
240 databaseGuid: selectedA.value || dataBaseGuid.value || '',
241 classifyDetailGuid: '',
242 gradeDetailGuid: '',
243 labelGuid: '',
244 });
245
246 getDataBaseFieldData({
247 pageIndex: 1,
248 pageSize: 50,
249 execGuid: execGuidInfo.value.execGuid,
250 tableGuid: selectedB.value || tableGuid.value || '',
251 databaseGuid: selectedA.value || dataBaseGuid.value || '',
252 fieldGuid: '',
253 classifyDetailGuid: '',
254 gradeDetailGuid: '',
255 labelGuid: '',
256 });
257
258 }
233 } 259 }
234 console.log('toSearch', val, classifyDetailGuidInfo.value); 260 console.log('toSearch', val, classifyDetailGuidInfo.value);
235 if (activeName.value === 'first' && !clear) { 261 if (activeName.value === 'first' && !clear) {
...@@ -657,7 +683,7 @@ const classEditFormItems = ref([{ ...@@ -657,7 +683,7 @@ const classEditFormItems = ref([{
657 placeholder: '请选择', 683 placeholder: '请选择',
658 field: 'orderNumLength', 684 field: 'orderNumLength',
659 options: selectLength.value, 685 options: selectLength.value,
660 required: true, 686 required: false,
661 clearable: true, 687 clearable: true,
662 }, 688 },
663 { 689 {
...@@ -667,7 +693,7 @@ const classEditFormItems = ref([{ ...@@ -667,7 +693,7 @@ const classEditFormItems = ref([{
667 field: 'orderNum', 693 field: 'orderNum',
668 maxlength: 6, 694 maxlength: 6,
669 regexp: /\D/g, 695 regexp: /\D/g,
670 required: true, 696 required: false,
671 clearable: true, 697 clearable: true,
672 col: 'numberClass', 698 col: 'numberClass',
673 }, 699 },
...@@ -678,7 +704,7 @@ const classEditFormItems = ref([{ ...@@ -678,7 +704,7 @@ const classEditFormItems = ref([{
678 field: 'fieldPrecision', 704 field: 'fieldPrecision',
679 maxlength: 2, 705 maxlength: 2,
680 regexp: /\D/g, 706 regexp: /\D/g,
681 required: true, 707 required: false,
682 clearable: true, 708 clearable: true,
683 block: true, 709 block: true,
684 }, { 710 }, {
...@@ -747,10 +773,10 @@ const classEditFormItems = ref([{ ...@@ -747,10 +773,10 @@ const classEditFormItems = ref([{
747 } 773 }
748 ]); 774 ]);
749 const classEditFormRules = ref({ 775 const classEditFormRules = ref({
750 classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], 776 // classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
751 orderNumLength: [{ required: true, message: '请选择长度', trigger: 'blur' }], 777 // orderNumLength: [{ required: true, message: '请选择长度', trigger: 'blur' }],
752 orderNum: [{ required: true, message: '请填写长度', trigger: 'blur' }], 778 // orderNum: [{ required: true, message: '请填写长度', trigger: 'blur' }],
753 fieldPrecision: [{ required: true, message: '请填写精度', trigger: 'blur' }], 779 // fieldPrecision: [{ required: true, message: '请填写精度', trigger: 'blur' }],
754 }); 780 });
755 /** 新增分类的form */ 781 /** 新增分类的form */
756 const classEditFormInfo = ref({ 782 const classEditFormInfo = ref({
...@@ -789,15 +815,39 @@ const drawerBtnClick = async (btn, info) => { ...@@ -789,15 +815,39 @@ const drawerBtnClick = async (btn, info) => {
789 } else { 815 } else {
790 btn.loading = true; 816 btn.loading = true;
791 const { orderNumLength, orderNum, numberStart, numberEnd, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info; 817 const { orderNumLength, orderNum, numberStart, numberEnd, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info;
818 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
819 if (orderNumLength && !orderNum) {
820 proxy.$ElMessage.error('请填写长度');
821 btn.loading = false;
822 return;
823 }
824 if (!orderNumLength && orderNum) {
825 proxy.$ElMessage.error('请选择长度边界范围');
826 btn.loading = false;
827 return;
828 }
792 let fieldLengthCondition = orderNumLength + '#' + orderNum; 829 let fieldLengthCondition = orderNumLength + '#' + orderNum;
793 let fieldValueRange: any = []; 830 let fieldValueRange: any = [];
831 // 字段取值范围也是要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
832 if (numberStart && !numberEnd) {
833 proxy.$ElMessage.error('请填写字段取值范围结束值');
834 btn.loading = false;
835 return;
836 }
837 if (!numberStart && numberEnd) {
838 proxy.$ElMessage.error('请填写字段取值范围开始值');
839 btn.loading = false;
840 return;
841 }
794 if (numberStart && numberEnd) { 842 if (numberStart && numberEnd) {
795 if (numberEnd < numberStart) { 843 if (Number(numberEnd) < Number(numberStart)) {
796 proxy.$ElMessage.error('字段取值范围结束值不能小于开始值'); 844 proxy.$ElMessage.error('字段取值范围结束值不能小于开始值');
845 btn.loading = false;
797 return; 846 return;
798 } 847 }
799 fieldValueRange = numberStart + '#' + numberEnd; 848 fieldValueRange = numberStart + '#' + numberEnd;
800 } 849 }
850
801 const params: any = []; 851 const params: any = [];
802 selectedRulesData.value.guids.forEach((item: any) => { 852 selectedRulesData.value.guids.forEach((item: any) => {
803 params.push({ 853 params.push({
...@@ -1030,7 +1080,12 @@ const tableFieldsDataInfo = ref({ ...@@ -1030,7 +1080,12 @@ const tableFieldsDataInfo = ref({
1030 { label: "表中文名", field: "tableChName", width: 140, }, 1080 { label: "表中文名", field: "tableChName", width: 140, },
1031 { label: "数据库名称", field: "database", width: 120 }, 1081 { label: "数据库名称", field: "database", width: 120 },
1032 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME }, 1082 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
1033 { label: "分类", field: "classifyDetailNameRoutes", width: 120, align: 'left', getName: (scope) => { return scope.row.classifyDetailNameRoutes.join('/') } }, 1083 {
1084 label: "分类", field: "classifyDetailNameRoutes", width: 120, align: 'left', getName: (scope) => {
1085 // 判断 Array.isArray(scope.row.classifyDetailNameRoutes)
1086 return Array.isArray(scope.row.classifyDetailNameRoutes) ? scope.row.classifyDetailNameRoutes.join('/') : '--';
1087 }
1088 },
1034 { label: "分级", field: "gradeDetailName", width: 120, align: 'left' }, 1089 { label: "分级", field: "gradeDetailName", width: 120, align: 'left' },
1035 // { label: "标签", field: "label", width: 120, align: 'center' }, 1090 // { label: "标签", field: "label", width: 120, align: 'center' },
1036 ], 1091 ],
...@@ -1076,17 +1131,20 @@ const dataBasenodeClick = (data: any) => { ...@@ -1076,17 +1131,20 @@ const dataBasenodeClick = (data: any) => {
1076 } 1131 }
1077 tableGuid.value = ''; 1132 tableGuid.value = '';
1078 getDataBaseFieldData({ 1133 getDataBaseFieldData({
1079 databaseGuid: data.databaseGuid 1134 databaseGuid: data.databaseGuid,
1135 gradeDetailGuid: levelGuidInfo.value,
1080 }); 1136 });
1081 getDataBaseTableData({ 1137 getDataBaseTableData({
1082 databaseGuid: data.databaseGuid 1138 databaseGuid: data.databaseGuid,
1139 gradeDetailGuid: levelGuidInfo.value,
1083 }); 1140 });
1084 } 1141 }
1085 if (data.tableGuid) { 1142 if (data.tableGuid) {
1086 tableGuid.value = data.tableGuid; 1143 tableGuid.value = data.tableGuid;
1087 dataBaseGuid.value = ''; 1144 dataBaseGuid.value = '';
1088 getDataBaseFieldData({ 1145 getDataBaseFieldData({
1089 tableGuid: data.tableGuid 1146 tableGuid: data.tableGuid,
1147 gradeDetailGuid: levelGuidInfo.value,
1090 }); 1148 });
1091 1149
1092 } 1150 }
...@@ -1372,7 +1430,6 @@ const levelGuidInfo = ref(''); ...@@ -1372,7 +1430,6 @@ const levelGuidInfo = ref('');
1372 const selectChange = (val, row, info) => { 1430 const selectChange = (val, row, info) => {
1373 1431
1374 if (info) { 1432 if (info) {
1375 labelGuidInfo.value = info.labelName;
1376 levelGuidInfo.value = info.levelName; 1433 levelGuidInfo.value = info.levelName;
1377 } 1434 }
1378 } 1435 }
...@@ -1430,7 +1487,8 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1430,7 +1487,8 @@ const treeSelectNodeClick = (node, item) => {
1430 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> --> 1487 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> -->
1431 </el-tab-pane> 1488 </el-tab-pane>
1432 <el-tab-pane label="数据库目录" name="second"> 1489 <el-tab-pane label="数据库目录" name="second">
1433 <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange' /> 1490 <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange'
1491 ref="dataBaseRef" />
1434 </el-tab-pane> 1492 </el-tab-pane>
1435 </el-tabs> 1493 </el-tabs>
1436 </div> 1494 </div>
......
...@@ -184,9 +184,37 @@ const saveRow = (row) => { ...@@ -184,9 +184,37 @@ const saveRow = (row) => {
184 if (row.lengthSymbol && row.lengthValue) { 184 if (row.lengthSymbol && row.lengthValue) {
185 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue 185 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
186 } 186 }
187 if (row.lengthSymbol && !row.lengthValue) {
188 proxy.$ElMessage.error('请填写字段长度值');
189 return
190 }
191 if (!row.lengthSymbol && row.lengthValue) {
192 proxy.$ElMessage.error('请选择字段长度符号');
193 return
194 }
195 if (!row.lengthSymbol && !row.lengthValue) {
196 row.fieldLengthCondition = ''
197 }
187 if (row.rangeStart && row.rangeEnd) { 198 if (row.rangeStart && row.rangeEnd) {
188 row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd 199 row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd
189 } 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 }
216
217
190 row.isEdit = false 218 row.isEdit = false
191 } 219 }
192 const data = [ 220 const data = [
...@@ -406,7 +434,7 @@ const cancelEdit = (row) => { ...@@ -406,7 +434,7 @@ const cancelEdit = (row) => {
406 <el-option label="大于等于" value=">="></el-option> 434 <el-option label="大于等于" value=">="></el-option>
407 <el-option label="小于等于" value="<="></el-option> 435 <el-option label="小于等于" value="<="></el-option>
408 </el-select> 436 </el-select>
409 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" /> 437 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" clearable />
410 </div> 438 </div>
411 </template> 439 </template>
412 </el-table-column> 440 </el-table-column>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!