d9e56607 by lxs

分类分级任务联调

1 parent 967a81c8
...@@ -254,26 +254,40 @@ export const getCgTaskDetail = (data) => request({ ...@@ -254,26 +254,40 @@ export const getCgTaskDetail = (data) => request({
254 }) 254 })
255 255
256 // 分来分级任务-新增 256 // 分来分级任务-新增
257 export const getCgTaskSave = (data) => request({ 257 export const cgTaskSave = (data) => request({
258 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/save`, 258 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/save`,
259 method: 'post', 259 method: 'post',
260 data 260 data
261 }) 261 })
262 262
263 // 分来分级任务-修改 263 // 分来分级任务-修改
264 export const getCgTaskUpdate = (data) => request({ 264 export const cgTaskUpdate = (data) => request({
265 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/update`, 265 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/update`,
266 method: 'put', 266 method: 'put',
267 data 267 data
268 }) 268 })
269 269
270 // 分来分级任务-删除 270 // 分来分级任务-删除
271 export const getCgTaskDelete = (data) => request({ 271 export const cgTaskDelete = (data) => request({
272 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/delete`, 272 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/delete`,
273 method: 'delete',
274 data
275 })
276
277 // 手动执行任务
278 export const runExecTask = (data) => request({
279 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task/exec-task`,
273 method: 'put', 280 method: 'put',
274 data 281 data
275 }) 282 })
276 283
284 // 分类分级任务日志
285 export const getTaskExecPageList = (data) => request({
286 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-task-exec/page-list`,
287 method: 'post',
288 data
289 })
290
277 // 标签规则-分页 291 // 标签规则-分页
278 export const getCgLabelPageList = (data) => request({ 292 export const getCgLabelPageList = (data) => request({
279 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-label/page-list`, 293 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-label/page-list`,
...@@ -317,7 +331,7 @@ export const filterVal = (val, type) => { ...@@ -317,7 +331,7 @@ export const filterVal = (val, type) => {
317 status = '已确认'; 331 status = '已确认';
318 break; 332 break;
319 default: 333 default:
320 status = '草稿中'; 334 status = '--';
321 break; 335 break;
322 } 336 }
323 } 337 }
......
...@@ -86,7 +86,7 @@ export const getMetaDataBase = (params) => request({ ...@@ -86,7 +86,7 @@ export const getMetaDataBase = (params) => request({
86 }) 86 })
87 // 表分页查询 87 // 表分页查询
88 export const getMetaDataSheet = (params) => request({ 88 export const getMetaDataSheet = (params) => request({
89 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-detail-list`, 89 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-detail-list`,
90 method: 'post', 90 method: 'post',
91 data: params 91 data: params
92 }) 92 })
......
...@@ -54,6 +54,7 @@ const useUserStore = defineStore( ...@@ -54,6 +54,7 @@ const useUserStore = defineStore(
54 userName.value = res.data.userName 54 userName.value = res.data.userName
55 // userData.value = JSON.stringify(res.data.data); 55 // userData.value = JSON.stringify(res.data.data);
56 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; 56 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
57 localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
57 let currentTenant = res.data.tenantInfoList?.[0]; 58 let currentTenant = res.data.tenantInfoList?.[0];
58 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { 59 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
59 if (info.code == '00000') { 60 if (info.code == '00000') {
......
...@@ -9,7 +9,7 @@ import useUserStore from "@/store/modules/user"; ...@@ -9,7 +9,7 @@ import useUserStore from "@/store/modules/user";
9 import { ElMessage, ElMessageBox } from "element-plus"; 9 import { ElMessage, ElMessageBox } from "element-plus";
10 10
11 import useDataAssetStore from "@/store/modules/dataAsset"; 11 import useDataAssetStore from "@/store/modules/dataAsset";
12 import { filterVal, getCgTaskPageList, } from "@/api/modules/dataInventory"; 12 import { filterVal, getCgTaskPageList, cgTaskDelete, runExecTask } from "@/api/modules/dataInventory";
13 import { TableColumnWidth } from '@/utils/enum'; 13 import { TableColumnWidth } from '@/utils/enum';
14 14
15 import Table from "@/components/Table/index.vue"; 15 import Table from "@/components/Table/index.vue";
...@@ -46,7 +46,12 @@ const tableInfo = ref({ ...@@ -46,7 +46,12 @@ const tableInfo = ref({
46 }); 46 });
47 } 47 }
48 }, 48 },
49 { label: "元数据", field: "metaNames", width: 200 }, 49 {
50 label: "元数据", field: "metaNames", width: 200, getName: (scope) => {
51 const metaNames = scope.row.metaNames || [];
52 return metaNames.join(',');
53 }
54 },
50 { 55 {
51 label: "执行状态", field: "status", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => { 56 label: "执行状态", field: "status", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
52 return filterVal(scope.row.status, 'status'); 57 return filterVal(scope.row.status, 'status');
...@@ -73,19 +78,18 @@ const tableInfo = ref({ ...@@ -73,19 +78,18 @@ const tableInfo = ref({
73 actionInfo: { 78 actionInfo: {
74 label: "操作", 79 label: "操作",
75 type: "btn", 80 type: "btn",
76 width: 220, 81 width: 280,
77 btns: (scope) => { 82 btns: (scope) => {
78 let row = scope.row, btnArr: any = [ 83 let row = scope.row, btnArr: any = [
84 { label: "手动执行", value: "run" },
79 { label: "编辑", value: "edit" }, 85 { label: "编辑", value: "edit" },
80 { label: "日志", value: "log" }, 86 { label: "日志", value: "log" },
81 { label: "删除", value: "delete" } 87 { label: "删除", value: "delete" }
82 ]; 88 ];
83 if (row.status == 'Y') {
84 if (row.confirmStatus == 'Y') { 89 if (row.confirmStatus == 'Y') {
85 btnArr.splice(0, 0, { label: "结果修改", value: "modify" }); 90 btnArr.splice(0, 0, { label: "结果修改", value: "modify" });
86 } else { 91 } else {
87 btnArr.splice(0, 0, { label: "结果确认", value: "confirm" }); 92 btnArr.splice(0, 0, { label: "结果确认", value: "confirm", disabled: row.status != 'Y' });
88 }
89 } 93 }
90 return btnArr; 94 return btnArr;
91 }, 95 },
...@@ -115,8 +119,25 @@ const tableBtnClick = (scope, btn) => { ...@@ -115,8 +119,25 @@ const tableBtnClick = (scope, btn) => {
115 const type = btn.value; 119 const type = btn.value;
116 const row = scope.row; 120 const row = scope.row;
117 currTableData.value = row; 121 currTableData.value = row;
118 if(type == 'confirm' || type == 'modify' || type == 'edit' || type == "log"){ 122 if (type == 'confirm' || type == 'modify' || type == 'edit' || type == "log") {
119 toPath(type); 123 toPath(type);
124 } else if (type == 'run') {
125 const guids = [currTableData.value.guid];
126 runExecTask(guids).then((res: any) => {
127 if (res.code == proxy.$passCode) {
128 getFirstPageData();
129 } else {
130 ElMessage({
131 type: "error",
132 message: res.msg,
133 });
134 }
135 }).catch((res) => {
136 ElMessage({
137 type: "error",
138 message: '请求失败',
139 });
140 });
120 } else if (type === "delete") { 141 } else if (type === "delete") {
121 open("此操作将永久删除,是否继续?", "warning"); 142 open("此操作将永久删除,是否继续?", "warning");
122 } 143 }
...@@ -130,21 +151,21 @@ const toPath = (type) => { ...@@ -130,21 +151,21 @@ const toPath = (type) => {
130 type 151 type
131 }, 152 },
132 }); 153 });
133 } else if(type == 'edit'){ 154 } else if (type == 'edit') {
134 router.push({ 155 router.push({
135 name: "taskEdit", 156 name: "taskEdit",
136 query: { 157 query: {
137 guid: currTableData.value.guid, 158 guid: currTableData.value.guid,
138 name: currTableData.value.damName, 159 name: currTableData.value.taskName,
139 type 160 type
140 }, 161 },
141 }); 162 });
142 } else if(type == 'confirm' || type == 'modify'){ 163 } else if (type == 'confirm' || type == 'modify') {
143 router.push({ 164 router.push({
144 name: "taskDetail", 165 name: "taskDetail",
145 query: { 166 query: {
146 guid: currTableData.value.guid, 167 guid: currTableData.value.guid,
147 name: currTableData.value.damName, 168 name: currTableData.value.taskName,
148 type 169 type
149 }, 170 },
150 }); 171 });
...@@ -153,7 +174,7 @@ const toPath = (type) => { ...@@ -153,7 +174,7 @@ const toPath = (type) => {
153 name: "taskLog", 174 name: "taskLog",
154 query: { 175 query: {
155 guid: currTableData.value.guid, 176 guid: currTableData.value.guid,
156 name: currTableData.value.damName, 177 name: currTableData.value.taskName,
157 type 178 type
158 }, 179 },
159 }); 180 });
...@@ -175,7 +196,7 @@ const open = (msg, type, isBatch = false) => { ...@@ -175,7 +196,7 @@ const open = (msg, type, isBatch = false) => {
175 type: type, 196 type: type,
176 }).then(() => { 197 }).then(() => {
177 const guids = [currTableData.value.guid]; 198 const guids = [currTableData.value.guid];
178 listingDelete(guids).then((res: any) => { 199 cgTaskDelete(guids).then((res: any) => {
179 if (res.code == proxy.$passCode) { 200 if (res.code == proxy.$passCode) {
180 getFirstPageData(); 201 getFirstPageData();
181 ElMessage({ 202 ElMessage({
...@@ -200,24 +221,22 @@ const getFirstPageData = () => { ...@@ -200,24 +221,22 @@ const getFirstPageData = () => {
200 getTableData(); 221 getTableData();
201 } 222 }
202 223
203 // onActivated(() => { 224 onActivated(() => {
204 // if (assetStore.isRefresh) {//如果是首次加载,则不需要调用 225 // if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
205 // getFirstPageData(); 226 // getFirstPageData();
206 // assetStore.set(false); 227 // assetStore.set(false);
207 // } 228 // }
208 // }) 229 getFirstPageData()
230 })
209 231
210 onBeforeMount(() => { 232 onBeforeMount(() => {
211 getFirstPageData() 233
212 }) 234 })
213 235
214 </script> 236 </script>
215 237
216 <template> 238 <template>
217 <div class="container_wrap" v-if="tableInfo.data.length"> 239 <div class="container_wrap" v-if="tableInfo.data.length">
218 <div class="table_tool_wrap">
219 <div class="table_title">分类分级任务</div>
220 </div>
221 <div class="table_panel_wrap"> 240 <div class="table_panel_wrap">
222 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" /> 241 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
223 </div> 242 </div>
...@@ -225,7 +244,7 @@ onBeforeMount(() => { ...@@ -225,7 +244,7 @@ onBeforeMount(() => {
225 <div class="container_wrap" v-else> 244 <div class="container_wrap" v-else>
226 <div class="card-noData"> 245 <div class="card-noData">
227 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" /> 246 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
228 <p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p> 247 <p>暂无日志记录</p>
229 </div> 248 </div>
230 </div> 249 </div>
231 </template> 250 </template>
...@@ -247,7 +266,7 @@ onBeforeMount(() => { ...@@ -247,7 +266,7 @@ onBeforeMount(() => {
247 266
248 .table_panel_wrap { 267 .table_panel_wrap {
249 width: 100%; 268 width: 100%;
250 height: calc(100% - 40px); 269 height: 100%;
251 padding: 0px 8px 0; 270 padding: 0px 8px 0;
252 } 271 }
253 272
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!