d9e56607 by lxs

分类分级任务联调

1 parent 967a81c8
......@@ -254,26 +254,40 @@ export const getCgTaskDetail = (data) => request({
})
// 分来分级任务-新增
export const getCgTaskSave = (data) => request({
export const cgTaskSave = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/save`,
method: 'post',
data
})
// 分来分级任务-修改
export const getCgTaskUpdate = (data) => request({
export const cgTaskUpdate = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/update`,
method: 'put',
data
})
// 分来分级任务-删除
export const getCgTaskDelete = (data) => request({
export const cgTaskDelete = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/delete`,
method: 'delete',
data
})
// 手动执行任务
export const runExecTask = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/exec-task`,
method: 'put',
data
})
// 分类分级任务日志
export const getTaskExecPageList = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec/page-list`,
method: 'post',
data
})
// 标签规则-分页
export const getCgLabelPageList = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-label/page-list`,
......@@ -317,7 +331,7 @@ export const filterVal = (val, type) => {
status = '已确认';
break;
default:
status = '草稿中';
status = '--';
break;
}
}
......
......@@ -86,7 +86,7 @@ export const getMetaDataBase = (params) => request({
})
// 表分页查询
export const getMetaDataSheet = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-detail-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-detail-list`,
method: 'post',
data: params
})
......
......@@ -54,6 +54,7 @@ const useUserStore = defineStore(
userName.value = res.data.userName
// userData.value = JSON.stringify(res.data.data);
currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
let currentTenant = res.data.tenantInfoList?.[0];
return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
if (info.code == '00000') {
......
......@@ -9,7 +9,7 @@ import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";
import useDataAssetStore from "@/store/modules/dataAsset";
import { filterVal, getCgTaskPageList, } from "@/api/modules/dataInventory";
import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory";
import { TableColumnWidth } from '@/utils/enum';
import Table from "@/components/Table/index.vue";
......@@ -46,7 +46,12 @@ const tableInfo = ref({
});
}
},
{ label: "元数据", field: "metaNames", width: 200 },
{
label: "元数据", field: "metaNames", width: 200, getName: (scope) => {
const metaNames = scope.row.metaNames || [];
return metaNames.join(',');
}
},
{
label: "执行状态", field: "status", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.status, 'status');
......@@ -73,19 +78,18 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 220,
width: 280,
btns: (scope) => {
let row = scope.row, btnArr: any = [
{ label: "手动执行", value: "run" },
{ label: "编辑", value: "edit" },
{ label: "日志", value: "log" },
{ label: "删除", value: "delete" }
];
if (row.status == 'Y') {
if (row.confirmStatus == 'Y') {
btnArr.splice(0, 0, { label: "结果修改", value: "modify" });
} else {
btnArr.splice(0, 0, { label: "结果确认", value: "confirm" });
}
if (row.confirmStatus == 'Y') {
btnArr.splice(0, 0, { label: "结果修改", value: "modify" });
} else {
btnArr.splice(0, 0, { label: "结果确认", value: "confirm", disabled: row.status != 'Y' });
}
return btnArr;
},
......@@ -115,8 +119,25 @@ const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if(type == 'confirm' || type == 'modify' || type == 'edit' || type == "log"){
if (type == 'confirm' || type == 'modify' || type == 'edit' || type == "log") {
toPath(type);
} else if (type == 'run') {
const guids = [currTableData.value.guid];
runExecTask(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getFirstPageData();
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
}).catch((res) => {
ElMessage({
type: "error",
message: '请求失败',
});
});
} else if (type === "delete") {
open("此操作将永久删除,是否继续?", "warning");
}
......@@ -130,21 +151,21 @@ const toPath = (type) => {
type
},
});
} else if(type == 'edit'){
} else if (type == 'edit') {
router.push({
name: "taskEdit",
query: {
guid: currTableData.value.guid,
name: currTableData.value.damName,
name: currTableData.value.taskName,
type
},
});
} else if(type == 'confirm' || type == 'modify'){
} else if (type == 'confirm' || type == 'modify') {
router.push({
name: "taskDetail",
query: {
guid: currTableData.value.guid,
name: currTableData.value.damName,
name: currTableData.value.taskName,
type
},
});
......@@ -153,7 +174,7 @@ const toPath = (type) => {
name: "taskLog",
query: {
guid: currTableData.value.guid,
name: currTableData.value.damName,
name: currTableData.value.taskName,
type
},
});
......@@ -175,7 +196,7 @@ const open = (msg, type, isBatch = false) => {
type: type,
}).then(() => {
const guids = [currTableData.value.guid];
listingDelete(guids).then((res: any) => {
cgTaskDelete(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getFirstPageData();
ElMessage({
......@@ -200,24 +221,22 @@ const getFirstPageData = () => {
getTableData();
}
// onActivated(() => {
// if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
// getFirstPageData();
// assetStore.set(false);
// }
// })
onActivated(() => {
// if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
// getFirstPageData();
// assetStore.set(false);
// }
getFirstPageData()
})
onBeforeMount(() => {
getFirstPageData()
})
</script>
<template>
<div class="container_wrap" v-if="tableInfo.data.length">
<div class="table_tool_wrap">
<div class="table_title">分类分级任务</div>
</div>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
......@@ -225,7 +244,7 @@ onBeforeMount(() => {
<div class="container_wrap" v-else>
<div class="card-noData">
<img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
<p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
<p>暂无日志记录</p>
</div>
</div>
</template>
......@@ -247,7 +266,7 @@ onBeforeMount(() => {
.table_panel_wrap {
width: 100%;
height: calc(100% - 40px);
height: 100%;
padding: 0px 8px 0;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!