|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<el-dialog :title="mode=='add'?'新增':'编辑'" :visible.sync="dialogVisible" width="800px" append-to-body :close-on-click-modal="false"> |
|
|
<el-dialog :title="calcTitle" :visible.sync="dialogVisible" width="800px" append-to-body :close-on-click-modal="false"> |
|
|
<!-- <div style="color:#fff"> |
|
|
<!-- <div style="color:#fff"> |
|
|
<p>类型:{{type}} 增删改类型:{{mode}}</p> |
|
|
<p>类型:{{type}} 增删改类型:{{mode}}</p> |
|
|
<p>模板id:{{ tpl }}</p> |
|
|
<p>模板id:{{ tpl }}</p> |
|
@ -57,7 +57,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="字体类型"> |
|
|
<el-form-item label="字体类型"> |
|
|
<el-select v-model="dataForm.fontFamily" placeholder="请选择"> |
|
|
<el-select v-model="dataForm.fontType" placeholder="请选择"> |
|
|
<el-option v-for="item in fontTypeList" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictValue"> |
|
|
<el-option v-for="item in fontTypeList" :key="item.dictLabel" :label="item.dictLabel" :value="item.dictValue"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
@ -90,7 +90,7 @@ |
|
|
</el-card> |
|
|
</el-card> |
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button @click="dataFormSubmitHandle" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button> |
|
|
<el-button @click="onSubmit" v-loading="loading" style="background-color: #10aac2;color:#fff;">确认</el-button> |
|
|
<el-button style="background-color:#b5b5b6;color:#fff" @click="onClose">取消</el-button> |
|
|
<el-button style="background-color:#b5b5b6;color:#fff" @click="onClose">取消</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -144,7 +144,7 @@ export default { |
|
|
content:"", |
|
|
content:"", |
|
|
fontColor:"", |
|
|
fontColor:"", |
|
|
fontSize:"", |
|
|
fontSize:"", |
|
|
fontFamily:"", |
|
|
fontType:"", |
|
|
stopTime:"", |
|
|
stopTime:"", |
|
|
inScreenMode:"", |
|
|
inScreenMode:"", |
|
|
screenSize:"" |
|
|
screenSize:"" |
|
@ -160,7 +160,6 @@ export default { |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
fontTypeList: [], |
|
|
|
|
|
screenSizeOptions: [], |
|
|
screenSizeOptions: [], |
|
|
colorList: [], |
|
|
colorList: [], |
|
|
isCurrencyOptions: [ |
|
|
isCurrencyOptions: [ |
|
@ -192,7 +191,7 @@ export default { |
|
|
infoType: '', |
|
|
infoType: '', |
|
|
devicePixelBoolean: false, |
|
|
devicePixelBoolean: false, |
|
|
categoryRules: false, |
|
|
categoryRules: false, |
|
|
tplDefault: { |
|
|
deviceCttDefault: { |
|
|
"residenceTime": "50", |
|
|
"residenceTime": "50", |
|
|
"intonation": "0", |
|
|
"intonation": "0", |
|
|
"fontSpacing": "1", |
|
|
"fontSpacing": "1", |
|
@ -252,11 +251,23 @@ export default { |
|
|
BoardPreview, BoardTplPreview |
|
|
BoardPreview, BoardTplPreview |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
|
|
|
calcTitle(){ |
|
|
|
|
|
let str = ''; |
|
|
|
|
|
if(this.mode=="toDevice"){ |
|
|
|
|
|
str = `从模板添加设备信息`; |
|
|
|
|
|
}else{ |
|
|
|
|
|
str = `${this.mode == 'add' ? '新增' : '编辑'}${this.type == 'template' ? '信息模板' : '设备信息'}` |
|
|
|
|
|
} |
|
|
|
|
|
return str; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
visible:{ |
|
|
visible:{ |
|
|
handler(newV){ |
|
|
handler(newV){ |
|
|
this.dialogVisible = newV; |
|
|
this.dialogVisible = newV; |
|
|
|
|
|
if(this.$refs.dataForm){ |
|
|
|
|
|
this.$refs.dataForm.clearValidate(); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
immediate:true |
|
|
immediate:true |
|
|
}, |
|
|
}, |
|
@ -281,10 +292,6 @@ export default { |
|
|
mounted() { |
|
|
mounted() { |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.getDicts('iot_device_font_type').then(res => { |
|
|
|
|
|
this.fontTypeList = res.data |
|
|
|
|
|
// console.log(this.fontTypeList, "字体类型"); |
|
|
|
|
|
}) |
|
|
|
|
|
this.getDicts('iot_devices_font_color').then(res => { |
|
|
this.getDicts('iot_devices_font_color').then(res => { |
|
|
this.colorList = res.data; |
|
|
this.colorList = res.data; |
|
|
// console.log(this.colorList, "字体颜色"); |
|
|
// console.log(this.colorList, "字体颜色"); |
|
@ -315,25 +322,25 @@ export default { |
|
|
content: "", |
|
|
content: "", |
|
|
fontColor: this.colorList[0].dictValue, |
|
|
fontColor: this.colorList[0].dictValue, |
|
|
fontSize: this.fontSizeList[0].dictValue, |
|
|
fontSize: this.fontSizeList[0].dictValue, |
|
|
fontFamily: this.fontTypeList[0].dictValue, |
|
|
fontType: this.fontTypeList[0].dictValue, |
|
|
stopTime: 5, |
|
|
stopTime: 5, |
|
|
inScreenMode: this.inScreenModeList[0].dictValue, |
|
|
inScreenMode: this.inScreenModeList[0].dictValue, |
|
|
screenSize: this.screenSize |
|
|
screenSize: this.screenSize |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
tempTpl = _.merge(this.tplDefault, this.tpl.origin); //首页弹窗,新增设备项时,需要传设备尺寸过来 |
|
|
tempTpl = _.merge(this.deviceCttDefault, this.tpl.origin); //首页弹窗,新增设备项时,需要传设备尺寸过来 |
|
|
} |
|
|
} |
|
|
this.dataForm = infoBoardUtils.dialogSourceFormat(tempTpl, this.type, this.mode); |
|
|
this.dataForm = infoBoardUtils.dialogSourceFormat(tempTpl, this.type, this.mode); |
|
|
}else{ |
|
|
}else{ |
|
|
this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type, this.mode, this.tplDefault); |
|
|
this.dataForm = infoBoardUtils.dialogSourceFormat(this.tpl, this.type, this.mode, this.deviceCttDefault); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onClose(){ |
|
|
onClose(){ |
|
|
this.dialogVisible = false; |
|
|
this.dialogVisible = false; |
|
|
}, |
|
|
}, |
|
|
// 表单提交 |
|
|
// 表单提交 |
|
|
async dataFormSubmitHandle() { |
|
|
async onSubmit() { |
|
|
if (!this.dataForm.content.trim()) { |
|
|
if (!this.dataForm.content.trim()) { |
|
|
return this.$modal.msgError('当前输入内容为空') |
|
|
return this.$modal.msgError('当前输入内容为空') |
|
|
} |
|
|
} |
|
@ -437,7 +444,6 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}else if (this.mode == "toDevice") { |
|
|
}else if (this.mode == "toDevice") { |
|
|
this.loading = false |
|
|
this.loading = false |
|
|
|
|
|
|
|
|
this.$emit("afterSubmit", { type: this.type, mode: this.mode, data: data }); |
|
|
this.$emit("afterSubmit", { type: this.type, mode: this.mode, data: data }); |
|
|
} else { |
|
|
} else { |
|
|
addTemplate(data).then(res => { |
|
|
addTemplate(data).then(res => { |
|
|