Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
abc5146e
authored
2024-12-20 16:18:28 +0800
by
lxs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分类分级任务联调
1 parent
d9e56607
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
183 additions
and
158 deletions
src/api/modules/dataInventory.ts
src/components/Tools/table_search.vue
src/components/Tools/table_tools.vue
src/router/modules/dataInventory.ts
src/store/modules/user.ts
src/views/data_inventory/taskConfig.vue
src/views/data_inventory/taskDetail.vue
src/views/data_inventory/taskEdit.vue
src/views/data_inventory/taskLog.vue
src/api/modules/dataInventory.ts
View file @
abc5146
...
...
@@ -277,8 +277,8 @@ export const cgTaskDelete = (data) => request({
// 手动执行任务
export
const
runExecTask
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task/exec-task`
,
method
:
'p
u
t'
,
data
method
:
'p
os
t'
,
params
:
data
})
// 分类分级任务日志
...
...
@@ -288,6 +288,47 @@ export const getTaskExecPageList = (data) => request({
data
})
// 分类分级任务执行树形数据
export
const
getTaskExeTreeList
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec/classify/tree-list`
,
method
:
'get'
,
params
:
data
})
// 分类分级任务执行字段统计
export
const
getTaskFieldCount
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec-result/confirm-field-cnt`
,
method
:
'get'
,
params
:
data
})
// 分类分级任务执行字段查询
export
const
execTaskFieldList
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec-result/confirm-field-list-query`
,
method
:
'post'
,
data
})
// 分类分级任务执行库表查询
export
const
execTaskSheetList
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec-result/confirm-db-list-query`
,
method
:
'post'
,
data
})
// 分类分级任务执行任务确认
export
const
execTaskConfirm
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec-result/confirm-task`
,
method
:
'post'
,
data
})
// 分类分级任务执行字段确认
export
const
execFieldConfirm
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-task-exec-result/confirm-field`
,
method
:
'post'
,
data
})
// 标签规则-分页
export
const
getCgLabelPageList
=
(
data
)
=>
request
({
url
:
`
${
import
.
meta
.
env
.
VITE_APP_CHECK_BASEURL
}
/cg-label/page-list`
,
...
...
@@ -334,6 +375,18 @@ export const filterVal = (val, type) => {
status
=
'--'
;
break
;
}
}
else
if
(
type
==
'isCgChange'
){
switch
(
val
)
{
case
'N'
:
status
=
'待确认'
;
break
;
case
'Y'
:
status
=
'已确认'
;
break
;
default
:
status
=
'待确认'
;
break
;
}
}
return
status
;
}
...
...
src/components/Tools/table_search.vue
View file @
abc5146
...
...
@@ -3,7 +3,17 @@ import { computed, reactive, ref } from 'vue'
import
{
Search
}
from
'@element-plus/icons-vue'
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
{
debounce
}
from
"@/utils/common"
const
emits
=
defineEmits
([
"tableSearch"
,
"toolFilterChange"
,
"loadMore"
,
"remoteMethod"
,
"treeSelectLoad"
,
"selectChange"
,
"treeSelectNodeChange"
,
"treeSelectNodeClick"
]);
const
emits
=
defineEmits
([
"tableSearch"
,
"toolFilterChange"
,
"loadMore"
,
"remoteMethod"
,
"treeSelectLoad"
,
"selectChange"
,
"treeSelectNodeChange"
,
"treeSelectNodeClick"
,
"cascaderChange"
,
]);
const
props
=
defineProps
({
itemList
:
{
type
:
Array
,
...
...
@@ -19,6 +29,7 @@ const props = defineProps({
}
})
const
formRef
=
ref
()
const
formCascaderRef
=
ref
();
const
formInline
:
any
=
computed
(()
=>
{
let
items
=
setFormFields
(
props
.
itemList
);
return
reactive
(
items
);
...
...
@@ -34,9 +45,16 @@ const resetForm = (formEl: FormInstance | undefined) => {
emits
(
'tableSearch'
,
form
,
true
)
})
}
const
getCascaderCheckedData
=
()
=>
{
const
formCascader
=
formCascaderRef
.
value
[
0
]
||
formCascaderRef
.
value
;
const
data
=
formCascader
.
getCheckedNodes
();
return
data
;
};
defineExpose
({
formInline
,
formRef
formRef
,
getCascaderCheckedData
})
const
setFormFields
=
(
list
:
any
)
=>
{
let
obj
=
{}
...
...
@@ -68,10 +86,13 @@ const selectChange = (val, row) => {
const
handleTreeSelectNodeChange
=
(
node
,
item
)
=>
{
emits
(
"treeSelectNodeChange"
,
node
,
item
);
}
const
handleTreeSelectNodeClick
=
(
node
,
item
)
=>
{
const
handleTreeSelectNodeClick
=
(
node
,
item
)
=>
{
emits
(
"treeSelectNodeClick"
,
node
,
item
);
}
const
inputChange
=
(
val
)
=>
{
const
cascaderChange
=
(
val
,
item
)
=>
{
emits
(
"cascaderChange"
,
val
,
item
);
}
const
inputChange
=
(
val
)
=>
{
onSubmit
()
}
onMounted
(()
=>
{
...
...
@@ -86,56 +107,47 @@ onMounted(() => {
:class=
"
{ 'width_auto': item.type == 'radio-button' }" :prop="item.field">
<template
v-if=
"item.type == 'select'"
>
<el-select
:class=
"
{ 'is-multiple': item.multiple }" v-model="formInline[item.field]"
:placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable" @change="(val) => selectChange(val, item)">
<el-option
v-for=
"opt in item.options"
:label=
"item.props?.label ? opt[item.props.label] : opt.label"
:value=
"item.props?.value ? opt[item.props.value] : opt.value"
/>
:placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable"
@change="(val) => selectChange(val, item)">
<el-option
v-for=
"opt in item.options"
:label=
"item.props?.label ? opt[item.props.label] : opt.label"
:value=
"item.props?.value ? opt[item.props.value] : opt.value"
/>
</el-select>
</
template
>
<
template
v-else-if=
"item.type == 'input-select'"
>
<el-input
v-model
.
trim=
"formInline[item.field]"
:placeholder=
"item.placeholder"
class=
"input-with-select"
:maxlength=
"item.maxlength ?? ''"
:suffix-icon=
"Search"
>
<el-input
v-model
.
trim=
"formInline[item.field]"
:placeholder=
"item.placeholder"
class=
"input-with-select"
:
maxlength=
"item.maxlength ?? ''"
:
suffix-icon=
"Search"
>
<template
#
prepend
>
<span
v-for=
"child in item.children"
>
<el-select
v-model=
"formItemList[child.field]"
:placeholder=
"child.placeholder"
:clearable=
"item.clearable"
style=
"vertical-align: inherit;"
>
<el-option
v-for=
"opts in child.options"
:label=
"child.props?.label ? opts[item.props.label] : opts.label"
:value=
"child.props?.value ? opts[item.props.value] : opts.value"
/>
<el-option
v-for=
"opts in child.options"
:label=
"child.props?.label ? opts[item.props.label] : opts.label"
:value=
"child.props?.value ? opts[item.props.value] : opts.value"
/>
</el-select>
</span>
</
template
>
</el-input>
</template>
<
template
v-else-if=
"item.type
==
'tree-select'"
>
<
template
v-else-if=
"item.type
==
'tree-select'"
>
<div
class=
"select_slots_panel"
>
<div
class=
"slot-prefix"
v-for=
"child in item.children"
>
<el-select
v-model=
"formInline[child.field]"
:placeholder=
"child.placeholder"
@
change=
"(val) => selectChange(val, child)"
>
<el-select
v-model=
"formInline[child.field]"
:placeholder=
"child.placeholder"
@
change=
"(val) => selectChange(val, child)"
>
<el-option
v-for=
"cpt in child.options"
:label=
"cpt.label"
:value=
"cpt.value"
/>
</el-select>
</div>
</div>
<div
class=
"slot-default"
>
<el-tree-select
v-model=
"formInline[item.field]"
:data=
"item.options"
:placeholder=
"item.placeholder"
:clearable=
"item.clearable"
:filterable=
"item.filterable"
:disabled=
"item.disabled"
:lazy=
"item.lazy ?? true"
:check-strictly =
"item.checkStrictly ?? false"
:node-key=
"item.nodeKey ?? 'guid'"
:load=
"(node, resolve) => treeSelectLoad(node, resolve, item)"
:props=
"item.props"
:multiple=
"item.multiple ?? false"
:render-after-expand=
"true"
:teleported=
"item.teleported ?? true"
:default-expanded-keys=
"item.expandKeys"
:collapse-tags-tooltip=
"item.collapseTagsTooltip ?? false"
:collapse-tags=
"item.collapseTags ?? false"
:max-collapse-tags=
"item.maxTags ?? 1"
:show-checkbox=
"item.showCheckbox ?? false"
@
change=
"(val) => selectChange(val, item)"
<el-tree-select
v-model=
"formInline[item.field]"
:data=
"item.options"
:placeholder=
"item.placeholder"
:clearable=
"item.clearable"
:filterable=
"item.filterable"
:disabled=
"item.disabled"
:lazy=
"item.lazy ?? true"
:check-strictly=
"item.checkStrictly ?? false"
:node-key=
"item.nodeKey ?? 'guid'"
:load=
"(node, resolve) => treeSelectLoad(node, resolve, item)"
:props=
"item.props"
:multiple=
"item.multiple ?? false"
:render-after-expand=
"true"
:teleported=
"item.teleported ?? true"
:default-expanded-keys=
"item.expandKeys"
:collapse-tags-tooltip=
"item.collapseTagsTooltip ?? false"
:collapse-tags=
"item.collapseTags ?? false"
:max-collapse-tags=
"item.maxTags ?? 1"
:show-checkbox=
"item.showCheckbox ?? false"
@
change=
"(val) => selectChange(val, item)"
@
current-change=
"(node) => handleTreeSelectNodeChange(node, item)"
@
node-click =
"(node)=>handleTreeSelectNodeClick(node, item)"
>
@
node-click=
"(node) => handleTreeSelectNodeClick(node, item)"
>
<!--
<template
#
default=
"
{ node, data }">
<template
v-if=
"item.getName"
>
...
...
@@ -153,8 +165,8 @@ onMounted(() => {
{{
item
.
getName
(
data
,
node
)
}}
</div>
</
template
>
<span
v-else
>
{{ data[item.props.label] }}
</span>
</template>
-->
<span
v-else
>
{{ data[item.props.label] }}
</span>
</template>
-->
</el-tree-select>
</div>
...
...
@@ -178,13 +190,21 @@ onMounted(() => {
<div
class=
"slot-default"
>
<el-select
:class=
"
{ 'is-multiple': item.multiple }" v-model="formInline[item.field]"
:placeholder="item.placeholder" :multiple="item.multiple" collapse-tags collapse-tags-tooltip
@change="(val) => selectChange(val, item)"
:
max-collapse-tags="3" :filterable="item.filterable" :
clearable="item.clearable" v-loadmore="loadMore">
@change="(val) => selectChange(val, item)"
:max-collapse-tags="3" :filterable="item.filterable"
:clearable="item.clearable" v-loadmore="loadMore">
<el-option
v-for=
"opt in item.options"
:label=
"opt.label"
:value=
"opt.value"
/>
</el-select>
</div>
</div>
</
template
>
<
template
v-else-if=
"item.type == 'cascader'"
>
<el-cascader
ref=
"formCascaderRef"
:class=
"[item.col,
{ is_block: item.block }]"
v-model="formInline[item.field]" :options="item.options" :props="item.props" :placeholder="item.placeholder"
:show-all-levels="item.showAllLevels ?? true" :clearable="item.clearable"
:filterable="item.filterable ?? false" :collapse-tags="item.collapse ?? false"
:collapse-tags-tooltip="item.tagsTooltip ?? false" :max-collapse-tags="item.maxTags ?? 1"
:disabled="item.disabled ?? false" @change="(val) => cascaderChange(val, item)" />
</
template
>
<
template
v-else
>
<el-input
v-model
.
trim=
"formInline[item.field]"
:placeholder=
"item.placeholder"
:clearable=
"item.clearable"
@
clear=
"inputChange"
/>
...
...
src/components/Tools/table_tools.vue
View file @
abc5146
<
script
lang=
"ts"
setup
name=
"TableTools"
>
import
TableSearch
from
'./table_search.vue'
const
emits
=
defineEmits
([
"search"
,
"filterChange"
,
"loadMore"
,
"remoteMethod"
,
"treeSelectLoad"
,
"selectChange"
,
"treeSelectNodeChange"
,
"treeSelectNodeClick"
]);
const
emits
=
defineEmits
([
"search"
,
"filterChange"
,
"loadMore"
,
"remoteMethod"
,
"treeSelectLoad"
,
"selectChange"
,
"treeSelectNodeChange"
,
"treeSelectNodeClick"
,
"cascaderChange"
]);
const
props
=
defineProps
({
searchItems
:
{
type
:
Array
,
...
...
@@ -53,6 +53,14 @@ const handleTreeSelectNodeChange = (node, item) => {
const
treeSelectNodeClick
=
(
node
,
item
)
=>
{
emits
(
"treeSelectNodeClick"
,
node
,
item
);
}
const
cascaderChange
=
(
val
,
item
)
=>
{
emits
(
"cascaderChange"
,
val
,
item
);
}
const
getCascaderCheckedData
=
()
=>
{
return
toolSearch
.
value
.
getCascaderCheckedData
();
}
defineExpose
({
toolSearch
,
})
...
...
@@ -69,6 +77,7 @@ defineExpose({
@
selectChange=
"selectChange"
@
treeSelectNodeChange=
"handleTreeSelectNodeChange"
@
treeSelectNodeClick=
"treeSelectNodeClick"
@
cascaderChange=
"cascaderChange"
/>
</div>
<div
class=
"tools_bar"
v-if=
"bars?.length"
>
...
...
src/router/modules/dataInventory.ts
View file @
abc5146
...
...
@@ -74,15 +74,8 @@ const routes: RouteRecordRaw[] = [
sidebar
:
false
,
breadcrumb
:
false
,
cache
:
true
,
reuse
:
true
,
editPage
:
true
,
activeMenu
:
'/data-inventory/classify-grade-manage/task-config'
},
beforeEnter
:
(
to
,
from
)
=>
{
// if (to.query.name) {
// to.meta.title = `编辑-${to.query.name}`;
// }
}
},
{
path
:
'template-config'
,
...
...
src/store/modules/user.ts
View file @
abc5146
...
...
@@ -33,7 +33,7 @@ const useUserStore = defineStore(
function
getToken
(
data
,
state
)
{
data
.
platformGuid
=
"7f16f697aec111ef8656fa163e60becd"
;
data
.
userType
=
2
;
data
.
validateUri
=
location
.
origin
+
'/'
;
data
.
validateUri
=
location
.
origin
==
'http://localhost:9000'
?
'http://localhost:9000/'
:
location
.
origin
+
'/'
;
return
getTokenPromise
.
value
=
getTokenByCode
(
data
).
then
((
res
:
any
)
=>
{
getTokenPromise
.
value
=
null
;
console
.
log
(
res
);
...
...
src/views/data_inventory/taskConfig.vue
View file @
abc5146
...
...
@@ -12,14 +12,13 @@ import useDataAssetStore from "@/store/modules/dataAsset";
import
{
filterVal
,
getCgTaskPageList
,
cgTaskDelete
,
runExecTask
}
from
"@/api/modules/dataInventory"
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
Table
from
"@/components/Table/index.vue"
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
userStore
=
useUserStore
();
const
userData
=
JSON
.
parse
(
userStore
.
userData
);
const
assetStore
=
useDataAssetStore
();
const
loading
=
ref
(
false
);
const
page
=
ref
({
limit
:
50
,
curr
:
1
,
...
...
@@ -41,8 +40,8 @@ const tableInfo = ref({
{
label
:
"目录名称"
,
field
:
"cgDirName"
,
width
:
120
,
type
:
"text_btn"
,
columClass
:
'text_btn'
,
click
:
(
scope
)
=>
{
router
.
push
({
name
:
"
templateConfig
"
,
query
:
{
guid
:
scope
.
row
.
damGuid
},
name
:
"
classifyGradeCatalogue
"
,
//
query: { guid: scope.row.damGuid },
});
}
},
...
...
@@ -68,13 +67,8 @@ const tableInfo = ref({
}
},
],
loading
:
false
,
data
:
[],
page
:
{
type
:
"normal"
,
rows
:
0
,
...
page
.
value
,
},
showPage
:
false
,
actionInfo
:
{
label
:
"操作"
,
type
:
"btn"
,
...
...
@@ -97,21 +91,18 @@ const tableInfo = ref({
});
const
getTableData
=
()
=>
{
tableInfo
.
value
.
loading
=
true
;
loading
.
value
=
true
;
getCgTaskPageList
(
Object
.
assign
({},
searchItemValue
.
value
,
{
pageIndex
:
page
.
value
.
curr
,
pageSize
:
page
.
value
.
limit
,
pageSize
:
-
1
,
})
).
then
((
res
:
any
)
=>
{
tableInfo
.
value
.
loading
=
false
;
loading
.
value
=
false
;
tableInfo
.
value
.
data
=
res
.
data
.
records
||
[];
tableInfo
.
value
.
page
.
curr
=
res
.
data
.
pageIndex
;
tableInfo
.
value
.
page
.
limit
=
res
.
data
.
pageSize
;
tableInfo
.
value
.
page
.
rows
=
res
.
data
.
totalRows
;
})
.
catch
((
res
)
=>
{
tableInfo
.
value
.
loading
=
false
;
loading
.
value
=
false
;
});
};
...
...
@@ -122,10 +113,10 @@ const tableBtnClick = (scope, btn) => {
if
(
type
==
'confirm'
||
type
==
'modify'
||
type
==
'edit'
||
type
==
"log"
)
{
toPath
(
type
);
}
else
if
(
type
==
'run'
)
{
const
guids
=
[
currTableData
.
value
.
guid
]
;
runExecTask
(
guid
s
).
then
((
res
:
any
)
=>
{
const
params
=
{
guid
:
currTableData
.
value
.
guid
}
;
runExecTask
(
param
s
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
get
FirstPag
eData
();
get
Tabl
eData
();
}
else
{
ElMessage
({
type
:
"error"
,
...
...
@@ -181,14 +172,6 @@ const toPath = (type) => {
}
}
const
tablePageChange
=
(
info
)
=>
{
page
.
value
.
curr
=
Number
(
info
.
curr
);
page
.
value
.
limit
=
Number
(
info
.
limit
);
tableInfo
.
value
.
page
.
limit
=
page
.
value
.
limit
;
tableInfo
.
value
.
page
.
curr
=
page
.
value
.
curr
;
getTableData
();
};
const
open
=
(
msg
,
type
,
isBatch
=
false
)
=>
{
ElMessageBox
.
confirm
(
msg
,
"提示"
,
{
confirmButtonText
:
"确定"
,
...
...
@@ -198,7 +181,7 @@ const open = (msg, type, isBatch = false) => {
const
guids
=
[
currTableData
.
value
.
guid
];
cgTaskDelete
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
get
FirstPag
eData
();
get
Tabl
eData
();
ElMessage
({
type
:
"success"
,
message
:
"删除成功"
,
...
...
@@ -210,41 +193,35 @@ const open = (msg, type, isBatch = false) => {
});
}
}).
catch
((
res
)
=>
{
tableInfo
.
value
.
loading
=
false
;
});
});
};
const
getFirstPageData
=
()
=>
{
page
.
value
.
curr
=
1
tableInfo
.
value
.
page
.
curr
=
1
;
getTableData
();
}
onActivated
(()
=>
{
// if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
// getFirstPageData();
// assetStore.set(false);
// }
getFirstPageData
()
})
onBeforeMount
(()
=>
{
getTableData
()
})
</
script
>
<
template
>
<div
class=
"container_wrap"
v-
if=
"tableInfo.data.length
"
>
<div
class=
"table_
panel_wrap
"
>
<
Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tablePageChange=
"tablePageChange"
/
>
<div
class=
"container_wrap"
v-
loading=
"loading
"
>
<div
class=
"table_
tool_wrap"
v-if=
"tableInfo.data.length
"
>
<
div
class=
"table_title"
>
分类分级任务
</div
>
</div>
<div
class=
"table_panel_wrap"
v-if=
"tableInfo.data.length"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
/>
</div>
<div
class=
"container_wrap"
v-else
>
<div
class=
"card-noData"
>
<div
class=
"card-noData"
v-else
>
<img
src=
"@/assets/images/no-data.png"
:style=
"
{ width: '96px', height: '96px' }" />
<p>
暂无
日志记录
</p>
<p>
暂无
分类分级任务,
<span
class=
"text_btn"
@
click=
"toPath('add')"
>
去新建
</span>
</p>
</div>
</div>
</
template
>
...
...
@@ -252,7 +229,7 @@ onBeforeMount(() => {
<
style
scoped
lang=
"scss"
>
.table_tool_wrap
{
width
:
100%
;
height
:
40px
!importan
t
;
min-height
:
unse
t
;
padding
:
0
8px
;
.table_title
{
...
...
@@ -266,8 +243,8 @@ onBeforeMount(() => {
.table_panel_wrap
{
width
:
100%
;
height
:
100%
;
padding
:
0px
8px
0
;
height
:
calc
(
100%
-
40px
)
;
padding
:
8px
8px
16px
;
}
.card-noData
{
...
...
src/views/data_inventory/taskDetail.vue
View file @
abc5146
This diff is collapsed.
Click to expand it.
src/views/data_inventory/taskEdit.vue
View file @
abc5146
...
...
@@ -152,6 +152,7 @@ const metadataTableInfo = ref({
const
getTaskDetail
=
(
data
)
=>
{
getCgTaskDetail
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
{};
taskDetail
.
value
=
data
;
taskFormItems
.
value
.
map
((
item
)
=>
{
...
...
@@ -160,6 +161,7 @@ const getTaskDetail = (data) => {
selectRowData
.
value
=
data
.
metaGuids
||
[];
getPermissionList
({});
getMetaTableData
();
}
})
}
...
...
@@ -179,22 +181,22 @@ const getTableData = () => {
})
).
then
((
res
:
any
)
=>
{
tableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
tableInfo
.
value
.
data
=
res
.
data
.
records
||
[];
tableInfo
.
value
.
page
.
curr
=
res
.
data
.
pageIndex
;
tableInfo
.
value
.
page
.
limit
=
res
.
data
.
pageSize
;
tableInfo
.
value
.
page
.
rows
=
res
.
data
.
totalRows
;
}
})
.
catch
((
res
)
=>
{
tableInfo
.
value
.
loading
=
false
;
});
};
const
toPath
=
(
type
=
null
)
=>
{
const
toPath
=
()
=>
{
router
.
push
({
name
:
"taskConfig"
,
query
:
{
type
},
query
:
{},
});
}
...
...
@@ -218,11 +220,9 @@ const tablePageChange = (info) => {
const
getMetaTableData
=
()
=>
{
getMetaTableCollectList
({}).
then
((
res
:
any
)
=>
{
metadataTableInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
.
records
||
[];
metadataTableInfo
.
value
.
data
=
data
;
// metadataTableInfo.value.page.curr = res.data.pageIndex;
// metadataTableInfo.value.page.limit = res.data.pageSize;
// metadataTableInfo.value.page.rows = res.data.totalRows;
if
(
route
.
query
.
type
===
'edit'
)
{
nextTick
(()
=>
{
data
.
map
((
row
)
=>
{
...
...
@@ -230,6 +230,7 @@ const getMetaTableData = () => {
});
})
}
}
})
}
...
...
@@ -330,7 +331,7 @@ const listClick = (row) => {
};
// 获取分类列表
const
getPermissionList
=
(
val
,
init
=
fals
e
)
=>
{
const
getPermissionList
=
(
val
,
init
=
tru
e
)
=>
{
let
params
:
any
=
val
?
{
...
val
}
:
{}
params
.
pageIndex
=
listPage
.
value
.
curr
;
params
.
pageSize
=
listPage
.
value
.
limit
;
...
...
@@ -343,10 +344,6 @@ const getPermissionList = (val, init = false) => {
permissionList
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
currpermissionList
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
listPage
.
value
.
totalPages
=
res
.
data
.
totalPages
}
else
{
permissionList
.
value
.
push
(...
JSON
.
parse
(
JSON
.
stringify
(
data
)))
querySearch
(
asideSearchInput
.
value
)
}
if
(
data
.
length
)
{
if
(
route
.
query
.
type
==
'edit'
)
{
templateInfo
.
value
=
data
.
filter
(
item
=>
item
.
guid
==
taskDetail
.
value
.
classifyGuid
)[
0
]
...
...
@@ -355,6 +352,10 @@ const getPermissionList = (val, init = false) => {
}
getClassifyTree
()
}
}
else
{
permissionList
.
value
.
push
(...
JSON
.
parse
(
JSON
.
stringify
(
data
)))
querySearch
(
asideSearchInput
.
value
)
}
}
listLoading
.
value
=
false
}).
catch
(()
=>
{
...
...
@@ -365,23 +366,32 @@ const getPermissionList = (val, init = false) => {
// 获取树形列表
const
getClassifyTree
=
()
=>
{
const
params
=
{
g
uid
:
templateInfo
.
value
.
guid
classifyGradeG
uid
:
templateInfo
.
value
.
guid
}
treeInfo
.
value
.
loading
=
true
;
getClassifyTreeList
(
params
).
then
((
res
:
any
)
=>
{
treeInfo
.
value
.
loading
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
const
data
=
res
.
data
||
[];
treeInfo
.
value
.
data
=
data
;
treeInfoRef
.
value
.
setCurrentKey
(
''
);
tableInfo
.
value
.
data
=
[];
}
treeInfo
.
value
.
loading
=
false
;
}).
catch
(()
=>
{
treeInfo
.
value
.
loading
=
false
;
})
}
onActivated
(()
=>
{
// if (route.query.type == 'edit') {
// getTaskDetail({ guid: route.query.guid })
// } else {
// getPermissionList({});
// getMetaTableData();
// }
})
onBeforeMount
(()
=>
{
if
(
route
.
query
.
type
==
'edit'
)
{
getTaskDetail
({
guid
:
route
.
query
.
guid
})
}
else
{
...
...
@@ -390,10 +400,6 @@ onActivated(() => {
}
})
onBeforeMount
(()
=>
{
// getPermissionList({})
})
</
script
>
<
template
>
...
...
src/views/data_inventory/taskLog.vue
View file @
abc5146
...
...
@@ -12,8 +12,6 @@ import useDataAssetStore from "@/store/modules/dataAsset";
import
{
getTaskExecPageList
,
filterVal
}
from
"@/api/modules/dataInventory"
;
import
{
TableColumnWidth
}
from
'@/utils/enum'
;
import
Table
from
"@/components/Table/index.vue"
;
const
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
router
=
useRouter
();
const
route
=
useRoute
();
...
...
@@ -21,6 +19,7 @@ const userStore = useUserStore();
const
userData
=
JSON
.
parse
(
userStore
.
userData
);
const
assetStore
=
useDataAssetStore
();
const
loading
=
ref
(
false
);
const
page
=
ref
({
limit
:
50
,
curr
:
1
,
...
...
@@ -63,7 +62,6 @@ const tableInfo = ref({
}
},
],
loading
:
false
,
data
:
[],
page
:
{
type
:
"normal"
,
...
...
@@ -84,7 +82,7 @@ const tableInfo = ref({
});
const
getTableData
=
()
=>
{
tableInfo
.
value
.
loading
=
true
;
loading
.
value
=
true
;
getTaskExecPageList
(
Object
.
assign
({},
searchItemValue
.
value
,
{
pageIndex
:
page
.
value
.
curr
,
...
...
@@ -92,14 +90,16 @@ const getTableData = () => {
taskGuid
:
route
.
query
.
guid
})
).
then
((
res
:
any
)
=>
{
tableInfo
.
value
.
loading
=
false
;
loading
.
value
=
false
;
if
(
res
.
code
==
proxy
.
$passCode
)
{
tableInfo
.
value
.
data
=
res
.
data
.
records
||
[];
tableInfo
.
value
.
page
.
curr
=
res
.
data
.
pageIndex
;
tableInfo
.
value
.
page
.
limit
=
res
.
data
.
pageSize
;
tableInfo
.
value
.
page
.
rows
=
res
.
data
.
totalRows
;
}
})
.
catch
((
res
)
=>
{
tableInfo
.
value
.
loading
=
false
;
loading
.
value
=
false
;
});
};
...
...
@@ -109,8 +109,6 @@ const tableBtnClick = (scope, btn) => {
currTableData
.
value
=
row
;
if
(
type
==
"path"
)
{
toPath
(
type
);
}
else
if
(
type
===
"delete"
)
{
open
(
"此操作将永久删除,是否继续?"
,
"warning"
);
}
};
...
...
@@ -133,32 +131,6 @@ const tablePageChange = (info) => {
getTableData
();
};
const
open
=
(
msg
,
type
,
isBatch
=
false
)
=>
{
ElMessageBox
.
confirm
(
msg
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
type
,
}).
then
(()
=>
{
const
guids
=
[
currTableData
.
value
.
guid
];
listingDelete
(
guids
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
==
proxy
.
$passCode
)
{
getFirstPageData
();
ElMessage
({
type
:
"success"
,
message
:
"删除成功"
,
});
}
else
{
ElMessage
({
type
:
"error"
,
message
:
res
.
msg
,
});
}
}).
catch
((
res
)
=>
{
tableInfo
.
value
.
loading
=
false
;
});
});
};
const
getFirstPageData
=
()
=>
{
page
.
value
.
curr
=
1
tableInfo
.
value
.
page
.
curr
=
1
;
...
...
@@ -176,18 +148,13 @@ onBeforeMount(() => {
</
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"
>
<div
class=
"container_wrap"
v-loading=
"loading"
>
<div
class=
"table_panel_wrap"
v-if=
"tableInfo.data.length"
>
<Table
:tableInfo=
"tableInfo"
@
tableBtnClick=
"tableBtnClick"
@
tablePageChange=
"tablePageChange"
/>
</div>
</div>
<div
class=
"container_wrap"
v-else
>
<div
class=
"card-noData"
>
<div
class=
"card-noData"
v-else
>
<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
>
...
...
@@ -209,7 +176,7 @@ onBeforeMount(() => {
.table_panel_wrap
{
width
:
100%
;
height
:
calc
(
100%
-
40px
)
;
height
:
100%
;
padding
:
0px
8px
0
;
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment