数据定价更新
Showing
5 changed files
with
79 additions
and
29 deletions
| ... | @@ -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 | ... | ... |
| ... | @@ -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> | ... | ... |
-
Please register or sign in to post a comment