From fab4d7d62b2039ab8660649d26a8c6f8f32193b5 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 11 一月 2024 17:41:11 +0800
Subject: [PATCH] 1. 初步完成评估任务整体逻辑; 2. 新增评估记录下载功能(待完善)
---
src/styles/element/base.scss | 100 ++--
src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue | 186 ++++++---
src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue | 4
src/api/fysp/downloadApi.js | 7
src/views/fysp/evaluation/components/CompEvaTask.vue | 13
src/views/fysp/evaluation/ResultManage.vue | 37 +
src/components.d.ts | 3
src/components/bg-task/FYBgTaskItem.vue | 218 +++++++++++
src/views/fysp/evaluation/components/precheck/CompPreCheck.vue | 41 +
src/router/index.js | 6
src/views/fysp/evaluation/DataSource.vue | 9
src/components/bg-task/FYBgTaskDialog.vue | 24 +
src/api/fysp/evaluateApi.js | 28 +
src/components/bg-task/FYBgTaskCard.vue | 292 ++++++--------
src/components/table/FYTable.vue | 38 +-
src/enum/bgTask.js | 7
src/api/index.js | 4
src/views/fysp/evaluation/components/CompQuickSet.vue | 26
src/styles/element/layout.js | 10
src/components/core/Header.vue | 36 -
src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue | 32 +
21 files changed, 729 insertions(+), 392 deletions(-)
diff --git a/src/api/fysp/downloadApi.js b/src/api/fysp/downloadApi.js
new file mode 100644
index 0000000..d1221e0
--- /dev/null
+++ b/src/api/fysp/downloadApi.js
@@ -0,0 +1,7 @@
+import { $fysp } from '../index';
+
+export default {
+ downloadFile(url) {
+ return $fysp.get(`files/${url}`);
+ }
+};
diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js
index 01d1cf5..0c75408 100644
--- a/src/api/fysp/evaluateApi.js
+++ b/src/api/fysp/evaluateApi.js
@@ -1,3 +1,4 @@
+import { Base64 } from 'js-base64';
import { $fysp } from '../index';
export default {
@@ -10,10 +11,31 @@
/**
* 鏌ヨ璇勪及鎬昏鍒�
- * @param {Object} param
- * @returns
+ * @param {Object} param
+ * @returns
*/
fetchEvaluationRule(param) {
return $fysp.post(`evaluationrule/find`, param).then((res) => res.data);
- }
+ },
+
+ autoEvaluate(param) {
+ return $fysp.post(`evaluation/auto`, param).then((res) => res.data);
+ },
+
+ downloadAutoEvaluation(param) {
+ return $fysp
+ .post(`evaluation/auto/record/download`, param, { responseType: 'blob' })
+ .then((res) => {
+ // return res.data;
+ const name = Base64.decode(res.headers.get('filename'));
+ const url = window.URL.createObjectURL(res.data);
+ const link = document.createElement('a');
+ link.href = url;
+ link.setAttribute('download', name);
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(url);
+ });
+ },
};
diff --git a/src/api/index.js b/src/api/index.js
index 4140d17..71e187f 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -9,9 +9,9 @@
let ip2_file = 'https://fyami.com.cn/';
if (debug) {
- ip1 = 'http://192.168.0.138:8082/';
+ ip1 = 'http://192.168.1.9:8082/';
// ip1_file = 'http://47.100.191.150:9005/';
- ip2 = 'http://192.168.0.138:8080/';
+ ip2 = 'http://192.168.1.9:8080/';
// ip2_file = 'https://fyami.com.cn/';
}
diff --git a/src/components.d.ts b/src/components.d.ts
index 50e6853..9692367 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -13,6 +13,7 @@
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBacktop: typeof import('element-plus/es')['ElBacktop']
+ ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
@@ -68,6 +69,8 @@
Footer: typeof import('./components/core/Footer.vue')['default']
FormCol: typeof import('./components/layout/FormCol.vue')['default']
FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default']
+ FYBgTaskDialog: typeof import('./components/bg-task/FYBgTaskDialog.vue')['default']
+ FYBgTaskItem: typeof import('./components/bg-task/FYBgTaskItem.vue')['default']
FYForm: typeof import('./components/form/FYForm.vue')['default']
FYOptionLocation: typeof import('./components/search-option/FYOptionLocation.vue')['default']
FYOptionOnlineStatus: typeof import('./components/search-option/FYOptionOnlineStatus.vue')['default']
diff --git a/src/components/bg-task/FYBgTaskCard.vue b/src/components/bg-task/FYBgTaskCard.vue
index 591aca6..d39bffe 100644
--- a/src/components/bg-task/FYBgTaskCard.vue
+++ b/src/components/bg-task/FYBgTaskCard.vue
@@ -1,200 +1,160 @@
<template>
- <el-card class="m-b-8" shadow="always" :body-style="{ padding: '8px' }">
- <el-row>
- <el-col :span="4">
- <div class="status-btn">
- <el-icon v-if="waiting" color="var(--el-color-info)" :size="50"><VideoPlay /></el-icon>
- <el-icon v-else-if="running" color="var(--el-color-primary)" :size="50" class="is-loading"
- ><Loading
- /></el-icon>
- <el-icon v-else-if="success" color="var(--el-color-success)" :size="50"
- ><CircleCheck
- /></el-icon>
- <el-icon v-else-if="fail" color="var(--el-color-error)" :size="50"
- ><CircleClose
- /></el-icon>
- <el-icon v-else color="var(--el-color-warning)" :size="50"><Warning /></el-icon>
- <el-text type="info" size="small" style="position: absolute; bottom: 0">{{
- nameToLabel(model.status)
- }}</el-text>
+ <el-card shadow="never" :body-style="{ padding: 0 }">
+ <template #header>
+ <el-row justify="space-between">
+ <div>
+ <div><el-text tag="b" size="large">鍚庡彴浠诲姟</el-text></div>
+ <el-text size="small" type="info">鏄剧ず褰撳墠姝e湪杩涜鐨勫悗鍙拌�楁椂浠诲姟鐘舵��</el-text>
</div>
- </el-col>
- <el-col :span="20" class="p-l-8">
- <el-row justify="space-between">
- <el-text class="m-l-4px w-300px" tag="b" size="large" truncated>{{ model.name }}</el-text>
- <el-tag>{{ nameToLabel(model.type) }}</el-tag>
- </el-row>
- <el-row class="p-v-8" align="bottom">
- <el-col :span="12">
- <span class="timer">{{ time }}</span>
- <el-text type="info" size="small" tag="div">杩愯鏃堕暱</el-text>
- </el-col>
- <el-col :span="12">
- <el-text type="default" size="default" tag="div"
- >寮�濮嬶細{{ $fm.formatYMDH(model.startTime) }}</el-text
- >
- <el-text type="default" size="default" tag="div"
- >缁撴潫锛歿{ $fm.formatYMDH(model.endTime) }}</el-text
- >
- </el-col>
- </el-row>
- <el-row justify="end" align="bottom">
- <!-- <span class="f-s color-i">ID锛歿{ model.id }}</span> -->
- <el-row>
- <FYReconfrimButton v-if="waiting" @confirm="startTask" v-model="startConfirm">
- <el-button
- plain
- icon="VideoPlay"
- type="primary"
- size="small"
- :loading="false"
- @click="startConfirm = true"
- >寮�濮嬩换鍔�</el-button
- >
- </FYReconfrimButton>
- <FYReconfrimButton v-if="running" @confirm="stopTask" v-model="stopConfirm">
- <el-button
- icon="VideoPause"
- plain
- type="danger"
- size="small"
- :loading="false"
- @click="stopConfirm = true"
- >寮哄埗缁撴潫</el-button
- >
- </FYReconfrimButton>
- <FYReconfrimButton v-if="!running" @confirm="removeTask" v-model="removeConfirm">
- <el-button
- icon="Delete"
- plain
- type="danger"
- size="small"
- :loading="false"
- @click="removeConfirm = true"
- >绉婚櫎浠诲姟</el-button
- >
- </FYReconfrimButton>
- <el-button
- v-if="success"
- plain
- type="success"
- size="small"
- :loading="false"
- @click="gotoResult"
- >鏌ョ湅缁撴灉<el-icon class="m-l-4"><Right /></el-icon
- ></el-button>
- </el-row>
- </el-row>
- </el-col>
- </el-row>
+ <el-button
+ icon="Refresh"
+ type="primary"
+ size="default"
+ :loading="loading"
+ @click="fetchTask"
+ >鍒锋柊浠诲姟</el-button
+ >
+ </el-row>
+ <!-- <el-row>
+ <el-button type="default" size="default" @click="newTestTask">鏂板娴嬭瘯浠诲姟</el-button>
+ <el-button type="default" size="default" @click="startNewTestTask"
+ >鏂板缓骞惰繍琛屼竴涓祴璇曚换鍔�</el-button
+ >
+ <el-button type="default" size="default" @click="shutDownTask"
+ >寮哄埗鍏抽棴鎵�鏈夋祴璇曚换鍔�</el-button
+ >
+ </el-row> -->
+ </template>
+ <el-scrollbar height="70vh" class="scrollbar">
+ <template v-for="(v, i) in taskList" :key="i">
+ <FYBgTaskItem
+ :model="v"
+ :index="i"
+ @start="startTask"
+ @shutDown="shutDownTask"
+ @remove="removeTask"
+ @gotoResult="gotoResult"
+ ></FYBgTaskItem>
+ </template>
+ </el-scrollbar>
</el-card>
</template>
<script>
-import { nTlBgTask, BG_TASK_STATUS } from '@/enum/bgTask';
-import { useTimer } from '@/composables/timer';
-// import { useTimer } from '@/composables/timer2';
+/**
+ * 鑷姩璇勪及浠诲姟绠$悊
+ */
+import { useFetchData } from '@/composables/fetchData';
+import bgtaskApi from '@/api/fysp/bgtaskApi';
+import { enumBgTask, BG_TASK_TYPE, BG_TASK_STATUS } from '@/enum/bgTask';
export default {
setup() {
- const { time, startTimer, pauseTimer, stopTimer, count } = useTimer();
- return { time, startTimer, pauseTimer, stopTimer, count };
+ const { loading, fetchData } = useFetchData();
+ return { loading, fetchData };
},
props: {
- model: Object,
- index: Number
+ modelValue: Number
},
- emits: ['start', 'shutDown', 'remove', 'gotoResult'],
+ emits: ['update:modelValue'],
data() {
return {
- startConfirm: false,
- stopConfirm: false,
- removeConfirm: false
+ taskList: [],
+ taskIndex: 0
};
},
watch: {
- 'model.status': {
+ taskList: {
handler(nV) {
- switch (nV) {
- case BG_TASK_STATUS.WAITING.name:
- this.stopTimer();
- break;
- case BG_TASK_STATUS.RUNNING.name:
- this.startTimer();
- break;
- case BG_TASK_STATUS.SUCCESS.name:
- case BG_TASK_STATUS.FAIL.name:
- case BG_TASK_STATUS.SHUTDOWN.name:
- this.pauseTimer();
- break;
- default:
- this.stopTimer();
- break;
+ let count = 0;
+ for (const e of nV) {
+ if (e.status == BG_TASK_STATUS.RUNNING.name) {
+ count++;
+ }
}
- this.count = this.model.runTime
+ this.$emit('update:modelValue', count);
},
- immediate: true
- }
- },
- computed: {
- waiting() {
- return this.model.status == BG_TASK_STATUS.WAITING.name;
- },
- running() {
- return this.model.status == BG_TASK_STATUS.RUNNING.name;
- },
- success() {
- return this.model.status == BG_TASK_STATUS.SUCCESS.name;
- },
- fail() {
- return this.model.status == BG_TASK_STATUS.FAIL.name;
- },
- shutdown() {
- return this.model.status == BG_TASK_STATUS.SHUTDOWN.name;
+ deep: true
}
},
methods: {
- nameToLabel(name) {
- const t = nTlBgTask(name);
- return t.label;
- },
- startTask() {
- this.$emit('start', this.index, (res) => {
- if (res) {
- this.startTimer();
- }
+ addTask() {},
+ newTestTask() {
+ this.fetchData((page, pageSize) => {
+ return bgtaskApi.newTestTask(`Test-Task-${++this.taskIndex}`).then((res) => {
+ this.taskList.push(res.data);
+ });
});
},
- stopTask() {
- this.$emit('shutDown', this.index, (res) => {
- if (res) {
- this.stopTimer();
- }
+ startNewTestTask() {
+ this.fetchData((page, pageSize) => {
+ return bgtaskApi.startNewTestTask(`Test-Task-${++this.taskIndex}`).then((res) => {
+ this.taskList.push(res.data);
+ });
});
},
- removeTask() {
- this.$emit('remove', this.index, (res) => {
- if (res) {
- // this.stopTimer();
- }
+
+ _getParam(taskStatus) {
+ return {
+ type: taskStatus.type,
+ id: taskStatus.id
+ };
+ },
+ fetchTask() {
+ this.fetchData((page, pageSize) => {
+ return bgtaskApi
+ .fetchTaskStatus({
+ // type: BG_TASK_TYPE.AUTO_SCORE.name
+ })
+ .then((res) => {
+ this.taskList = res.data;
+ });
});
},
- gotoResult() {
- this.$emit('gotoResult', this.index);
- }
+ startTask(index, callback) {
+ this.fetchData((page, pageSize) => {
+ const param = this._getParam(this.taskList[index]);
+ return bgtaskApi.startTask(param).then((res) => {
+ this.taskList[index] = res.data;
+ callback(true);
+ });
+ });
+ },
+ shutDownTask(index, callback) {
+ this.fetchData((page, pageSize) => {
+ const param = this._getParam(this.taskList[index]);
+ return bgtaskApi.shutDownTask(param).then((res) => {
+ if (index && res.data && res.data.length == 1) {
+ this.taskList[index] = res.data[0];
+ } else {
+ res.data.forEach((e) => {
+ let v = this.taskList.find((value) => {
+ return value.id == e.id;
+ });
+ const i = this.taskList.indexOf(v);
+ this.taskList[i] = e;
+ });
+ }
+ callback(true);
+ });
+ });
+ },
+ removeTask(index, callback) {
+ this.fetchData((page, pageSize) => {
+ const param = this._getParam(this.taskList[index]);
+ return bgtaskApi.removeTask(param).then((res) => {
+ if (res.data) {
+ this.taskList.splice(index, 1);
+ callback(true);
+ }
+ });
+ });
+ },
+ gotoResult(index) {}
}
};
</script>
<style scoped>
-.status-btn {
- width: 100%;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- border: var(--el-border);
- border-radius: var(--el-border-radius-base);
-}
-.timer {
- font-size: 30px;
+.scrollbar {
+ padding: 8px;
}
</style>
diff --git a/src/components/bg-task/FYBgTaskDialog.vue b/src/components/bg-task/FYBgTaskDialog.vue
new file mode 100644
index 0000000..8139e47
--- /dev/null
+++ b/src/components/bg-task/FYBgTaskDialog.vue
@@ -0,0 +1,24 @@
+<template>
+ <el-popover placement="bottom" :width="600" trigger="click">
+ <template #reference>
+ <el-badge :value="runningNum" :hidden="runningNum == 0" class="m-r-16">
+ <el-button circle>
+ <el-icon v-if="runningNum > 0" color="red" class="is-loading"><Clock /></el-icon>
+ <el-icon v-else><Clock /></el-icon>
+ </el-button>
+ </el-badge>
+ </template>
+ <!-- <el-button circle icon="Close" type="danger" @click=</el-button> -->
+ <FYBgTaskCard v-model="runningNum"></FYBgTaskCard>
+ </el-popover>
+</template>
+<script>
+export default {
+ data() {
+ return {
+ runningNum: 0
+ };
+ }
+};
+</script>
+<style scoped></style>
diff --git a/src/components/bg-task/FYBgTaskItem.vue b/src/components/bg-task/FYBgTaskItem.vue
new file mode 100644
index 0000000..df9b060
--- /dev/null
+++ b/src/components/bg-task/FYBgTaskItem.vue
@@ -0,0 +1,218 @@
+<template>
+ <el-card class="m-b-8" shadow="always" :body-style="{ padding: '8px' }">
+ <el-row>
+ <el-col :span="4">
+ <div class="status-btn">
+ <el-icon v-if="waiting" color="var(--el-color-info)" :size="50"><VideoPlay /></el-icon>
+ <el-icon v-else-if="running" color="var(--el-color-primary)" :size="50" class="is-loading"
+ ><Loading
+ /></el-icon>
+ <el-icon v-else-if="success" color="var(--el-color-success)" :size="50"
+ ><CircleCheck
+ /></el-icon>
+ <el-icon v-else-if="fail" color="var(--el-color-error)" :size="50"
+ ><CircleClose
+ /></el-icon>
+ <el-icon v-else color="var(--el-color-warning)" :size="50"><Warning /></el-icon>
+ <el-text type="info" size="small" style="position: absolute; bottom: 0">{{
+ nameToLabel(model.status)
+ }}</el-text>
+ </div>
+ </el-col>
+ <el-col :span="20" class="p-l-8">
+ <el-row justify="space-between">
+ <el-text class="m-l-4px w-300px" tag="b" size="large" truncated>{{ model.name }}</el-text>
+ <el-tag>{{ nameToLabel(model.type) }}</el-tag>
+ </el-row>
+ <el-row class="p-v-8" align="bottom">
+ <el-col :span="12">
+ <span class="timer">{{ time }}</span>
+ <el-text type="info" size="small" tag="div">杩愯鏃堕暱</el-text>
+ </el-col>
+ <el-col :span="12">
+ <el-text type="default" size="default" tag="div"
+ >寮�濮嬶細{{ $fm.formatYMDH(model.startTime) }}</el-text
+ >
+ <el-text type="default" size="default" tag="div"
+ >缁撴潫锛歿{ $fm.formatYMDH(model.endTime) }}</el-text
+ >
+ </el-col>
+ </el-row>
+ <el-row justify="end" align="bottom">
+ <!-- <span class="f-s color-i">ID锛歿{ model.id }}</span> -->
+ <el-row>
+ <FYReconfrimButton v-if="waiting" @confirm="startTask" v-model="startConfirm">
+ <el-button
+ plain
+ icon="VideoPlay"
+ type="primary"
+ size="small"
+ :loading="false"
+ @click="startConfirm = true"
+ >寮�濮嬩换鍔�</el-button
+ >
+ </FYReconfrimButton>
+ <FYReconfrimButton v-if="running" @confirm="stopTask" v-model="stopConfirm">
+ <el-button
+ icon="VideoPause"
+ plain
+ type="danger"
+ size="small"
+ :loading="false"
+ @click="stopConfirm = true"
+ >寮哄埗缁撴潫</el-button
+ >
+ </FYReconfrimButton>
+ <FYReconfrimButton v-if="!running" @confirm="removeTask" v-model="removeConfirm">
+ <el-button
+ icon="Delete"
+ plain
+ type="danger"
+ size="small"
+ :loading="false"
+ @click="removeConfirm = true"
+ >绉婚櫎浠诲姟</el-button
+ >
+ </FYReconfrimButton>
+ <template v-if="success">
+ <el-button
+ v-if="btnType"
+ plain
+ type="success"
+ size="small"
+ :loading="false"
+ @click="download"
+ >涓嬭浇鏂囦欢<el-icon class="m-l-4"><Right /></el-icon
+ ></el-button>
+ <el-button
+ v-else
+ plain
+ type="success"
+ size="small"
+ :loading="false"
+ @click="gotoResult"
+ >鏌ョ湅缁撴灉<el-icon class="m-l-4"><Right /></el-icon
+ ></el-button>
+ </template>
+ </el-row>
+ </el-row>
+ </el-col>
+ </el-row>
+ </el-card>
+</template>
+<script>
+import { nTlBgTask, BG_TASK_STATUS, BG_TASK_TYPE } from '@/enum/bgTask';
+import { useTimer } from '@/composables/timer';
+import downloadApi from '@/api/fysp/downloadApi';
+// import { useTimer } from '@/composables/timer2';
+
+export default {
+ setup() {
+ const { time, startTimer, pauseTimer, stopTimer, count } = useTimer();
+ return { time, startTimer, pauseTimer, stopTimer, count };
+ },
+ props: {
+ model: Object,
+ index: Number
+ },
+ emits: ['start', 'shutDown', 'remove', 'gotoResult'],
+ data() {
+ return {
+ startConfirm: false,
+ stopConfirm: false,
+ removeConfirm: false
+ };
+ },
+ watch: {
+ 'model.status': {
+ handler(nV) {
+ switch (nV) {
+ case BG_TASK_STATUS.WAITING.name:
+ this.stopTimer();
+ break;
+ case BG_TASK_STATUS.RUNNING.name:
+ this.startTimer();
+ break;
+ case BG_TASK_STATUS.SUCCESS.name:
+ case BG_TASK_STATUS.FAIL.name:
+ case BG_TASK_STATUS.SHUTDOWN.name:
+ this.pauseTimer();
+ break;
+ default:
+ this.stopTimer();
+ break;
+ }
+ this.count = this.model.runTime;
+ },
+ immediate: true
+ }
+ },
+ computed: {
+ btnType() {
+ return this.model.type == BG_TASK_TYPE.DOCUMENT.name;
+ },
+ waiting() {
+ return this.model.status == BG_TASK_STATUS.WAITING.name;
+ },
+ running() {
+ return this.model.status == BG_TASK_STATUS.RUNNING.name;
+ },
+ success() {
+ return this.model.status == BG_TASK_STATUS.SUCCESS.name;
+ },
+ fail() {
+ return this.model.status == BG_TASK_STATUS.FAIL.name;
+ },
+ shutdown() {
+ return this.model.status == BG_TASK_STATUS.SHUTDOWN.name;
+ }
+ },
+ methods: {
+ nameToLabel(name) {
+ const t = nTlBgTask(name);
+ return t.label;
+ },
+ startTask() {
+ this.$emit('start', this.index, (res) => {
+ if (res) {
+ this.startTimer();
+ }
+ });
+ },
+ stopTask() {
+ this.$emit('shutDown', this.index, (res) => {
+ if (res) {
+ this.stopTimer();
+ }
+ });
+ },
+ removeTask() {
+ this.$emit('remove', this.index, (res) => {
+ if (res) {
+ // this.stopTimer();
+ }
+ });
+ },
+ gotoResult() {
+ this.$emit('gotoResult', this.index);
+ },
+ download() {
+ downloadApi.downloadFile(this.model.extra);
+ }
+ }
+};
+</script>
+<style scoped>
+.status-btn {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border: var(--el-border);
+ border-radius: var(--el-border-radius-base);
+}
+.timer {
+ font-size: 30px;
+}
+</style>
diff --git a/src/components/core/Header.vue b/src/components/core/Header.vue
index 1a14d18..3c742e0 100644
--- a/src/components/core/Header.vue
+++ b/src/components/core/Header.vue
@@ -1,20 +1,16 @@
<template>
<el-row align="middle" class="header">
- <el-col :span="1">
- <el-button
- @click="collapsedSider"
- icon="Fold"
- circle
- :class="rotateIcon"
- />
+ <el-col :span="12">
+ <el-space>
+ <el-button @click="collapsedSider" icon="Fold" circle :class="rotateIcon" />
+ <el-breadcrumb separator="/" style="white-space: nowrap">
+ <el-breadcrumb-item v-for="(t, i) in navTitles" :key="i">{{ t }}</el-breadcrumb-item>
+ </el-breadcrumb>
+ </el-space>
</el-col>
- <el-col :span="18">
- <el-breadcrumb separator="/" style="white-space: nowrap;">
- <el-breadcrumb-item v-for="(t, i) in navTitles" :key="i">{{t}}</el-breadcrumb-item>
- </el-breadcrumb>
- </el-col>
- <el-col :span="5" class="logout">
- <el-button icon="SwitchButton">閫�鍑虹櫥褰�</el-button>
+ <el-col :span="12" class="logout">
+ <FYBgTaskDialog></FYBgTaskDialog>
+ <el-button icon="SwitchButton">閫�鍑虹櫥褰�</el-button>
</el-col>
</el-row>
</template>
@@ -25,16 +21,16 @@
props: {
collapse: {
type: Boolean,
- default: false,
+ default: false
},
navTitles: {
type: Array,
- default: () => ['home','promotion list', 'promotion detail'],
+ default: () => ['home', 'promotion list', 'promotion detail']
}
},
data() {
return {
- isCollapsed: this.collapse,
+ isCollapsed: this.collapse
};
},
watch: {},
@@ -44,7 +40,7 @@
*/
rotateIcon() {
return ['menu-icon', this.isCollapsed ? 'rotate-icon' : ''];
- },
+ }
},
methods: {
/**
@@ -53,8 +49,8 @@
collapsedSider() {
this.isCollapsed = !this.isCollapsed;
this.$emit('collapsedSider', this.isCollapsed);
- },
- },
+ }
+ }
};
</script>
diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index c519077..66c53bf 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -58,18 +58,18 @@
currentPage: 1,
pageSize: 20,
loading: false
- }
+ };
},
emits: ['search'],
watch: {
currentPage(nValue, oValue) {
if (nValue != oValue) {
- this.onSearch()
+ this.onSearch();
}
},
pageSize(nValue, oValue) {
if (nValue != oValue) {
- this.onSearch()
+ this.onSearch();
}
}
},
@@ -80,7 +80,7 @@
* 鍥炶皟鍑芥暟鎺ユ敹涓�涓璞★紝鍖呮嫭琛ㄦ牸鏁版嵁鏁扮粍data鍜屾暟鎹�绘暟total
*/
onSearch() {
- this.loading = true
+ this.loading = true;
this.$emit(
'search',
{
@@ -88,37 +88,37 @@
pageSize: this.pageSize
},
(res) => {
- this.tableData = res.data
- this.total = res.total ? res.total : 0
- this.loading = false
+ this.tableData = res.data;
+ this.total = res.total ? res.total : 0;
+ this.loading = false;
}
- )
+ );
},
calcTableHeight() {
- const h1 = this.$refs.searchRef.$el.offsetHeight
- const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0
- const h3 = this.$refs.expandRef.$el.offsetHeight
- const h = h1 + h2 + h3
+ const h1 = this.$refs.searchRef.$el.offsetHeight;
+ const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
+ const h3 = this.$refs.expandRef.$el.offsetHeight;
+ const h = h1 + h2 + h3;
// return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`;
- return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`
+ return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
},
tableRowClassName({ row }) {
if (this.rowClassName) {
if (typeof this.rowClassName == 'string') {
- return this.rowClassName
+ return this.rowClassName;
} else if (typeof this.rowClassName == 'function') {
- return this.rowClassName({ row })
+ return this.rowClassName({ row });
}
} else {
- return row.extension1 != '0' ? 'online-row' : 'offline-row'
+ return row.extension1 != '0' ? 'online-row' : 'offline-row';
}
}
},
mounted() {
- this.tableHeight = this.calcTableHeight()
- this.onSearch()
+ this.tableHeight = this.calcTableHeight();
+ this.onSearch();
}
-}
+};
</script>
<style>
diff --git a/src/enum/bgTask.js b/src/enum/bgTask.js
index 6e0c920..ecde806 100644
--- a/src/enum/bgTask.js
+++ b/src/enum/bgTask.js
@@ -11,6 +11,11 @@
name: 'AUTO_SCORE',
label: '鑷姩璇勪及浠诲姟',
value: '1'
+ },
+ DOCUMENT: {
+ name: 'DOCUMENT',
+ label: '鏂囨。鐢熸垚浠诲姟',
+ value: '2'
}
});
@@ -52,6 +57,8 @@
return BG_TASK_TYPE[name];
} else if (name in BG_TASK_STATUS) {
return BG_TASK_STATUS[name];
+ } else {
+ return '-'
}
}
diff --git a/src/router/index.js b/src/router/index.js
index 9493f98..1129d92 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -82,13 +82,15 @@
//璇勪及鏁版嵁婧�
name: 'fyspDatasource',
path: '/fysp/evaluation/datasource',
- component: () => import('@/views/fysp/evaluation/DataSource.vue')
+ component: () => import('@/views/fysp/evaluation/DataSource.vue'),
+ meta: { keepAlive: true }
},
{
//璇勪及绠$悊
name: 'fyspResultManage',
path: '/fysp/evaluation/resultManage',
- component: () => import('@/views/fysp/evaluation/ResultManage.vue')
+ component: () => import('@/views/fysp/evaluation/ResultManage.vue'),
+ meta: { keepAlive: true }
},
{
//鍦烘櫙淇℃伅
diff --git a/src/styles/element/base.scss b/src/styles/element/base.scss
index 7ed2e32..4347524 100644
--- a/src/styles/element/base.scss
+++ b/src/styles/element/base.scss
@@ -1,54 +1,34 @@
-//
-@mixin font-size($size) {
- font-size: var($size);
+/************************************** font size **************************************/
+$fontsize: (
+ s: var(--el-font-size-small),
+ b: var(--el-font-size-base),
+ m: var(--el-font-size-medium),
+ l: var(--el-font-size-large)
+);
+
+@each $dName, $dValue in $fontsize {
+ .f-#{$dName} {
+ font-size: #{$dValue};
+ }
}
-.f-s {
- @include font-size(--el-font-size-small);
-}
+/************************************** color **************************************/
+$colors: (
+ p: var(--el-color-primary),
+ s: var(--el-color-success),
+ w: var(--el-color-warning),
+ d: var(--el-color-danger),
+ e: var(--el-color-error),
+ i: var(--el-color-info)
+);
-.f-b {
- @include font-size(--el-font-size-base);
-}
-
-.f-m {
- @include font-size(--el-font-size-medium);
-}
-
-.f-l {
- @include font-size(--el-font-size-large);
-}
-
-@mixin color($value) {
- color: var($value);
-}
-
-.color-p {
- @include color(--el-color-primary);
-}
-
-.color-s {
- @include color(--el-color-success);
-}
-
-.color-w {
- @include color(--el-color-warning);
-}
-
-.color-d {
- @include color(--el-color-danger);
-}
-
-.color-e {
- @include color(--el-color-error);
-}
-
-.color-i {
- @include color(--el-color-info);
-}
-
-.b-color-aqua {
- background-color: aqua;
+@each $dName, $dValue in $colors {
+ .color-#{$dName} {
+ color: #{$dValue};
+ }
+ .b-color-#{$dName} {
+ background-color: #{$dValue};
+ }
}
/************************************** 鍐呭杈硅窛 **************************************/
@@ -85,8 +65,28 @@
}
}
-.w-300px {
- width: 300px;
+/************************************** 瀹介珮 **************************************/
+$csize: (
+ small: var(--el-component-size-small),
+ default: var(--el-component-size-default),
+ large: var(--el-component-size-large)
+);
+$ws: (20px, 40px, 60px, 100px, 150px, 300px);
+@each $name, $value in $csize {
+ .w-#{$name} {
+ width: #{$value};
+ }
+ .h-#{$name} {
+ height: #{$value};
+ }
+}
+@each $i in $ws {
+ .w-#{$i} {
+ width: #{$i};
+ }
+ .h-#{$i} {
+ height: #{$i};
+ }
}
//
diff --git a/src/styles/element/layout.js b/src/styles/element/layout.js
index 59cf64b..24acde8 100644
--- a/src/styles/element/layout.js
+++ b/src/styles/element/layout.js
@@ -14,19 +14,19 @@
pull: 0,
},
md: {
- span: 16,
- offset: 3,
+ span: 20,
+ offset: 2,
push: 0,
pull: 0,
},
lg: {
- span: 14,
- offset: 4,
+ span: 18,
+ offset: 3,
push: 0,
pull: 0,
},
xl: {
- span: 12,
+ span: 14,
offset: 5,
push: 0,
pull: 0,
diff --git a/src/views/fysp/evaluation/DataSource.vue b/src/views/fysp/evaluation/DataSource.vue
index d8a31e1..aac4e87 100644
--- a/src/views/fysp/evaluation/DataSource.vue
+++ b/src/views/fysp/evaluation/DataSource.vue
@@ -1,10 +1,10 @@
<template>
<el-row :gutter="16">
<el-col :span="16">
- <CompPreCheck></CompPreCheck>
+ <CompPreCheck @start-task="refreshTask"></CompPreCheck>
</el-col>
<el-col :span="8">
- <CompEvaTask></CompEvaTask>
+ <CompEvaTask ref="refEvaTask"></CompEvaTask>
</el-col>
</el-row>
</template>
@@ -17,6 +17,11 @@
components: { CompPreCheck, CompEvaTask },
data() {
return {};
+ },
+ methods:{
+ refreshTask(){
+ this.$refs.refEvaTask.fetchTask()
+ }
}
};
</script>
diff --git a/src/views/fysp/evaluation/ResultManage.vue b/src/views/fysp/evaluation/ResultManage.vue
index b076fda..0ba2bf5 100644
--- a/src/views/fysp/evaluation/ResultManage.vue
+++ b/src/views/fysp/evaluation/ResultManage.vue
@@ -21,7 +21,9 @@
</template>
<template #options-expand>
- <CompQuickSet @quick-set="setOptions"></CompQuickSet>
+ <el-form :inline="true">
+ <CompQuickSet @quick-set="setOptions"></CompQuickSet>
+ </el-form>
</template>
<template #table-column>
@@ -70,8 +72,8 @@
<el-table-column prop="biManagementCompany" label="鐗╀笟" min-width="110"/> -->
<el-table-column fixed="right" align="right" label="鎿嶄綔" width="160">
<template #header>
- <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true"
- >鑷姩璇勪及</el-button
+ <el-button icon="Download" size="default" type="success" @click="download"
+ >涓嬭浇缁撴灉</el-button
>
</template>
<template #default="{ row }">
@@ -102,23 +104,27 @@
};
},
methods: {
- setOptions(param) {
- this.formSearch.locations = param.locations;
- this.formSearch.scenetype = param.scenetype;
- this.$refs.tableRef.onSearch()
- },
- onSearch(page, func) {
+ _getParam() {
const { locations, scenetype, time } = this.formSearch;
- const area = {
+ return {
provincecode: locations.pCode,
provincename: locations.pName,
citycode: locations.cCode,
cityname: locations.cName,
districtcode: locations.dCode,
districtname: locations.dName,
- starttime: dayjs(time).format('YYYY-MM-DD'),
+ starttime: dayjs(time).format('YYYY-MM-DD HH:mm:ss'),
scensetypeid: scenetype.value
};
+ },
+ setOptions(param) {
+ this.formSearch.locations = param.locations;
+ this.formSearch.scenetype = param.scenetype;
+ this.formSearch.sourceType = param.sourceType;
+ this.$refs.tableRef.onSearch();
+ },
+ onSearch(page, func) {
+ const area = this._getParam()
evaluateApi.fetchAutoEvaluation(area).then((res) => {
if (typeof func === 'function') {
func({ data: res.data });
@@ -127,6 +133,12 @@
this.getFilters(res.data);
}
});
+ },
+ download() {
+ const area = this._getParam()
+ evaluateApi.downloadAutoEvaluation(area).then(res=>{
+ this.$parent
+ })
},
getFilters(data) {
const townList = [];
@@ -166,5 +178,4 @@
}
};
</script>
-<style scoped>
-</style>
+<style scoped></style>
diff --git a/src/views/fysp/evaluation/components/CompEvaTask.vue b/src/views/fysp/evaluation/components/CompEvaTask.vue
index 27bcec4..dd1dd53 100644
--- a/src/views/fysp/evaluation/components/CompEvaTask.vue
+++ b/src/views/fysp/evaluation/components/CompEvaTask.vue
@@ -15,7 +15,7 @@
>鍒锋柊浠诲姟</el-button
>
</el-row>
- <el-row>
+ <!-- <el-row>
<el-button type="default" size="default" @click="newTestTask">鏂板娴嬭瘯浠诲姟</el-button>
<el-button type="default" size="default" @click="startNewTestTask"
>鏂板缓骞惰繍琛屼竴涓祴璇曚换鍔�</el-button
@@ -23,18 +23,18 @@
<el-button type="default" size="default" @click="shutDownTask"
>寮哄埗鍏抽棴鎵�鏈夋祴璇曚换鍔�</el-button
>
- </el-row>
+ </el-row> -->
</template>
<el-scrollbar height="70vh" class="scrollbar">
<template v-for="(v, i) in taskList" :key="i">
- <FYBgTaskCard
+ <FYBgTaskItem
:model="v"
:index="i"
@start="startTask"
@shutDown="shutDownTask"
@remove="removeTask"
@gotoResult="gotoResult"
- ></FYBgTaskCard>
+ ></FYBgTaskItem>
</template>
</el-scrollbar>
</el-card>
@@ -59,6 +59,9 @@
};
},
methods: {
+ addTask(){
+
+ },
newTestTask() {
this.fetchData((page, pageSize) => {
return bgtaskApi.newTestTask(`Test-Task-${++this.taskIndex}`).then((res) => {
@@ -84,7 +87,7 @@
this.fetchData((page, pageSize) => {
return bgtaskApi
.fetchTaskStatus({
- type: BG_TASK_TYPE.TEST.name
+ type: BG_TASK_TYPE.AUTO_SCORE.name
})
.then((res) => {
this.taskList = res.data;
diff --git a/src/views/fysp/evaluation/components/CompQuickSet.vue b/src/views/fysp/evaluation/components/CompQuickSet.vue
index 4e91557..e37fda3 100644
--- a/src/views/fysp/evaluation/components/CompQuickSet.vue
+++ b/src/views/fysp/evaluation/components/CompQuickSet.vue
@@ -87,19 +87,19 @@
scenetype: { label: '鎼呮媽绔�', value: '3' },
sourceType: 2,
},
- {
- name: '寰愭眹姹戒慨',
- locations: {
- pCode: '31',
- pName: '涓婃捣甯�',
- cCode: '3100',
- cName: '涓婃捣甯�',
- dCode: '310104',
- dName: '寰愭眹鍖�'
- },
- scenetype: { label: '姹戒慨', value: '7' },
- sourceType: 1,
- }
+ // {
+ // name: '寰愭眹姹戒慨',
+ // locations: {
+ // pCode: '31',
+ // pName: '涓婃捣甯�',
+ // cCode: '3100',
+ // cName: '涓婃捣甯�',
+ // dCode: '310104',
+ // dName: '寰愭眹鍖�'
+ // },
+ // scenetype: { label: '姹戒慨', value: '7' },
+ // sourceType: 1,
+ // }
]
}
}
diff --git a/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
index e291c40..7001369 100644
--- a/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
+++ b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue
@@ -2,17 +2,18 @@
<el-steps :active="stepIndex" finish-status="success" style="" align-center>
<el-step title="璇勪及鑼冨洿" />
<el-step title="鏁版嵁婧愭鏌�" />
- <el-step title="璞佸厤鏉$洰" />
+ <el-step title="鏉$洰璞佸厤" />
<el-step title="鑷姩璇勪及" />
</el-steps>
<CompCheckArea v-show="stepIndex == 0" v-model="stepIndex" @change="onAreaChange"></CompCheckArea>
- <CompCheckSource
- v-show="stepIndex == 1"
- v-model="stepIndex"
- ref="refSource"
- ></CompCheckSource>
+ <CompCheckSource v-show="stepIndex == 1" v-model="stepIndex" ref="refSource"></CompCheckSource>
<CompCheckExemption v-show="stepIndex == 2" v-model="stepIndex"></CompCheckExemption>
- <CompCheckConfirm v-show="stepIndex == 3" v-model="stepIndex"></CompCheckConfirm>
+ <CompCheckConfirm
+ v-show="stepIndex == 3"
+ v-model="stepIndex"
+ :area-info="area"
+ @start="onNewTask"
+ ></CompCheckConfirm>
</template>
<script>
@@ -29,7 +30,7 @@
name: 'CompPreCheck',
components: { CompCheckArea, CompCheckSource, CompCheckExemption, CompCheckConfirm },
props: {},
- emits: ['preCheck'],
+ emits: ['startTask'],
data() {
return {
// 鎿嶄綔姝ラ涓嬫爣
@@ -41,16 +42,30 @@
/**
* 鐩戝惉璇勪及鑼冨洿鍙樻洿
*/
- onAreaChange(v) {
- // this.area = v;
- this.$refs.refSource.startCheck(v);
+ onAreaChange(val) {
+ const v = val.value;
+ this.area = {
+ provincecode: v._locations.pCode,
+ provincename: v._locations.pName,
+ citycode: v._locations.cCode,
+ cityname: v._locations.cName,
+ districtcode: v._locations.dCode,
+ districtname: v._locations.dName,
+ towncode: v._locations.tCode,
+ townname: v._locations.tName,
+ starttime: this.$fm.formatYMDH(v.time),
+ scensetypeid: v._scenetype.value,
+ online: true,
+ sourceType: v.sourceType
+ };
+ this.$refs.refSource.startCheck(this.area);
},
/**
* 鑷姩璇勪及鍓嶇疆鍚堣鎬ф鏌�
* 妫�鏌ユ墍閫夎寖鍥村唴鍚勯」璇勪及鏁版嵁婧愭槸鍚﹀畬鏁�
*/
- preCheck() {
- // this.$emit('preCheck', param)
+ onNewTask() {
+ this.$emit('startTask');
}
}
};
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
index b8f819e..c117318 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue
@@ -1,36 +1,46 @@
<template>
<el-card shadow="never">
- Never4
+ <template #header>
+ <div><el-text tag="b" size="large">鑷姩璇勪及纭</el-text></div>
+ <el-text size="small" type="info">鏈�缁堢‘璁よ嚜鍔ㄨ瘎浼板悇閰嶇疆椤癸紝骞跺紑濮嬭嚜鍔ㄨ瘎浼�</el-text>
+ </template>
+ <div>璇勪及鑼冨洿</div>
+ <div>璇勪及鏁版嵁婧愬畬鏁村害</div>
+ <div>鏄惁鏈夎眮鍏嶆潯鐩�</div>
<template #footer>
<el-row justify="space-around">
<el-button type="primary" size="default" @click="lastStep">涓婁竴姝�</el-button>
- <!-- <el-button type="primary" size="default" @click="nextStep">涓嬩竴姝�</el-button> -->
+ <el-button type="primary" size="default" @click="startEvaluate">寮�濮嬭瘎浼�</el-button>
</el-row>
</template>
</el-card>
</template>
<script>
+import evaluateApi from '@/api/fysp/evaluateApi';
+
/**
* 璇勪及浠诲姟鏈�缁堝紑鍚‘璁�
*/
export default {
props: {
// 姝ラ涓嬫爣
- modelValue: Number
+ modelValue: Number,
+ // 鍖哄煙淇℃伅
+ areaInfo: Object
},
- emits: ['update:modelValue'],
+ emits: ['update:modelValue', 'start'],
data() {
- return {
-
- };
+ return {};
},
methods: {
- // 璺宠浆涓嬩竴姝�
- nextStep() {
- this.$emit('update:modelValue', this.modelValue + 1);
+ // 寮�鍚嚜鍔ㄨ瘎浼颁换鍔�
+ startEvaluate() {
+ evaluateApi.autoEvaluate(this.areaInfo).then((res) => {
+ this.$emit('start', res.data);
+ });
},
- // 璺宠浆涓嬩竴姝�
+ // 璺宠浆涓婁竴姝�
lastStep() {
this.$emit('update:modelValue', this.modelValue - 1);
}
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
index 5392bda..f9195e4 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue
@@ -1,5 +1,9 @@
<template>
<el-card shadow="never">
+ <template #header>
+ <div><el-text tag="b" size="large">鏉$洰璞佸厤</el-text></div>
+ <el-text size="small" type="info">鑷畾涔夎缃娆¤瘎浼颁笉鍙備笌璁$畻鐨勬潯鐩�</el-text>
+ </template>
璞佸厤鏉$洰鍔熻兘鏆傛湭瀹屾垚锛岃鐩存帴鐐瑰嚮涓嬩竴姝�
<template #footer>
<el-row justify="space-around">
diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index 3456d9c..c098e85 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -3,50 +3,57 @@
<template #header>
<div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
<el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
+ <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
</template>
<FormCol>
- <el-form-item align="middle" v-for="(v, i) in checkResults" :key="i">
- <el-col :span="14">
- <el-row align="middle">
- <el-text size="default" :class="v.required ? 'required' : 'not-required'">*</el-text>
- <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
- </el-row>
- </el-col>
- <el-col :span="5">
- <el-row align="middle">
- <el-space>
- <template v-if="v.loading">
- <el-icon class="is-loading"><Loading /></el-icon>
- <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
- </template>
- <template v-else-if="v.pass == true">
- <el-icon color="var(--el-color-success)"><Check /></el-icon>
- <el-text size="default" type="success">閫氳繃</el-text>
- </template>
- <template v-else-if="v.pass == false">
- <el-icon color="var(--el-color-danger)"><Close /></el-icon>
- <el-text size="default" type="danger">缂哄け</el-text>
- </template>
- <template v-else>
- <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
- <el-text size="default" type="warning">鏆傜暐杩�</el-text>
- </template>
- </el-space>
- </el-row>
- </el-col>
- <el-col :span="5">
- <el-button
- v-if="!v.pass"
- type="primary"
- size="small"
- @click="goto(v.path)"
- :disabled="v.path == ''"
- >
- 鍘诲畬鍠�
- <el-icon class="m-l-4"><Right /></el-icon>
- </el-button>
- </el-col>
- </el-form-item>
+ <template v-for="(v, i) in checkResults" :key="i">
+ <el-row class="h-small" align="middle">
+ <el-col :span="14">
+ <el-row align="middle">
+ <el-text size="default" :class="v.required ? 'required' : 'not-required'">*</el-text>
+ <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
+ </el-row>
+ </el-col>
+ <el-col :span="5">
+ <el-row align="middle">
+ <el-space>
+ <template v-if="v.loading">
+ <el-icon class="is-loading"><Loading /></el-icon>
+ <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
+ </template>
+ <template v-else-if="v.pass == true">
+ <el-icon color="var(--el-color-success)"><Check /></el-icon>
+ <el-text size="default" type="success">閫氳繃</el-text>
+ </template>
+ <template v-else-if="v.pass == false">
+ <el-icon color="var(--el-color-danger)"><Close /></el-icon>
+ <el-text size="default" type="danger">缂哄け</el-text>
+ </template>
+ <template v-else>
+ <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
+ <el-text size="default" type="warning">鏆傜暐杩�</el-text>
+ </template>
+ </el-space>
+ </el-row>
+ </el-col>
+ <el-col :span="5">
+ <el-button
+ v-show="!v.loading"
+ :type="v.pass ? '' : 'danger'"
+ size="small"
+ @click="goto(v.path)"
+ :disabled="v.path == ''"
+ >
+ {{ v.pass ? '鍘讳慨鏀�' : '鍘诲畬鍠�' }}
+ <el-icon class="m-l-4"><Right /></el-icon>
+ </el-button>
+ </el-col>
+ </el-row>
+ <el-row align="middle" class="m-b-16">
+ <el-text size="small" class="not-required">*</el-text>
+ <el-text size="small" class="m-l-4 color-i">{{ v.des }}</el-text>
+ </el-row>
+ </template>
</FormCol>
<template #footer>
<el-row justify="space-around">
@@ -80,10 +87,13 @@
loading: true,
pass: false,
path: _path,
+ des: '',
async fetch() {
this.loading = true;
setTimeout(async () => {
- this.pass = await _fetch();
+ const res = await _fetch();
+ this.pass = res ? res.pass : undefined;
+ this.des = res ? res.des : undefined;
this.loading = false;
}, 1000);
}
@@ -114,7 +124,19 @@
...this.areaInfo
};
return evaluateApi.fetchEvaluationRule(param).then((res) => {
- return res.data.length > 0;
+ const pass = res.data.length > 0;
+ let des = '';
+ if (pass) {
+ res.data.forEach((e) => {
+ if (des != '') {
+ des += '銆�';
+ }
+ des += `銆�${e.rulename}銆媊;
+ });
+ } else {
+ des = '鏈壘鍒扮浉鍏宠瘎浼拌鍒欒〃';
+ }
+ return { pass, des };
});
},
true
@@ -122,35 +144,61 @@
// 鍖哄煙鑼冨洿鍐呯殑鐩戠浠诲姟鏄惁瀛樺湪
baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => {
return taskApi.fetchTopTasks(this.areaInfo).then((res) => {
- return res.data.length > 0;
+ const pass = res.data.length > 0;
+ let des = '';
+ if (pass) {
+ res.data.forEach((e) => {
+ if (des != '') {
+ des += '銆�';
+ }
+ des += e.name;
+ });
+ } else {
+ des = '鏈壘鍒扮浉鍏冲贰鏌ユ�讳换鍔�';
+ }
+ return { pass, des };
});
}),
// 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚
baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}),
// 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑
baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {
- userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
- return res.data.length > 0;
+ return userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
+ const pass = res.data.length > 0;
+ let des = '';
+ if (pass) {
+ des = `鎵惧埌鍖归厤璁板綍鍏�${res.data.length}鏉;
+ } else {
+ des = '鏈壘鍒扮浉鍏冲尮閰嶈褰�';
+ }
+ return { pass, des };
});
}),
// 鍖哄煙鑼冨洿鍐呯殑鐩戠闂閰嶇疆琛ㄦ槸鍚﹀瓨鍦�
baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => {
- const param = {
+ const param = {
cityCode: this.areaInfo.citycode,
districtCode: this.areaInfo.districtcode,
sceneTypeId: this.areaInfo.scensetypeid
- }
- problemApi.fetchProblemType(param).then((res) => {
- return res.length > 0;
+ };
+ return problemApi.fetchProblemType(param).then((res) => {
+ const pass = res.length > 0;
+ let des = '';
+ if (pass) {
+ des = `鎵惧埌闂绫诲瀷鍏�${res.length}鏉;
+ } else {
+ des = '鏈壘鍒扮浉鍏抽棶棰樼被鍨�';
+ }
+ return { pass, des };
});
}),
// 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
baseCheckItem('淇¤鎶曡瘔', '', () => {
- complaintApi.fetchComplaints();
+ // complaintApi.fetchComplaints();
}),
// 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
baseCheckItem('琛屾斂澶勭綒', '', () => {
- complaintApi.fetchPunishment();
+ // complaintApi.fetchPunishment();
})
]
};
@@ -189,21 +237,23 @@
},
// 寮�濮嬫鏌ヤ换鍔�
startCheck(value) {
- const v = value.value
- this.areaInfo = {
- provincecode: v._locations.pCode,
- provincename: v._locations.pName,
- citycode: v._locations.cCode,
- cityname: v._locations.cName,
- districtcode: v._locations.dCode,
- districtname: v._locations.dName,
- towncode: v._locations.tCode,
- townname: v._locations.tName,
- starttime: v.time,
- scensetypeid: v._scenetype.value,
- online: true,
- sourceType: v.sourceType,
- };
+ // const v = value.value;
+ // this.areaInfo = {
+ // provincecode: v._locations.pCode,
+ // provincename: v._locations.pName,
+ // citycode: v._locations.cCode,
+ // cityname: v._locations.cName,
+ // districtcode: v._locations.dCode,
+ // districtname: v._locations.dName,
+ // towncode: v._locations.tCode,
+ // townname: v._locations.tName,
+ // starttime: this.$fm.formatYMDH(v.time),
+ // scensetypeid: v._scenetype.value,
+ // online: true,
+ // sourceType: v.sourceType
+ // };
+ this.areaInfo = value
+
this.checkResults.forEach((e) => {
e.fetch();
});
--
Gitblit v1.9.3