修改模版按钮显示

dev
suixy 2 days ago
parent 607d81252a
commit e3dfaf1960

@ -424,10 +424,15 @@ const insertText = (e) => {
font-size: 16px;
}
}
/deep/ .t-button--theme-warning {
border-color: var(--td-warning-color-hover);
background-color: var(--td-warning-color-hover);
}
</style>
<style>
.umo-footer {
position: sticky;
bottom: 0px;
}
</style>
</style>

@ -19,8 +19,6 @@ const template = ref({});
const editorRef = ref();
const fieldList = ref([]);
let templateData = {};
const options = ref({
document: {
@ -100,7 +98,7 @@ const rowRenderTemplate = (str, index) => {
if (arr.length > 0) {
arr[0] = `#{${arr[0]}}`;
}
return arr.reduce((o, k) => o?.[k], templateData) ?? ' ';
return arr.reduce((o, k) => o?.[k], templateData) || ' ';
});
return res;
};
@ -136,7 +134,7 @@ const fillRowData = (e, index) => {
return fillRowData(item, index);
});
} else {
e.text = rowRenderTemplate(e.text || '', index);
e.text = rowRenderTemplate(e.text || ' ', index);
}
return e;
};
@ -172,7 +170,7 @@ const fillData = (e) => {
return fillData(item);
});
} else {
e.text = renderTemplate(e.text || '', templateData);
e.text = renderTemplate(e.text || ' ', templateData);
}
}
return e;
@ -206,7 +204,7 @@ onMounted(async () => {
templateData = {};
assignData.forEach((item) => {
// templateData[extractPlaceholders(item.varName)] = item.varValue;
templateData[item.varName] = item.varValue;
templateData[item.varName] = item.varValue || ' ';
});
// console.log(templateData);
getPrintTemplate(route.query.templateId).then((e) => {
@ -214,46 +212,12 @@ onMounted(async () => {
const editor = editorRef.value;
const docData = JSON.parse(e.data.templateData || '{}');
const data = fillData(docData);
// console.log(data);
// console.log(JSON.parse(e.data.templateData || '{}'));
// editor.setContent(JSON.parse(e.data.templateData || '{}'));
editor.setContent(data);
});
});
</script>
<style scoped>
.title {
width: 100%;
line-height: 40px;
font-size: 14px;
color: #666;
text-align: center;
}
.fieldList {
width: 100%;
height: calc(100vh - 50px - 34px - 40px);
overflow-y: auto;
.fieldItem {
width: 80%;
font-size: 12px;
padding-left: 15px;
color: #333;
cursor: pointer;
.btn {
padding: 10px;
&:hover {
background-color: #eee;
border-radius: 10px;
}
}
}
}
/deep/ .umo-toolbar-actions.ribbon {
display: none !important;
}
@ -265,6 +229,10 @@ onMounted(async () => {
/deep/ .umo-status-bar-left .umo-button:nth-child(5) {
display: none;
}
/deep/ .t-button--theme-warning{
border-color: var(--td-warning-color-hover);
background-color: var(--td-warning-color-hover);
}
</style>
<style>
.umo-footer {

Loading…
Cancel
Save