ADD 系统任务中心
This commit is contained in:
parent
c45139f34f
commit
6760f7b4ba
|
|
@ -101,5 +101,14 @@ export default {
|
||||||
return await http.get(this.url, params);
|
return await http.get(this.url, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tasks: {
|
||||||
|
list: {
|
||||||
|
url: `${config.API_URL}/system/tasks/list`,
|
||||||
|
name: "系统任务管理",
|
||||||
|
get: async function(params){
|
||||||
|
return await http.get(this.url, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
<template>
|
||||||
|
<scTable ref="table" :apiObj="apiObj" row-key="id" empty-text="没有正在执行的任务" paginationLayout="total, prev, pager, next">
|
||||||
|
<sc-table-column label="序号" type="index"></sc-table-column>
|
||||||
|
<sc-table-column label="任务名称" prop="taskName" min-width="100"></sc-table-column>
|
||||||
|
<sc-table-column label="创建时间" prop="createDate" width="170"></sc-table-column>
|
||||||
|
<sc-table-column label="状态" prop="stateName" width="80"></sc-table-column>
|
||||||
|
<sc-table-column label="结果" prop="result" width="80">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button v-if="scope.row.state=='1'" type="primary" icon="el-icon-download" circle plain size="small" @click="download(scope.row)"></el-button>
|
||||||
|
</template>
|
||||||
|
</sc-table-column>
|
||||||
|
</scTable>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
apiObj: this.$API.system.tasks.list,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
download(row){
|
||||||
|
let a = document.createElement("a")
|
||||||
|
a.style = "display: none"
|
||||||
|
a.target = "_blank"
|
||||||
|
a.href = row.result
|
||||||
|
document.body.appendChild(a)
|
||||||
|
a.click()
|
||||||
|
document.body.removeChild(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -6,6 +6,9 @@
|
||||||
<div class="screen panel-item hidden-sm-and-down" @click="screen">
|
<div class="screen panel-item hidden-sm-and-down" @click="screen">
|
||||||
<el-icon><el-icon-full-screen /></el-icon>
|
<el-icon><el-icon-full-screen /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tasks panel-item" @click="tasks">
|
||||||
|
<el-icon><el-icon-sort /></el-icon>
|
||||||
|
</div>
|
||||||
<div class="msg panel-item" @click="showMsg">
|
<div class="msg panel-item" @click="showMsg">
|
||||||
<el-badge :hidden="msgList.length==0" :value="msgList.length" class="badge" type="danger">
|
<el-badge :hidden="msgList.length==0" :value="msgList.length" class="badge" type="danger">
|
||||||
<el-icon><el-icon-chat-dot-round /></el-icon>
|
<el-icon><el-icon-chat-dot-round /></el-icon>
|
||||||
|
|
@ -62,20 +65,27 @@
|
||||||
<search @success="searchVisible=false"></search>
|
<search @success="searchVisible=false"></search>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-drawer v-model="tasksVisible" :size="550" title="任务中心" destroy-on-close>
|
||||||
|
<tasks></tasks>
|
||||||
|
</el-drawer>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import search from './search.vue';
|
import search from './search.vue'
|
||||||
|
import tasks from './tasks.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
search
|
search,
|
||||||
|
tasks
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
userName: "",
|
userName: "",
|
||||||
userNameF: "",
|
userNameF: "",
|
||||||
searchVisible: false,
|
searchVisible: false,
|
||||||
|
tasksVisible: false,
|
||||||
msg: false,
|
msg: false,
|
||||||
msgList: [
|
msgList: [
|
||||||
{
|
{
|
||||||
|
|
@ -165,6 +175,10 @@
|
||||||
//搜索
|
//搜索
|
||||||
search(){
|
search(){
|
||||||
this.searchVisible = true
|
this.searchVisible = true
|
||||||
|
},
|
||||||
|
//任务
|
||||||
|
tasks(){
|
||||||
|
this.tasksVisible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue