desc: 增加规则,提示信息国际化
This commit is contained in:
parent
fdd28f3c45
commit
374bf96525
@ -5,6 +5,7 @@ import router from './router';
|
||||
import lesson from './lesson';
|
||||
import error from './error';
|
||||
import rules from './rules';
|
||||
import tip from './tip';
|
||||
|
||||
export default {
|
||||
...cnLocale,
|
||||
@ -13,5 +14,6 @@ export default {
|
||||
router,
|
||||
lesson,
|
||||
error,
|
||||
rules
|
||||
rules,
|
||||
tip
|
||||
};
|
||||
|
@ -43,6 +43,11 @@ export default {
|
||||
statusSignalName: '状态信号名称:',
|
||||
stateSignalsPlotCoordinates: '状态信号画图坐标:',
|
||||
|
||||
lineCoding: '线条编码:',
|
||||
lineType: '线条类型:',
|
||||
lineWidth: '线条宽度:',
|
||||
segmentCoordinates: '区段显示坐标:',
|
||||
|
||||
publishMapCreation: '从发布地图创建',
|
||||
confirm: '确 定',
|
||||
cancel: '取 消',
|
||||
@ -163,6 +168,19 @@ export default {
|
||||
color: '颜色:',
|
||||
|
||||
upside: '上段',
|
||||
hypomere: '下段'
|
||||
hypomere: '下段',
|
||||
|
||||
linkType: 'Link类型',
|
||||
linkCode: 'Link编码:',
|
||||
linkName: 'Link名称:',
|
||||
linkDisplayLength: 'Link显示长度:',
|
||||
linkActualLength: 'Link实际长度:',
|
||||
linkColor: 'Link颜色:',
|
||||
linkLeftFdCode: '左侧正向Link:',
|
||||
linkLeftSdCode: '左侧侧向Link:',
|
||||
linkRightFdCode: '右侧正向Link:',
|
||||
linkRightSdCode: '右侧侧向Link:',
|
||||
linkLp: 'Link 起点坐标:',
|
||||
linkRp: 'Link 终点坐标:',
|
||||
|
||||
};
|
||||
|
@ -1,5 +1,34 @@
|
||||
export default {
|
||||
selectEquipment: '请选择设备',
|
||||
deviceTypeNotNull: '设备类型码不能为空',
|
||||
operationTypeNotNull: '操作码不能为空',
|
||||
tipsNotNull: '提示信息不能为空'
|
||||
tipsNotNull: '提示信息不能为空',
|
||||
pleaseSelectEncoding: '请选择唯一编码',
|
||||
pleaseEnterStatusSignal: '请输入状态信号名称',
|
||||
pleaseEnterXCoordinate: '请输入x坐标',
|
||||
pleaseEnterYCoordinate: '请输入y坐标',
|
||||
|
||||
pleaseSelectLine: '请选择Line',
|
||||
pleaseSelectLineType: '请选择Line类型',
|
||||
pleaseSelectLineWidth: '请输入线条宽度',
|
||||
|
||||
linkXCoordinate: '请输入Link x坐标',
|
||||
linkYCoordinate: '请输入Link y坐标',
|
||||
linkEnterLength: '请输入显示长度',
|
||||
linkEnterDisplayLength: '请输入真实长度',
|
||||
|
||||
linkSelectBase: '请选择基础Link',
|
||||
linkEnterLeft: '请输入左侧正向Link',
|
||||
linkEnterRight: '请输入右侧正向Link',
|
||||
linkSelectName: '请输入Link名称',
|
||||
linkSelectDisplayLength: '请输入Link实际长度',
|
||||
|
||||
lengthShow: '显示长度:',
|
||||
lengthFact: '真实长度:',
|
||||
color: '颜色:',
|
||||
|
||||
pointX: '坐标 x:',
|
||||
pointY: '坐标 y:',
|
||||
direct: '方向:',
|
||||
basisLink: '基础Link:',
|
||||
};
|
||||
|
17
src/i18n/langs/zh/tip.js
Normal file
17
src/i18n/langs/zh/tip.js
Normal file
@ -0,0 +1,17 @@
|
||||
export default {
|
||||
confirm: '确 定',
|
||||
cancel: '取 消',
|
||||
creatingSuccessful: '创建成功!',
|
||||
confirmDeletion: '是否确认删除?',
|
||||
hint: '提示',
|
||||
cancelledDelete: '已取消删除',
|
||||
|
||||
updateSuccessfully: '更新成功',
|
||||
updateFailed: '更新失败',
|
||||
successfullyDelete: '删除成功',
|
||||
failDelete: '删除失败',
|
||||
|
||||
cannotCoincide: '起始坐标和结束坐标不能重合',
|
||||
|
||||
meter: '米'
|
||||
};
|
@ -42,7 +42,7 @@
|
||||
</el-checkbox-group>
|
||||
</el-row>
|
||||
<el-tabs v-model="enabledTab" type="card">
|
||||
<el-tab-pane :label="$t('map.Link')" name="Link">
|
||||
<el-tab-pane :label="$t('map.link')" name="Link">
|
||||
<link-draft
|
||||
ref="Link"
|
||||
:card-height="cardHeights"
|
||||
@ -163,7 +163,7 @@
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t(map.delayUnlock)" name="DelayUnlock">
|
||||
<el-tab-pane :label="$t('map.delayUnlock')" name="DelayUnlock">
|
||||
<delay-unlock-draft
|
||||
ref="DelayUnlock"
|
||||
:card-height="cardHeights"
|
||||
|
@ -46,7 +46,7 @@
|
||||
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="make" label-width="150px" :rules="createRules" :model="addModel" size="mini">
|
||||
<el-form-item label="状态信号名称:" prop="name">
|
||||
<el-form-item :label="$t('map.statusSignalName')" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
@ -120,16 +120,16 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请选择唯一编码', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -144,13 +144,13 @@ export default {
|
||||
createRules: function () {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('map.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('map.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
@ -228,15 +228,15 @@ export default {
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) {
|
||||
const _that = this;
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('delMapModel', selected);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info('已取消删除');
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane class="view-control" label="属性" name="first">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="form" :model="editModel" label-width="150px" size="mini" :rules="rules">
|
||||
<el-form-item label="编码:" prop="code">
|
||||
<el-form-item :label="$t('map.code')" prop="code">
|
||||
<el-select v-model="editModel.code" filterable @change="deviceChange">
|
||||
<el-option
|
||||
v-for="item in tempSpeedLimitList"
|
||||
@ -14,11 +14,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态信号名称:" prop="name">
|
||||
<el-form-item :label="$t('map.statusSignalName')" prop="name">
|
||||
<el-input v-model="editModel.name" />
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title">状态信号画图坐标:</span>
|
||||
<span class="title">{{ $t('map.stateSignalsPlotCoordinates') }}</span>
|
||||
<el-form-item
|
||||
label="x:"
|
||||
prop="position.x"
|
||||
@ -39,18 +39,18 @@
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" @click="edit">修改</el-button>
|
||||
<el-button type="primary" @click="deleteObj">删除</el-button>
|
||||
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="操作" name="second">
|
||||
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="make" label-width="150px" :rules="createRules" :model="addModel" size="mini">
|
||||
<el-form-item label="状态信号名称:" prop="name">
|
||||
<el-form-item :label="$t('map.statusSignalName')" prop="name">
|
||||
<el-input v-model="addModel.name" />
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title">状态信号画图坐标:</span>
|
||||
<span class="title">{{ $t('map.stateSignalsPlotCoordinates') }}</span>
|
||||
<el-form-item
|
||||
label="x:"
|
||||
prop="position.x"
|
||||
@ -71,7 +71,7 @@
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" @click="create">创建</el-button>
|
||||
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -120,16 +120,16 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请选择唯一编码', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectEncoding'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -144,13 +144,13 @@ export default {
|
||||
createRules: function () {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: '请输入状态信号名称', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterStatusSignal'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: '请输入x坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: '请输入y坐标位置', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
@ -228,15 +228,15 @@ export default {
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
if (selected && selected._type.toUpperCase() === 'LimitControl'.toUpperCase()) {
|
||||
const _that = this;
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('delMapModel', selected);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info('已取消删除');
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane class="view-control" label="属性" name="first">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="form" :model="editModel" label-width="120px" size="mini" :rules="rules">
|
||||
<el-form-item label="线条编码:" prop="code">
|
||||
<el-form-item :label="$t('map.lineCoding')" prop="code">
|
||||
<el-select v-model="editModel.code" filterable @change="deviceChange">
|
||||
<el-option
|
||||
v-for="item in lineList"
|
||||
@ -14,7 +14,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="线条类型:" prop="type">
|
||||
<el-form-item :label="$t('map.lineType')" prop="type">
|
||||
<el-select v-model="editModel.type" filterable>
|
||||
<el-option
|
||||
v-for="item in LineTypeList"
|
||||
@ -24,11 +24,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="线条宽度:" prop="width">
|
||||
<el-form-item :label="$t('map.lineWidth')" prop="width">
|
||||
<el-input-number v-model="editModel.width" :min="1" />px
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title">区段显示坐标:</span>
|
||||
<span class="title">{{ $t('map.segmentCoordinates') }}</span>
|
||||
<div class="point-section">
|
||||
<template v-for="(point, index) in editModel.points">
|
||||
<div :key="index" style="overflow: hidden;">
|
||||
@ -70,14 +70,14 @@
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" @click="edit">修改</el-button>
|
||||
<el-button type="primary" @click="deleteObj">删除</el-button>
|
||||
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="操作" name="second">
|
||||
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="make" label-width="120px" :model="addModel" size="mini" :rules="makeRules">
|
||||
<el-form-item label="线条类型:" prop="type">
|
||||
<el-form-item :label="$t('map.lineType')" prop="type">
|
||||
<el-select v-model="addModel.type" filterable>
|
||||
<el-option
|
||||
v-for="item in LineTypeList"
|
||||
@ -87,11 +87,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="线条宽度:" prop="width">
|
||||
<el-form-item :label="$t('map.lineWidth')" prop="width">
|
||||
<el-input-number v-model="addModel.width" :min="1" />px
|
||||
</el-form-item>
|
||||
<div class="coordinate">
|
||||
<span class="title">区段显示坐标:</span>
|
||||
<span class="title">{{ $t('map.segmentCoordinates') }}</span>
|
||||
<div class="point-section">
|
||||
<template v-for="(point, index) in addModel.points">
|
||||
<div :key="index" style="overflow: hidden;">
|
||||
@ -133,7 +133,7 @@
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" @click="create">创建</el-button>
|
||||
<el-button type="primary" @click="create">{{ $t('map.create') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -163,10 +163,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
LineTypeList: [
|
||||
{ code: '01', name: '测试' }
|
||||
|
||||
],
|
||||
LineTypeList: [],
|
||||
editModel: {
|
||||
code: '',
|
||||
type: '',
|
||||
@ -183,24 +180,24 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请选择Line', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLine'), trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择Line类型', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLineType'), trigger: 'blur' }
|
||||
],
|
||||
width: [
|
||||
{ required: true, message: '请输入线条宽度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLineWidth'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
makeRules: {
|
||||
code: [
|
||||
{ required: true, message: '请选择Line', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLine'), trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择Line类型', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLineType'), trigger: 'blur' }
|
||||
],
|
||||
width: [
|
||||
{ required: true, message: '请输入线条宽度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLineWidth'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -271,7 +268,7 @@ export default {
|
||||
};
|
||||
this.$emit('addOrUpdateMapModel', model);
|
||||
} else {
|
||||
this.$message.console.error('起始坐标和结束坐标不能重合');
|
||||
this.$message.console.error(this.$t('tip.cannotCoincide'));
|
||||
|
||||
}
|
||||
}
|
||||
@ -301,15 +298,15 @@ export default {
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
|
||||
const _that = this;
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('delMapModel', selected);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info('已取消删除');
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane class="view-control" label="属性" name="first">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules" />
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button type="primary" @click="edit">修改</el-button>
|
||||
<el-button type="primary" @click="deleteObj">删除</el-button>
|
||||
<el-button type="primary" @click="edit">{{ $t('map.updateObj') }}</el-button>
|
||||
<el-button type="primary" @click="deleteObj">{{ $t('map.deleteObj') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" label="操作" name="second">
|
||||
<el-tab-pane class="view-control" :label="$t('map.operation')" name="second">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||
<el-form ref="make" label-width="120px" :model="addModel" size="mini">
|
||||
<el-form-item label="Link类型:">
|
||||
<el-form-item :label="$t('map.linkType')">
|
||||
<el-radio-group v-model="LinkType">
|
||||
<el-radio
|
||||
v-for="item in LinkTypeList"
|
||||
@ -37,9 +37,9 @@
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<el-button-group class="map-draft-group">
|
||||
<el-button v-if="isNew" type="primary" @click="isNewCreate">创建</el-button>
|
||||
<el-button v-if="isFd" type="primary" @click="isFdCreate">创建</el-button>
|
||||
<el-button v-if="isSd" type="primary" @click="isSdCreate">创建</el-button>
|
||||
<el-button v-if="isNew" type="primary" @click="isNewCreate">{{ $t('map.create') }}</el-button>
|
||||
<el-button v-if="isFd" type="primary" @click="isFdCreate">{{ $t('map.create') }}</el-button>
|
||||
<el-button v-if="isSd" type="primary" @click="isSdCreate">{{ $t('map.create') }}</el-button>
|
||||
</el-button-group>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -111,38 +111,38 @@ export default {
|
||||
skins: [],
|
||||
makeRules1: {
|
||||
x: [
|
||||
{ required: true, message: '请输入Link x坐标', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
y: [
|
||||
{ required: true, message: '请输入Link y坐标', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkYCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
lengthShow: [
|
||||
{ required: true, message: '请输入显示长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterLength'), trigger: 'blur' }
|
||||
],
|
||||
lengthFact: [
|
||||
{ required: true, message: '请输入真实长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterDisplayLength'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
makeRules2: {
|
||||
code: [
|
||||
{ required: true, message: '请选择基础Link', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.linkSelectBase'), trigger: 'change' }
|
||||
],
|
||||
lengthShow: [
|
||||
{ required: true, message: '请输入显示长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterLength'), trigger: 'blur' }
|
||||
],
|
||||
lengthFact: [
|
||||
{ required: true, message: '请输入真实长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterDisplayLength'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
makeRules3: {
|
||||
lfd: [
|
||||
{ required: true, message: '请输入左侧正向Link', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterLeft'), trigger: 'blur' }
|
||||
],
|
||||
rfd: [
|
||||
{ required: true, message: '请输入右侧正向Link', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterRight'), trigger: 'blur' }
|
||||
],
|
||||
lengthFact: [
|
||||
{ required: true, message: '请输入真实长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkEnterDisplayLength'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -155,20 +155,20 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '130px',
|
||||
items: [
|
||||
{ prop: 'code', label: 'Link编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: 'Link名称:', type: 'input' },
|
||||
{ prop: 'lengthShow', label: 'Link显示长度:', type: 'number', min: 50, placeholder: 'px' },
|
||||
{ prop: 'lengthFact', label: 'Link实际长度:', type: 'number', min: 0, placeholder: '米' },
|
||||
{ prop: 'color', label: 'Link颜色:', type: 'color' },
|
||||
{ prop: 'leftFdCode', label: '左侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'leftSdCode', label: '左侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'rightFdCode', label: '右侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'rightSdCode', label: '右侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'lp', label: 'Link 起点坐标:', type: 'coordinate', width: '160px', children: [
|
||||
{ prop: 'code', label: this.$t('map.linkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.linkName'), type: 'input' },
|
||||
{ prop: 'lengthShow', label: this.$t('map.linkDisplayLength'), type: 'number', min: 50, placeholder: 'px' },
|
||||
{ prop: 'lengthFact', label: this.$t('map.linkActualLength'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
|
||||
{ prop: 'color', label: this.$t('map.linkColor'), type: 'color' },
|
||||
{ prop: 'leftFdCode', label: this.$t('map.linkLeftFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'leftSdCode', label: this.$t('map.linkLeftSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'rightFdCode', label: this.$t('map.linkRightFdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'rightSdCode', label: this.$t('map.linkRightSdCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'lp', label: this.$t('map.linkLp'), type: 'coordinate', width: '160px', children: [
|
||||
{ prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
|
||||
{ prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
||||
] },
|
||||
{ prop: 'rp', label: 'Link 终点坐标:', type: 'coordinate', width: '160px', children: [
|
||||
{ prop: 'rp', label: this.$t('map.linkRp'), type: 'coordinate', width: '160px', children: [
|
||||
{ prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
|
||||
{ prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
||||
] }
|
||||
@ -179,13 +179,13 @@ export default {
|
||||
rules() {
|
||||
const rules = {
|
||||
code: [
|
||||
{ required: true, message: '请选择设备', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入Link名称', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
|
||||
],
|
||||
lengthFact: [
|
||||
{ required: true, message: '请输入Link实际长度', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.linkSelectDisplayLength'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
// 清空表单验证提示信息
|
||||
@ -200,11 +200,11 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px' },
|
||||
{ prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
|
||||
{ prop: 'color', label: '颜色:', type: 'color' },
|
||||
{ prop: 'x', label: '坐标 x:', type: 'number', placeholder: 'px' },
|
||||
{ prop: 'y', label: '坐标 y:', type: 'number', placeholder: 'px' }
|
||||
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px' },
|
||||
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
|
||||
{ prop: 'color', label: this.$t('rules.color'), type: 'color' },
|
||||
{ prop: 'x', label: this.$t('rules.pointX'), type: 'number', placeholder: 'px' },
|
||||
{ prop: 'y', label: this.$t('rules.pointY'), type: 'number', placeholder: 'px' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -213,11 +213,11 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'code', label: '基础Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'direct', label: '方向:', type: 'radio', border: true, radioList: this.LinkDriectTypeList },
|
||||
{ prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
|
||||
{ prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
|
||||
{ prop: 'color', label: '颜色:', type: 'color' }
|
||||
{ prop: 'code', label: this.$t('rules.basisLink'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'direct', label: this.$t('rules.direct'), type: 'radio', border: true, radioList: this.LinkDriectTypeList },
|
||||
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
|
||||
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
|
||||
{ prop: 'color', label: this.$t('rules.color'), type: 'color' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -228,9 +228,9 @@ export default {
|
||||
items: [
|
||||
{ prop: 'lfd', label: '左侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'rfd', label: '右侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
|
||||
{ prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
|
||||
{ prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
|
||||
{ prop: 'color', label: '颜色:', type: 'color' }
|
||||
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
|
||||
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
|
||||
{ prop: 'color', label: this.$t('rules.color'), type: 'color' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -524,16 +524,16 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||
confirmButtonText: this.$t('tip.confirm'),
|
||||
cancelButtonText: this.$t('tip.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_that.$emit('addOrUpdateMapModel', updates);
|
||||
_that.$emit('delMapModel', selected);
|
||||
_that.deviceSelect();
|
||||
}).catch(() => {
|
||||
_that.$message.info('已取消删除');
|
||||
_that.$message.info(this.$t('tip.cancelledDelete'));
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user