|
@ -101,6 +101,7 @@ |
|
|
:key="item.dictValue" |
|
|
:key="item.dictValue" |
|
|
:label="item.dictLabel" |
|
|
:label="item.dictLabel" |
|
|
:value="item.dictValue" |
|
|
:value="item.dictValue" |
|
|
|
|
|
v-if="+(item.dictValue.replace('px',''))<=maxFontSize" |
|
|
> |
|
|
> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
@ -191,6 +192,7 @@ import { debounce } from "lodash"; |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
maxFontSize:100, |
|
|
alignmentNum: 2, |
|
|
alignmentNum: 2, |
|
|
content: "", |
|
|
content: "", |
|
|
boardWidth: "", |
|
|
boardWidth: "", |
|
@ -316,6 +318,17 @@ export default { |
|
|
speechSpeed: "0", |
|
|
speechSpeed: "0", |
|
|
font: "3", |
|
|
font: "3", |
|
|
}, |
|
|
}, |
|
|
|
|
|
templateDefault: { |
|
|
|
|
|
category: "", |
|
|
|
|
|
formatStyle: "2", |
|
|
|
|
|
content: "", |
|
|
|
|
|
fontColor: "", |
|
|
|
|
|
fontSize: "", |
|
|
|
|
|
fontType: "", |
|
|
|
|
|
stopTime: 50, |
|
|
|
|
|
inScreenMode: "", |
|
|
|
|
|
screenSize: "", |
|
|
|
|
|
}, |
|
|
isLocked: false, |
|
|
isLocked: false, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
@ -361,6 +374,26 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
|
|
|
screenSize(newV){ |
|
|
|
|
|
|
|
|
|
|
|
if(newV){ |
|
|
|
|
|
let boardH = newV.split("*")[1]; |
|
|
|
|
|
let fontSize = "20"; |
|
|
|
|
|
if (['64', '48'].includes(boardH)) { |
|
|
|
|
|
this.maxFontSize = +boardH |
|
|
|
|
|
fontSize = boardH + "" |
|
|
|
|
|
} else if (['80'].includes(boardH)) { |
|
|
|
|
|
this.maxFontSize = +boardH / 2 |
|
|
|
|
|
fontSize = +boardH / 2 + "" |
|
|
|
|
|
} else if (['160'].includes(boardH)) { |
|
|
|
|
|
this.maxFontSize = +boardH / 2 |
|
|
|
|
|
fontSize = +boardH / 4 + "" |
|
|
|
|
|
} |
|
|
|
|
|
this.deviceCttDefault.fontSize = fontSize |
|
|
|
|
|
this.templateDefault.screenSize = newV; |
|
|
|
|
|
this.templateDefault.fontSize = fontSize; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
visible: { |
|
|
visible: { |
|
|
handler(newV) { |
|
|
handler(newV) { |
|
|
this.dialogVisible = newV; |
|
|
this.dialogVisible = newV; |
|
@ -400,21 +433,30 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
created() { |
|
|
created() { |
|
|
|
|
|
this.templateDefault.fontType = this.fontTypeList[0].dictValue //设置模板的默认值 |
|
|
this.getDicts("iot_devices_font_color").then((res) => { |
|
|
this.getDicts("iot_devices_font_color").then((res) => { |
|
|
this.colorList = res.data; |
|
|
this.colorList = res.data; |
|
|
|
|
|
this.templateDefault.fontColor = this.colorList[0].dictValue |
|
|
// console.log(this.colorList, "字体颜色"); |
|
|
// console.log(this.colorList, "字体颜色"); |
|
|
}); |
|
|
}); |
|
|
this.getDicts("iot_device_font_inScreen_mode").then((res) => { |
|
|
this.getDicts("iot_device_font_inScreen_mode").then((res) => { |
|
|
this.inScreenModeList = res.data; |
|
|
this.inScreenModeList = res.data; |
|
|
|
|
|
this.templateDefault.inScreenMode = this.inScreenModeList[0].dictValue |
|
|
// console.log(this.inScreenModeList, "入屏方式"); |
|
|
// console.log(this.inScreenModeList, "入屏方式"); |
|
|
}); |
|
|
}); |
|
|
this.getDicts("iot_template_category").then((res) => { |
|
|
this.getDicts("iot_template_category").then((res) => { |
|
|
this.templateCategoryList = res.data; |
|
|
this.templateCategoryList = res.data; |
|
|
|
|
|
this.templateDefault.category = this.templateCategoryList[0].dictValue |
|
|
}); |
|
|
}); |
|
|
this.getDicts("iot_device_font_size").then((res) => { |
|
|
this.getDicts("iot_device_font_size").then((res) => { |
|
|
this.fontSizeList = res.data; |
|
|
this.fontSizeList = res.data; |
|
|
|
|
|
// this.templateDefault.fontSize = this.fontSizeList[0].dictValue |
|
|
// this.dataForm.FONT_SIZE = res.data[1].dictValue |
|
|
// this.dataForm.FONT_SIZE = res.data[1].dictValue |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
initData() { |
|
|
initData() { |
|
@ -433,17 +475,7 @@ export default { |
|
|
if (this.mode == "add") { |
|
|
if (this.mode == "add") { |
|
|
let tempTpl = null; |
|
|
let tempTpl = null; |
|
|
if (this.type == "template") { |
|
|
if (this.type == "template") { |
|
|
tempTpl = { |
|
|
tempTpl = _.merge({}, this.templateDefault, this.tpl); |
|
|
category: this.templateCategoryList[0].dictValue, |
|
|
|
|
|
formatStyle: 0, |
|
|
|
|
|
content: "", |
|
|
|
|
|
fontColor: this.colorList[0].dictValue, |
|
|
|
|
|
fontSize: this.fontSizeList[0].dictValue, |
|
|
|
|
|
fontType: this.fontTypeList[0].dictValue, |
|
|
|
|
|
stopTime: 50, |
|
|
|
|
|
inScreenMode: this.inScreenModeList[0].dictValue, |
|
|
|
|
|
screenSize: this.screenSize, |
|
|
|
|
|
}; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
tempTpl = _.merge({}, this.deviceCttDefault, this.tpl.origin); //首页弹窗,新增设备项时,需要传设备尺寸过来 |
|
|
tempTpl = _.merge({}, this.deviceCttDefault, this.tpl.origin); //首页弹窗,新增设备项时,需要传设备尺寸过来 |
|
|
} |
|
|
} |
|
|