e9767fa0 by lxs

数据定价更新

1 parent 264403ea
...@@ -188,6 +188,15 @@ export const deleteConfigure = (params) => { ...@@ -188,6 +188,15 @@ export const deleteConfigure = (params) => {
188 }); 188 });
189 }; 189 };
190 190
191 // 复制配置
192 export const addCopyConfigure = (params) => {
193 return request({
194 url: `${import.meta.env.VITE_API_NEW_PORTAL}/pricing-configure/copy`,
195 method: "post",
196 data: params,
197 });
198 };
199
191 // 获取数据定价 200 // 获取数据定价
192 export const getPriceList = (params) => { 201 export const getPriceList = (params) => {
193 return request({ 202 return request({
...@@ -245,9 +254,9 @@ export const deletePrice = (params) => { ...@@ -245,9 +254,9 @@ export const deletePrice = (params) => {
245 // 获取数据资源目录 254 // 获取数据资源目录
246 export const getDamCatalogList = (params) => { 255 export const getDamCatalogList = (params) => {
247 return request({ 256 return request({
248 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-grounding/not-exclude-overview-page-list`, 257 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-select-new`,
249 method: "post", 258 method: "get",
250 data: params, 259 params,
251 }); 260 });
252 }; 261 };
253 262
......
...@@ -303,3 +303,10 @@ export const getCurrentUserInfo = (params) => { ...@@ -303,3 +303,10 @@ export const getCurrentUserInfo = (params) => {
303 params 303 params
304 }); 304 });
305 }; 305 };
306
307 /** 下载文件模板 */
308 export const exportTemplate = (params) => request({
309 url: `${import.meta.env.VITE_APP_ADD_FILE}/import-config/export-template?bizGuid=${params.bizGuid}&importType=${params.importType}`,
310 method: 'post',
311 responseType: 'blob'
312 });
......
...@@ -248,6 +248,7 @@ onMounted(() => { ...@@ -248,6 +248,7 @@ onMounted(() => {
248 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border 248 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border
249 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')" 249 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')"
250 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName" 250 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName"
251 :tree-props="props.tableInfo.treeProps" :default-expand-all="props.tableInfo.expandAll ?? false"
251 :expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick" 252 :expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick"
252 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange" 253 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange"
253 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block" 254 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block"
......
...@@ -113,11 +113,14 @@ defineExpose({ ...@@ -113,11 +113,14 @@ defineExpose({
113 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label 113 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label
114 }}:</span> 114 }}:</span>
115 <el-select v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder" 115 <el-select v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder"
116 :disabled="item.selectInfo.disabled" @change="selectChange"> 116 :disabled="item.selectInfo.disabled" @change="selectChange" :filterable="item.selectInfo.filterable" :style="item.selectInfo.style">
117 <el-option v-for="opts in item.selectInfo.options" :label="opts.label" :value="opts.value" /> 117 <el-option v-for="opts in item.selectInfo.options"
118 :label="item.selectInfo.props?.label ? opts[item.selectInfo.props.label] : opts.label"
119 :value="item.selectInfo.props?.value ? opts[item.selectInfo.props.value] : opts.value"
120 :disabled="opts.disabled" />
118 </el-select> 121 </el-select>
119 </div> 122 </div>
120 <div class="form_item" v-if="item.type == 'tree-select'"> 123 <div class="form_item" v-else-if="item.type == 'tree-select'">
121 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label 124 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label
122 }}:</span> 125 }}:</span>
123 <el-tree-select 126 <el-tree-select
...@@ -176,7 +179,7 @@ defineExpose({ ...@@ -176,7 +179,7 @@ defineExpose({
176 </el-button> 179 </el-button>
177 </div> 180 </div>
178 <el-upload v-else ref="fileUploadRef" class="upload_panel" :class="[props.uploadInfo.col]" 181 <el-upload v-else ref="fileUploadRef" class="upload_panel" :class="[props.uploadInfo.col]"
179 v-model:file-list="fileList" :action="item.uploadInfo.action" :auto-upload="item.uploadInfo.auto ?? ''" 182 v-model:file-list="fileList" :action="item.uploadInfo.action ?? ''" :auto-upload="item.uploadInfo.auto ?? ''"
180 :drag="item.uploadInfo.drag ?? false" :accept="item.uploadInfo.accept" :limit="item.uploadInfo.limit ?? 1" 183 :drag="item.uploadInfo.drag ?? false" :accept="item.uploadInfo.accept" :limit="item.uploadInfo.limit ?? 1"
181 :on-change="onUpload" :on-exceed="val => exceedFile(val, item.uploadInfo.cover ?? false)" 184 :on-change="onUpload" :on-exceed="val => exceedFile(val, item.uploadInfo.cover ?? false)"
182 :on-error="handleError" :on-success="handleSuccess" :before-upload="beforeUPload" 185 :on-error="handleError" :on-success="handleSuccess" :before-upload="beforeUPload"
......
...@@ -9,7 +9,7 @@ import useUserStore from "@/store/modules/user"; ...@@ -9,7 +9,7 @@ import useUserStore from "@/store/modules/user";
9 import useDataAssetStore from "@/store/modules/dataAsset"; 9 import useDataAssetStore from "@/store/modules/dataAsset";
10 import { getAllFlowData } from '@/api/modules/queryService'; 10 import { getAllFlowData } from '@/api/modules/queryService';
11 import { getDamCatalogList } from "@/api/modules/dataPricing"; 11 import { getDamCatalogList } from "@/api/modules/dataPricing";
12 import { getRegisterCatalogDetail, getDataResourceUpSummaryList, getRegisterCatalogTableDetail } from "@/api/modules/dataResourceUpService"; 12 import { getRegisterCatalogDetail, getRegisterCatalogTableDetail } from "@/api/modules/dataAsset";
13 import { download } from '@/utils/common' 13 import { download } from '@/utils/common'
14 import { 14 import {
15 getConfigureList, 15 getConfigureList,
...@@ -24,7 +24,6 @@ import { ...@@ -24,7 +24,6 @@ import {
24 exportModelScore 24 exportModelScore
25 } from '@/api/modules/dataPricing'; 25 } from '@/api/modules/dataPricing';
26 import { changeNum } from "@/utils/common"; 26 import { changeNum } from "@/utils/common";
27 import { merge } from 'lodash-es';
28 27
29 const { proxy } = getCurrentInstance() as any; 28 const { proxy } = getCurrentInstance() as any;
30 const router = useRouter(); 29 const router = useRouter();
...@@ -202,7 +201,7 @@ const getDiseaseData = () => { ...@@ -202,7 +201,7 @@ const getDiseaseData = () => {
202 } 201 }
203 // 获取数据资源 202 // 获取数据资源
204 const getDataCatalog = () => { 203 const getDataCatalog = () => {
205 return getDamCatalogList({ damName: "", pageIndex: 1, pageSize: -1, bizApproveState: "Y" }).then((res: any) => { 204 return getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "D" }).then((res: any) => {
206 if (res.code == proxy.$passCode) { 205 if (res.code == proxy.$passCode) {
207 const data = res.data.records || []; 206 const data = res.data.records || [];
208 typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data)); 207 typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data));
...@@ -696,24 +695,6 @@ const getDemandField = (rGuid, rIndex) => { ...@@ -696,24 +695,6 @@ const getDemandField = (rGuid, rIndex) => {
696 } 695 }
697 }); 696 });
698 tableData.value[rIndex].dataFields = tData; 697 tableData.value[rIndex].dataFields = tData;
699 // // 合并数组
700 // const arr1Map = new Map(fData.map(item => [item.guid, item]));
701
702 // const merged = tFields.map(item => {
703 // if (item.demandFieldGuid && arr1Map.has(item.demandFieldGuid)) {
704 // return merge({}, arr1Map.get(item.demandFieldGuid), item);
705 // }
706 // return item;
707 // });
708
709 // fData.forEach(item => {
710 // if (!tFields.some(x => x.demandFieldGuid === item.guid)) {
711 // merged.push(item);
712 // }
713 // });
714
715 // const tData = merged;
716 // tableData.value[rIndex].dataFields = tData;
717 698
718 } else { 699 } else {
719 proxy.$ElMessage.error(res.msg); 700 proxy.$ElMessage.error(res.msg);
......
...@@ -84,9 +84,10 @@ const tableInfo = ref({ ...@@ -84,9 +84,10 @@ const tableInfo = ref({
84 label: "操作", 84 label: "操作",
85 type: "btn", 85 type: "btn",
86 isMore: false, 86 isMore: false,
87 width: 120, 87 width: 160,
88 btns: [ 88 btns: [
89 { label: "编辑", value: "edit" }, 89 { label: "编辑", value: "edit" },
90 { label: "复制", value: "copy" },
90 { label: "删除", value: "del" } 91 { label: "删除", value: "del" }
91 ] 92 ]
92 } 93 }
...@@ -171,6 +172,17 @@ const tableBtnClick = (scope, btn) => { ...@@ -171,6 +172,17 @@ const tableBtnClick = (scope, btn) => {
171 } 172 }
172 } 173 }
173 ); 174 );
175 } else if(type == 'copy'){ //复制
176 router.push(
177 {
178 name: 'priceModel',
179 query: {
180 guid: row.guid,
181 name: `${row.modelName}_副本`,
182 type
183 }
184 }
185 );
174 } else if (type === 'del') { // 删除 186 } else if (type === 'del') { // 删除
175 open('确定要删除该条数据吗?', 'warning'); 187 open('确定要删除该条数据吗?', 'warning');
176 } 188 }
......
...@@ -15,7 +15,8 @@ import { ...@@ -15,7 +15,8 @@ import {
15 getDemandTreeList, 15 getDemandTreeList,
16 getConfigureDetail, 16 getConfigureDetail,
17 saveConfigure, 17 saveConfigure,
18 updateConfigure 18 updateConfigure,
19 addCopyConfigure
19 } from '@/api/modules/dataPricing'; 20 } from '@/api/modules/dataPricing';
20 21
21 const { proxy } = getCurrentInstance() as any; 22 const { proxy } = getCurrentInstance() as any;
...@@ -27,6 +28,7 @@ const fullPath = route.fullPath; ...@@ -27,6 +28,7 @@ const fullPath = route.fullPath;
27 const userData = JSON.parse(localStorage.userData); 28 const userData = JSON.parse(localStorage.userData);
28 const guid = route.query.guid; 29 const guid = route.query.guid;
29 const modelName = route.query.name; 30 const modelName = route.query.name;
31 const detailType = route.query.type;
30 32
31 const loading = ref(false); 33 const loading = ref(false);
32 const flowDetail: any = ref({}); 34 const flowDetail: any = ref({});
...@@ -792,6 +794,7 @@ const getModelDetail = () => { ...@@ -792,6 +794,7 @@ const getModelDetail = () => {
792 getConfigureDetail({ guid }).then((res: any) => { 794 getConfigureDetail({ guid }).then((res: any) => {
793 if (res.code == proxy.$passCode) { 795 if (res.code == proxy.$passCode) {
794 const data = res.data || {}; 796 const data = res.data || {};
797 detailType == 'copy' && (data.modelName = `${data.modelName}_副本`);
795 flowDetail.value = data; 798 flowDetail.value = data;
796 getDataTypeList() 799 getDataTypeList()
797 } 800 }
...@@ -939,7 +942,7 @@ const btnClick = async (btn, row: any = null) => { ...@@ -939,7 +942,7 @@ const btnClick = async (btn, row: any = null) => {
939 targetFormItems.value[2].visible = row.computationalFormula == '1'; 942 targetFormItems.value[2].visible = row.computationalFormula == '1';
940 targetFormItems.value.at(-2).options.map(o => { 943 targetFormItems.value.at(-2).options.map(o => {
941 const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3'); 944 const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3');
942 o.disabled = fData.find(f => f.demandTableGuid == o.guid)? true: false; 945 o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true : false;
943 }); 946 });
944 drawerInfo.value.container.contents[0] = contents.value.target; 947 drawerInfo.value.container.contents[0] = contents.value.target;
945 tableData.value = []; 948 tableData.value = [];
...@@ -990,6 +993,22 @@ const btnClick = async (btn, row: any = null) => { ...@@ -990,6 +993,22 @@ const btnClick = async (btn, row: any = null) => {
990 }; 993 };
991 if (guid) { 994 if (guid) {
992 params.guid = guid 995 params.guid = guid
996 if (detailType == 'copy') {
997 addCopyConfigure(params).then((res: any) => {
998 loading.value = false;
999 if (res.code == proxy.$passCode) {
1000 ElMessage({
1001 type: "success",
1002 message: "复制定价配置成功",
1003 });
1004 toPath()
1005 } else {
1006 proxy.$ElMessage.error(res.msg);
1007 }
1008 }).catch(() => {
1009 loading.value = false;
1010 });
1011 } else {
993 updateConfigure(params).then((res: any) => { 1012 updateConfigure(params).then((res: any) => {
994 loading.value = false; 1013 loading.value = false;
995 if (res.code == proxy.$passCode) { 1014 if (res.code == proxy.$passCode) {
...@@ -1004,6 +1023,7 @@ const btnClick = async (btn, row: any = null) => { ...@@ -1004,6 +1023,7 @@ const btnClick = async (btn, row: any = null) => {
1004 }).catch(() => { 1023 }).catch(() => {
1005 loading.value = false; 1024 loading.value = false;
1006 }); 1025 });
1026 }
1007 } else { 1027 } else {
1008 saveConfigure(params).then((res: any) => { 1028 saveConfigure(params).then((res: any) => {
1009 loading.value = false; 1029 loading.value = false;
...@@ -1059,7 +1079,7 @@ const tableBtnClick = async (scope, btn, lData: any = null) => { ...@@ -1059,7 +1079,7 @@ const tableBtnClick = async (scope, btn, lData: any = null) => {
1059 targetFormItems.value[2].visible = lData.computationalFormula == '1'; 1079 targetFormItems.value[2].visible = lData.computationalFormula == '1';
1060 targetFormItems.value.at(-2).options.map(o => { 1080 targetFormItems.value.at(-2).options.map(o => {
1061 const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3'); 1081 const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3');
1062 o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true: false; 1082 o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true : false;
1063 }); 1083 });
1064 drawerInfo.value.container.contents[0] = contents.value.target; 1084 drawerInfo.value.container.contents[0] = contents.value.target;
1065 drawerInfo.value.visible = true; 1085 drawerInfo.value.visible = true;
......
...@@ -25,12 +25,13 @@ import { ...@@ -25,12 +25,13 @@ import {
25 getDatabase, 25 getDatabase,
26 getRuleTypeList 26 getRuleTypeList
27 } from '@/api/modules/dataQuality'; 27 } from '@/api/modules/dataQuality';
28 import { getDamCatalogList } from '@/api/modules/dataPricing';
28 import useDataQualityStore from "@/store/modules/dataQuality"; 29 import useDataQualityStore from "@/store/modules/dataQuality";
29 import { useValidator } from '@/hooks/useValidator'; 30 import { useValidator } from '@/hooks/useValidator';
30 import { TableColumnWidth } from '@/utils/enum'; 31 import { TableColumnWidth } from '@/utils/enum';
31 32
32 const dataQualityStore = useDataQualityStore(); 33 const dataQualityStore = useDataQualityStore();
33 34 const userData = JSON.parse(localStorage.userData);
34 const { proxy } = getCurrentInstance() as any; 35 const { proxy } = getCurrentInstance() as any;
35 const { orderNum, description } = useValidator(); 36 const { orderNum, description } = useValidator();
36 37
...@@ -39,6 +40,8 @@ const cacheStore = useCatchStore(); ...@@ -39,6 +40,8 @@ const cacheStore = useCatchStore();
39 /** 可选择的质量规则列表。 */ 40 /** 可选择的质量规则列表。 */
40 const ruleTypeList: any = ref([]); 41 const ruleTypeList: any = ref([]);
41 42
43 const productList: any = ref([]);
44
42 /** 质量规则集表对象。 */ 45 /** 质量规则集表对象。 */
43 const qualityModelTreeRef = ref(); 46 const qualityModelTreeRef = ref();
44 /** 树选中不同层级的,代表的类型, model, group, table */ 47 /** 树选中不同层级的,代表的类型, model, group, table */
...@@ -281,7 +284,21 @@ const formItems: any = ref([ ...@@ -281,7 +284,21 @@ const formItems: any = ref([
281 default: '', 284 default: '',
282 maxlength: 6, 285 maxlength: 6,
283 required: true 286 required: true
284 }, { 287 },
288 {
289 label: '数据产品',
290 type: 'select',
291 field: 'damGuid',
292 default: '',
293 placeholder: '请选择',
294 options: productList.value,
295 props: {
296 value: 'damGuid',
297 label: 'damName'
298 },
299 clearable: true,
300 },
301 {
285 label: '描述', 302 label: '描述',
286 type: 'textarea', 303 type: 'textarea',
287 placeholder: '请输入', 304 placeholder: '请输入',
...@@ -929,6 +946,16 @@ onActivated(async () => { ...@@ -929,6 +946,16 @@ onActivated(async () => {
929 } 946 }
930 }) 947 })
931 948
949 // 获取数据产品列表
950 const getProducts = () => {
951 getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "Z" }).then((res: any) => {
952 if (res.code == proxy.$passCode) {
953 const data = res.data.records || [];
954 productList.value = data;
955 }
956 })
957 }
958
932 onBeforeMount(() => { 959 onBeforeMount(() => {
933 getQualityGroupTreeData(); 960 getQualityGroupTreeData();
934 getGroupTableData(); 961 getGroupTableData();
...@@ -945,6 +972,7 @@ onBeforeMount(() => { ...@@ -945,6 +972,7 @@ onBeforeMount(() => {
945 ElMessage.error(res.msg); 972 ElMessage.error(res.msg);
946 } 973 }
947 }) 974 })
975 getProducts();
948 }) 976 })
949 977
950 </script> 978 </script>
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
18 getImportData, 18 getImportData,
19 exportDictionary, 19 exportDictionary,
20 exportCollectTask, 20 exportCollectTask,
21 // getImageContent 21 exportTemplate
22 } from '@/api/modules/queryService'; 22 } from '@/api/modules/queryService';
23 import { 23 import {
24 parseAndDecodeUrl, 24 parseAndDecodeUrl,
...@@ -29,6 +29,7 @@ import { ...@@ -29,6 +29,7 @@ import {
29 getDictionaryTree 29 getDictionaryTree
30 } from '@/api/modules/dataInventory'; 30 } from '@/api/modules/dataInventory';
31 import { commonPageConfig } from '@/utils/enum'; 31 import { commonPageConfig } from '@/utils/enum';
32 import { getDemandTreeList, getDiseaseAll } from '@/api/modules/dataPricing';
32 33
33 const { proxy } = getCurrentInstance() as any; 34 const { proxy } = getCurrentInstance() as any;
34 35
...@@ -156,6 +157,29 @@ const getDictList = () => { ...@@ -156,6 +157,29 @@ const getDictList = () => {
156 }) 157 })
157 } 158 }
158 159
160 // 获取需求表树形数据
161 const getTreeData = () => {
162 if (isfileImport == '7') {
163 getDemandTreeList({ pageIndex: 1, pageSize: 100000, isCatalog: 'N' }).then((res: any) => {
164 if (res.code == proxy.$passCode) {
165 const data = res.data?.records || [];
166 dictionaryList.value = data;
167 } else {
168 proxy.$ElMessage.error(res.msg);
169 }
170 })
171 } else {
172 getDiseaseAll().then((res: any) => {
173 if (res.code == proxy.$passCode) {
174 const data = res.data || [];
175 dictionaryList.value = data;
176 } else {
177 proxy.$ElMessage.error(res.msg);
178 }
179 })
180 }
181 }
182
159 const tabsChange = (name) => { 183 const tabsChange = (name) => {
160 tabsActiveName.value = name 184 tabsActiveName.value = name
161 let info: any = { 185 let info: any = {
...@@ -283,11 +307,16 @@ const batching = (type) => { ...@@ -283,11 +307,16 @@ const batching = (type) => {
283 } 307 }
284 open("此操作将永久删除, 是否继续?", "warning", true); 308 open("此操作将永久删除, 是否继续?", "warning", true);
285 } else if (type === 'importFile') { 309 } else if (type === 'importFile') {
286 if (isfileImport == '2' || isfileImport == '4') { 310 if (isfileImport == '2' || isfileImport == '4' || isfileImport == '7' || isfileImport == '8') {
287 dialogInfo.value.header.title = '导入数据' 311 dialogInfo.value.header.title = '导入数据'
288 dialogInfo.value.type = 'upload' 312 dialogInfo.value.type = 'upload'
289 dialogInfo.value.size = isfileImport == '4' ? 600 : 500; 313 dialogInfo.value.size = isfileImport == '4' ? 600 : 500;
290 uploadFiles.value = [] 314 uploadFiles.value = []
315 if (isfileImport == '7') {
316 uploadSteps.value[0].selectInfo.options = dictionaryList.value;
317 } else if (isfileImport == '8') {
318 uploadSteps.value[0].cascaderInfo.options = dictionaryList.value;
319 }
291 uploadInfo.value.uploadInfo.steps = uploadSteps.value 320 uploadInfo.value.uploadInfo.steps = uploadSteps.value
292 const content: any = [uploadInfo.value] 321 const content: any = [uploadInfo.value]
293 dialogInfo.value.contents = content 322 dialogInfo.value.contents = content
...@@ -377,6 +406,20 @@ const exportData = (ids: any = null) => { ...@@ -377,6 +406,20 @@ const exportData = (ids: any = null) => {
377 res?.msg && ElMessage.error(res?.msg); 406 res?.msg && ElMessage.error(res?.msg);
378 } 407 }
379 }); 408 });
409 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
410 exportTemplate({
411 bizGuid: '',
412 importType: "0046"
413 }).then((res: any) => {
414 download(res, '需求表管理导入模板.xlsx', 'excel')
415 });
416 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
417 exportTemplate({
418 bizGuid: '',
419 importType: "0047"
420 }).then((res: any) => {
421 download(res, '疾病管理导入模板.xlsx', 'excel')
422 });
380 } 423 }
381 } 424 }
382 425
...@@ -390,11 +433,11 @@ const importData = (info) => { ...@@ -390,11 +433,11 @@ const importData = (info) => {
390 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) 433 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
391 return 434 return
392 } 435 }
393 let paramUrl = '';
394 if (isfileImport == '2') {
395 uploadFiles.value.forEach((item: any, index: number) => { 436 uploadFiles.value.forEach((item: any, index: number) => {
396 params.append("file", item.raw); 437 params.append("file", item.raw);
397 }); 438 });
439 let paramUrl = '';
440 if (isfileImport == '2') {
398 paramUrl = `ms-daop-zcgl-asset-dam-service/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}` 441 paramUrl = `ms-daop-zcgl-asset-dam-service/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}`
399 } else if (isfileImport == '4') { 442 } else if (isfileImport == '4') {
400 if (!info.databaseNameZh) { 443 if (!info.databaseNameZh) {
...@@ -411,14 +454,17 @@ const importData = (info) => { ...@@ -411,14 +454,17 @@ const importData = (info) => {
411 }) 454 })
412 return; 455 return;
413 } 456 }
414 uploadFiles.value.forEach((item: any, index: number) => { 457
415 params.append("uploadFile", item.raw);
416 });
417 paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}` 458 paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}`
459 } else if (isfileImport == '7') {
460 info.bizGuid = '0046';
461 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}`
462 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
463 } else if (isfileImport == '8') {
464 info.bizGuid = '0047';
465 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}`
466 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
418 } else { 467 } else {
419 uploadFiles.value.forEach((item: any, index: number) => {
420 params.append("file", item.raw);
421 });
422 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2` 468 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2`
423 if (info && Object.keys(info).length) { 469 if (info && Object.keys(info).length) {
424 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}` 470 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
...@@ -452,6 +498,10 @@ const dialogBtnClick = (btn, info) => { ...@@ -452,6 +498,10 @@ const dialogBtnClick = (btn, info) => {
452 if (dialogInfo.value.type == 'upload') { 498 if (dialogInfo.value.type == 'upload') {
453 if (tabsActiveName.value == 'dictionary') { 499 if (tabsActiveName.value == 'dictionary') {
454 importData({ bizGuid: dictionaryGuid.value }) 500 importData({ bizGuid: dictionaryGuid.value })
501 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
502 importData(info)
503 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
504 importData(info)
455 } else { 505 } else {
456 importData(info) 506 importData(info)
457 } 507 }
...@@ -478,6 +528,10 @@ const setUploadInfo = () => { ...@@ -478,6 +528,10 @@ const setUploadInfo = () => {
478 importType.value = '0034'; 528 importType.value = '0034';
479 } else if (isfileImport == '4') { 529 } else if (isfileImport == '4') {
480 importType.value = '0042'; 530 importType.value = '0042';
531 } else if (isfileImport == '7') {
532 importType.value = '0046';
533 } else if (isfileImport == '8') {
534 importType.value = '0047';
481 } else { 535 } else {
482 importType.value = '0033'; 536 importType.value = '0033';
483 } 537 }
...@@ -641,6 +695,94 @@ const setUploadInfo = () => { ...@@ -641,6 +695,94 @@ const setUploadInfo = () => {
641 } 695 }
642 ] 696 ]
643 uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' } 697 uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' }
698 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
699 uploadSteps.value = [
700 {
701 title: '1、导入前请先录入以下内容',
702 type: 'select',
703 selectInfo: {
704 label: '需求表名称',
705 placeholder: '请选择',
706 field: 'menuGuid',
707 default: '',
708 options: [],
709 props: {
710 label: "menuName",
711 value: "guid",
712 },
713 filterable: true,
714 clearable: true,
715 required: true,
716 style: {
717 width: '191px',
718 }
719 }
720 },
721 {
722 title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据',
723 type: 'btn_down'
724 },
725 {
726 title: '3、选择准备好的文件导入',
727 type: 'btn_upload',
728 uploadInfo: {
729 action: '',
730 auto: false,
731 cover: true,
732 fileList: [],
733 accept: '.xlsx, .xls',
734 tips: '当前支持xls、xlsx文件,默认使用第一个sheet'
735 }
736 }
737 ]
738 dictionaryGuid.value = uploadSetting.value?.dictionaryGuid || ''
739 uploadInfo.value.uploadInfo.extraParams = {
740 menuGuid: dictionaryGuid.value
741 }
742 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
743 uploadSteps.value = [
744 {
745 title: '1、导入前请先录入以下内容',
746 type: 'cascader',
747 cascaderInfo: {
748 label: '疾病名称',
749 placeholder: '',
750 field: 'parentGuid',
751 options: [],
752 default: '',
753 showAllLevels: false,
754 props: {
755 checkStrictly: true,
756 label: "diseaseName",
757 value: "guid",
758 children: 'childList',
759 emitPath: false
760 },
761 filterable: true,
762 clearable: true,
763 }
764 },
765 {
766 title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据',
767 type: 'btn_down'
768 },
769 {
770 title: '3、选择准备好的文件导入',
771 type: 'btn_upload',
772 uploadInfo: {
773 action: '',
774 auto: false,
775 cover: true,
776 fileList: [],
777 accept: '.xlsx, .xls',
778 tips: '当前支持xls、xlsx文件,默认使用第一个sheet'
779 }
780 }
781 ]
782 dictionaryGuid.value = uploadSetting.value?.dictionaryGuid || ''
783 uploadInfo.value.uploadInfo.extraParams = {
784 parentGuid: dictionaryGuid.value
785 }
644 } else { 786 } else {
645 uploadSteps.value = [ 787 uploadSteps.value = [
646 { 788 {
...@@ -674,7 +816,8 @@ onActivated(() => { ...@@ -674,7 +816,8 @@ onActivated(() => {
674 if (tabsActiveName.value == 'dictionary') { 816 if (tabsActiveName.value == 'dictionary') {
675 getDictList(); 817 getDictList();
676 } 818 }
677 setUploadInfo() 819 setUploadInfo();
820 (isfileImport == '7' || isfileImport == '8') && getTreeData();
678 }) 821 })
679 822
680 </script> 823 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!