济菏高速业务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

79 lines
2.6 KiB

import Vue from 'vue';
export default {
deviceFontToEdit(font){
//字体转换
// ["SimSun", "KaiTi", "SimHei", "FangSong", "LiSu"]
// let idx = 0;
// const arr = ["宋体", "楷体", ["黑体","微软雅黑"], "仿宋", "隶书"];
// arr.forEach((item,index)=>{
// if(item.includes(font)){
// idx = index;
// return
// }
// });
// return idx+'';
let fontTypeList = Vue.prototype.fontTypeList;
fontTypeList.forEach(item => {
// if(item.)
});
return "SimHei"
},
editFontToDevice(){
let fontTypeList = Vue.prototype.fontTypeList;
fontTypeList.forEach(item => {
// if(item.)
});
return "黑体"
},
dialogSourceFormat(data, type, mode, tplDefault){
let data1
if(type=='template'){
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime*0.1
if(mode=="toDevice"){
// data.origin = tplDefault;
data.origin = _.merge(tplDefault, data.origin);
}
}
else{
data1 = {
// formatStyle: data.horizontalAlignment,
formatStyle: data.verticalAlignment,
content: data.textContent.replaceAll('\\,', ',').replaceAll('\\=', '=').replaceAll('\\\\n', '\n'),
fontColor: data.foregroundColor.toUpperCase(),
fontSize: data.fontSize.replace("px",""),
// fontFamily: this.deviceFontToEdit(data.font),
fontFamily: data.font,
stopTime: data.residenceTime,
inScreenMode: data.screenEntryMethod,
origin: data
}
}
return data1
},
dialogSaveFormat(data, type, mode) {
let data1;
if (type == 'template' && mode!=='toDevice') {
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime * 10 + "";
} else {
let temp = {
// horizontalAlignment : data.formatStyle,
verticalAlignment : data.formatStyle,
textContent : data.content,
foregroundColor: data.fontColor.toLowerCase(),
fontSize: data.fontSize.replace("px", ""),
font: data.fontFamily,
residenceTime : data.stopTime,
screenEntryMethod : data.inScreenMode
}
data1 = _.merge(data.origin, temp);
}
return data1;
},
templateToDevice(data) {
return {
}
}
}