fix: 任务 跳转
This commit is contained in:
parent
79d014da70
commit
43c3e56905
@ -24,7 +24,7 @@
|
||||
"element-ui": "2.13.0",
|
||||
"file-save": "^0.2.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"fit2cloud-ui": "1.2.0",
|
||||
"fit2cloud-ui": "1.5.0-beta.0",
|
||||
"html2canvasde": "^v1.1.4-de",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsencrypt": "^3.0.0-rc.1",
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div>
|
||||
<slot name="toolbar" />
|
||||
</div>
|
||||
<fu-search-bar v-bind="searchConfig" @exec="search">
|
||||
<fu-search-bar v-bind="searchConfig" @exec="search" ref="search">
|
||||
<template #complex>
|
||||
<slot name="complex" />
|
||||
</template>
|
||||
@ -57,15 +57,25 @@ export default {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
searchConfig: Object,
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
paginationConfig: Object
|
||||
paginationConfig: Object,
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
condition: {}
|
||||
condition: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.transCondition !== null) {
|
||||
this.$refs.search.setConditions(this.transCondition)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
search(condition, e) {
|
||||
console.log(condition)
|
||||
if (condition) {
|
||||
this.condition = condition
|
||||
}
|
||||
|
||||
@ -873,6 +873,7 @@ export default {
|
||||
sync_now: 'Update Now',
|
||||
add_task: 'Add Task',
|
||||
task_name: 'Task Name',
|
||||
task_id: 'Task ID',
|
||||
start_time: 'Start Time',
|
||||
end_time: 'End Time',
|
||||
status: 'State',
|
||||
|
||||
@ -873,6 +873,7 @@ export default {
|
||||
sync_now: '立即更新',
|
||||
add_task: '添加任務',
|
||||
task_name: '任務名稱',
|
||||
task_id: '任務ID',
|
||||
start_time: '開始時間',
|
||||
end_time: '結束時間',
|
||||
status: '狀態',
|
||||
|
||||
@ -873,6 +873,7 @@ export default {
|
||||
sync_now: '立即更新',
|
||||
add_task: '添加任务',
|
||||
task_name: '任务名称',
|
||||
task_id: '任务ID',
|
||||
start_time: '开始时间',
|
||||
end_time: '结束时间',
|
||||
status: '状态',
|
||||
|
||||
@ -153,7 +153,7 @@ export default {
|
||||
}
|
||||
const param = this.multipleSelection.map(item => item.msgId)
|
||||
batchRead(param).then(res => {
|
||||
this.$success('webmsg.mark_success')
|
||||
this.$success(this.$t('webmsg.mark_success'))
|
||||
this.search()
|
||||
})
|
||||
},
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<complex-table :data="data" :columns="columns" local-key="datasetTask" :search-config="searchConfig" :pagination-config="paginationConfig" @select="select" @search="search" @sort-change="sortChange">
|
||||
<complex-table :data="data" :columns="columns" local-key="datasetTask" :transCondition="transCondition" :search-config="searchConfig" :pagination-config="paginationConfig" @select="select" @search="search" @sort-change="sortChange">
|
||||
<template #toolbar>
|
||||
<el-button icon="el-icon-circle-plus-outline" @click="selectDataset">{{ $t('dataset.task.create') }}</el-button>
|
||||
</template>
|
||||
@ -223,6 +223,10 @@ export default {
|
||||
param: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -259,8 +263,9 @@ export default {
|
||||
useComplexSearch: true,
|
||||
quickPlaceholder: this.$t('dataset.task.search_by_name'),
|
||||
components: [
|
||||
{ field: 'dataset_table.name', label: this.$t('dataset.name'), component: 'DeComplexInput' },
|
||||
{ field: 'dataset_table_task.name', label: this.$t('dataset.task_name'), component: 'DeComplexInput'},
|
||||
{ field: 'dataset_table_task.id', label: this.$t('dataset.task_id'), component: 'FuComplexInput' },
|
||||
{ field: 'dataset_table.name', label: this.$t('dataset.name'), component: 'DeComplexInput' },
|
||||
{ field: 'dataset_table_task.status', label: this.$t('dataset.task.task_status'), component: 'FuComplexSelect',
|
||||
options: [{ label: this.$t('dataset.task.stopped'), value: 'Stopped' }, { label: this.$t('dataset.task.underway'), value: 'Underway' }, { label: this.$t('dataset.task.pending'), value: 'Pending' }, { label: this.$t('dataset.underway'), value: 'Exec' }], multiple: false },
|
||||
{ field: 'dataset_table_task.last_exec_status', label: this.$t('dataset.task.last_exec_status'), component: 'FuComplexSelect', options: [{ label: this.$t('dataset.completed'), value: 'Completed' }, { label: this.$t('dataset.underway'), value: 'Underway' }, { label: this.$t('dataset.error'), value: 'Error' }], multiple: false }
|
||||
@ -343,19 +348,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.param == null) {
|
||||
this.last_condition = {}
|
||||
this.search()
|
||||
} else {
|
||||
this.last_condition = {
|
||||
'dataset_table_task.name': {
|
||||
field: 'dataset_table_task.name',
|
||||
operator: 'eq',
|
||||
value: this.param.name
|
||||
}
|
||||
}
|
||||
this.search(this.last_condition)
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
this.search(this.last_condition, false)
|
||||
}, 5000)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<complex-table :data="data" :columns="columns" local-key="datasetTaskRecord" :search-config="searchConfig" :pagination-config="paginationConfig" @select="select" @search="search" @sort-change="sortChange">
|
||||
<complex-table :data="data" :columns="columns" local-key="datasetTaskRecord" :search-config="searchConfig" :transCondition="transCondition" :pagination-config="paginationConfig" @select="select" @search="search" @sort-change="sortChange">
|
||||
<el-table-column prop="name" :label="$t('dataset.task_name')">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
@ -64,6 +64,10 @@ export default {
|
||||
param: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -81,7 +85,8 @@ export default {
|
||||
useComplexSearch: true,
|
||||
quickPlaceholder: this.$t('dataset.task.search_by_name'),
|
||||
components: [
|
||||
{ field: 'dataset_table_task.name', label: this.$t('dataset.task_name'), component: 'DeComplexInput' },
|
||||
{ field: 'dataset_table_task.name', label: this.$t('dataset.task_name'), component: 'FuComplexInput' },
|
||||
{ field: 'dataset_table_task.id', label: this.$t('dataset.task_id'), component: 'FuComplexInput' },
|
||||
{ field: 'dataset_table.name', label: this.$t('dataset.name'), component: 'DeComplexInput' },
|
||||
{ field: 'dataset_table_task_log.status', label: this.$t('commons.status'), component: 'FuComplexSelect', options: [{ label: this.$t('dataset.completed'), value: 'Completed' }, { label: this.$t('dataset.underway'), value: 'Underway' }, { label: this.$t('dataset.error'), value: 'Error' }], multiple: false }
|
||||
]
|
||||
@ -117,37 +122,16 @@ export default {
|
||||
computed: {
|
||||
},
|
||||
created() {
|
||||
if (this.param == null) {
|
||||
this.last_condition = {}
|
||||
this.search()
|
||||
} else if (this.param.name) {
|
||||
this.last_condition = {
|
||||
'dataset_table_task.name': {
|
||||
field: 'dataset_table_task.name',
|
||||
operator: 'eq',
|
||||
value: this.param.name
|
||||
}
|
||||
}
|
||||
this.search(this.last_condition)
|
||||
} else if (this.param.taskId) {
|
||||
if (this.param !== null && this.param.taskId) {
|
||||
this.matchLogId = this.param.logId || this.matchLogId
|
||||
this.last_condition = {
|
||||
'dataset_table_task.id': {
|
||||
field: 'dataset_table_task.id',
|
||||
this.transCondition['dataset_table_task.id'] = {
|
||||
operator: 'eq',
|
||||
value: this.param.taskId
|
||||
}
|
||||
}
|
||||
this.search(this.last_condition)
|
||||
}
|
||||
|
||||
// this.timer = setInterval(() => {
|
||||
// this.search(this.last_condition, false)
|
||||
// }, 5000)
|
||||
this.createTimer()
|
||||
},
|
||||
beforeDestroy() {
|
||||
// clearInterval(this.timer)
|
||||
this.destroyTimer()
|
||||
},
|
||||
methods: {
|
||||
@ -164,25 +148,6 @@ export default {
|
||||
this.timer = null
|
||||
}
|
||||
},
|
||||
// msg2Current(routerParam) {
|
||||
// if (!routerParam || !routerParam.taskId) return
|
||||
// const taskId = routerParam.taskId
|
||||
// // console.log(taskId)
|
||||
// const current_condition = {
|
||||
// 'dataset_table_task.id': {
|
||||
// field: 'dataset_table_task.id',
|
||||
// operator: 'eq',
|
||||
// value: taskId
|
||||
// }
|
||||
// }
|
||||
// // 先把定时器干掉 否则会阻塞下面的search
|
||||
// this.destroyTimer()
|
||||
|
||||
// this.search(current_condition)
|
||||
|
||||
// // 查询完再开启定时器
|
||||
// this.createTimer()
|
||||
// },
|
||||
sortChange({ column, prop, order }) {
|
||||
this.orderConditions = []
|
||||
if (!order) {
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<el-row style="height: 100%;width: 100%;">
|
||||
<el-tabs v-model="tabActive" @tab-click="changeTab">
|
||||
<el-tab-pane :label="$t('dataset.task.list')" name="DatasetTaskList">
|
||||
<dataset-task-list v-if="tabActive=='DatasetTaskList'" :param="task" @jumpTaskRecord="jumpTaskRecord" />
|
||||
<dataset-task-list v-if="tabActive=='DatasetTaskList'" :transCondition="transCondition" @jumpTaskRecord="jumpTaskRecord" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('dataset.task.record')" name="TaskRecord">
|
||||
<task-record v-if="tabActive=='TaskRecord'" ref="task_record" :param="task" @jumpTask="jumpTask" />
|
||||
<task-record v-if="tabActive=='TaskRecord'" ref="task_record" :trans-condition="transCondition" @jumpTask="jumpTask" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-row>
|
||||
@ -27,8 +27,8 @@ export default {
|
||||
components: { LayoutContent, DatasetTaskList, TaskRecord },
|
||||
data() {
|
||||
return {
|
||||
task: null,
|
||||
tabActive: 'DatasetTaskList'
|
||||
tabActive: 'DatasetTaskList',
|
||||
transCondition: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -50,15 +50,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeTab() {
|
||||
this.task = null
|
||||
console.log(this.tabActive)
|
||||
this.transCondition = {}
|
||||
},
|
||||
jumpTaskRecord(task) {
|
||||
this.task = task
|
||||
this.transCondition['dataset_table_task.id'] = {
|
||||
operator: 'eq',
|
||||
value: task.id
|
||||
}
|
||||
this.tabActive = 'TaskRecord'
|
||||
},
|
||||
jumpTask(task) {
|
||||
this.task = task
|
||||
jumpTask(taskRecord) {
|
||||
this.transCondition['dataset_table_task.id'] = {
|
||||
operator: 'eq',
|
||||
value: taskRecord.taskId
|
||||
}
|
||||
this.tabActive = 'DatasetTaskList'
|
||||
},
|
||||
toMsgShare(routerParam) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user