提交 43c3e569 authored 作者: taojinlong's avatar taojinlong

fix: 任务 跳转

上级 79d014da
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"element-ui": "2.13.0", "element-ui": "2.13.0",
"file-save": "^0.2.0", "file-save": "^0.2.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"fit2cloud-ui": "1.2.0", "fit2cloud-ui": "1.5.0-beta.0",
"html2canvasde": "^v1.1.4-de", "html2canvasde": "^v1.1.4-de",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1", "jsencrypt": "^3.0.0-rc.1",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<div> <div>
<slot name="toolbar" /> <slot name="toolbar" />
</div> </div>
<fu-search-bar v-bind="searchConfig" @exec="search"> <fu-search-bar v-bind="searchConfig" @exec="search" ref="search">
<template #complex> <template #complex>
<slot name="complex" /> <slot name="complex" />
</template> </template>
...@@ -57,15 +57,25 @@ export default { ...@@ -57,15 +57,25 @@ export default {
// eslint-disable-next-line vue/require-default-prop // eslint-disable-next-line vue/require-default-prop
searchConfig: Object, searchConfig: Object,
// eslint-disable-next-line vue/require-default-prop // eslint-disable-next-line vue/require-default-prop
paginationConfig: Object paginationConfig: Object,
transCondition: {
type: Object,
default: null
}
}, },
data() { data() {
return { return {
condition: {} condition: {},
}
},
mounted() {
if (this.transCondition !== null) {
this.$refs.search.setConditions(this.transCondition)
} }
}, },
methods: { methods: {
search(condition, e) { search(condition, e) {
console.log(condition)
if (condition) { if (condition) {
this.condition = condition this.condition = condition
} }
......
...@@ -873,6 +873,7 @@ export default { ...@@ -873,6 +873,7 @@ export default {
sync_now: 'Update Now', sync_now: 'Update Now',
add_task: 'Add Task', add_task: 'Add Task',
task_name: 'Task Name', task_name: 'Task Name',
task_id: 'Task ID',
start_time: 'Start Time', start_time: 'Start Time',
end_time: 'End Time', end_time: 'End Time',
status: 'State', status: 'State',
......
...@@ -873,6 +873,7 @@ export default { ...@@ -873,6 +873,7 @@ export default {
sync_now: '立即更新', sync_now: '立即更新',
add_task: '添加任務', add_task: '添加任務',
task_name: '任務名稱', task_name: '任務名稱',
task_id: '任務ID',
start_time: '開始時間', start_time: '開始時間',
end_time: '結束時間', end_time: '結束時間',
status: '狀態', status: '狀態',
......
...@@ -873,6 +873,7 @@ export default { ...@@ -873,6 +873,7 @@ export default {
sync_now: '立即更新', sync_now: '立即更新',
add_task: '添加任务', add_task: '添加任务',
task_name: '任务名称', task_name: '任务名称',
task_id: '任务ID',
start_time: '开始时间', start_time: '开始时间',
end_time: '结束时间', end_time: '结束时间',
status: '状态', status: '状态',
......
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
} }
const param = this.multipleSelection.map(item => item.msgId) const param = this.multipleSelection.map(item => item.msgId)
batchRead(param).then(res => { batchRead(param).then(res => {
this.$success('webmsg.mark_success') this.$success(this.$t('webmsg.mark_success'))
this.search() this.search()
}) })
}, },
......
<template> <template>
<el-col> <el-col>
<el-row style="margin-top: 10px;"> <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> <template #toolbar>
<el-button icon="el-icon-circle-plus-outline" @click="selectDataset">{{ $t('dataset.task.create') }}</el-button> <el-button icon="el-icon-circle-plus-outline" @click="selectDataset">{{ $t('dataset.task.create') }}</el-button>
</template> </template>
...@@ -223,6 +223,10 @@ export default { ...@@ -223,6 +223,10 @@ export default {
param: { param: {
type: Object, type: Object,
default: null default: null
},
transCondition: {
type: Object,
default: null
} }
}, },
data() { data() {
...@@ -259,8 +263,9 @@ export default { ...@@ -259,8 +263,9 @@ export default {
useComplexSearch: true, useComplexSearch: true,
quickPlaceholder: this.$t('dataset.task.search_by_name'), quickPlaceholder: this.$t('dataset.task.search_by_name'),
components: [ components: [
{ 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.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.status', label: this.$t('dataset.task.task_status'), component: 'FuComplexSelect', { 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 }, 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 } { 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 { ...@@ -343,19 +348,6 @@ export default {
} }
}, },
created() { 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.timer = setInterval(() => {
this.search(this.last_condition, false) this.search(this.last_condition, false)
}, 5000) }, 5000)
......
<template> <template>
<el-col> <el-col>
<el-row style="margin-top: 10px;"> <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')"> <el-table-column prop="name" :label="$t('dataset.task_name')">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span>
...@@ -64,6 +64,10 @@ export default { ...@@ -64,6 +64,10 @@ export default {
param: { param: {
type: Object, type: Object,
default: null default: null
},
transCondition: {
type: Object,
default: null
} }
}, },
data() { data() {
...@@ -81,7 +85,8 @@ export default { ...@@ -81,7 +85,8 @@ export default {
useComplexSearch: true, useComplexSearch: true,
quickPlaceholder: this.$t('dataset.task.search_by_name'), quickPlaceholder: this.$t('dataset.task.search_by_name'),
components: [ 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.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 } { 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 { ...@@ -117,37 +122,16 @@ export default {
computed: { computed: {
}, },
created() { created() {
if (this.param == null) { if (this.param !== null && this.param.taskId) {
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) {
this.matchLogId = this.param.logId || this.matchLogId this.matchLogId = this.param.logId || this.matchLogId
this.last_condition = { this.transCondition['dataset_table_task.id'] = {
'dataset_table_task.id': { operator: 'eq',
field: 'dataset_table_task.id', value: this.param.taskId
operator: 'eq',
value: this.param.taskId
} }
}
this.search(this.last_condition)
} }
// this.timer = setInterval(() => {
// this.search(this.last_condition, false)
// }, 5000)
this.createTimer() this.createTimer()
}, },
beforeDestroy() { beforeDestroy() {
// clearInterval(this.timer)
this.destroyTimer() this.destroyTimer()
}, },
methods: { methods: {
...@@ -164,25 +148,6 @@ export default { ...@@ -164,25 +148,6 @@ export default {
this.timer = null 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 }) { sortChange({ column, prop, order }) {
this.orderConditions = [] this.orderConditions = []
if (!order) { if (!order) {
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<el-row style="height: 100%;width: 100%;"> <el-row style="height: 100%;width: 100%;">
<el-tabs v-model="tabActive" @tab-click="changeTab"> <el-tabs v-model="tabActive" @tab-click="changeTab">
<el-tab-pane :label="$t('dataset.task.list')" name="DatasetTaskList"> <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>
<el-tab-pane :label="$t('dataset.task.record')" name="TaskRecord"> <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-tab-pane>
</el-tabs> </el-tabs>
</el-row> </el-row>
...@@ -27,8 +27,8 @@ export default { ...@@ -27,8 +27,8 @@ export default {
components: { LayoutContent, DatasetTaskList, TaskRecord }, components: { LayoutContent, DatasetTaskList, TaskRecord },
data() { data() {
return { return {
task: null, tabActive: 'DatasetTaskList',
tabActive: 'DatasetTaskList' transCondition: {}
} }
}, },
computed: { computed: {
...@@ -50,15 +50,20 @@ export default { ...@@ -50,15 +50,20 @@ export default {
}, },
methods: { methods: {
changeTab() { changeTab() {
this.task = null this.transCondition = {}
console.log(this.tabActive)
}, },
jumpTaskRecord(task) { jumpTaskRecord(task) {
this.task = task this.transCondition['dataset_table_task.id'] = {
operator: 'eq',
value: task.id
}
this.tabActive = 'TaskRecord' this.tabActive = 'TaskRecord'
}, },
jumpTask(task) { jumpTask(taskRecord) {
this.task = task this.transCondition['dataset_table_task.id'] = {
operator: 'eq',
value: taskRecord.taskId
}
this.tabActive = 'DatasetTaskList' this.tabActive = 'DatasetTaskList'
}, },
toMsgShare(routerParam) { toMsgShare(routerParam) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论