济菏高速业务端
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.
 
 
 
 
 

73 lines
2.2 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){
let data1
if(type=='template'){
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime*0.1
}
else{
data1 = {
formatStyle: data.horizontalAlignment,
content: data.textContent,
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) {
let data1;
if (type == 'template') {
data1 = _.cloneDeep(data);
data1.stopTime = data1.stopTime * 10 + "";
} else {
let temp = {
horizontalAlignment : data.formatStyle,
textContent : data.content,
foregroundColor: data.fontColor.toLowerCase(),
fontSize: data.fontSize,
font: data.fontFamily,
residenceTime : data.stopTime,
screenEntryMethod : data.inScreenMode
}
data1 = _.merge(data.origin, temp);
}
return data1;
},
templateToDevice(data) {
return {
}
}
}