This commit is contained in:
fan 2020-09-14 18:35:06 +08:00
commit b44e193bcf
20 changed files with 1465 additions and 1603 deletions

View File

@ -25,8 +25,8 @@ export function jl3dEditorLoader(mapid,scope){
if(data.data ){ if(data.data ){
if(data.data.assets){ if(data.data.assets){
initData(editmapid,data.data.id); // initData(editmapid,data.data.id);
// loadData(editmapid,data.data); loadData(editmapid,data.data);
}else{ }else{
initData(editmapid,data.data.id); initData(editmapid,data.data.id);
} }

View File

@ -45,6 +45,7 @@ export function StationStandList() {
let stand= { let stand= {
code : stationstanddata[j].code, code : stationstanddata[j].code,
position : stationstanddata[j].position, position : stationstanddata[j].position,
posy:stationstanddata[j].position.y,
name : stationstanddata[j].name, name : stationstanddata[j].name,
right : stationstanddata[j].right, right : stationstanddata[j].right,
section : stationstanddata[j].standTrackCode, section : stationstanddata[j].standTrackCode,
@ -75,13 +76,14 @@ export function StationStandList() {
} }
if(newstationstand.code != null){ if(newstationstand.code != null){
newstationstand.stands.sort(compare("posy"));
scope.list.push(newstationstand); scope.list.push(newstationstand);
} }
} }
} }
console.log(scope.list);
resolve("loadedstation"); resolve("loadedstation");
}); });
} }
@ -207,6 +209,13 @@ export function StationStandList() {
} }
} }
function compare(property){
return function(a,b){
var value1 = a[property];
var value2 = b[property];
return value1 - value2;
}
}
//canvas文字贴图方法 //canvas文字贴图方法
//PS:待提炼 增强功能 //PS:待提炼 增强功能
function getTextCanvas(text){ function getTextCanvas(text){

View File

@ -2,30 +2,30 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item :label="this.$t('ibp.alarmCode')" prop="code"> <el-form-item :label="this.$t('ibp.alarmCode')" prop="code">
<el-input :disabled="true" v-model="form.code"> <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.alarmWidth')" prop="alarmWidth"> <el-form-item :label="this.$t('ibp.alarmWidth')" prop="alarmWidth">
<el-input-number v-model="form.alarmWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.alarmWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.xCoordinate')"> <el-form-item :label="this.$t('ibp.xCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.yCoordinate')"> <el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'ButtonDraft', name: 'ButtonDraft',
components: { components: {
}, },
@ -42,10 +42,10 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('rules.enterTheAlarmCode'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheAlarmCode'), trigger: 'blur' }
], ],
alarmWidth: [ alarmWidth: [
{ required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheAlarmWidth'), trigger: 'blur' }
] ]
} }
}; };
@ -56,7 +56,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'Alarm' ){ if (model._type === 'Alarm' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -72,7 +72,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid){ if (valid) {
const alarmModel = { const alarmModel = {
point:{ point:{
x: this.form.x, x: this.form.x,
@ -80,9 +80,9 @@
}, },
code: this.form.code, code: this.form.code,
_type: 'Alarm', _type: 'Alarm',
width: this.form .alarmWidth, width: this.form.alarmWidth
}; };
this.$emit('createAlarm', alarmModel); this.$emit('createData', alarmModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -97,9 +97,9 @@
}, },
code: this.form.code, code: this.form.code,
_type: 'Alarm', _type: 'Alarm',
width: this.form .alarmWidth, width: this.form.alarmWidth
}; };
this.$emit('deleteDataModel',alarmModel ); this.$emit('deleteDataModel', alarmModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -115,10 +115,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "alarm_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'alarm_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,36 +2,36 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item :label="this.$t('ibp.escalatorFrameCode')" prop="code"> <el-form-item :label="this.$t('ibp.escalatorFrameCode')" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.escalatorFrameWidth')" prop="appendageBoxWidth"> <el-form-item :label="this.$t('ibp.escalatorFrameWidth')" prop="appendageBoxWidth">
<el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="50"></el-input-number> <el-input-number v-model="form.appendageBoxWidth" controls-position="right" :min="50" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.escalatorFrameHeight')" prop="appendageBoxHeight"> <el-form-item :label="this.$t('ibp.escalatorFrameHeight')" prop="appendageBoxHeight">
<el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="75"></el-input-number> <el-input-number v-model="form.appendageBoxHeight" controls-position="right" :min="75" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.borderWidth')" prop="borderWidth"> <el-form-item :label="this.$t('ibp.borderWidth')" prop="borderWidth">
<el-input-number v-model="form.borderWidth" controls-position="right" :min="1"></el-input-number><span>&nbsp&nbsp{{$t('ibp.recommendedSize')}}</span> <el-input-number v-model="form.borderWidth" controls-position="right" :min="1" /><span>&nbsp;&nbsp;{{ $t('ibp.recommendedSize') }}</span>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.xCoordinate')"> <el-form-item :label="this.$t('ibp.xCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.yCoordinate')"> <el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'AppendageBoxDraft', name: 'AppendageBoxDraft',
components: { components: {
}, },
@ -50,16 +50,16 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameCode'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheEscalatorFrameCode'), trigger: 'blur' }
], ],
appendageBoxWidth: [ appendageBoxWidth: [
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameWidth'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheEscalatorFrameWidth'), trigger: 'blur' }
], ],
appendageBoxHeight: [ appendageBoxHeight: [
{ required: true, message: this.$t('ibp.enterTheEscalatorFrameHeight'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheEscalatorFrameHeight'), trigger: 'blur' }
], ],
borderWidth: [ borderWidth: [
{ required: true, message: this.$t('ibp.enterTheBorderWidth'), trigger: 'blur'}, { required: true, message: this.$t('ibp.enterTheBorderWidth'), trigger: 'blur'}
] ]
} }
}; };
@ -70,7 +70,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'AppendageBox' ){ if (model._type === 'AppendageBox' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -79,7 +79,7 @@
this.form.appendageBoxHeight = model.height; this.form.appendageBoxHeight = model.height;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
this.form.borderWidth = model.borderWidth this.form.borderWidth = model.borderWidth;
} }
} }
}, },
@ -88,7 +88,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid){ if (valid) {
const appendageBoxModel = { const appendageBoxModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -96,11 +96,11 @@
}, },
_type: 'AppendageBox', _type: 'AppendageBox',
code: this.form.code, code: this.form.code,
width: this.form .appendageBoxWidth, width: this.form.appendageBoxWidth,
height: this.form.appendageBoxHeight, height: this.form.appendageBoxHeight,
borderWidth: this.form.borderWidth borderWidth: this.form.borderWidth
}; };
this.$emit('createAppendageBox', appendageBoxModel); this.$emit('createData', appendageBoxModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -115,11 +115,11 @@
}, },
_type: 'AppendageBox', _type: 'AppendageBox',
code: this.form.code, code: this.form.code,
width: this.form .appendageBoxWidth, width: this.form.appendageBoxWidth,
height: this.form.appendageBoxHeight, height: this.form.appendageBoxHeight,
borderWidth: this.form.borderWidth borderWidth: this.form.borderWidth
}; };
this.$emit('deleteDataModel',appendageBoxModel ); this.$emit('deleteDataModel', appendageBoxModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -137,10 +137,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "aBox"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'aBox' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,44 +2,44 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item :label="this.$t('ibp.arrowCode')" prop="code"> <el-form-item :label="this.$t('ibp.arrowCode')" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.arrowDirection')" prop="orientation"> <el-form-item :label="this.$t('ibp.arrowDirection')" prop="orientation">
<el-select v-model="form.orientation" :placeholder="this.$t('rules.selectTheDirectionOfTheArrow')"> <el-select v-model="form.orientation" :placeholder="this.$t('rules.selectTheDirectionOfTheArrow')">
<el-option :label="this.$t('ibp.up')" value="top"></el-option> <el-option :label="this.$t('ibp.up')" value="top" />
<el-option :label="this.$t('ibp.down')" value="bottom"></el-option> <el-option :label="this.$t('ibp.down')" value="bottom" />
<el-option :label="this.$t('ibp.left')" value="left"></el-option> <el-option :label="this.$t('ibp.left')" value="left" />
<el-option :label="this.$t('ibp.right')" value="right"></el-option> <el-option :label="this.$t('ibp.right')" value="right" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.arrowLength')" prop="arrowLength"> <el-form-item :label="this.$t('ibp.arrowLength')" prop="arrowLength">
<el-input-number v-model="form.arrowLength" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.arrowLength" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.arrowWidth')" prop="arrowLength"> <el-form-item :label="this.$t('ibp.arrowWidth')" prop="arrowLength">
<el-input-number v-model="form.arrowWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.arrowWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.arrowColor')" prop="fillColor"> <el-form-item :label="this.$t('ibp.arrowColor')" prop="fillColor">
<el-color-picker v-model="form.fillColor"></el-color-picker> <el-color-picker v-model="form.fillColor" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.vertexXCoordinate')"> <el-form-item :label="this.$t('ibp.vertexXCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.vertexYCoordinate')"> <el-form-item :label="this.$t('ibp.vertexYCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'ArrowDraft', name: 'ArrowDraft',
components: { components: {
}, },
@ -59,20 +59,20 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('rules.enterTheArrowCode'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheArrowCode'), trigger: 'blur' }
], ],
orientation: [ orientation: [
{ required: true, message: this.$t('rules.selectTheDirectionOfTheArrow'), trigger: 'change'} { required: true, message: this.$t('rules.selectTheDirectionOfTheArrow'), trigger: 'change'}
], ],
arrowLength: [ arrowLength: [
{ required: true, message: this.$t('rules.enterTheArrowLength'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheArrowLength'), trigger: 'blur' }
], ],
arrowWidth: [ arrowWidth: [
{ required: true, message: this.$t('rules.enterTheArrowWidth'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheArrowWidth'), trigger: 'blur' }
], ],
fillColor: [ fillColor: [
{ required: true, message: this.$t('rules.enterTheArrowColor'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheArrowColor'), trigger: 'blur' }
], ]
} }
}; };
}, },
@ -82,7 +82,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'Arrow' ){ if (model._type === 'Arrow' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -101,7 +101,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid){ if (valid) {
const arrowModel = { const arrowModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -111,12 +111,12 @@
code: this.form.code, code: this.form.code,
orientation: this.form.orientation, orientation: this.form.orientation,
fill: this.form.fillColor, fill: this.form.fillColor,
width: this.form .arrowWidth, width: this.form.arrowWidth,
length: this.form.arrowLength, length: this.form.arrowLength
}; };
this.$emit('createArrow', arrowModel); this.$emit('createData', arrowModel);
this.initPage(); this.initPage();
}else { } else {
return false; return false;
} }
}); });
@ -132,10 +132,10 @@
code: this.form.code, code: this.form.code,
orientation: this.form.orientation, orientation: this.form.orientation,
fill: this.form.fillColor, fill: this.form.fillColor,
width: this.form .arrowWidth, width: this.form.arrowWidth,
length: this.form.arrowLength, length: this.form.arrowLength
}; };
this.$emit('deleteDataModel',arrowModel); this.$emit('deleteDataModel', arrowModel);
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -154,10 +154,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "arrow_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'arrow_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -62,7 +62,7 @@ export default {
width: this.form.bgWidth, width: this.form.bgWidth,
height: this.form.bgHeight height: this.form.bgHeight
}; };
this.$emit('updateBg', bgModel); this.$emit('createData', bgModel);
}, },
initPage() { initPage() {
this.form.bgWidth = this.$store.state.ibp.ibpBgDevice.model ? this.$store.state.ibp.ibpBgDevice.model.width : 1; this.form.bgWidth = this.$store.state.ibp.ibpBgDevice.model ? this.$store.state.ibp.ibpBgDevice.model.width : 1;

View File

@ -118,7 +118,7 @@ export default {
width: this.form.buttonWidth, width: this.form.buttonWidth,
mean: this.from.mean mean: this.from.mean
}; };
this.$emit('createButton', buttonModel); this.$emit('createData', buttonModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;

View File

@ -2,30 +2,30 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item :label="this.$t('ibp.digitalClockCode')" prop="code"> <el-form-item :label="this.$t('ibp.digitalClockCode')" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.digitalClockWidth')" prop="clockWidth"> <el-form-item :label="this.$t('ibp.digitalClockWidth')" prop="clockWidth">
<el-input-number v-model="form.clockWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.clockWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.xCoordinate')"> <el-form-item :label="this.$t('ibp.xCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.yCoordinate')"> <el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'ClockDraft', name: 'ClockDraft',
components: { components: {
}, },
@ -42,10 +42,10 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('rules.enterTheDigitalClockCode'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheDigitalClockCode'), trigger: 'blur' }
], ],
clockWidth: [ clockWidth: [
{ required: true, message: this.$t('rules.enterTheDigitalClockWidth'), trigger: 'blur' }, { required: true, message: this.$t('rules.enterTheDigitalClockWidth'), trigger: 'blur' }
] ]
} }
}; };
@ -56,7 +56,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'Clock' ){ if (model._type === 'Clock' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -80,11 +80,11 @@
}, },
_type: 'Clock', _type: 'Clock',
code: this.form.code, code: this.form.code,
width: this.form.clockWidth, width: this.form.clockWidth
}; };
this.$emit('createClock', clockModel); this.$emit('createData', clockModel);
this.initPage(); this.initPage();
}else { } else {
return false; return false;
} }
}); });
@ -97,9 +97,9 @@
}, },
_type: 'Clock', _type: 'Clock',
code: this.form.code, code: this.form.code,
width: this.form.clockWidth, width: this.form.clockWidth
}; };
this.$emit('deleteDataModel',clockModel ); this.$emit('deleteDataModel', clockModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -116,10 +116,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "clock_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'clock_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,42 +2,42 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item :label="this.$t('ibp.escalatorCode')" prop="code"> <el-form-item :label="this.$t('ibp.escalatorCode')" prop="code">
<el-input :disabled="true" v-model="form.code"> <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.escalatorWidth')" prop="elevatorWidth"> <el-form-item :label="this.$t('ibp.escalatorWidth')" prop="elevatorWidth">
<el-input-number v-model="form.elevatorWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.elevatorWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.escalatorHeight')" prop="elevatorHeight"> <el-form-item :label="this.$t('ibp.escalatorHeight')" prop="elevatorHeight">
<el-input-number v-model="form.elevatorHeight" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.elevatorHeight" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.escalatorColor')" prop="elevatorColor"> <el-form-item :label="this.$t('ibp.escalatorColor')" prop="elevatorColor">
<el-color-picker v-model="form.elevatorColor"></el-color-picker> <el-color-picker v-model="form.elevatorColor" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.startingDirection')" prop="direction"> <el-form-item :label="this.$t('ibp.startingDirection')" prop="direction">
<el-select v-model="form.direction" placeholder="请选择启动方向"> <el-select v-model="form.direction" placeholder="请选择启动方向">
<el-option :label="this.$t('ibp.doNotStart')" value="none"></el-option> <el-option :label="this.$t('ibp.doNotStart')" value="none" />
<el-option :label="this.$t('ibp.startUp')" value="top"></el-option> <el-option :label="this.$t('ibp.startUp')" value="top" />
<el-option :label="this.$t('ibp.startDown')" value="bottom"></el-option> <el-option :label="this.$t('ibp.startDown')" value="bottom" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.xCoordinate')"> <el-form-item :label="this.$t('ibp.xCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.yCoordinate')"> <el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'ElevatorDraft', name: 'ElevatorDraft',
components: { components: {
}, },
@ -57,20 +57,20 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: this.$t('ibp.enterTheElevatorCode'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheElevatorCode'), trigger: 'blur' }
], ],
elevatorWidth: [ elevatorWidth: [
{ required: true, message: this.$t('ibp.enterTheElevatorWidth'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheElevatorWidth'), trigger: 'blur' }
], ],
elevatorHeight: [ elevatorHeight: [
{ required: true, message: this.$t('ibp.enterTheElevatorHeight'), trigger: 'blur' }, { required: true, message: this.$t('ibp.enterTheElevatorHeight'), trigger: 'blur' }
], ],
elevatorColor: [ elevatorColor: [
{ required: true, message: this.$t('ibp.enterTheElevatorColor'), trigger: 'change' }, { required: true, message: this.$t('ibp.enterTheElevatorColor'), trigger: 'change' }
], ],
direction: [ direction: [
{ required: true, message: this.$t('ibp.selectTheStartingDirection'), trigger: 'change' }, { required: true, message: this.$t('ibp.selectTheStartingDirection'), trigger: 'change' }
], ]
} }
}; };
}, },
@ -80,7 +80,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'Elevator' ){ if (model._type === 'Elevator' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -99,7 +99,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid){ if (valid) {
const elevatorModel = { const elevatorModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -110,9 +110,9 @@
width: this.form.elevatorWidth, width: this.form.elevatorWidth,
height: this.form.elevatorHeight, height: this.form.elevatorHeight,
fillColor: this.form.elevatorColor, fillColor: this.form.elevatorColor,
direction: this.form.direction, direction: this.form.direction
}; };
this.$emit('createElevator', elevatorModel); this.$emit('createData', elevatorModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -131,9 +131,9 @@
width: this.form.elevatorWidth, width: this.form.elevatorWidth,
height: this.form.elevatorHeight, height: this.form.elevatorHeight,
fillColor: this.form.elevatorColor, fillColor: this.form.elevatorColor,
direction: this.form.direction, direction: this.form.direction
}; };
this.$emit('deleteDataModel',elevatorModel ); this.$emit('deleteDataModel', elevatorModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -152,10 +152,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "elevator_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'elevator_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -129,7 +129,7 @@ export default {
bottomText:this.form.bottomText, bottomText:this.form.bottomText,
mean:this.form.mean mean:this.form.mean
}; };
this.$emit('createKey', keyModel); this.$emit('createData', keyModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;

View File

@ -2,18 +2,18 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item :label="this.$t('ibp.circularLampCode')" prop="code"> <el-form-item :label="this.$t('ibp.circularLampCode')" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{$t('ibp.generateCode')}}</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">{{ $t('ibp.generateCode') }}</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.circularLampRadius')" prop="r"> <el-form-item :label="this.$t('ibp.circularLampRadius')" prop="r">
<el-input-number v-model="form.r" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.r" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.xCoordinate')"> <el-form-item :label="this.$t('ibp.xCoordinate')">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item :label="this.$t('ibp.yCoordinate')"> <el-form-item :label="this.$t('ibp.yCoordinate')">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="表示状态"> <el-form-item label="表示状态">
<el-select v-model="form.mean" placeholder="请选择"> <el-select v-model="form.mean" placeholder="请选择">
@ -21,24 +21,24 @@
v-for="item in showMeanList" v-for="item in showMeanList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关联设备"> <el-form-item label="关联设备">
<el-input v-model="form.linkDevice"></el-input> <el-input v-model="form.linkDevice" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">{{$t('global.delete')}}</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">{{ $t('global.delete') }}</el-button>
<el-button v-show="showDeleteButton" @click="initPage">{{$t('global.cancel')}}</el-button> <el-button v-show="showDeleteButton" @click="initPage">{{ $t('global.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'LampDraft', name: 'LampDraft',
components: { components: {
}, },
@ -62,11 +62,11 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请输入按钮编号', trigger: 'blur' }, { required: true, message: '请输入按钮编号', trigger: 'blur' }
], ],
r: [ r: [
{ required: true, message: '请输入圆形灯半径', trigger: 'blur'} { required: true, message: '请输入圆形灯半径', trigger: 'blur'}
], ]
} }
}; };
}, },
@ -76,7 +76,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'CircularLamp' ){ if (model._type === 'CircularLamp' ) {
this.buttonText = this.$t('global.modify'); this.buttonText = this.$t('global.modify');
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -94,7 +94,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if(valid){ if (valid) {
const lampModel = { const lampModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -107,9 +107,9 @@
linkDevice: this.form.linkDevice, linkDevice: this.form.linkDevice,
fillColor: '#332C22' fillColor: '#332C22'
}; };
this.$emit('createLamp', lampModel); this.$emit('createData', lampModel);
this.initPage(); this.initPage();
}else { } else {
return false; return false;
} }
}); });
@ -128,7 +128,7 @@
linkDevice: this.form.linkDevice, linkDevice: this.form.linkDevice,
fillColor: '#332C22' fillColor: '#332C22'
}; };
this.$emit('deleteDataModel',lampModel ); this.$emit('deleteDataModel', lampModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -141,15 +141,15 @@
x: 10, x: 10,
y: 10, y: 10,
mean: '', mean: '',
linkDevice: '', linkDevice: ''
}; };
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "lamp_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'lamp_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
</style> </style>

View File

@ -2,31 +2,31 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="线段编号" prop="code"> <el-form-item label="线段编号" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="线段宽度" prop="lineWidth"> <el-form-item label="线段宽度" prop="lineWidth">
<el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50"></el-input-number> <el-input-number v-model="form.lineWidth" controls-position="right" :min="1" :max="50" />
</el-form-item> </el-form-item>
<el-form-item label="线段颜色" prop="fillColor"> <el-form-item label="线段颜色" prop="fillColor">
<el-color-picker v-model="form.fillColor"></el-color-picker> <el-color-picker v-model="form.fillColor" />
</el-form-item> </el-form-item>
<el-form-item label="起始X轴坐标"> <el-form-item label="起始X轴坐标">
<el-input-number v-model="form.x1" controls-position="right" :min="0"></el-input-number> <el-input-number v-model="form.x1" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="起始Y轴坐标"> <el-form-item label="起始Y轴坐标">
<el-input-number v-model="form.y1" controls-position="right" :min="0"></el-input-number> <el-input-number v-model="form.y1" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="终止X轴坐标"> <el-form-item label="终止X轴坐标">
<el-input-number v-model="form.x2" controls-position="right" :min="0"></el-input-number> <el-input-number v-model="form.x2" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="终止Y轴坐标"> <el-form-item label="终止Y轴坐标">
<el-input-number v-model="form.y2" controls-position="right" :min="0"></el-input-number> <el-input-number v-model="form.y2" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button> <el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -34,7 +34,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'TextDraft', name: 'TextDraft',
components: { components: {
}, },
@ -54,14 +54,14 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请输入线段编号', trigger: 'blur' }, { required: true, message: '请输入线段编号', trigger: 'blur' }
], ],
lineWidth: [ lineWidth: [
{ required: true, message: '请输入线段宽度', trigger: 'blur' }, { required: true, message: '请输入线段宽度', trigger: 'blur' }
], ],
fillColor: [ fillColor: [
{ required: true, message: '请输入线段颜色', trigger: 'blur' }, { required: true, message: '请输入线段颜色', trigger: 'blur' }
], ]
} }
}; };
}, },
@ -71,7 +71,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'IbpLine' ){ if (model._type === 'IbpLine' ) {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -90,7 +90,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) =>{ this.$refs[form].validate((valid) =>{
if (valid){ if (valid) {
const lineModel = { const lineModel = {
point1: { point1: {
x: this.form.x1, x: this.form.x1,
@ -105,9 +105,9 @@
lineWidth: this.form.lineWidth, lineWidth: this.form.lineWidth,
fillColor: this.form.fillColor fillColor: this.form.fillColor
}; };
this.$emit('createLine', lineModel); this.$emit('createData', lineModel);
this.initPage(); this.initPage();
}else { } else {
return false; return false;
} }
}); });
@ -128,7 +128,7 @@
lineWidth: this.form.lineWidth, lineWidth: this.form.lineWidth,
fillColor: this.form.fillColor fillColor: this.form.fillColor
}; };
this.$emit('deleteDataModel',lineModel ); this.$emit('deleteDataModel', lineModel );
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -147,10 +147,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "line_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'line_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,28 +2,28 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="旋转提示编号" prop="code"> <el-form-item label="旋转提示编号" prop="code">
<el-input :disabled="true" v-model="form.code"> <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="旋转提示宽度" prop="rotateTipWidth"> <el-form-item label="旋转提示宽度" prop="rotateTipWidth">
<el-input-number v-model="form.rotateTipWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.rotateTipWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="Y轴坐标"> <el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="提示颜色" prop="rotateTipColor"> <el-form-item label="提示颜色" prop="rotateTipColor">
<el-select v-model="form.rotateTipColor" placeholder="请选择提示颜色"> <el-select v-model="form.rotateTipColor" placeholder="请选择提示颜色">
<el-option label="红色" value="red"></el-option> <el-option label="红色" value="red" />
<el-option label="黑色" value="black"></el-option> <el-option label="黑色" value="black" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button> <el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -31,7 +31,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'KeyDraft', name: 'KeyDraft',
components: { components: {
}, },
@ -49,10 +49,10 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请输入旋转提示编号', trigger: 'blur' }, { required: true, message: '请输入旋转提示编号', trigger: 'blur' }
], ],
rotateTipWidth: [ rotateTipWidth: [
{ required: true, message: '请输入旋转提示宽度', trigger: 'blur' }, { required: true, message: '请输入旋转提示宽度', trigger: 'blur' }
], ],
rotateTipColor: [ rotateTipColor: [
{ required: true, message: '请选择按钮颜色', trigger: 'change'} { required: true, message: '请选择按钮颜色', trigger: 'change'}
@ -66,13 +66,13 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'RotateTip' ){ if (model._type === 'RotateTip' ) {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
this.form.code = model.code; this.form.code = model.code;
this.form.rotateTipWidth = model.width; this.form.rotateTipWidth = model.width;
this.form.rotateTipColor = model.color?model.color:'black'; this.form.rotateTipColor = model.color ? model.color : 'black';
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
} }
@ -83,7 +83,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if(valid) { if (valid) {
const rotateTipModel = { const rotateTipModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -95,9 +95,9 @@
width: this.form.rotateTipWidth, width: this.form.rotateTipWidth,
color: this.form.rotateTipColor color: this.form.rotateTipColor
}; };
this.$emit('createRotateTip', rotateTipModel); this.$emit('createData', rotateTipModel);
this.initPage(); this.initPage();
}else { } else {
return false; return false;
} }
}); });
@ -112,10 +112,10 @@
draggable: true, draggable: true,
_type: 'RotateTip', _type: 'RotateTip',
code: this.form.code, code: this.form.code,
width: this.form .rotateTipWidth, width: this.form.rotateTipWidth,
color: this.form.rotateTipColor color: this.form.rotateTipColor
}; };
this.$emit('deleteDataModel',rotateTipModel); this.$emit('deleteDataModel', rotateTipModel);
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -132,10 +132,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "rTip_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'rTip_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -2,22 +2,22 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="120px"> <el-form ref="form" :rules="rules" :model="form" label-width="120px">
<el-form-item label="端子编号" prop="code"> <el-form-item label="端子编号" prop="code">
<el-input :disabled="true" v-model="form.code"> <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="端子宽度" prop="terminalWidth"> <el-form-item label="端子宽度" prop="terminalWidth">
<el-input-number v-model="form.terminalWidth" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.terminalWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="Y轴坐标"> <el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button> <el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -25,7 +25,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'KeyDraft', name: 'KeyDraft',
components: { components: {
}, },
@ -42,11 +42,11 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请输入端子编号', trigger: 'blur' }, { required: true, message: '请输入端子编号', trigger: 'blur' }
], ],
terminalWidth: [ terminalWidth: [
{ required: true, message: '请输入端子宽度', trigger: 'blur' }, { required: true, message: '请输入端子宽度', trigger: 'blur' }
], ]
} }
}; };
}, },
@ -56,7 +56,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'TeleTerminal' ){ if (model._type === 'TeleTerminal' ) {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -73,7 +73,7 @@
methods: { methods: {
onSubmit(form) { onSubmit(form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid){ if (valid) {
const TerminalModel = { const TerminalModel = {
point: { point: {
x: this.form.x, x: this.form.x,
@ -82,9 +82,9 @@
draggable: true, draggable: true,
_type: 'TeleTerminal', _type: 'TeleTerminal',
code: this.form.code, code: this.form.code,
width: this.form.terminalWidth, width: this.form.terminalWidth
}; };
this.$emit('createTeleTerminal', TerminalModel); this.$emit('createData', TerminalModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -101,9 +101,9 @@
draggable: true, draggable: true,
_type: 'TeleTerminal', _type: 'TeleTerminal',
code: this.form.code, code: this.form.code,
width: this.form .terminalWidth, width: this.form.terminalWidth
}; };
this.$emit('deleteDataModel',TerminalModel); this.$emit('deleteDataModel', TerminalModel);
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -119,10 +119,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "terminal"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'terminal' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -10,13 +10,20 @@
<el-input v-model="form.context" type="textarea" /> <el-input v-model="form.context" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label="文字颜色" prop="textFill"> <el-form-item label="文字颜色" prop="textFill">
<el-input v-model="form.textFill" /> <el-color-picker v-model="form.textFill" />
</el-form-item> </el-form-item>
<el-form-item label="文字大小" prop="fontSize"> <el-form-item label="文字大小" prop="fontSize">
<el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100" /> <el-input-number v-model="form.fontSize" controls-position="right" :min="1" :max="100" />
</el-form-item> </el-form-item>
<el-form-item label="文字粗细" prop="fontWeight"> <el-form-item label="文字粗细" prop="fontWeight">
<el-input-number v-model="form.fontWeight" controls-position="right" :min="1" /> <el-select v-model="form.fontWeight">
<el-option
v-for="item in fontWeightList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1" /> <el-input-number v-model="form.x" controls-position="right" :min="1" />
@ -24,24 +31,6 @@
<el-form-item label="Y轴坐标"> <el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1" /> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<!--<el-form-item label="文字背景">-->
<!--<el-switch v-model="form.hasRect" @change="handleChange"></el-switch>-->
<!--</el-form-item>-->
<!--<el-form-item v-show="form.hasRect" label="背景X轴坐标">-->
<!--<el-input-number v-model="form.xBg" controls-position="right" :min="0"></el-input-number>-->
<!--</el-form-item>-->
<!--<el-form-item v-show="form.hasRect" label="背景Y轴坐标">-->
<!--<el-input-number v-model="form.yBg" controls-position="right" :min="0"></el-input-number>-->
<!--</el-form-item>-->
<!--<el-form-item v-show="form.hasRect" label="背景宽度">-->
<!--<el-input-number v-model="form.bgWidth" controls-position="right" :min="1"></el-input-number>-->
<!--</el-form-item>-->
<!--<el-form-item v-show="form.hasRect" label="背景高度">-->
<!--<el-input-number v-model="form.bgHeight" controls-position="right" :min="1"></el-input-number>-->
<!--</el-form-item>-->
<!--<el-form-item v-show="form.hasRect" label="背景颜色" prop="elevatorColor">-->
<!--<el-color-picker v-model="form.textBackgroundColor"></el-color-picker>-->
<!--</el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
@ -61,6 +50,17 @@ export default {
isUpdate: false, isUpdate: false,
buttonText: '立即创建', buttonText: '立即创建',
showDeleteButton: false, showDeleteButton: false,
fontWeightList: [
{ label: '100', value: '100' },
{ label: '200', value: '200' },
{ label: '300', value: '300' },
{ label: '400', value: '400' },
{ label: '500', value: '500' },
{ label: '600', value: '600' },
{ label: '700', value: '700' },
{ label: '800', value: '800' },
{ label: '900', value: '900' }
],
form: { form: {
code: '', code: '',
context: '', context: '',
@ -69,12 +69,6 @@ export default {
fontWeight: '', fontWeight: '',
x: 10, x: 10,
y: 10 y: 10
// hasRect: false,
// xBg: 10,
// yBg: 10,
// bgWidth: 0,
// bgHeight: 0,
// textBackgroundColor: ''
}, },
rules: { rules: {
code: [ code: [
@ -112,12 +106,6 @@ export default {
this.form.fontWeight = model.fontWeight; this.form.fontWeight = model.fontWeight;
this.form.x = model.point.x; this.form.x = model.point.x;
this.form.y = model.point.y; this.form.y = model.point.y;
// this.form.hasRect = model.hasRect;
// this.form.xBg = model.textRect ? model.textRect.x : 10;
// this.form.yBg = model.textRect ? model.textRect.y : 10;
// this.form.bgWidth = model.textRect ? model.textRect.width : 0;
// this.form.bgHeight = model.textRect ? model.textRect.height : 0;
// this.form.textBackgroundColor = model.textRect ? model.textRect.textBackgroundColor : '';
} }
} }
}, },
@ -139,17 +127,8 @@ export default {
fontSize: this.form.fontSize, fontSize: this.form.fontSize,
fontWeight: this.form.fontWeight, fontWeight: this.form.fontWeight,
fontFamily: 'consolas' fontFamily: 'consolas'
// hasRect: this.form.hasRect,
// textRect: this.form.hasRect ?
// {
// x: this.form.xBg,
// y: this.form.yBg,
// width: this.form.bgWidth,
// height: this.form.bgHeight
// }:'',
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
}; };
this.$emit('createText', textModel); this.$emit('createData', textModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -171,15 +150,6 @@ export default {
fontSize: this.form.fontSize, fontSize: this.form.fontSize,
fontWeight: this.form.fontWeight, fontWeight: this.form.fontWeight,
fontFamily: 'consolas' fontFamily: 'consolas'
// hasRect: this.form.hasRect,
// textRect: this.form.hasRect ?
// {
// x: this.form.xBg,
// y: this.form.yBg,
// width: this.form.bgWidth,
// height: this.form.bgHeight
// }:'',
// textBackgroundColor: this.form.hasRect?this.form.textBackgroundColor: ''
}; };
this.$emit('deleteDataModel', textModel); this.$emit('deleteDataModel', textModel);
this.initPage(); this.initPage();

View File

@ -2,37 +2,37 @@
<div> <div>
<el-form ref="form" :rules="rules" :model="form" label-width="100px"> <el-form ref="form" :rules="rules" :model="form" label-width="100px">
<el-form-item label="矩形编号" prop="code"> <el-form-item label="矩形编号" prop="code">
<el-input :disabled="true" v-model="form.code" > <el-input v-model="form.code" :disabled="true">
<el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button> <el-button slot="append" :disabled="isUpdate" type="primary" @click="generateCode">生成编号</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="矩形宽度" prop="tipBoxWidth"> <el-form-item label="矩形宽度" prop="tipBoxWidth">
<el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" ></el-input-number> <el-input-number v-model="form.tipBoxWidth" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="矩形高度" prop="tipBoxHeight"> <el-form-item label="矩形高度" prop="tipBoxHeight">
<el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" ></el-input-number> <el-input-number v-model="form.tipBoxHeight" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="填充颜色" prop="fillColor"> <el-form-item label="填充颜色" prop="fillColor">
<el-color-picker v-model="form.fillColor"></el-color-picker> <el-color-picker v-model="form.fillColor" />
</el-form-item> </el-form-item>
<el-form-item label="填充透明颜色"> <el-form-item label="填充透明颜色">
<el-switch v-model="opacity"></el-switch> <el-switch v-model="opacity" />
</el-form-item> </el-form-item>
<el-form-item label="边框线宽" prop="lineWidth"> <el-form-item label="边框线宽" prop="lineWidth">
<el-input-number v-model="form.lineWidth" controls-position="right" :min="0" ></el-input-number> <el-input-number v-model="form.lineWidth" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="边线颜色" prop="stroke"> <el-form-item label="边线颜色" prop="stroke">
<el-color-picker v-model="form.stroke"></el-color-picker> <el-color-picker v-model="form.stroke" />
</el-form-item> </el-form-item>
<el-form-item label="X轴坐标"> <el-form-item label="X轴坐标">
<el-input-number v-model="form.x" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.x" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item label="Y轴坐标"> <el-form-item label="Y轴坐标">
<el-input-number v-model="form.y" controls-position="right" :min="1"></el-input-number> <el-input-number v-model="form.y" controls-position="right" :min="1" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button> <el-button type="primary" @click="onSubmit('form')">{{ buttonText }}</el-button>
<el-button v-show="showDeleteButton" @click="deleteDevice" type="danger">删除</el-button> <el-button v-show="showDeleteButton" type="danger" @click="deleteDevice">删除</el-button>
<el-button v-show="showDeleteButton" @click="initPage">取消</el-button> <el-button v-show="showDeleteButton" @click="initPage">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -41,7 +41,7 @@
<script> <script>
export default { export default {
name: 'TextDraft', name: 'TextDraft',
components: { components: {
}, },
@ -63,16 +63,16 @@
}, },
rules: { rules: {
code: [ code: [
{ required: true, message: '请输入提示框编号', trigger: 'blur' }, { required: true, message: '请输入提示框编号', trigger: 'blur' }
], ],
tipBoxWidth: [ tipBoxWidth: [
{ required: true, message: '请输入提示框宽度', trigger: 'blur' }, { required: true, message: '请输入提示框宽度', trigger: 'blur' }
], ],
tipBoxHeight: [ tipBoxHeight: [
{ required: true, message: '请输入提示框高度', trigger: 'blur' }, { required: true, message: '请输入提示框高度', trigger: 'blur' }
], ],
fillColor: [ fillColor: [
{ required: true, message: '请输入提示框颜色', trigger: 'blur' }, { required: true, message: '请输入提示框颜色', trigger: 'blur' }
] ]
} }
}; };
@ -83,7 +83,7 @@
watch: { watch: {
'$store.state.ibp.rightClickCount': function (val) { '$store.state.ibp.rightClickCount': function (val) {
const model = this.$store.getters['ibp/updateDeviceData']; const model = this.$store.getters['ibp/updateDeviceData'];
if (model._type === 'TipBox' ){ if (model._type === 'TipBox' ) {
this.buttonText = '修改'; this.buttonText = '修改';
this.showDeleteButton = true; this.showDeleteButton = true;
this.isUpdate = true; this.isUpdate = true;
@ -119,7 +119,7 @@
lineWidth: this.form.lineWidth, lineWidth: this.form.lineWidth,
stroke: this.form.stroke stroke: this.form.stroke
}; };
this.$emit('createTipBox', tipBoxModel); this.$emit('createData', tipBoxModel);
this.initPage(); this.initPage();
} else { } else {
return false; return false;
@ -142,7 +142,7 @@
lineWidth: this.form.lineWidth, lineWidth: this.form.lineWidth,
stroke: this.form.stroke stroke: this.form.stroke
}; };
this.$emit('deleteDataModel',tipBoxModel); this.$emit('deleteDataModel', tipBoxModel);
this.initPage(); this.initPage();
}, },
initPage() { initPage() {
@ -163,10 +163,10 @@
}, },
generateCode() { generateCode() {
const mydate = new Date(); const mydate = new Date();
this.form.code = "tipBox_"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000); this.form.code = 'tipBox_' + mydate.getDay() + mydate.getHours() + mydate.getMinutes() + mydate.getSeconds() + mydate.getMilliseconds() + Math.round(Math.random() * 10000);
} }
} }
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -2,153 +2,28 @@
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="map-control"> <div class="map-control">
<div class="clearfix"> <div class="clearfix">
<div style="float: left;padding-top: 17px;">
<span style="padding-top: 5px;">{{ $t('ibp.stationName') }}</span> <span style="padding-top: 5px;">{{ $t('ibp.stationName') }}</span>
<el-select v-model="stationCode" :placeholder="this.$t('rules.selectStation')" style="padding-top: 5px;" @change="changeStationCode"> <span>{{ stationCode }}</span>
</div>
<!-- <el-select v-model="stationCode" :placeholder="this.$t('rules.selectStation')" style="padding-top: 5px;" @change="changeStationCode">
<el-option <el-option
v-for="item in stationOptions" v-for="item in stationOptions"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
<el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button> <el-button type="text" style="float: right; padding: 15px 0; margin-right: 5px;" @click="handleSave">{{ $t('ibp.save') }}</el-button>
</div> </div>
<el-tabs v-model="enabledTab" class="ibpEdit" type="card" @tab-click="handleTabClick"> <el-tabs v-model="enabledTab" class="ibpEdit" type="card" @tab-click="handleTabClick">
<el-tab-pane :label="this.$t('ibp.background')" name="Background"> <el-tab-pane v-for="(each, index) in tabList" :key="index" :label="each.label" :name="each.name">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }"> <el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-bg <component
ref="background" :is="each.menus"
:ref="each.name"
style="width:90%" style="width:90%"
@updateBg="createDataModel" @createData="createDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.line')" name="IbpLine">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-line
ref="ibpline"
style="width:90%"
@createLine="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.text')" name="IbpText">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-text
ref="ibptext"
style="width:90%"
@createText="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.rect')" name="TipBox">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-tip-box
ref="tipbox"
style="width:90%"
@createTipBox="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.button')" name="SquareButton">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-button
ref="squarebutton"
style="width:90%"
@createButton="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.circularLamp')" name="CircularLamp">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-lamp
ref="circularlamp"
style="width:90%"
@createLamp="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.arrow')" name="Arrow">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-arrow
ref="arrow"
style="width:90%"
@createArrow="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.escalatorFrame')" name="AppendageBox">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-appendage-box
ref="appendagebox"
style="width:90%"
@createAppendageBox="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.alarm')" name="Alarm">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-alarm
ref="alarm"
style="width:90%"
@createAlarm="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.telephoneTerminal')" name="TeleTerminal">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-telephone-terminal
ref="teleTerminal"
style="width:90%"
@createTeleTerminal="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.escalator')" name="Elevator">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-elevator
ref="elevator"
style="width:90%"
@createElevator="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.key')" name="Key">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-key
ref="key"
style="width:90%"
@createKey="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.digitalClock')" name="Clock">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-clock
ref="clock"
style="width:90%"
@createClock="createDataModel"
@deleteDataModel="deleteDataModel"
/>
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="this.$t('ibp.rotateTip')" name="RotateTip">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: height+'px' }">
<ibp-rotate-tip
ref="rotateTip"
style="width:90%"
@createRotateTip="createDataModel"
@deleteDataModel="deleteDataModel" @deleteDataModel="deleteDataModel"
/> />
</el-scrollbar> </el-scrollbar>
@ -200,32 +75,34 @@ export default {
data() { data() {
return { return {
enabledTab: 'Background', enabledTab: 'Background',
lazy: true,
tabList:[
{ label: this.$t('ibp.background'), name:'Background', menus: IbpBg },
{ label: this.$t('ibp.line'), name:'IbpLine', menus: IbpLine },
{ label: this.$t('ibp.text'), name:'IbpText', menus: IbpText },
{ label: this.$t('ibp.rect'), name:'TipBox', menus: IbpTipBox },
{ label: this.$t('ibp.button'), name:'SquareButton', menus: IbpButton },
{ label: this.$t('ibp.circularLamp'), name:'CircularLamp', menus: IbpLamp },
{ label: this.$t('ibp.arrow'), name:'Arrow', menus: IbpArrow },
{ label: this.$t('ibp.escalatorFrame'), name:'AppendageBox', menus: IbpAppendageBox },
{ label: this.$t('ibp.alarm'), name:'Alarm', menus: IbpAlarm },
{ label: this.$t('ibp.telephoneTerminal'), name:'TeleTerminal', menus: IbpTelephoneTerminal },
{ label: this.$t('ibp.escalator'), name:'Elevator', menus: IbpElevator },
{ label: this.$t('ibp.key'), name:'Key', menus: IbpKey },
{ label: this.$t('ibp.digitalClock'), name:'Clock', menus: IbpClock },
{ label: this.$t('ibp.rotateTip'), name:'RotateTip', menus: IbpRotateTip }
],
data: '', data: '',
stationOptions:[], stationOptions:[],
// stationOptions:[
// {
// value: 'Station_203_0.07533',
// // label: ''
// label: ''
// },
// {
// value: 'Station_207_0.62282',
// // label: ''
// label: ''
// },
// {
// value: 'Station_209_0.95175',
// label: ''
// // label: ''
// }
// ],
// drawData: {},
// stationCode: '',
height: this.$store.state.app.height - 190 height: this.$store.state.app.height - 190
}; };
}, },
computed:{ computed:{
stationCode() { stationCode() {
if (this.stationOptions.length) {
const obj = this.stationOptions.find(ele => ele.value == this.$route.query.stationCode);
return obj.label;
}
return this.$route.query.stationCode; return this.$route.query.stationCode;
} }
}, },
@ -254,9 +131,6 @@ export default {
} catch (error) { } catch (error) {
console.log('error', error); console.log('error', error);
} }
},
beforeDestroy() {
}, },
methods: { methods: {
createDataModel(model) { createDataModel(model) {
@ -278,31 +152,35 @@ export default {
} }
}, },
setIbpShow(data) { setIbpShow(data) {
if (data) {
this.$emit('set-ibp-show', data); this.$emit('set-ibp-show', data);
}
this.handleTabClick(); this.handleTabClick();
}, },
setEmptyShow() { setEmptyShow() {
this.$emit('set-empty-show'); this.$emit('set-empty-show');
}, },
changeStationCode(e) { // changeStationCode(e) {
this.$emit('ibpChange', e); // this.$emit('ibpChange', e);
this.handleTabClick(); // this.handleTabClick();
}, // },
handleTabClick() { handleTabClick() {
this.$refs.ibpline.initPage(); this.$nextTick(() => {
this.$refs.ibptext.initPage(); this.$refs.IbpLine[0].initPage();
this.$refs.tipbox.initPage(); this.$refs.IbpText[0].initPage();
this.$refs.squarebutton.initPage(); this.$refs.TipBox[0].initPage();
this.$refs.circularlamp.initPage(); this.$refs.SquareButton[0].initPage();
this.$refs.arrow.initPage(); this.$refs.CircularLamp[0].initPage();
this.$refs.appendagebox.initPage(); this.$refs.Arrow[0].initPage();
this.$refs.alarm.initPage(); this.$refs.AppendageBox[0].initPage();
this.$refs.elevator.initPage(); this.$refs.Alarm[0].initPage();
this.$refs.key.initPage(); this.$refs.Elevator[0].initPage();
this.$refs.teleTerminal.initPage(); this.$refs.Key[0].initPage();
this.$refs.clock.initPage(); this.$refs.TeleTerminal[0].initPage();
this.$refs.rotateTip.initPage(); this.$refs.Clock[0].initPage();
this.$refs.background.initPage(); this.$refs.RotateTip[0].initPage();
this.$refs.Background[0].initPage();
});
} }
} }
}; };
@ -317,6 +195,7 @@ export default {
.clearfix{ .clearfix{
height: 50px; height: 50px;
padding: 0 22px; padding: 0 22px;
overflow: hidden;
} }
.ibpEdit{ .ibpEdit{
height: calc(100% - 50px); height: calc(100% - 50px);

View File

@ -167,6 +167,7 @@ export default {
}, },
setIbp(data, oldData) { setIbp(data, oldData) {
this.$ibp.setIbp(oldData, data); this.$ibp.setIbp(oldData, data);
this.$store.dispatch('ibp/setIbpData', oldData);
}, },
handleBanOpenScreenDoorStatus() { handleBanOpenScreenDoorStatus() {
this.$store.state.ibp.ibp['keyList'].forEach(item => { this.$store.state.ibp.ibp['keyList'].forEach(item => {

View File

@ -30,9 +30,12 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="通知选择:" prop="noticeType"> <el-form-item label="通知选择:" prop="noticeType">
<el-radio-group v-model="messageModel.noticeType"> <el-checkbox-group v-model="messageModel.noticeType">
<el-checkbox v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-checkbox>
</el-checkbox-group>
<!-- <el-radio-group v-model="messageModel.noticeType">
<el-radio v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="(item, index) in regionList" :key="index" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group> </el-radio-group> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -60,7 +63,7 @@ export default {
type: '', type: '',
subject: '', subject: '',
content: '', content: '',
noticeType: '01' noticeType: []
}, },
rules: { rules: {
type: [ type: [
@ -71,10 +74,10 @@ export default {
], ],
content:[ content:[
{ required: true, message: this.$t('rules.enterTheNewsContent'), trigger: 'blur' } { required: true, message: this.$t('rules.enterTheNewsContent'), trigger: 'blur' }
],
noticeType: [
{ required: true, message: this.$t('rules.chooseNewsCanBeClosed'), trigger: 'change' }
] ]
// noticeType: [
// { required: true, message: this.$t('rules.chooseNewsCanBeClosed'), trigger: 'change' }
// ]
} }
}; };
}, },

Binary file not shown.