From ca74569775e90f1508c14ed719a17e3e7d47e07f Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 30 Dec 2020 16:09:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?iscs=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= =?UTF-8?q?=20=E8=BF=90=E8=A1=8C=E5=9B=BE=20=E7=BC=96=E5=88=B6=20=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=9C=8D=E5=8A=A1=E5=8F=B7=20=E9=99=90=E5=88=B6?= =?UTF-8?q?=E4=B8=BA=E6=95=B0=E5=AD=97=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stationConfig/powerMonitor/substation.vue | 6 +- .../editTool/menus/addPlanningTrain.vue | 56 ++++++++++++++----- .../editTool/menus/gernaratePlanTrain.vue | 22 ++++++-- .../planMonitor/newEditTool/menus/addTask.vue | 2 +- .../newEditTool/menus/modifyingTask.vue | 1 + .../menus/populatingGenericData.vue | 4 +- src/views/publish/publishISCS/index.vue | 5 +- 7 files changed, 71 insertions(+), 25 deletions(-) diff --git a/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue b/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue index e12c6dc5d..2019493a8 100644 --- a/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue +++ b/src/views/iscs/iscsSystem/stationConfig/powerMonitor/substation.vue @@ -60,9 +60,11 @@ export default { this.bacground = 'rgba(0,0,0,0)'; this.scaleRate = window.innerWidth / 2200; if (this.stationId == 'mainHouseOne') { - this.title = '黄山主变电所接线图'; + // 黄山 + this.title = '主所1主变电所接线图'; } else { - this.title = '茶亭主变电所接线图'; + // 茶亭 + this.title = '主所2主变电所接线图'; } params.userInterface = 'substation'; // parkingLotName diff --git a/src/views/planMonitor/editTool/menus/addPlanningTrain.vue b/src/views/planMonitor/editTool/menus/addPlanningTrain.vue index 090a58e71..201064a87 100644 --- a/src/views/planMonitor/editTool/menus/addPlanningTrain.vue +++ b/src/views/planMonitor/editTool/menus/addPlanningTrain.vue @@ -10,12 +10,11 @@ :modal="false" :close-on-click-modal="false" > - - {{ $t('planMonitor.serviceNumber2')+$t('global.colon') }} - - - - + + + + + {{ $t('global.cancel') }} {{ $t('global.confirm') }} @@ -40,7 +39,15 @@ export default { return { dialogShow: false, loading: false, - serviceNumber: '' + formModel:{ + serviceNumber: '' + }, + rules:{ + serviceNumber:[ + {required: true, validator: this.validateServiceNumber, trigger: 'blur'}, + {required: true, validator: this.validateServiceNumber, trigger: 'change'} + ] + } }; }, computed: { @@ -58,9 +65,30 @@ export default { this.loading = false; this.dialogShow = false; }, + validateServiceNumber(rule, value, callback) { + if (typeof value == 'string' && value.trim().length == 0) { + return callback(new Error('请填写服务号')); + } else { + const newValue = parseInt(value); + if (newValue) { + if (newValue.toString() != value) { + this.formModel.serviceNumber = newValue; + } + const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); + if (serviceNumberList.includes(value)) { + return callback(new Error('该服务号已存在,请重新填写')); + } else { + return callback(); + } + } else { + this.formModel.serviceNumber = ''; + } + + } + }, handleCommit() { - if (this.$route.query.planId || this.loadRunPlanId) { - if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) { + this.$refs.dataform.validateForm(() => { + if (this.$route.query.planId || this.loadRunPlanId) { checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.serviceNumber }).then(resp => { if (resp.data) { this.$emit('dispatchDialog', { @@ -79,11 +107,13 @@ export default { } }); } else { - this.$messageBox('长度在二到三位'); + this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph')); } - } else { - this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph')); - } + }); + // if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) { + // } else { + // this.$messageBox('长度在二到三位'); + // } }, handleConfirm(isNew = false) { this.doClose(); diff --git a/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue b/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue index b24a05fc5..4e287186f 100644 --- a/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue +++ b/src/views/planMonitor/editTool/menus/gernaratePlanTrain.vue @@ -58,7 +58,8 @@ export default { rules: { serviceNumber:[ - {required: true, validator: this.validateServiceNumber, trigger: 'blur'} + {required: true, validator: this.validateServiceNumber, trigger: 'blur'}, + {required: true, validator: this.validateServiceNumber, trigger: 'change'} ], beginTime: [ { required: true, message: '请填写开始时间', trigger: 'blur' } @@ -134,15 +135,24 @@ export default { this.dialogShow = true; }, validateServiceNumber(rule, value, callback) { - if (value.trim().length == 0) { + if (typeof value == 'string' && value.trim().length == 0) { return callback(new Error('请填写服务号')); } else { - const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); - if (serviceNumberList.includes(value.trim())) { - return callback(new Error('该服务号已存在,请重新填写')); + const newValue = parseInt(value); + if (newValue) { + if (newValue.toString() != value) { + this.formModel.serviceNumber = newValue; + } + const serviceNumberList = Object.keys(this.$store.state.runPlan.editData); + if (serviceNumberList.includes(value)) { + return callback(new Error('该服务号已存在,请重新填写')); + } else { + return callback(); + } } else { - return callback(); + this.formModel.serviceNumber = ''; } + } }, validateRunningRouting(rule, value, callback) { diff --git a/src/views/planMonitor/newEditTool/menus/addTask.vue b/src/views/planMonitor/newEditTool/menus/addTask.vue index 0fd25eea5..25ce168e2 100644 --- a/src/views/planMonitor/newEditTool/menus/addTask.vue +++ b/src/views/planMonitor/newEditTool/menus/addTask.vue @@ -32,7 +32,7 @@ {{ $t('global.startTime')+$t('global.colon') }} - + diff --git a/src/views/planMonitor/newEditTool/menus/modifyingTask.vue b/src/views/planMonitor/newEditTool/menus/modifyingTask.vue index 4a9f5eac5..0585702a6 100644 --- a/src/views/planMonitor/newEditTool/menus/modifyingTask.vue +++ b/src/views/planMonitor/newEditTool/menus/modifyingTask.vue @@ -146,6 +146,7 @@ value-format="HH:mm:ss" size="mini" :clearable="false" + :picker-options="{selectableRange:'02:00:00-23:59:59'}" /> diff --git a/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue b/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue index 8c832b617..b00955840 100644 --- a/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue +++ b/src/views/planMonitor/newEditTool/menus/populatingGenericData.vue @@ -80,8 +80,8 @@ export default { return { labelWidth: '100px', items: [ - { prop: 'beginTime', label: '开始时间', type: 'timePicker'}, - { prop: 'overTime', label: '结束时间', type: 'timePicker'}, + { prop: 'beginTime', label: '开始时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'}, + { prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'}, { prop: 'departureTimeInterval', label: '发车间隔', type: 'number'}, { prop: 'parkedTime', label: '停站时间', type: 'number'}, { prop: 'reentryTime', label: '折返时间', type: 'number'}, diff --git a/src/views/publish/publishISCS/index.vue b/src/views/publish/publishISCS/index.vue index 767b593ac..7eb19b43b 100644 --- a/src/views/publish/publishISCS/index.vue +++ b/src/views/publish/publishISCS/index.vue @@ -4,7 +4,7 @@ - {{ $t('global.confirm') }} + {{ $t('global.confirm') }} {{ $t('global.cancel') }} @@ -158,11 +158,14 @@ export default { }, doSave() { this.$refs.dataform.validateForm(() => { + this.loading = true; copyIscsData(this.formModel).then(res=>{ + this.loading = false; this.$message.success('复制ISCS数据成功'); this.close(); this.reloadTable(); }).catch(() => { + this.loading = false; this.reloadTable(); this.$messageBox('复制ISCS数据失败'); }); From aefd1dc9e787e473628efabe0c3e065406d7648d Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 30 Dec 2020 17:44:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=B9=B3=E5=8F=B0=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=95=E5=8D=B7=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/publish/examRule/draft/examFrom.vue | 32 +++++++------------ src/views/publish/examRule/draft/index.vue | 1 + src/views/publish/examRule/draft/rule.vue | 4 +-- src/views/publish/examRule/index.vue | 3 +- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/views/publish/examRule/draft/examFrom.vue b/src/views/publish/examRule/draft/examFrom.vue index f95524a4c..edae99ce0 100644 --- a/src/views/publish/examRule/draft/examFrom.vue +++ b/src/views/publish/examRule/draft/examFrom.vue @@ -255,34 +255,26 @@ export default { }); }, submitForm() { + this.submit('definition'); + }, + submit(type) { this.$refs['form'].validate((valid) => { if (valid) { - if (this.form.startDate) { - this.form.startDate = this.getDate(this.form.startDate); + const form = Object.assign({}, this.form); + if (form.startDate) { + form.startDate = this.getDate(form.startDate); } - if (this.form.endDate) { - this.form.endDate = this.getDate(this.form.endDate); + if (form.endDate) { + form.endDate = this.getDate(form.endDate); } - this.form['trial'] = this.trial; - this.$store.dispatch('exam/setCourseDetail', this.form); - this.$emit('definition', this.form); + form['trial'] = this.trial; + this.$store.dispatch('exam/setCourseDetail', form); + this.$emit(type, form); } }); }, createQuickly() { - this.$refs['form'].validate((valid) => { - if (valid) { - if (this.form.startDate) { - this.form.startDate = this.getDate(this.form.startDate); - } - if (this.form.endDate) { - this.form.endDate = this.getDate(this.form.endDate); - } - this.form['trial'] = this.trial; - this.$store.dispatch('exam/setCourseDetail', this.form); - this.$emit('createQuickly', this.form); - } - }); + this.submit('createQuickly'); }, getDate(date) { const now = new Date(date); diff --git a/src/views/publish/examRule/draft/index.vue b/src/views/publish/examRule/draft/index.vue index a48bc94d3..bd3cc9196 100644 --- a/src/views/publish/examRule/draft/index.vue +++ b/src/views/publish/examRule/draft/index.vue @@ -149,6 +149,7 @@ export default { this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据 const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; const lessonId = this.$route.params.lessonId; + this.$store.dispatch('exam/setCourseDetail', {}); if (parseInt(lessonId)) { this.$router.replace({ path: `${path}`, query: { mapId: this.$route.query.mapId, lessonId: lessonId, noPreLogout: this.$route.query.noPreLogout } }); } else { diff --git a/src/views/publish/examRule/draft/rule.vue b/src/views/publish/examRule/draft/rule.vue index f776b8cea..c9a067b81 100644 --- a/src/views/publish/examRule/draft/rule.vue +++ b/src/views/publish/examRule/draft/rule.vue @@ -141,8 +141,8 @@ export default { name: this.course.name, // 名称 passingPoint: Number(this.course.passMark), // 及格分 remarks: this.course.desc, // 考试说明 - endTime: this.course.endTime, - startTime: this.course.startTime, + endTime: this.course.endDate, + startTime: this.course.startDate, type: this.course.type, // 类型 trial: this.course.trial == 2 // 权限判断 }; diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index 9bafd2d08..666e0a1da 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -76,7 +76,8 @@ export default { title: this.$t('publish.examTime'), prop: 'startTime', type: 'formatter', - format: 'yyyy-MM-dd hh:ss' + format: 'yyyy-MM-dd hh:ss', + width:'200px' }, { title: this.$t('publish.fullMark'), From a09ec3e2f24e8eceefeee79753b66b43a536eed7 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 30 Dec 2020 18:24:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=B9=B3=E5=8F=B0=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=95=E5=8D=B7=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/publish/examRule/draft/examFrom.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/publish/examRule/draft/examFrom.vue b/src/views/publish/examRule/draft/examFrom.vue index edae99ce0..f71d1a4a5 100644 --- a/src/views/publish/examRule/draft/examFrom.vue +++ b/src/views/publish/examRule/draft/examFrom.vue @@ -24,6 +24,7 @@ value-format="timestamp" :disabled="isEdit" :picker-options="pickerOptions" + @change="handle" /> @@ -37,8 +38,8 @@ style="width: 100%;" value-format="timestamp" :disabled="true" - :picker-options="pickerOptions" /> + @@ -123,6 +124,7 @@ export default { pickerOptions: { disabledDate(time) { return time.getTime() < new Date(new Date().toLocaleDateString()).getTime(); + // return time.getTime() < Date.now() - 1 * 24 * 3600 * 1000; } }, formDetail: { @@ -217,6 +219,12 @@ export default { passMark: data.passMark }; }, + handle() { + var startAt = new Date(this.form.startDate) * 1000 / 1000; + if (startAt < Date.now()) { + this.form.startDate = new Date().getTime(); + } + }, getClassList() { if (this.isClassShow) { this.classList = [];