修改看板配置项

master
suixy 1 month ago
parent eae37c7f7d
commit 494f9051fb

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@ -2,7 +2,6 @@
<div class="boardGenerate"> <div class="boardGenerate">
<div class="top"> <div class="top">
<span style="color: #fff"> <span style="color: #fff">
{{pageSettingForm}}
</span> </span>
<!-- <el-button @click="nodes.forEach(e=>e.draggable =true)">11</el-button>--> <!-- <el-button @click="nodes.forEach(e=>e.draggable =true)">11</el-button>-->
<div class="componentMenu"> <div class="componentMenu">
@ -1663,7 +1662,6 @@ const handleResizeStop = (event, node) => {
}; };
onMounted(async () => { onMounted(async () => {
console.log(123123);
icons.value = Object.keys(icon); icons.value = Object.keys(icon);
loading.value = true; loading.value = true;
getDataSourceList({ getDataSourceList({
@ -1683,8 +1681,8 @@ onMounted(async () => {
isPage: e.fieldThree === 'true' isPage: e.fieldThree === 'true'
}; };
}); });
}) });
customBoard.value = JSON.parse(localStorage.getItem('BOARDNODE') || '[]'); // customBoard.value = JSON.parse(localStorage.getItem('BOARDNODE') || '[]');
await nextTick(); await nextTick();
getBoardApi(router.currentRoute.value.query.id) getBoardApi(router.currentRoute.value.query.id)
.then((res) => { .then((res) => {
@ -1743,12 +1741,12 @@ onMounted(async () => {
}; };
}) || []; }) || [];
pageData.value = JSON.parse(data.customContent) || {}; pageData.value = JSON.parse(data.customContent) || {};
pageSettingForm.value = pageData.value;
nextTick(() => { nextTick(() => {
isSnapToGrid.value = true; isSnapToGrid.value = true;
}); });
}) })
.finally(() => { .finally(() => {
loading.value = false; loading.value = false;
}); });
}); });
@ -1776,7 +1774,7 @@ const nodes = ref([{
}]); }]);
const edges = ref([]); const edges = ref([]);
const customData = ref([]); const customData = ref([]);
const customBoard = ref([]); // const customBoard = ref([]);
const cellOption = ref({}); const cellOption = ref({});
const boardData = ref({}); const boardData = ref({});
const pageData = ref({}); const pageData = ref({});
@ -2042,7 +2040,6 @@ const pitchOnNode = (e) => {
const cellClick = (e) => { const cellClick = (e) => {
let option = (nodeAttrForm.value.tableCellOptions || []).find(v => v.index === e.$index && v.cellIndex === e.cellIndex) || {}; let option = (nodeAttrForm.value.tableCellOptions || []).find(v => v.index === e.$index && v.cellIndex === e.cellIndex) || {};
console.log(e);
cellOption.value = { cellOption.value = {
...(nodeAttrForm.value.tableOptions?.[e.cellIndex] || {}), ...(nodeAttrForm.value.tableOptions?.[e.cellIndex] || {}),
$index: e.$index, $index: e.$index,
@ -2123,7 +2120,6 @@ const setText = (value, row, formula) => {
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

@ -273,7 +273,12 @@ const getOption = (e) => {
gridBottom: 10, gridBottom: 10,
gridRight: 10, gridRight: 10,
tooltip: true, tooltip: true,
legend: true legend: true,
radarCenter: [30, 50],
radarRadius: 40,
radarShape: 'polygon',
radarSplitNumber: 5,
splitLineColor: '#9E87FF'
}; };
} else if (e === 'pie' || e === 'nightingaleRoseDiagram') { } else if (e === 'pie' || e === 'nightingaleRoseDiagram') {
return { return {

@ -1,16 +1,30 @@
<template> <template>
<div style="width: 100%; height: 100vh; overflow: hidden"> <div style="width: 100%; height: 100vh; overflow: hidden" v-loading="loading">
<div class="left"> <div class="open" @click="drawer = true">
<div class="printTemplateList" v-for=" i in printTemplateList"> <div class="icon"></div>
<el-card @click="setNodes(i)" class="moduleCard" shadow="never" </div>
:style="{display:'inline-block',margin:'0 4px 4px 0'}" <el-drawer
:body-style="{padding:'4px 0'}"> v-model="drawer"
<template #header> :with-header="false"
<el-image style="width: 100%; height: 100%" :src="doc" fit="contain" /> :close-on-click-modal="true"
</template> direction="ttb"
<div class="moduleText">{{ i.templateName }}</div> size="240"
</el-card> ref="drawerRef"
>
<div class="divCenter" v-loading="loading">
<div class="printTemplateList" v-for=" i in printTemplateList">
<el-card @click="setNodes(i)" class="moduleCard" shadow="never"
:style="{display:'inline-block',margin:'0 4px 4px 0'}"
:body-style="{padding:'4px 0'}">
<template #header>
<el-image style="width: 100px" :src="doc" fit="contain" />
</template>
<div class="moduleText">{{ i.templateName }}</div>
</el-card>
</div>
</div> </div>
</el-drawer>
<div class="left">
</div> </div>
<div class="center"> <div class="center">
<div id="printInfo" ref="printRef"> <div id="printInfo" ref="printRef">
@ -89,19 +103,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="right"> <!-- <div class="right">-->
<el-dropdown split-button type="primary" @click="printFun" @command="switchPrinter" style="margin-right: 8px"> <!-- <el-dropdown split-button type="primary" @click="printFun" @command="switchPrinter" style="margin-right: 8px">-->
{{ printName() }} <!-- {{ printName() }}-->
<template #dropdown> <!-- <template #dropdown>-->
<el-dropdown-menu> <!-- <el-dropdown-menu>-->
<el-dropdown-item :command="-1">导出PDF</el-dropdown-item> <!-- <el-dropdown-item :command="-1">导出PDF</el-dropdown-item>-->
<el-dropdown-item divided :command="0">本地打印</el-dropdown-item> <!-- <el-dropdown-item divided :command="0">本地打印</el-dropdown-item>-->
<el-dropdown-item :divided="k === 0" :command="i.id" v-for="(i, k) in printers">{{ i.name }} <!-- <el-dropdown-item :divided="k === 0" :command="i.id" v-for="(i, k) in printers">{{ i.name }}-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
</el-dropdown-menu> <!-- </el-dropdown-menu>-->
</template> <!-- </template>-->
</el-dropdown> <!-- </el-dropdown>-->
</div> <!-- </div>-->
</div> </div>
<div id="printArea" v-if="printPngList.length > 0"> <div id="printArea" v-if="printPngList.length > 0">
<div v-for="(url, index) in printPngList" :key="index" class="print-page"> <div v-for="(url, index) in printPngList" :key="index" class="print-page">
@ -112,6 +126,7 @@
<script setup> <script setup>
import html2canvas from 'html2canvas'; import html2canvas from 'html2canvas';
import jsPDF from 'jspdf'; import jsPDF from 'jspdf';
import { ElMessageBox } from 'element-plus';
import { options } from '@/views/print/tool.js'; import { options } from '@/views/print/tool.js';
import TextNode from '@/views/print/nodes/textNode.vue'; import TextNode from '@/views/print/nodes/textNode.vue';
import ImageNode from '@/views/print/nodes/image.vue'; import ImageNode from '@/views/print/nodes/image.vue';
@ -127,6 +142,18 @@ import doc from '@/assets/images/doc.png';
import { getSysPrintTemplateNodeList } from '@/api/system/printTemplateNode/index'; import { getSysPrintTemplateNodeList } from '@/api/system/printTemplateNode/index';
import { listPrintTemplateInfo } from '@/api/system/printTemplateInfo/index'; import { listPrintTemplateInfo } from '@/api/system/printTemplateInfo/index';
const handleClose = (done) => {
ElMessageBox.confirm('Are you sure you want to close this?')
.then(() => {
done();
})
.catch(() => {
// catch error
});
};
const drawer = ref(false);
const loading = ref(false);
const drawerRef = ref()
const printTemplateList = ref([]); const printTemplateList = ref([]);
const route = useRoute(); const route = useRoute();
const printType = ref(0); const printType = ref(0);
@ -178,7 +205,7 @@ const messageFun = (event) => {
// } // }
}; };
const setNodes = (data) => { const setNodes = (data) => {
loading.value = true;
listPrintTemplateInfo({ templateListId: data.templateListId }).then(e => { listPrintTemplateInfo({ templateListId: data.templateListId }).then(e => {
let templateInfoId = e.rows?.[0]?.templateInfoId; let templateInfoId = e.rows?.[0]?.templateInfoId;
getSysPrintTemplateNodeList({ templateInfoId }).then(v => { getSysPrintTemplateNodeList({ templateInfoId }).then(v => {
@ -203,8 +230,10 @@ const setNodes = (data) => {
}; };
}); });
nextTick(() => { nextTick(() => {
zoom.value = ((printRef.value.offsetWidth - 20) / 793); zoom.value = ((printRef.value.offsetWidth) / 793);
}); });
drawer.value = false
loading.value = false;
}); });
}); });
}; };
@ -229,6 +258,9 @@ onMounted(() => {
listPrintTemplateList().then(data => { listPrintTemplateList().then(data => {
printTemplateList.value = data.rows; printTemplateList.value = data.rows;
}); });
nextTick(() => {
zoom.value = ((printRef.value.offsetWidth) / 793);
});
}); });
const switchPrinter = (e) => { const switchPrinter = (e) => {
@ -318,10 +350,11 @@ defineExpose({
<style scoped> <style scoped>
.content { .content {
position: relative; position: relative;
width: 100%;
overflow: hidden; overflow: hidden;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
border: 1px solid #ccc; border-top: 1px solid #ccc;
transform-origin: top left; transform-origin: top left;
} }
@ -330,16 +363,23 @@ defineExpose({
} }
.left { .left {
position: absolute;
top: 0;
left: 0;
z-index: 8;
display: inline-block; display: inline-block;
width: 10vw; width: 100%;
height: 100vh;
overflow: auto; overflow: auto;
margin-right: 50px; margin-right: 50px;
} }
.divCenter {
text-align: center;
}
.center { .center {
display: inline-block; display: inline-block;
width: calc(100% - 10vw - 50px); width: calc(100%);
height: 100vh; height: 100vh;
overflow: auto; overflow: auto;
padding-top: 40px; padding-top: 40px;
@ -357,6 +397,36 @@ defineExpose({
right: 0; right: 0;
top: 0; top: 0;
} }
.printTemplateList {
width: 150px;
display: inline-block;
vertical-align: top;
text-align: center;
min-width: 50px;
}
.open {
position: fixed;
top: 0;
left: 50%;
width: 100px;
height: 30px;
background-color: #ddd;
border-bottom-left-radius: 30px;
border-bottom-right-radius: 30px;
.icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-image: url("@/assets/icons/down.png");
background-repeat: no-repeat;
background-size: 100% 100%;
width: 12px;
height: 12px;
}
}
</style> </style>
<style> <style>
.print-page { .print-page {
@ -393,4 +463,5 @@ defineExpose({
page-break-after: always; page-break-after: always;
} }
} }
</style> </style>

Loading…
Cancel
Save