1f86e613 by lxs Committed by lihua

数据定价更新

1 parent 2a0d7095
......@@ -188,6 +188,15 @@ export const deleteConfigure = (params) => {
});
};
// 复制配置
export const addCopyConfigure = (params) => {
return request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/pricing-configure/copy`,
method: "post",
data: params,
});
};
// 获取数据定价
export const getPriceList = (params) => {
return request({
......@@ -245,9 +254,9 @@ export const deletePrice = (params) => {
// 获取数据资源目录
export const getDamCatalogList = (params) => {
return request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-grounding/not-exclude-overview-page-list`,
method: "post",
data: params,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-select-new`,
method: "get",
params,
});
};
......
......@@ -24,7 +24,6 @@ import {
exportModelScore
} from '@/api/modules/dataPricing';
import { changeNum } from "@/utils/common";
import { merge } from 'lodash-es';
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
......@@ -202,7 +201,7 @@ const getDiseaseData = () => {
}
// 获取数据资源
const getDataCatalog = () => {
return getDamCatalogList({ damName: "", pageIndex: 1, pageSize: -1, bizApproveState: "Y" }).then((res: any) => {
return getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "D" }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data.records || [];
typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data));
......@@ -696,24 +695,6 @@ const getDemandField = (rGuid, rIndex) => {
}
});
tableData.value[rIndex].dataFields = tData;
// // 合并数组
// const arr1Map = new Map(fData.map(item => [item.guid, item]));
// const merged = tFields.map(item => {
// if (item.demandFieldGuid && arr1Map.has(item.demandFieldGuid)) {
// return merge({}, arr1Map.get(item.demandFieldGuid), item);
// }
// return item;
// });
// fData.forEach(item => {
// if (!tFields.some(x => x.demandFieldGuid === item.guid)) {
// merged.push(item);
// }
// });
// const tData = merged;
// tableData.value[rIndex].dataFields = tData;
} else {
proxy.$ElMessage.error(res.msg);
......
......@@ -84,9 +84,10 @@ const tableInfo = ref({
label: "操作",
type: "btn",
isMore: false,
width: 120,
width: 160,
btns: [
{ label: "编辑", value: "edit" },
{ label: "复制", value: "copy" },
{ label: "删除", value: "del" }
]
}
......@@ -171,6 +172,17 @@ const tableBtnClick = (scope, btn) => {
}
}
);
} else if(type == 'copy'){ //复制
router.push(
{
name: 'priceModel',
query: {
guid: row.guid,
name: `${row.modelName}_副本`,
type
}
}
);
} else if (type === 'del') { // 删除
open('确定要删除该条数据吗?', 'warning');
}
......
......@@ -15,7 +15,8 @@ import {
getDemandTreeList,
getConfigureDetail,
saveConfigure,
updateConfigure
updateConfigure,
addCopyConfigure
} from '@/api/modules/dataPricing';
const { proxy } = getCurrentInstance() as any;
......@@ -27,6 +28,7 @@ const fullPath = route.fullPath;
const userData = JSON.parse(localStorage.userData);
const guid = route.query.guid;
const modelName = route.query.name;
const detailType = route.query.type;
const loading = ref(false);
const flowDetail: any = ref({});
......@@ -792,6 +794,7 @@ const getModelDetail = () => {
getConfigureDetail({ guid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
detailType == 'copy' && (data.modelName = `${data.modelName}_副本`);
flowDetail.value = data;
getDataTypeList()
}
......@@ -939,7 +942,7 @@ const btnClick = async (btn, row: any = null) => {
targetFormItems.value[2].visible = row.computationalFormula == '1';
targetFormItems.value.at(-2).options.map(o => {
const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3');
o.disabled = fData.find(f => f.demandTableGuid == o.guid)? true: false;
o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true : false;
});
drawerInfo.value.container.contents[0] = contents.value.target;
tableData.value = [];
......@@ -990,20 +993,37 @@ const btnClick = async (btn, row: any = null) => {
};
if (guid) {
params.guid = guid
updateConfigure(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: guid ? "编辑定价配置成功" : "新增定价配置成功",
});
toPath()
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
if (detailType == 'copy') {
addCopyConfigure(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: "复制定价配置成功",
});
toPath()
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
} else {
updateConfigure(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: guid ? "编辑定价配置成功" : "新增定价配置成功",
});
toPath()
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
}
} else {
saveConfigure(params).then((res: any) => {
loading.value = false;
......@@ -1059,7 +1079,7 @@ const tableBtnClick = async (scope, btn, lData: any = null) => {
targetFormItems.value[2].visible = lData.computationalFormula == '1';
targetFormItems.value.at(-2).options.map(o => {
const fData = tData.filter(t => t.targetType == '2' && t.functionName == '3');
o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true: false;
o.disabled = fData.find(f => f.demandTableGuid == o.guid) ? true : false;
});
drawerInfo.value.container.contents[0] = contents.value.target;
drawerInfo.value.visible = true;
......
......@@ -25,12 +25,13 @@ import {
getDatabase,
getRuleTypeList
} from '@/api/modules/dataQuality';
import { getDamCatalogList } from '@/api/modules/dataPricing';
import useDataQualityStore from "@/store/modules/dataQuality";
import { useValidator } from '@/hooks/useValidator';
import { TableColumnWidth } from '@/utils/enum';
const dataQualityStore = useDataQualityStore();
const userData = JSON.parse(localStorage.userData);
const { proxy } = getCurrentInstance() as any;
const { orderNum, description } = useValidator();
......@@ -39,6 +40,8 @@ const cacheStore = useCatchStore();
/** 可选择的质量规则列表。 */
const ruleTypeList: any = ref([]);
const productList: any = ref([]);
/** 质量规则集表对象。 */
const qualityModelTreeRef = ref();
/** 树选中不同层级的,代表的类型, model, group, table */
......@@ -281,7 +284,21 @@ const formItems: any = ref([
default: '',
maxlength: 6,
required: true
}, {
},
{
label: '数据产品',
type: 'select',
field: 'damGuid',
default: '',
placeholder: '请选择',
options: productList.value,
props: {
value: 'damGuid',
label: 'damName'
},
clearable: true,
},
{
label: '描述',
type: 'textarea',
placeholder: '请输入',
......@@ -929,6 +946,16 @@ onActivated(async () => {
}
})
// 获取数据产品列表
const getProducts = () => {
getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "Z" }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data.records || [];
productList.value = data;
}
})
}
onBeforeMount(() => {
getQualityGroupTreeData();
getGroupTableData();
......@@ -945,6 +972,7 @@ onBeforeMount(() => {
ElMessage.error(res.msg);
}
})
getProducts();
})
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!