diff --git a/src/permission.js b/src/permission.js index d430cdcde..118472c2e 100644 --- a/src/permission.js +++ b/src/permission.js @@ -29,7 +29,8 @@ function getRouteInfo(to) { if (whiteList.includes(toRoutePath)) { // 登陆页面清空 token removeToken(); } - loginPath = loginInfo[current_session] ? loginInfo[current_session].loginPath : whiteList[0]; + const localLogin = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl'; + loginPath = loginInfo[current_session] && !localLogin ? loginInfo[current_session].loginPath : whiteList[0]; if (to.query.projectDevice && to.query.type) { loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`; } diff --git a/src/views/messageBoard/create.vue b/src/views/messageBoard/create.vue index f8df89f1d..bb1d34390 100644 --- a/src/views/messageBoard/create.vue +++ b/src/views/messageBoard/create.vue @@ -70,8 +70,12 @@ export default { createPost(this.form).then(resp => { this.$emit('reloadTable'); this.handleClose(); - }).catch(() => { - this.$message.error('创建留言板失败!'); + }).catch((error) => { + if (error.code == '10012') { + this.$message.error('本项目下的留言板已存在,请勿重复创建!'); + } else { + this.$message.error('创建留言板失败!'); + } this.handleClose(); }); } diff --git a/src/views/newMap/newMapdraft/mapoperate/line.vue b/src/views/newMap/newMapdraft/mapoperate/line.vue index afc02f4ae..031088d89 100644 --- a/src/views/newMap/newMapdraft/mapoperate/line.vue +++ b/src/views/newMap/newMapdraft/mapoperate/line.vue @@ -51,13 +51,15 @@ export default { activeName: 'first', lazy: true, LineTypeList: [], + centralizedStationList: [], editModel: { code: '', type: '', width: 1, lineColor: '', showConditions: '01', - points: [] + points: [], + stationCode: '' }, addModel: { type: '', @@ -110,7 +112,8 @@ export default { { prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' }, { prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' }, { prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList}, - { prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint } + { prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }, + { prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList } ] }, map: { @@ -153,14 +156,20 @@ export default { clearDeviceSelect() { this.$emit('deviceSelect', ''); }, + handleInit() { + if (this.stationList && this.stationList.length) { + this.centralizedStationList = this.stationList.filter(station=> station.centralized); + } + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { + this.handleInit(); if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } diff --git a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue index 739e1cc88..6d217ade9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue @@ -51,6 +51,7 @@ export default { activeName: 'first', lazy: true, LineTypeList: [], + centralizedStationList: [], editModel: { code: '', width: 1, @@ -59,7 +60,8 @@ export default { position: { x: 0, y: 0 - } + }, + stationCode: '' }, addModel: { code: '', @@ -86,7 +88,8 @@ export default { }, computed: { ...mapGetters('map', [ - 'outerFrameList' + 'outerFrameList', + 'stationList' ]), showConditionsList() { const showConditionsList = ConstConfig.ConstSelect.showConditionsList; @@ -108,7 +111,8 @@ export default { { prop: 'position', label: '坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } - ] } + ] }, + { prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList } ] } } @@ -125,12 +129,17 @@ export default { }); }, methods: { + handleInit() { + if (this.stationList && this.stationList.length) { + this.centralizedStationList = this.stationList.filter(station=> station.centralized); + } + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - + this.handleInit(); this.$refs.createForm && this.$refs.createForm.resetFields(); if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) { this.activeName = 'first'; diff --git a/src/views/newMap/newMapdraft/mapoperate/text.vue b/src/views/newMap/newMapdraft/mapoperate/text.vue index d3314afcc..f74da1c1f 100644 --- a/src/views/newMap/newMapdraft/mapoperate/text.vue +++ b/src/views/newMap/newMapdraft/mapoperate/text.vue @@ -61,7 +61,8 @@ export default { position: { x: 0, y: 0 - } + }, + stationCode: '' }, addModel: { prepend: 'H', @@ -72,6 +73,7 @@ export default { y: 0 } }, + centralizedStationList: [], // 设备集中站列表 rules: { code: [ { required: true, message: this.$t('rules.selectText'), trigger: 'blur' } @@ -125,7 +127,8 @@ export default { { prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } - ] } + ] }, + { prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList } ] }, map: { @@ -158,13 +161,19 @@ export default { } }, methods: { + handleInit() { + if (this.stationList && this.stationList.length) { + this.centralizedStationList = this.stationList.filter(station=> station.centralized); + } + }, deviceChange(code) { this.$emit('setCenter', code); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { + this.handleInit(); this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index 5ea07eb6d..9bafd2d08 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -264,14 +264,13 @@ export default { message: this.$t('publish.setSuccess') }); }).catch(res => { - // if (res.code == '500009') { - // this.$message({ type: 'warning', message: this.$t('error.paperHasUseNotDel') }); - // } else if (res.code == '10005') { - // this.$message({ type: 'warning', message: '本试卷已被使用!'}); - // } else { - // this.$message({ type: 'error', message: this.$t('error.deleteException') }); - // } - this.$message({ type: 'error', message: '删除失败:' + res.message }); + if (res.code == '10004') { + this.$message({ type: 'error', message: '删除失败:试卷已被使用,无法删除!' }); + } else if (res.code == '10003') { + this.$message({ type: 'warning', message: '删除失败:无权限删除!'}); + } else { + this.$message({ type: 'error', message: this.$t('error.deleteException') }); + } }); }).catch(() => { }); },