text、line、outFrame添加参数&报错提示调整

This commit is contained in:
fan 2020-12-18 09:17:18 +08:00
parent ca8da79986
commit 5740b863b3
6 changed files with 52 additions and 21 deletions

View File

@ -29,7 +29,8 @@ function getRouteInfo(to) {
if (whiteList.includes(toRoutePath)) { // 登陆页面清空 token if (whiteList.includes(toRoutePath)) { // 登陆页面清空 token
removeToken(); 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) { if (to.query.projectDevice && to.query.type) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`; loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
} }

View File

@ -70,8 +70,12 @@ export default {
createPost(this.form).then(resp => { createPost(this.form).then(resp => {
this.$emit('reloadTable'); this.$emit('reloadTable');
this.handleClose(); this.handleClose();
}).catch(() => { }).catch((error) => {
if (error.code == '10012') {
this.$message.error('本项目下的留言板已存在,请勿重复创建!');
} else {
this.$message.error('创建留言板失败!'); this.$message.error('创建留言板失败!');
}
this.handleClose(); this.handleClose();
}); });
} }

View File

@ -51,13 +51,15 @@ export default {
activeName: 'first', activeName: 'first',
lazy: true, lazy: true,
LineTypeList: [], LineTypeList: [],
centralizedStationList: [],
editModel: { editModel: {
code: '', code: '',
type: '', type: '',
width: 1, width: 1,
lineColor: '', lineColor: '',
showConditions: '01', showConditions: '01',
points: [] points: [],
stationCode: ''
}, },
addModel: { addModel: {
type: '', type: '',
@ -110,7 +112,8 @@ export default {
{ prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' }, { prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' },
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' }, { 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: '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: { map: {
@ -153,14 +156,20 @@ export default {
clearDeviceSelect() { clearDeviceSelect() {
this.$emit('deviceSelect', ''); this.$emit('deviceSelect', '');
}, },
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized);
}
},
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
}, },
deviceSelect(selected) { deviceSelect(selected) {
this.handleInit();
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
this.$refs.form && this.$refs.form.resetFields(); 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.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);
} }

View File

@ -51,6 +51,7 @@ export default {
activeName: 'first', activeName: 'first',
lazy: true, lazy: true,
LineTypeList: [], LineTypeList: [],
centralizedStationList: [],
editModel: { editModel: {
code: '', code: '',
width: 1, width: 1,
@ -59,7 +60,8 @@ export default {
position: { position: {
x: 0, x: 0,
y: 0 y: 0
} },
stationCode: ''
}, },
addModel: { addModel: {
code: '', code: '',
@ -86,7 +88,8 @@ export default {
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'outerFrameList' 'outerFrameList',
'stationList'
]), ]),
showConditionsList() { showConditionsList() {
const showConditionsList = ConstConfig.ConstSelect.showConditionsList; const showConditionsList = ConstConfig.ConstSelect.showConditionsList;
@ -108,7 +111,8 @@ export default {
{ prop: 'position', label: '坐标:', type: 'coordinate', width: '140px', children: [ { prop: 'position', label: '坐标:', type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { 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: '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: { methods: {
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized);
}
},
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
}, },
deviceSelect(selected) { deviceSelect(selected) {
this.handleInit();
this.$refs.createForm && this.$refs.createForm.resetFields(); this.$refs.createForm && this.$refs.createForm.resetFields();
if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) { if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) {
this.activeName = 'first'; this.activeName = 'first';

View File

@ -61,7 +61,8 @@ export default {
position: { position: {
x: 0, x: 0,
y: 0 y: 0
} },
stationCode: ''
}, },
addModel: { addModel: {
prepend: 'H', prepend: 'H',
@ -72,6 +73,7 @@ export default {
y: 0 y: 0
} }
}, },
centralizedStationList: [], //
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('rules.selectText'), trigger: 'blur' } { 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', 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.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: '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: { map: {
@ -158,13 +161,19 @@ export default {
} }
}, },
methods: { methods: {
handleInit() {
if (this.stationList && this.stationList.length) {
this.centralizedStationList = this.stationList.filter(station=> station.centralized);
}
},
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
}, },
deviceSelect(selected) { deviceSelect(selected) {
this.handleInit();
this.$refs.form && this.$refs.form.resetFields(); 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()) { if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) {
this.activeName = 'first'; this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected); this.editModel = deepAssign(this.editModel, selected);

View File

@ -264,14 +264,13 @@ export default {
message: this.$t('publish.setSuccess') message: this.$t('publish.setSuccess')
}); });
}).catch(res => { }).catch(res => {
// if (res.code == '500009') { if (res.code == '10004') {
// this.$message({ type: 'warning', message: this.$t('error.paperHasUseNotDel') }); this.$message({ type: 'error', message: '删除失败:试卷已被使用,无法删除!' });
// } else if (res.code == '10005') { } else if (res.code == '10003') {
// this.$message({ type: 'warning', message: '使'}); this.$message({ type: 'warning', message: '删除失败:无权限删除!'});
// } else { } else {
// this.$message({ type: 'error', message: this.$t('error.deleteException') }); this.$message({ type: 'error', message: this.$t('error.deleteException') });
// } }
this.$message({ type: 'error', message: '删除失败:' + res.message });
}); });
}).catch(() => { }); }).catch(() => { });
}, },