4d1a6b46 by lihua

添加数据目录分类接口联调

1 parent 54199f30
......@@ -291,7 +291,7 @@ export const getParamsList = (params) => request({
// data: { paramCode: "DAM-TYPE" }
// })
export const getDamTypesList = (params) => request({
url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/data/get-by-dictType`,
method: 'get',
params
})
......@@ -613,4 +613,10 @@ export const getDictData = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/get-tree`,
method: 'post',
data: params
})
\ No newline at end of file
})
export const addDictDictionary = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/save-dict`,
method: 'post',
data: params
})
......
......@@ -78,6 +78,7 @@ import {
getDictClass,
removeDict,
getDictData,
addDictDictionary,
} from "@/api/modules/dataAsset";
const { required } = useValidator();
......@@ -574,30 +575,28 @@ const tableSelectionChange = (val) => {
selectRowData.value = val.map((item) => item.guid);
}
// 批量删除
function batchDelete(param) {
if (param == "delete") {
if (selectRowData.value.length == 0) {
ElMessage({
type: "info",
message: "请选择需要删除的数据",
});
return;
}
proxy.$openMessageBox("数据删除后不可恢复,确定是否删除?", () => {
removeDict(selectRowData.value).then(async (res: any) => {
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: '删除成功'
})
page.value.curr = 1;
toSearch(params.value)
} else {
proxy.$ElMessage.error(res.msg);
}
})
const batchDelete = () => {
if (selectRowData.value.length == 0) {
ElMessage({
type: "info",
message: "请选择需要删除的数据",
});
return;
}
proxy.$openMessageBox("数据删除后不可恢复,确定是否删除?", () => {
removeDict(selectRowData.value).then(async (res: any) => {
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: '删除成功'
})
page.value.curr = 1;
toSearch(params.value)
} else {
proxy.$ElMessage.error(res.msg);
}
})
});
};
const tablePageChange = (info) => {
......@@ -674,7 +673,7 @@ const tableInfo = ref({
align: "center",
},
{
label: "字典描述",
label: "描述",
field: "remarks",
width: 160,
},
......@@ -810,23 +809,24 @@ const drawerBtnClick = (btn, info) => {
drawerInfo.value.visible = false;
} else {
if (btn.value == "save") {
let message = drawerInfo.value.type != 'add' ? '编辑成功' : '新增成功'
if (drawerInfo.value.type != 'add') {
info.guid = currEditTableRow.value.guid;
}
//TODO
// dictApi.addDictionary(resultForm1).then(res => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: message
// })
// drawerInfo.value.visible = false;
// toSearch(params.value)
// }
// });
let message = drawerInfo.value.type != 'add' ? '编辑成功' : '新增成功'
if (drawerInfo.value.type != 'add') {
info.guid = currEditTableRow.value.guid;
}
drawerInfo.value.footer.btns[1].loading = true;
addDictDictionary(info).then((res: any) => {
drawerInfo.value.footer.btns[1].loading = false;
if (res.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: message
})
drawerInfo.value.visible = false;
toSearch(params.value)
} else {
proxy.$ElMessage.error(res.msg);
}
});
} else {
drawerInfo.value.container.id = "add-dictionary-form";
drawerInfo.value.visible = false;
......
......@@ -8,7 +8,6 @@ import { useRouter, useRoute } from "vue-router";
import useUserStore from "@/store/modules/user";
import {
getAreaData,
getParamsList,
} from "@/api/modules/queryService";
import {
registerCatalogSave,
......@@ -22,6 +21,7 @@ import {
getRegisterCatalogTableList,
checkDamTableChange,
getTenantList,
getDamTypesList
} from "@/api/modules/dataAsset";
import {
getValidApi,
......@@ -867,7 +867,7 @@ onBeforeMount(() => {
})
}
getParamsList({
getDamTypesList({
dictType: "资产类型",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
......@@ -878,7 +878,7 @@ onBeforeMount(() => {
proxy.$ElMessage.error(res.msg);
}
})
getParamsList({
getDamTypesList({
dictType: "数据资产目录主题名称",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
......@@ -890,7 +890,7 @@ onBeforeMount(() => {
}
})
getParamsList({
getDamTypesList({
dictType: "行业分类",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
......@@ -902,7 +902,7 @@ onBeforeMount(() => {
}
})
getParamsList({ dictType: '领域' }).then((res: any) => {
getDamTypesList({ dictType: '领域' }).then((res: any) => {
if (res.code == proxy.$passCode) {
domainDictList.value = res.data || [];
let itemIndex = baseInfoFormItems.value.findIndex(item => item.field == 'domain');
......@@ -915,7 +915,7 @@ onBeforeMount(() => {
}
});
getParamsList({
getDamTypesList({
dictType: "组织机构性质",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
......@@ -927,7 +927,7 @@ onBeforeMount(() => {
}
})
getParamsList({
getDamTypesList({
dictType: "更新周期",
}).then((res: any) => {
if (res.code == proxy.$passCode) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!