修改模版按钮显示

dev
suixy 4 weeks ago
parent 607d81252a
commit e3dfaf1960

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

@ -19,8 +19,6 @@ const template = ref({});
const editorRef = ref(); const editorRef = ref();
const fieldList = ref([]);
let templateData = {}; let templateData = {};
const options = ref({ const options = ref({
document: { document: {
@ -100,7 +98,7 @@ const rowRenderTemplate = (str, index) => {
if (arr.length > 0) { if (arr.length > 0) {
arr[0] = `#{${arr[0]}}`; arr[0] = `#{${arr[0]}}`;
} }
return arr.reduce((o, k) => o?.[k], templateData) ?? ' '; return arr.reduce((o, k) => o?.[k], templateData) || ' ';
}); });
return res; return res;
}; };
@ -206,7 +204,7 @@ onMounted(async () => {
templateData = {}; templateData = {};
assignData.forEach((item) => { assignData.forEach((item) => {
// templateData[extractPlaceholders(item.varName)] = item.varValue; // templateData[extractPlaceholders(item.varName)] = item.varValue;
templateData[item.varName] = item.varValue; templateData[item.varName] = item.varValue || ' ';
}); });
// console.log(templateData); // console.log(templateData);
getPrintTemplate(route.query.templateId).then((e) => { getPrintTemplate(route.query.templateId).then((e) => {
@ -214,46 +212,12 @@ onMounted(async () => {
const editor = editorRef.value; const editor = editorRef.value;
const docData = JSON.parse(e.data.templateData || '{}'); const docData = JSON.parse(e.data.templateData || '{}');
const data = fillData(docData); const data = fillData(docData);
// console.log(data);
// console.log(JSON.parse(e.data.templateData || '{}'));
// editor.setContent(JSON.parse(e.data.templateData || '{}'));
editor.setContent(data); editor.setContent(data);
}); });
}); });
</script> </script>
<style scoped> <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 { /deep/ .umo-toolbar-actions.ribbon {
display: none !important; display: none !important;
} }
@ -265,6 +229,10 @@ onMounted(async () => {
/deep/ .umo-status-bar-left .umo-button:nth-child(5) { /deep/ .umo-status-bar-left .umo-button:nth-child(5) {
display: none; display: none;
} }
/deep/ .t-button--theme-warning{
border-color: var(--td-warning-color-hover);
background-color: var(--td-warning-color-hover);
}
</style> </style>
<style> <style>
.umo-footer { .umo-footer {

Loading…
Cancel
Save