From 023ea35893ed047887a43555509335eec7a8b161 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 09 一月 2024 17:28:49 +0800 Subject: [PATCH] 1. 编写评估任务模块中 --- src/styles/element/base.scss | 47 ++- src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue | 182 ++++++++++++ src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue | 0 src/components/search-option/FYOptionTime.vue | 13 src/components.d.ts | 1 src/components/form/FYForm.vue | 14 src/composables/timer2.js | 95 ++++++ src/views/fysp/evaluation/components/precheck/CompPreCheck.vue | 57 +++ src/views/fysp/evaluation/DataSource.vue | 2 src/api/fysp/evaluateApi.js | 9 src/components/bg-task/FYBgTaskCard.vue | 33 + /dev/null | 146 --------- src/views/notice/NoticeManage.vue | 2 src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue | 128 ++++++++ src/views/notice/CompNoticeAdd.vue | 71 ++-- src/api/fysp/taskApi.js | 9 src/composables/timer.js | 2 src/views/fysp/evaluation/components/CompQuickSet.vue | 28 + src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue | 0 src/components/search-option/FYOptionScene.vue | 32 + 20 files changed, 630 insertions(+), 241 deletions(-) diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js index 6e752a6..01d1cf5 100644 --- a/src/api/fysp/evaluateApi.js +++ b/src/api/fysp/evaluateApi.js @@ -6,5 +6,14 @@ */ fetchAutoEvaluation(param) { return $fysp.post(`evaluation/auto/record`, param).then((res) => res.data); + }, + + /** + * 鏌ヨ璇勪及鎬昏鍒� + * @param {Object} param + * @returns + */ + fetchEvaluationRule(param) { + return $fysp.post(`evaluationrule/find`, param).then((res) => res.data); } }; diff --git a/src/api/fysp/taskApi.js b/src/api/fysp/taskApi.js index 35096d7..fbdb714 100644 --- a/src/api/fysp/taskApi.js +++ b/src/api/fysp/taskApi.js @@ -9,6 +9,15 @@ }, /** + * 鏌ヨ鎬讳换鍔� + * @param {Object} param + * @returns + */ + fetchTopTasks(param) { + return $fysp.post('task/find', param).then((res) => res.data); + }, + + /** * 鑾峰彇瀛愪换鍔$粺璁′俊鎭� */ getSubtaskSummary({ topTaskId = undefined, sceneTypeId = undefined }) { diff --git a/src/components.d.ts b/src/components.d.ts index 42c74ea..4a308bb 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -61,6 +61,7 @@ ElTag: typeof import('element-plus/es')['ElTag'] ElText: typeof import('element-plus/es')['ElText'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] + ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] Footer: typeof import('./components/core/Footer.vue')['default'] FormCol: typeof import('./components/layout/FormCol.vue')['default'] diff --git a/src/components/bg-task/FYBgTaskCard.vue b/src/components/bg-task/FYBgTaskCard.vue index 0c50ec5..591aca6 100644 --- a/src/components/bg-task/FYBgTaskCard.vue +++ b/src/components/bg-task/FYBgTaskCard.vue @@ -21,7 +21,7 @@ </el-col> <el-col :span="20" class="p-l-8"> <el-row justify="space-between"> - <el-text class="m-l-4px w-150px" tag="b" size="large" truncated>{{ model.name }}</el-text> + <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"> @@ -91,12 +91,13 @@ </template> <script> import { nTlBgTask, BG_TASK_STATUS } from '@/enum/bgTask'; -import { useTimer } from '../../composables/timer'; +import { useTimer } from '@/composables/timer'; +// import { useTimer } from '@/composables/timer2'; export default { setup() { - const { time, startTimer, pauseTimer, stopTimer } = useTimer(); - return { time, startTimer, pauseTimer, stopTimer }; + const { time, startTimer, pauseTimer, stopTimer, count } = useTimer(); + return { time, startTimer, pauseTimer, stopTimer, count }; }, props: { model: Object, @@ -110,6 +111,30 @@ 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: { waiting() { return this.model.status == BG_TASK_STATUS.WAITING.name; diff --git a/src/components/form/FYForm.vue b/src/components/form/FYForm.vue index 07fde84..94773fa 100644 --- a/src/components/form/FYForm.vue +++ b/src/components/form/FYForm.vue @@ -69,13 +69,6 @@ required: true, message: '琛屾斂鍖哄垝涓嶈兘涓虹┖', trigger: 'change' - // validator: (rule, value, callback) => { - // if (!value) { - // callback(new Error('Please input the age')); - // } else { - // callback() - // } - // } } ], _scenetype: [ @@ -83,13 +76,6 @@ required: true, message: '鍦烘櫙绫诲瀷涓嶈兘涓虹┖', trigger: 'change' - // validator: (rule, value, callback) => { - // if (!value) { - // callback(new Error('Please input the age')); - // } else { - // callback() - // } - // } } ] }); diff --git a/src/components/search-option/FYOptionScene.vue b/src/components/search-option/FYOptionScene.vue index 0786b61..6cf9b1b 100644 --- a/src/components/search-option/FYOptionScene.vue +++ b/src/components/search-option/FYOptionScene.vue @@ -6,12 +6,7 @@ placeholder="鍦烘櫙绫诲瀷" style="width: 150px" > - <el-option - v-for="s in sceneTypes" - :key="s.value" - :label="s.label" - :value="s" - /> + <el-option v-for="s in sceneTypes" :key="s.value" :label="s.label" :value="s" /> </el-select> </el-form-item> </template> @@ -24,30 +19,45 @@ // 鏄惁鍦ㄩ閫夐」澶勬坊鍔犫�滃叏閮ㄢ�濋�夐」 allOption: { type: Boolean, - default: true, + default: true }, // 1:椋炵窘鐜绯荤粺锛�2锛氶缇界洃绠$郴缁燂紱 type: { type: Number, - default: 1, + default: 1 }, // 杩斿洖缁撴灉 value: Object, // 鏄惁榛樿杩斿洖鍒濆閫夐」 initValue: { type: Boolean, - default: true, + default: true }, + // form琛ㄥ崟缁戝畾灞炴�у悕 prop: { type: String, default: '_scenetype' + }, + // 鍒囨崲 type 鍚庯紝褰撳墠閫夐」鏄惁娓呯┖ + sourceInit: { + type: Boolean, + default: true } }, emits: ['update:value'], data() { return { - sceneTypes: enumScene(this.type, this.allOption), + // sceneTypes: enumScene(this.type, this.allOption), }; + }, + computed: { + sceneTypes() { + if (this.sourceInit) { + // 褰撳洜涓簍ype鎴栬�卆llOption鍙傛暟鍙樺寲寮曡捣閫夐」鍙樻洿鏃讹紝娓呯┖褰撳墠閫夐」 + this.handleChange(); + } + return enumScene(this.type, this.allOption); + } }, methods: { handleChange(value) { @@ -58,6 +68,6 @@ if (this.initValue) { this.handleChange(this.sceneTypes[0]); } - }, + } }; </script> diff --git a/src/components/search-option/FYOptionTime.vue b/src/components/search-option/FYOptionTime.vue index 18ccb34..801fbde 100644 --- a/src/components/search-option/FYOptionTime.vue +++ b/src/components/search-option/FYOptionTime.vue @@ -1,9 +1,9 @@ <template> <el-form-item label="鏃堕棿" :prop="prop"> <el-date-picker - :model-value="value" + v-model="date" @change="handleChange" - type="month" + :type="type" placeholder="閫夋嫨鏃堕棿" style="width: 150px" /> @@ -32,7 +32,11 @@ }, emits: ['update:value'], data() { - return {}; + return { + date: this.value + }; + }, + computed:{ }, methods: { handleChange(value) { @@ -49,7 +53,8 @@ }, mounted() { if (this.initValue) { - this.handleChange(new Date()); + this.date = new Date() + this.handleChange(this.date); } } }; diff --git a/src/composables/timer.js b/src/composables/timer.js index eec906a..e2fdf5f 100644 --- a/src/composables/timer.js +++ b/src/composables/timer.js @@ -38,5 +38,5 @@ count.value = 0; } - return { time, startTimer, pauseTimer, stopTimer, running }; + return { time, startTimer, pauseTimer, stopTimer, running, count }; } diff --git a/src/composables/timer2.js b/src/composables/timer2.js new file mode 100644 index 0000000..fe86fda --- /dev/null +++ b/src/composables/timer2.js @@ -0,0 +1,95 @@ +import { ref, computed, watch } from 'vue'; +import { useNow } from '@vueuse/core'; + +/** + * 绉掕〃璁℃椂鍣� + */ +export function useTimer() { + const startTime = ref(new Date()); + const endTime = ref(new Date()); + const { now, pause, resume } = useNow({ controls: true }); + + // 鏃堕棿鍋忕Щ閲忥紙褰撳垵濮嬫椂闂翠粠鏈嶅姟鍣ㄧ瓑澶栭儴璁惧鑾峰彇鏃讹紝娴忚鍣ㄦ墍鍦ㄨ澶囩殑鏃堕棿浼氫笌鍏舵湁璇樊锛屼负浜嗚鏃跺櫒涓ユ牸鍦�0绉掑惎鍔紝璁板綍鍏朵箣闂寸殑鍋忕Щ閲忥級 + const offset = ref(0) + // 杩愯鐘舵�侊紝0锛氬仠姝紱1锛氳繍琛屼腑锛�2锛氭殏鍋� + const status = ref(0); + const time = computed(() => { + if (status.value == 0) { + return `00:00:00`; + } + + let seconds = 0; + if (status.value == 2) { + seconds = endTime.value.getTime() - startTime.value.getTime(); + } else { + seconds = now.value.getTime() - startTime.value.getTime(); + } + seconds = (seconds + offset.value) / 1000 + const hour = Math.floor(seconds / 3600); + const min = Math.floor((seconds - hour * 3600) / 60); + const sec = Math.floor(seconds - hour * 3600 - min * 60); + + // console.log(seconds); + // console.log(hour); + // console.log(min); + // console.log(sec); + + return `${hour.toString().padStart(2, '0')}:${min.toString().padStart(2, '0')}:${sec + .toString() + .padStart(2, '0')}`; + }); + + watch(startTime, (nV)=>{ + + }) + + /** + * 鍚姩璁℃椂鍣� + * @param {Date} s 鍒濆鏃堕棿 + */ + function startTimer(s) { + status.value = 1; + if (s) { + startTime.value = new Date(s); + } else { + startTime.value = new Date(); + } + resumeTimer(); + } + + /** + * 缁х画璁℃椂鍣� + */ + function resumeTimer() { + // now.value = startTime.value; + offset.value = startTime.value.getTime() - now.value.getTime() + resume(); + } + + /** + * 鏆傚仠璁℃椂鍣� + */ + function pauseTimer(s, e) { + status.value = 2; + if (s) { + startTime.value = new Date(s); + } + if (e) { + endTime.value = new Date(e); + } else { + endTime.value = new Date(); + } + offset.value = 0 + pause(); + } + + /** + * 鍋滄璁℃椂鍣� + */ + function stopTimer() { + pauseTimer(); + status.value = 0; + } + + return { time, startTimer, resumeTimer, pauseTimer, stopTimer, status, startTime }; +} diff --git a/src/styles/element/base.scss b/src/styles/element/base.scss index 209bbe6..7ed2e32 100644 --- a/src/styles/element/base.scss +++ b/src/styles/element/base.scss @@ -51,25 +51,42 @@ background-color: aqua; } -// -.p-l-8 { - padding-left: 8px; +/************************************** 鍐呭杈硅窛 **************************************/ +$direction: ( + l: 'left', + t: 'top', + r: 'right', + b: 'bottom' +); +$size: (4, 8, 10, 16); +@each $dName, $dValue in $direction { + @each $i in $size { + .p-#{$dName}-#{$i} { + padding-#{$dValue}: #{$i}px; + } + .m-#{$dName}-#{$i} { + margin-#{$dValue}: #{$i}px; + } + } } -.p-v-8 { - padding: 8px 0; +@each $i in $size { + .p-v-#{$i} { + padding: #{$i}px 0; + } + .p-h-#{$i} { + padding: 0 #{$i}px; + } + .m-v-#{$i} { + margin: #{$i}px 0; + } + .m-h-#{$i} { + margin: 0 #{$i}px; + } } -.m-b-8 { - margin-bottom: 8px; -} - -.m-l-4 { - margin-left: 4px; -} - -.w-150px { - width: 290px; +.w-300px { + width: 300px; } // diff --git a/src/views/fysp/evaluation/DataSource.vue b/src/views/fysp/evaluation/DataSource.vue index 0c16095..d8a31e1 100644 --- a/src/views/fysp/evaluation/DataSource.vue +++ b/src/views/fysp/evaluation/DataSource.vue @@ -11,7 +11,7 @@ <script> import CompEvaTask from './components/CompEvaTask.vue'; -import CompPreCheck from './components/CompPreCheck.vue'; +import CompPreCheck from './components/precheck/CompPreCheck.vue'; export default { name: 'DataSource', components: { CompPreCheck, CompEvaTask }, diff --git a/src/views/fysp/evaluation/components/CompPreCheck.vue b/src/views/fysp/evaluation/components/CompPreCheck.vue deleted file mode 100644 index ad11ba1..0000000 --- a/src/views/fysp/evaluation/components/CompPreCheck.vue +++ /dev/null @@ -1,45 +0,0 @@ -<template> - <el-steps :active="stepIndex" finish-status="success" style="" align-center> - <el-step title="璇勪及鑼冨洿" /> - <el-step title="鏁版嵁婧愭鏌�" /> - <el-step title="璞佸厤鏉$洰" /> - <el-step title="鑷姩璇勪及" /> - </el-steps> - <CompCheckArea v-show="stepIndex == 0" v-model="stepIndex"></CompCheckArea> - <CompCheckSource v-show="stepIndex == 1" v-model="stepIndex"></CompCheckSource> - <CompCheckExemption v-show="stepIndex == 2" v-model="stepIndex"></CompCheckExemption> - <CompCheckConfirm v-show="stepIndex == 3" v-model="stepIndex"></CompCheckConfirm> -</template> - -<script> -import dayjs from 'dayjs'; -import CompCheckArea from './precheck/CompCheckArea.vue'; -import CompCheckSource from './precheck/CompCheckSource.vue'; -import CompCheckExemption from './precheck/CompCheckExemption.vue'; -import CompCheckConfirm from './precheck/CompCheckConfirm.vue'; - -/** - * 鑷姩璇勪及鏉′欢鍚堣鎬ф鏌� - */ -export default { - name: 'CompPreCheck', - components: { CompCheckArea, CompCheckSource, CompCheckExemption, CompCheckConfirm }, - props: {}, - emits: ['preCheck'], - data() { - return { - // 鎿嶄綔姝ラ涓嬫爣 - stepIndex: 0 - }; - }, - methods: { - /** - * 鑷姩璇勪及鍓嶇疆鍚堣鎬ф鏌� - * 妫�鏌ユ墍閫夎寖鍥村唴鍚勯」璇勪及鏁版嵁婧愭槸鍚﹀畬鏁� - */ - preCheck() { - // this.$emit('preCheck', param) - } - } -}; -</script> diff --git a/src/views/fysp/evaluation/components/CompQuickSet.vue b/src/views/fysp/evaluation/components/CompQuickSet.vue index e401b49..2cd420b 100644 --- a/src/views/fysp/evaluation/components/CompQuickSet.vue +++ b/src/views/fysp/evaluation/components/CompQuickSet.vue @@ -32,7 +32,8 @@ dCode: '310106', dName: '闈欏畨鍖�', }, - scenetype: { label: '宸ュ湴', value: '1' } + scenetype: { label: '宸ュ湴', value: '1' }, + sourcetype: false, }, { name: '寰愭眹椁愰ギ', @@ -44,7 +45,8 @@ dCode: '310104', dName: '寰愭眹鍖�' }, - scenetype: { label: '椁愰ギ', value: '5' } + scenetype: { label: '椁愰ギ', value: '5' }, + sourcetype: false, }, { name: '閲戝北宸ュ湴', @@ -56,7 +58,8 @@ dCode: '310116', dName: '閲戝北鍖�' }, - scenetype: { label: '宸ュ湴', value: '1' } + scenetype: { label: '宸ュ湴', value: '1' }, + sourcetype: false, }, { name: '閲戝北鐮佸ご', @@ -68,7 +71,8 @@ dCode: '310116', dName: '閲戝北鍖�' }, - scenetype: { label: '鐮佸ご', value: '2' } + scenetype: { label: '鐮佸ご', value: '2' }, + sourcetype: false, }, { name: '閲戝北鎼呮媽绔�', @@ -80,7 +84,21 @@ dCode: '310116', dName: '閲戝北鍖�' }, - scenetype: { label: '鎼呮媽绔�', value: '3' } + scenetype: { label: '鎼呮媽绔�', value: '3' }, + sourcetype: false, + }, + { + name: '寰愭眹姹戒慨', + locations: { + pCode: '31', + pName: '涓婃捣甯�', + cCode: '3100', + cName: '涓婃捣甯�', + dCode: '310104', + dName: '寰愭眹鍖�' + }, + scenetype: { label: '姹戒慨', value: '7' }, + sourcetype: true, } ] } diff --git a/src/views/fysp/evaluation/components/precheck/CompCheckArea.vue b/src/views/fysp/evaluation/components/precheck/CompCheckArea.vue deleted file mode 100644 index 3bdeeb2..0000000 --- a/src/views/fysp/evaluation/components/precheck/CompCheckArea.vue +++ /dev/null @@ -1,97 +0,0 @@ -<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> - <FormCol> - <FYForm ref="formRef" :rules="evaConditionRules" :showButtons="false" @submit="nextStep"> - <template #form-item="{ formObj }"> - <CompQuickSet @quick-set="setOptions"></CompQuickSet> - <!-- 鍖哄幙 --> - <FYOptionLocation - :allOption="false" - :level="3" - :initValue="false" - :checkStrictly="false" - v-model:value="formObj._locations" - ></FYOptionLocation> - <!-- 鍦烘櫙绫诲瀷 --> - <FYOptionScene - :allOption="false" - :initValue="false" - :type="2" - v-model:value="formObj._scenetype" - ></FYOptionScene> - <!-- 鏃堕棿 --> - <FYOptionTime - prop="time" - :initValue="true" - type="month" - v-model:value="formObj.time" - ></FYOptionTime> - </template> - </FYForm> - </FormCol> - <template #footer> - <el-row justify="space-around"> - <el-button type="primary" size="default" :loading="loading" @click="submit" - >涓嬩竴姝�</el-button - > - </el-row> - </template> - </el-card> -</template> - -<script> -import CompQuickSet from '../CompQuickSet.vue'; - -/** - * 璇勪及鑼冨洿鍚堣鎬ф鏌� - */ -export default { - components: { CompQuickSet }, - props: { - // 姝ラ涓嬫爣 - modelValue: Number - }, - emits: ['update:modelValue'], - data() { - return { - loading: false, - evaConditionRules: { - time: [ - { - required: true, - message: '鏃堕棿涓嶈兘涓虹┖', - trigger: 'change' - } - ] - } - }; - }, - methods: { - setOptions(param) { - this.$refs.formRef.formObj._locations = param.locations; - this.$refs.formRef.formObj._scenetype = param.scenetype; - }, - submit() { - this.$refs.formRef.onSubmit(false); - }, - // 璺宠浆涓嬩竴姝� - nextStep() { - // todo: 妫�鏌ユ槸鍚﹀凡鏈夎瘎浼拌褰曪紝鎻愮ず鐢ㄦ埛鍙洿鎺ヨ烦杞煡鐪嬫垨缁х画涓嬩竴姝� - - - this.loading = true; - return new Promise((reslove, reject) => { - setTimeout(() => { - this.$emit('update:modelValue', this.modelValue + 1); - this.loading = false; - reslove(); - }, 1000); - }); - } - } -}; -</script> diff --git a/src/views/fysp/evaluation/components/precheck/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/CompCheckSource.vue deleted file mode 100644 index 2e4c294..0000000 --- a/src/views/fysp/evaluation/components/precheck/CompCheckSource.vue +++ /dev/null @@ -1,146 +0,0 @@ -<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> - <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">{{ 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"> - <el-icon color="var(--el-color-success)"><Check /></el-icon> - <el-text size="default" type="success">閫氳繃</el-text> - </template> - <template v-else> - <el-icon color="var(--el-color-danger)"><Close /></el-icon> - <el-text size="default" type="danger">缂哄け</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)"> - 鍘诲畬鍠� - <el-icon class="m-l-4"><Right /></el-icon> - </el-button> - </el-col> - </el-form-item> - </FormCol> - <template #footer> - <el-row justify="space-around"> - <el-button type="primary" size="default" @click="lastStep">涓婁竴姝�</el-button> - <el-button :disabled="!checkPass" type="primary" size="default" @click="nextStep">涓嬩竴姝�</el-button> - </el-row> - </template> - </el-card> -</template> - -<script> -/** - * 璇勪及鏁版嵁婧愬畬鏁存�ф鏌� - */ -export default { - props: { - // 姝ラ涓嬫爣 - modelValue: Number - }, - emits: ['update:modelValue'], - data() { - return { - // 鏁版嵁婧愭鏌ヨ褰� - checkResults: [ - { - required: true, - name: '鑷姩璇勪及瑙勫垯琛�', - loading: false, - pass: true, - path: '' - }, - { - name: '鐜板満鐩戠宸℃煡鎬讳换鍔�', - loading: false, - pass: true, - path: '' - }, - { - name: '鐜板満鐩戞祴鏁版嵁', - loading: false, - pass: false, - path: '' - }, - { - name: '鐜板満鐩戠闂绫诲瀷', - loading: false, - pass: true, - path: '' - }, - { - name: '淇¤鎶曡瘔', - loading: false, - pass: true, - path: '' - }, - { - name: '琛屾斂澶勭綒', - loading: false, - pass: true, - path: '' - } - ] - }; - }, - computed: { - /** - * 鍒ゆ柇鏁版嵁婧愭鏌ユ槸鍚﹂�氳繃 - * 鍏ㄩ儴鍔犺浇瀹屾垚鍚庯紝蹇呰椤瑰繀椤婚�氳繃锛屽彲閫夐」闈炲繀椤婚�氳繃 - */ - checkPass() { - let res = true; - this.checkResults.forEach((e) => { - if (e.loading) { - res = res && false - } else if (e.required) { - res = res && e.pass; - } - }); - return res; - } - }, - methods: { - // 璺宠浆涓嬩竴姝� - nextStep() { - this.$emit('update:modelValue', this.modelValue + 1); - }, - // 璺宠浆涓婁竴姝� - lastStep() { - this.$emit('update:modelValue', this.modelValue - 1); - }, - goto(path) { - if (path && path != '') { - this.$router.push(path); - } - } - } -}; -</script> -<style scoped> -.required { - color: var(--el-color-danger); -} - -.not-required { - color: transparent; -} -</style> diff --git a/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue new file mode 100644 index 0000000..e291c40 --- /dev/null +++ b/src/views/fysp/evaluation/components/precheck/CompPreCheck.vue @@ -0,0 +1,57 @@ +<template> + <el-steps :active="stepIndex" finish-status="success" style="" align-center> + <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> + <CompCheckExemption v-show="stepIndex == 2" v-model="stepIndex"></CompCheckExemption> + <CompCheckConfirm v-show="stepIndex == 3" v-model="stepIndex"></CompCheckConfirm> +</template> + +<script> +import dayjs from 'dayjs'; +import CompCheckArea from './components/CompCheckArea.vue'; +import CompCheckSource from './components/CompCheckSource.vue'; +import CompCheckExemption from './components/CompCheckExemption.vue'; +import CompCheckConfirm from './components/CompCheckConfirm.vue'; + +/** + * 鑷姩璇勪及鏉′欢鍚堣鎬ф鏌� + */ +export default { + name: 'CompPreCheck', + components: { CompCheckArea, CompCheckSource, CompCheckExemption, CompCheckConfirm }, + props: {}, + emits: ['preCheck'], + data() { + return { + // 鎿嶄綔姝ラ涓嬫爣 + stepIndex: 0, + area: {} + }; + }, + methods: { + /** + * 鐩戝惉璇勪及鑼冨洿鍙樻洿 + */ + onAreaChange(v) { + // this.area = v; + this.$refs.refSource.startCheck(v); + }, + /** + * 鑷姩璇勪及鍓嶇疆鍚堣鎬ф鏌� + * 妫�鏌ユ墍閫夎寖鍥村唴鍚勯」璇勪及鏁版嵁婧愭槸鍚﹀畬鏁� + */ + preCheck() { + // this.$emit('preCheck', param) + } + } +}; +</script> diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue new file mode 100644 index 0000000..3aea097 --- /dev/null +++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue @@ -0,0 +1,128 @@ +<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> + <FormCol> + <FYForm ref="formRef" :rules="evaConditionRules" :showButtons="false" @submit="nextStep"> + <template #form-item="{ formObj }"> + <CompQuickSet @quick-set="setOptions"></CompQuickSet> + <!-- 鍖哄幙 --> + <FYOptionLocation + :allOption="false" + :level="3" + :initValue="false" + :checkStrictly="false" + v-model:value="formObj._locations" + ></FYOptionLocation> + <!-- 鍦烘櫙绫诲瀷 --> + <FYOptionScene + :allOption="false" + :initValue="false" + :sourceInit="sceneOptionSourceInit" + :type="formObj.sourcetype ? 1 : 2" + v-model:value="formObj._scenetype" + ></FYOptionScene> + <!-- 鏃堕棿 --> + <FYOptionTime + prop="time" + :initValue="true" + type="month" + v-model:value="formObj.time" + ></FYOptionTime> + <el-form-item label="涓绘暟鎹簮" prop="sourcetype"> + <el-switch v-model="formObj.sourcetype" @change="sceneOptionSourceInit = true" /> + <span class="m-l-16">{{ formObj.sourcetype ? '瀹堟硶鏈嶅姟璁板綍' : '鐜板満宸℃煡璁板綍' }}</span> + <el-tooltip placement="bottom-start" effect="light"> + <template #content> + <!-- <el-text tag="b" size="default">璇存槑</el-text><br /> --> + <el-text tag="i" size="default" type="warning" + >璇ラ�夐」鏄敤浜庡喅瀹氳瘎浼颁富浣撳璞$殑鑾峰彇鏂瑰紡</el-text + ><br /> + <el-text tag="b" size="small">瀹堟硶鏈嶅姟璁板綍锛�</el-text><br /> + <el-text size="small" + >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庡畧娉曟湇鍔″皬绋嬪簭绯荤粺涓幏鍙栫殑褰撳墠鍙敤鐨勭敤鎴凤紱<br /> + 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄娌℃湁杩涜鐜板満宸℃煡锛屽彧鏈夊畧娉曟湇鍔$浉鍏宠褰曟椂锛岄噰鐢ㄦ閫夐」锛�</el-text + ><br /> + <el-text tag="b" size="small">鐜板満宸℃煡璁板綍锛�</el-text><br /> + <el-text size="small" + >琛ㄧず鍦ㄨ瘎浼版椂锛岃瘎浼板璞℃槸浠庣幇鍦哄贰鏌ョ洃绠$郴缁熶腑鑾峰彇鐨勬�讳换鍔′笅鐨勬墍鏈夌洃绠″満鏅紱<br /> + 涓�鑸儏鍐典笅锛屽綋璇勪及瀵硅薄鏈夎繘琛岀幇鍦哄贰鏌ワ紝閲囩敤姝ら�夐」锛� </el-text + ><br /> + </template> + <el-icon class="m-l-8 cursor-p" :size="16" color="var(--el-color-warning)" + ><QuestionFilled + /></el-icon> + </el-tooltip> + </el-form-item> + </template> + </FYForm> + </FormCol> + <template #footer> + <el-row justify="space-around"> + <el-button type="primary" size="default" :loading="loading" @click="submit" + >涓嬩竴姝�</el-button + > + </el-row> + </template> + </el-card> +</template> + +<script> +import CompQuickSet from '../../CompQuickSet.vue'; + +/** + * 璇勪及鑼冨洿鍚堣鎬ф鏌� + */ +export default { + components: { CompQuickSet }, + props: { + // 姝ラ涓嬫爣 + modelValue: Number + }, + emits: ['update:modelValue', 'change'], + data() { + return { + loading: false, + evaConditionRules: { + time: [ + { + required: true, + message: '鏃堕棿涓嶈兘涓虹┖', + trigger: 'change' + } + ] + }, + // 褰撳満鏅�夐」鍒囨崲鏁版嵁婧愭椂锛屾槸鍚︽竻绌哄綋鍓嶉�夐」鍊� + sceneOptionSourceInit: true + }; + }, + methods: { + setOptions(param) { + this.sceneOptionSourceInit = false; + this.$refs.formRef.formObj._locations = param.locations; + this.$refs.formRef.formObj._scenetype = param.scenetype; + this.$refs.formRef.formObj.sourcetype = param.sourcetype; + }, + submit() { + this.$refs.formRef.onSubmit(false); + }, + // 璺宠浆涓嬩竴姝� + nextStep(formObj, success, fail) { + // todo: 妫�鏌ユ槸鍚﹀凡鏈夎瘎浼拌褰曪紝鎻愮ず鐢ㄦ埛鍙洿鎺ヨ烦杞煡鐪嬫垨缁х画涓嬩竴姝� + + this.loading = true; + return new Promise((reslove, reject) => { + setTimeout(() => { + this.$emit('change', formObj); + this.$emit('update:modelValue', this.modelValue + 1); + this.loading = false; + success(); + reslove(); + }, 1000); + }); + } + } +}; +</script> diff --git a/src/views/fysp/evaluation/components/precheck/CompCheckConfirm.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue similarity index 100% rename from src/views/fysp/evaluation/components/precheck/CompCheckConfirm.vue rename to src/views/fysp/evaluation/components/precheck/components/CompCheckConfirm.vue diff --git a/src/views/fysp/evaluation/components/precheck/CompCheckExemption.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue similarity index 100% rename from src/views/fysp/evaluation/components/precheck/CompCheckExemption.vue rename to src/views/fysp/evaluation/components/precheck/components/CompCheckExemption.vue diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue new file mode 100644 index 0000000..9217bc3 --- /dev/null +++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue @@ -0,0 +1,182 @@ +<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> + <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> + </FormCol> + <template #footer> + <el-row justify="space-around"> + <el-button type="primary" size="default" @click="lastStep">涓婁竴姝�</el-button> + <el-button :disabled="!checkPass" type="primary" size="default" @click="nextStep" + >涓嬩竴姝�</el-button + > + </el-row> + </template> + </el-card> +</template> + +<script> +import evaluateApi from '@/api/fysp/evaluateApi'; +import taskApi from '@/api/fysp/taskApi'; + +/** + * 鐢熸垚涓�椤规暟鎹簮妫�鏌ヨ褰� + * @param {*} _name + * @param {*} _path + * @param {*} _fetch + * @param {*} _required + */ +function baseCheckItem(_name, _path, _fetch, _required) { + return { + required: _required, + name: _name, + loading: true, + pass: false, + path: _path, + async fetch() { + this.loading = true; + setTimeout(async () => { + this.pass = await _fetch(); + this.loading = false; + }, 1000); + } + }; +} + +/** + * 璇勪及鏁版嵁婧愬畬鏁存�ф鏌� + */ +export default { + props: { + // 姝ラ涓嬫爣 + modelValue: Number + }, + emits: ['update:modelValue'], + data() { + return { + areaInfo: { + _locations: '', + _scenetype: '', + time: '', + sourcetype: '' + }, + // 鏁版嵁婧愭鏌ヨ褰� + checkResults: [ + baseCheckItem( + '鑷姩璇勪及瑙勫垯琛�', + '', + () => { + const param = { + taskTypeId: 99, + scensetypeid: this.areaInfo._scenetype.value + }; + return evaluateApi.fetchEvaluationRule(param).then((res) => { + return res.data.length > 0; + }); + }, + true + ), + baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => {}), + baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}), + baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {}), + baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => {}), + baseCheckItem('淇¤鎶曡瘔', '', () => {}), + baseCheckItem('琛屾斂澶勭綒', '', () => {}) + ] + }; + }, + computed: { + /** + * 鍒ゆ柇鏁版嵁婧愭鏌ユ槸鍚﹂�氳繃 + * 鍏ㄩ儴鍔犺浇瀹屾垚鍚庯紝蹇呰椤瑰繀椤婚�氳繃锛屽彲閫夐」闈炲繀椤婚�氳繃 + */ + checkPass() { + let res = true; + this.checkResults.forEach((e) => { + if (e.loading) { + res = res && false; + } else if (e.required) { + res = res && e.pass; + } + }); + return res; + } + }, + methods: { + // 璺宠浆涓嬩竴姝� + nextStep() { + this.$emit('update:modelValue', this.modelValue + 1); + }, + // 璺宠浆涓婁竴姝� + lastStep() { + this.$emit('update:modelValue', this.modelValue - 1); + }, + // 璺宠浆妫�鏌ラ」鐨勯摼鎺� + goto(path) { + if (path && path != '') { + this.$router.push(path); + } + }, + // 寮�濮嬫鏌ヤ换鍔� + startCheck(v) { + this.areaInfo = v; + this.checkResults.forEach((e) => { + e.fetch(); + }); + } + } +}; +</script> +<style scoped> +.required { + color: var(--el-color-danger); +} + +.not-required { + color: transparent; +} +</style> diff --git a/src/views/notice/CompNoticeAdd.vue b/src/views/notice/CompNoticeAdd.vue index 545b138..127295a 100644 --- a/src/views/notice/CompNoticeAdd.vue +++ b/src/views/notice/CompNoticeAdd.vue @@ -1,11 +1,5 @@ <template> - <el-form - :inline="false" - :model="form" - ref="formRef" - :rules="rules" - label-position="top" - > + <el-form :inline="false" :model="form" ref="formRef" :rules="rules" label-position="top"> <el-form-item label="閫氱煡鏍囬" prop="title"> <el-input v-model="form.title" placeholder="閫氱煡鏍囬" /> </el-form-item> @@ -22,22 +16,19 @@ </el-form-item> <el-form-item label="鍖哄幙绫诲瀷" prop="district"> <el-select v-model="form.district" placeholder="鍖哄幙绫诲瀷"> - <el-option - v-for="s in districts" - :key="s.value" - :label="s.label" - :value="s.value" - /> + <el-option v-for="s in districts" :key="s.value" :label="s.label" :value="s.value" /> </el-select> </el-form-item> - <el-form-item label="鍦烘櫙绫诲瀷" prop="receiverType"> - <el-select v-model="form.receiverType" placeholder="鍦烘櫙绫诲瀷"> - <el-option - v-for="s in sceneTypes" - :key="s.value" - :label="s.label" - :value="s.value" - /> + <!-- <FYOptionScene + prop="receiverType" + :allOption="true" + :type="1" + :initValue="true" + v-model:value="form.receiverType" + ></FYOptionScene> --> + <el-form-item label="鍦烘櫙绫诲瀷" prop="_receiverType"> + <el-select v-model="form._receiverType" placeholder="鍦烘櫙绫诲瀷"> + <el-option v-for="s in sceneTypes" :key="s.value" :label="s.label" :value="s.value" /> </el-select> </el-form-item> <el-form-item label="鏄惁闇�瑕佺鏀�" prop="needSigned"> @@ -45,9 +36,7 @@ <span style="margin-left: 16px">{{ form.needSigned ? '鏄�' : '鍚�' }}</span> </el-form-item> <el-form-item> - <el-button type="primary" @click="onSubmit" :loading="loading" - >鎻愪氦</el-button - > + <el-button type="primary" @click="onSubmit" :loading="loading">鎻愪氦</el-button> <el-button @click="onCancel">鍙栨秷</el-button> </el-form-item> </el-form> @@ -62,10 +51,10 @@ props: { active: { type: Boolean, - default: false, + default: false }, edit: Boolean, - loading: Boolean, + loading: Boolean }, emits: ['update:edit', 'onSubmit', 'onCancel'], data() { @@ -98,35 +87,36 @@ //鏄惁闇�瑕佺鏀� needSigned: false, //鎺ュ彈鐢ㄦ埛鍦烘櫙绫诲瀷 + _receiverType: null, receiverType: '0', //鎺ュ彈鐢ㄦ埛鍖哄幙 district: '0', //鎺ュ彈鐢ㄦ埛id - receiverId: null, + receiverId: null }, rules: { title: [ { required: true, message: '璇疯緭鍏ラ�氱煡鏍囬', - trigger: 'blur', - }, + trigger: 'blur' + } ], content: [ { required: true, message: '璇疯緭鍏ラ�氱煡鍐呭', - trigger: 'blur', - }, + trigger: 'blur' + } ], _typeArray: [ { required: true, message: '璇烽�夋嫨閫氱煡绫诲瀷', - trigger: 'change', - }, - ], - }, + trigger: 'change' + } + ] + } }; }, watch: { @@ -149,8 +139,8 @@ } this.isReset = false; }, - deep: true, - }, + deep: true + } }, computed: {}, methods: { @@ -170,6 +160,9 @@ this.form.typeId = a[0]; this.form.subTypeId = 0; } + if (this.form._receiverType == null) { + this.form.receiverType = '0'; + } this.$emit('onSubmit', this.form); } else { console.log('error submit!', fields); @@ -179,10 +172,10 @@ onCancel() { // this.reset(); this.$emit('onCancel'); - }, + } }, mounted() { this.noticeTypes[0].disabled = true; - }, + } }; </script> diff --git a/src/views/notice/NoticeManage.vue b/src/views/notice/NoticeManage.vue index 35c111f..84bc5d2 100644 --- a/src/views/notice/NoticeManage.vue +++ b/src/views/notice/NoticeManage.vue @@ -118,7 +118,7 @@ /> <el-table-column width="160" prop="ecCreator" label="鍒涘缓浜�" /> <!-- <el-table-column prop="ecPicurl" label="鍥剧墖" /> --> - <el-table-column prop="ecReceiverid" label="绛炬敹浜�" /> + <!-- <el-table-column prop="ecReceiverid" label="绛炬敹浜�" /> --> </el-table> <!-- <el-affix :offset="0" position="bottom"> --> <el-pagination -- Gitblit v1.9.3