|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="blue-background">
|
|
<div class="blue-background">
|
|
|
<div class="lighter-container">
|
|
<div class="lighter-container">
|
|
|
- <span>
|
|
|
|
|
|
|
+ <div class="left-row">
|
|
|
<div>
|
|
<div>
|
|
|
<div>状态:</div>
|
|
<div>状态:</div>
|
|
|
<el-tag size="large" :effect="focusTaskStatus.includes('all') ? 'dark' : ''" type="primary"
|
|
<el-tag size="large" :effect="focusTaskStatus.includes('all') ? 'dark' : ''" type="primary"
|
|
@@ -15,7 +15,20 @@
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</div>
|
|
</div>
|
|
|
- </span>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div>类别:</div>
|
|
|
|
|
+ <el-tag size="large" :effect="focusTaskType.includes('all') ? 'dark' : ''" type="primary"
|
|
|
|
|
+ @click="changeTaskType()">
|
|
|
|
|
+ 全部
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <template v-for="type in taskType" :key="type.index">
|
|
|
|
|
+ <el-tag size="large" :effect="focusTaskType.includes(type.index) ? 'dark' : ''" type="primary"
|
|
|
|
|
+ @click="changeTaskType(type)">
|
|
|
|
|
+ {{ type.name }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
<el-input class="searcher" v-model="searcher" placeholder="请输入任务名称相关关键字" />
|
|
<el-input class="searcher" v-model="searcher" placeholder="请输入任务名称相关关键字" />
|
|
|
<el-button type="primary" @click="pullTaskData(1)">搜索</el-button>
|
|
<el-button type="primary" @click="pullTaskData(1)">搜索</el-button>
|
|
@@ -27,9 +40,16 @@
|
|
|
<el-table table-layout="fixed" row-key="main_id" :data="taskData" class="table">
|
|
<el-table table-layout="fixed" row-key="main_id" :data="taskData" class="table">
|
|
|
<el-table-column prop="main_c_name" label="名称" />
|
|
<el-table-column prop="main_c_name" label="名称" />
|
|
|
<el-table-column prop="main_c_user_name" label="用户" />
|
|
<el-table-column prop="main_c_user_name" label="用户" />
|
|
|
|
|
+ <el-table-column prop="main_c_state" label="类型">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-tag effect="dark" v-show="getType(scope.row.main_c_type) != null" disable-transitions>{{
|
|
|
|
|
+ getType(scope.row.main_c_type)?.name ?? '' }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="main_c_state" label="状态">
|
|
<el-table-column prop="main_c_state" label="状态">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-tag effect="dark" :type="statusStaticInfo[scope.row.main_c_state]?.tagType ?? ''"
|
|
|
|
|
|
|
+ <el-tag effect="dark" v-show="getStatus(scope.row.main_c_state)!=null" :type="statusStaticInfo[scope.row.main_c_state]?.tagType ?? ''"
|
|
|
disable-transitions>{{
|
|
disable-transitions>{{
|
|
|
getStatus(scope.row.main_c_state)?.name ?? '' }}</el-tag>
|
|
getStatus(scope.row.main_c_state)?.name ?? '' }}</el-tag>
|
|
|
</template>
|
|
</template>
|
|
@@ -88,6 +108,11 @@
|
|
|
<el-descriptions-item label="任务描述">
|
|
<el-descriptions-item label="任务描述">
|
|
|
{{ focusTask.main_c_comment }}
|
|
{{ focusTask.main_c_comment }}
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="任务类型">
|
|
|
|
|
+ <el-tag effect="dark" v-show="getType(focusTask.main_c_type) != null" disable-transitions>{{
|
|
|
|
|
+ getType(focusTask.main_c_type)?.name ?? '' }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
<el-descriptions-item label="用户名">
|
|
<el-descriptions-item label="用户名">
|
|
|
{{ focusTask.main_c_user_name }}
|
|
{{ focusTask.main_c_user_name }}
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
@@ -137,7 +162,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getTasks, getTaskStatus } from '@/api/rwgl';
|
|
|
|
|
|
|
+import { getTasks, getCName } from '@/api/rwgl';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
@@ -145,8 +170,6 @@ export default {
|
|
|
searcher: "",
|
|
searcher: "",
|
|
|
taskStatus: [],
|
|
taskStatus: [],
|
|
|
focusTaskStatus: ["all"],
|
|
focusTaskStatus: ["all"],
|
|
|
- taskData: [],
|
|
|
|
|
- taskNum: 0,
|
|
|
|
|
statusStaticInfo: {
|
|
statusStaticInfo: {
|
|
|
0: {
|
|
0: {
|
|
|
tagType: "primary"
|
|
tagType: "primary"
|
|
@@ -161,6 +184,10 @@ export default {
|
|
|
tagType: "danger"
|
|
tagType: "danger"
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ taskType: [],
|
|
|
|
|
+ focusTaskType: ["all"],
|
|
|
|
|
+ taskData: [],
|
|
|
|
|
+ taskNum: 0,
|
|
|
focusTask: {},
|
|
focusTask: {},
|
|
|
dialog: false,
|
|
dialog: false,
|
|
|
page: 1
|
|
page: 1
|
|
@@ -168,11 +195,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.pullTaskStatus()
|
|
this.pullTaskStatus()
|
|
|
|
|
+ this.pullTaskType()
|
|
|
this.pullTaskData(1)
|
|
this.pullTaskData(1)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
async pullTaskStatus() {
|
|
async pullTaskStatus() {
|
|
|
- this.taskStatus = (await getTaskStatus()).sort((a, b) => a.index - b.index)
|
|
|
|
|
|
|
+ this.taskStatus = (await getCName("task_status")).sort((a, b) => a.index - b.index)
|
|
|
},
|
|
},
|
|
|
changeTaskStatus(status) {
|
|
changeTaskStatus(status) {
|
|
|
if (status == null) {
|
|
if (status == null) {
|
|
@@ -194,17 +222,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
getCheckedStatus() {
|
|
getCheckedStatus() {
|
|
|
if (this.focusTaskStatus.includes("all")) {
|
|
if (this.focusTaskStatus.includes("all")) {
|
|
|
- return this.taskStatus.map(t => t.index)
|
|
|
|
|
|
|
+ return null
|
|
|
} else {
|
|
} else {
|
|
|
return this.focusTaskStatus
|
|
return this.focusTaskStatus
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- async pullTaskData(page) {
|
|
|
|
|
- if (page != null) this.page = page
|
|
|
|
|
- let res = await getTasks(this.page, 10, this.searcher, this.getCheckedStatus())
|
|
|
|
|
- this.taskNum = res.count
|
|
|
|
|
- this.taskData = res.data
|
|
|
|
|
- },
|
|
|
|
|
getStatus(index) {
|
|
getStatus(index) {
|
|
|
for (let i = 0; i < this.taskStatus.length; i++) {
|
|
for (let i = 0; i < this.taskStatus.length; i++) {
|
|
|
const e = this.taskStatus[i];
|
|
const e = this.taskStatus[i];
|
|
@@ -213,11 +235,50 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async pullTaskType() {
|
|
|
|
|
+ this.taskType = (await getCName("yzt_task_type")).sort((a, b) => a.index - b.index)
|
|
|
|
|
+ },
|
|
|
|
|
+ changeTaskType(types) {
|
|
|
|
|
+ if (types == null) {
|
|
|
|
|
+ this.focusTaskType = ["all"]
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let set = new Set(this.focusTaskType)
|
|
|
|
|
+ set.delete("all")
|
|
|
|
|
+ let index = types.index
|
|
|
|
|
+ if (this.focusTaskType.includes(index)) {
|
|
|
|
|
+ set.delete(index)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ set.add(index)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.focusTaskType = Array.from(set)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getCheckedType() {
|
|
|
|
|
+ if (this.focusTaskType.includes("all")) {
|
|
|
|
|
+ return null
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return this.focusTaskType
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getType(index) {
|
|
|
|
|
+ for (let i = 0; i < this.taskType.length; i++) {
|
|
|
|
|
+ const e = this.taskType[i];
|
|
|
|
|
+ if (e.index == index) {
|
|
|
|
|
+ return e;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async pullTaskData(page) {
|
|
|
|
|
+ if (page != null) this.page = page
|
|
|
|
|
+ let res = await getTasks(this.page, 10, this.searcher, this.getCheckedStatus(), this.getCheckedType())
|
|
|
|
|
+ this.taskNum = res.count
|
|
|
|
|
+ this.taskData = res.data
|
|
|
|
|
+ },
|
|
|
timeFormatter(time) {
|
|
timeFormatter(time) {
|
|
|
- if(time==null) return;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if (time == null) return;
|
|
|
|
|
+
|
|
|
let date = new Date(time)
|
|
let date = new Date(time)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return date.toLocaleString()
|
|
return date.toLocaleString()
|
|
|
},
|
|
},
|
|
|
async downloadWithBlob(url, filename) {
|
|
async downloadWithBlob(url, filename) {
|
|
@@ -383,7 +444,8 @@ body {
|
|
|
|
|
|
|
|
.row,
|
|
.row,
|
|
|
.warp-row,
|
|
.warp-row,
|
|
|
-.between-row {
|
|
|
|
|
|
|
+.between-row,
|
|
|
|
|
+.left-row {
|
|
|
display: flex !important;
|
|
display: flex !important;
|
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
|
padding: 0;
|
|
padding: 0;
|
|
@@ -398,6 +460,13 @@ body {
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.left-row{
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+}
|
|
|
|
|
+.left-row>*{
|
|
|
|
|
+ margin-right: 15px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.col {
|
|
.col {
|
|
|
display: flex !important;
|
|
display: flex !important;
|
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|