修改报表配置

master
suixy 3 months ago
parent a13ab4f2f9
commit da9f676d23

@ -98,7 +98,7 @@ $--color-warning: #e6a23c;
$--color-danger: #f56c6c; $--color-danger: #f56c6c;
$--color-info: #909399; $--color-info: #909399;
$base-sidebar-width: 200px; $base-sidebar-width: 250px;
// the :export directive is the magic sauce for webpack // the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass

@ -28,27 +28,16 @@
<template #default="scope"> <template #default="scope">
<el-button text type="primary" size="small" @click="editDataSource(scope.row)"> <el-button text type="primary" size="small" @click="editDataSource(scope.row)">
</el-button> </el-button>
<el-button <el-button size="small" type="danger" text @click="delDataSource(scope.row)">
size="small"
type="danger"
text
@click="delDataSource(scope.row)"
>删除
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination class="pagination" v-model:current-page="selectForm.pageNum"
class="pagination" v-model:page-size="selectForm.pageSize" :page-sizes="[10, 20, 50, 100]"
v-model:current-page="selectForm.pageNum" layout="total, sizes, prev, pager, next, jumper" v-if="total > 0" :total="total"
v-model:page-size="selectForm.pageSize" @size-change="pageChange"
:page-sizes="[10,20,50,100]" @current-change="pageChange" />
layout="total, sizes, prev, pager, next, jumper"
v-if="total>0"
:total="total"
@size-change="pageChange"
@current-change="pageChange"
/>
</el-card> </el-card>
<el-dialog v-model="constructionDataFormVisible" draggable width="800"> <el-dialog v-model="constructionDataFormVisible" draggable width="800">
@ -95,8 +84,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="120"> <el-table-column label="操作" min-width="120">
<template #default="scope"> <template #default="scope">
<el-button link size="small" type="primary" <el-button link size="small" type="primary" @click="paramsTableData.splice(scope.$index, 1)">
@click="paramsTableData.splice(scope.$index, 1)">
删除 删除
</el-button> </el-button>
</template> </template>
@ -135,8 +123,7 @@
<el-button style="width: 100%" @click="constructionDataForm.designDataFieldList.push({})"> <el-button style="width: 100%" @click="constructionDataForm.designDataFieldList.push({})">
添加字段 添加字段
</el-button> </el-button>
<el-button v-if="isEasy" style="width: 100%;margin: 12px 0 0 0" <el-button v-if="isEasy" style="width: 100%;margin: 12px 0 0 0" @click="findTier">
@click="findTier">
查找 查找
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -144,7 +131,7 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="constructionDataFormVisible = false">关闭</el-button> <el-button @click="constructionDataFormVisible = false">关闭</el-button>
<el-button type="primary" @click="createData "> <el-button type="primary" @click="createData">
{{ constructionDataForm.dataSourceId ? '确定' : '创建' }} {{ constructionDataForm.dataSourceId ? '确定' : '创建' }}
</el-button> </el-button>
</div> </div>
@ -162,12 +149,8 @@
</el-form-item> </el-form-item>
<el-form-item label="数据库" prop="db"> <el-form-item label="数据库" prop="db">
<el-select @change="selectDb" v-model="addSQLForm.db" placeholder="选择数据库" style="width: 240px"> <el-select @change="selectDb" v-model="addSQLForm.db" placeholder="选择数据库" style="width: 240px">
<el-option <el-option v-for="item in dbList" :key="item.value" :label="`${item.linkName}(${item.host}:${item.port})`"
v-for="item in dbList" :value="item.linkId" />
:key="item.value"
:label="`${item.linkName}(${item.host}:${item.port})`"
:value="item.linkId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否分页" prop="dataSourceName"> <el-form-item label="是否分页" prop="dataSourceName">
@ -191,13 +174,7 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item label="SQL" prop="SQL"> <el-form-item label="SQL" prop="SQL">
<el-input <el-input v-model="addSQLForm.SQL" style="width: 100%" :rows="2" type="textarea" placeholder="" />
v-model="addSQLForm.SQL"
style="width: 100%"
:rows="2"
type="textarea"
placeholder=""
/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="关键字">--> <!-- <el-form-item label="关键字">-->
<!-- <el-tag type="success" style="margin-right: 8px;margin-bottom: 8px;" v-for="i in keyword"--> <!-- <el-tag type="success" style="margin-right: 8px;margin-bottom: 8px;" v-for="i in keyword"-->
@ -253,8 +230,7 @@
<el-button style="width: 100%" @click="addSQLForm.designDataFieldList.push({})"> <el-button style="width: 100%" @click="addSQLForm.designDataFieldList.push({})">
添加字段 添加字段
</el-button> </el-button>
<el-button style="width: 100%;margin: 12px 0 0 0" <el-button style="width: 100%;margin: 12px 0 0 0" @click="sqlFindTier">
@click="sqlFindTier">
查找 查找
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -262,7 +238,7 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="addSQLFormVisible = false">关闭</el-button> <el-button @click="addSQLFormVisible = false">关闭</el-button>
<el-button type="primary" @click="createSQL "> <el-button type="primary" @click="createSQL">
{{ addSQLForm.dataSourceId ? '确定' : '创建' }} {{ addSQLForm.dataSourceId ? '确定' : '创建' }}
</el-button> </el-button>
</div> </div>
@ -299,7 +275,7 @@ const selectForm = ref({
pageSize: 10 pageSize: 10
}); });
const total = ref(0); const total = ref(0);
const tableData = ref([{}]); const tableData = ref([]);
const constructionDataForm = ref({ designDataFieldList: [] }); const constructionDataForm = ref({ designDataFieldList: [] });
const constructionDataFormVisible = ref(false); const constructionDataFormVisible = ref(false);
const addSQLFormVisible = ref(false); const addSQLFormVisible = ref(false);
@ -394,6 +370,7 @@ const createSQL = () => {
fieldTwo: addSQLForm.value.SQL, fieldTwo: addSQLForm.value.SQL,
fieldThree: addSQLForm.value.isPage fieldThree: addSQLForm.value.isPage
}; };
delete params.SQL;
if (addSQLForm.value.dataSourceId) { if (addSQLForm.value.dataSourceId) {
editDataSourceApi(params).then(() => { editDataSourceApi(params).then(() => {
@ -517,7 +494,6 @@ const findTier = () => {
(paramsTableData.value || []).forEach((item) => { (paramsTableData.value || []).forEach((item) => {
params[item.name] = item.test; params[item.name] = item.test;
}); });
(options.isD ? request : axios.request)({ (options.isD ? request : axios.request)({
method: constructionDataForm.value.requestMethod, method: constructionDataForm.value.requestMethod,
url: constructionDataForm.value.requestUrl, url: constructionDataForm.value.requestUrl,
@ -567,13 +543,41 @@ const findTier = () => {
}); });
} }
}); });
};
const formulaFun = (formula) => {
let data = formula.replace(/\$\{\s*([^}]+?)\s*\}/g, (_, key) => {
let infos = key.split(',');
if (infos.length === 1) {
if (addSQLForm.value.testList.find(e => e.fieldOne === infos[0])) {
return addSQLForm.value.testList.find(e => e.fieldOne === infos[0])?.fieldTwo || '';
} else {
addSQLForm.value.testList.push({
fieldOne: infos[0],
fieldTwo: ''
});
return '';
}
}
if (infos.length === 2) {
if (addSQLForm.value.testList.find(e => e.fieldOne === infos[1])) {
return `AND ${infos[0]} = ${addSQLForm.value.testList.find(e => e.fieldOne === infos[1])?.fieldTwo || ''}`;
} else {
addSQLForm.value.testList.push({
fieldOne: infos[1],
fieldTwo: ''
});
return '';
}
}
});
return data;
}; };
const sqlFindTier = () => { const sqlFindTier = () => {
addSQLForm.value.designDataFieldList = []; addSQLForm.value.designDataFieldList = [];
if (addSQLForm.value.isPage) { if (addSQLForm.value.isPage) {
querySql1({ querySql1({
sql: addSQLForm.value.SQL.replace(/\n/g, ' '), sql: formulaFun(addSQLForm.value.SQL.replace(/\n/g, ' ')),
linkId: addSQLForm.value.db, linkId: addSQLForm.value.db,
pageSize: 10, pageSize: 10,
pageNum: 1 pageNum: 1
@ -598,7 +602,7 @@ const sqlFindTier = () => {
}); });
}); });
} else { } else {
querySql(addSQLForm.value.SQL, addSQLForm.value.db).then((res) => { querySql(formulaFun(addSQLForm.value.SQL.replace(/\n/g, ' ')), addSQLForm.value.db).then((res) => {
let data = res; let data = res;
if (data?.data) { if (data?.data) {
Object.keys(data.data?.[0]).forEach(key => { Object.keys(data.data?.[0]).forEach(key => {

@ -145,6 +145,14 @@
</template> </template>
<div class="moduleText">文字</div> <div class="moduleText">文字</div>
</el-card> </el-card>
<el-card class="moduleCard" shadow="never" :draggable="true"
@dragstart="onDragStart($event, 'buttonNode')" :style="{display:'inline-block',margin:'0 4px 4px 0'}"
:body-style="{padding:'4px 0'}">
<template #header>
<StarFilled />
</template>
<div class="moduleText">按钮</div>
</el-card>
<el-card class="moduleCard" shadow="never" :draggable="true" <el-card class="moduleCard" shadow="never" :draggable="true"
@dragstart="onDragStart($event, 'inputNode')" :style="{display:'inline-block',margin:'0 4px 4px 0'}" @dragstart="onDragStart($event, 'inputNode')" :style="{display:'inline-block',margin:'0 4px 4px 0'}"
:body-style="{padding:'4px 0'}"> :body-style="{padding:'4px 0'}">
@ -329,6 +337,10 @@
<InputNode :inputData=getInputData(inputNodeProps.id) v-bind="inputNodeProps" <InputNode :inputData=getInputData(inputNodeProps.id) v-bind="inputNodeProps"
@resize="resize"></InputNode> @resize="resize"></InputNode>
</template> </template>
<template #node-buttonNode="buttonNodeProps">
<ButtonNode :inputData=getInputData(buttonNodeProps.id) v-bind="buttonNodeProps"
@resize="resize"></ButtonNode>
</template>
<template #node-time="timeNodeProps"> <template #node-time="timeNodeProps">
<TimeNode :inputData=getInputData(timeNodeProps.id) v-bind="timeNodeProps" <TimeNode :inputData=getInputData(timeNodeProps.id) v-bind="timeNodeProps"
@resize="resize"></TimeNode> @resize="resize"></TimeNode>
@ -888,6 +900,7 @@ import DataNode from './nodes/data/dataNode.vue';
import CustomDataNode from './nodes/data/customDataNode.vue'; import CustomDataNode from './nodes/data/customDataNode.vue';
import MapNode from './nodes/form/mapNode.vue'; import MapNode from './nodes/form/mapNode.vue';
import InputNode from './nodes/form/inputNode.vue'; import InputNode from './nodes/form/inputNode.vue';
import ButtonNode from './nodes/form/buttonNode.vue';
import TimeNode from './nodes/form/timeNode.vue'; import TimeNode from './nodes/form/timeNode.vue';
import TextNode from './nodes/form/textNode.vue'; import TextNode from './nodes/form/textNode.vue';
import ImgNode from './nodes/form/imgNode.vue'; import ImgNode from './nodes/form/imgNode.vue';

@ -233,6 +233,18 @@
</template> </template>
<div class="moduleText">文字</div> <div class="moduleText">文字</div>
</el-card> </el-card>
<el-card class="moduleCard" shadow="never" :draggable="true"
@dragstart="onDragStart($event, 'buttonNode')"
:style="{display:'inline-block',margin:'0 4px 4px 0'}"
:body-style="{padding:'4px 0'}">
<template #header>
<div style="width: 100%;height: 100%;text-align: center">
<el-image style="width:50px;height: 50px;text-align: center" :src="inputNodeImg" fit="contain" />
</div>
</template>
<div class="moduleText">按钮</div>
</el-card>
<el-card class="moduleCard" shadow="never" :draggable="true" <el-card class="moduleCard" shadow="never" :draggable="true"
@dragstart="onDragStart($event, 'inputNode')" @dragstart="onDragStart($event, 'inputNode')"
:style="{display:'inline-block',margin:'0 4px 4px 0'}" :style="{display:'inline-block',margin:'0 4px 4px 0'}"
@ -577,6 +589,11 @@
@resize="(e) => handleResizeStop(e, inputNodeProps)" /> @resize="(e) => handleResizeStop(e, inputNodeProps)" />
</template> </template>
<template #node-buttonNode="buttonNodeProps">
<ButtonNode v-bind="buttonNodeProps" :inputData="getInputData(buttonNodeProps.id)"
@resize="(e) => handleResizeStop(e, buttonNodeProps)" />
</template>
<template #node-selectNode="selectNodeProps"> <template #node-selectNode="selectNodeProps">
<SelectNode v-bind="selectNodeProps" :inputData="getInputData(selectNodeProps.id)" <SelectNode v-bind="selectNodeProps" :inputData="getInputData(selectNodeProps.id)"
@resize="(e) => handleResizeStop(e, selectNodeProps)" /> @resize="(e) => handleResizeStop(e, selectNodeProps)" />
@ -1071,8 +1088,8 @@
<el-form-item label="超时时间" v-if="Object.keys(nodeAttrForm).includes('timeout')"> <el-form-item label="超时时间" v-if="Object.keys(nodeAttrForm).includes('timeout')">
<el-input-number <el-input-number
v-model="nodeAttrForm.timeout" v-model="nodeAttrForm.timeout"
:min="1000" :min="-1"
:step="1000" :step="1"
controls-position="right" controls-position="right"
/> />
</el-form-item> </el-form-item>
@ -1193,6 +1210,23 @@
<el-form-item label="饼图半径" v-if="Object.keys(nodeAttrForm).includes('pieRadius')"> <el-form-item label="饼图半径" v-if="Object.keys(nodeAttrForm).includes('pieRadius')">
<el-slider v-model="nodeAttrForm.pieRadius" :min="0" :max="100" range /> <el-slider v-model="nodeAttrForm.pieRadius" :min="0" :max="100" range />
</el-form-item> </el-form-item>
<el-form-item label="发送脉冲类型" v-if="Object.keys(nodeAttrForm).includes('sendType')">
<el-select
multiple
v-model="nodeAttrForm.sendType"
placeholder="Select"
style="width: 100%"
>
<el-option
label="确定"
value="ok"
/>
<el-option
label="重置"
value="reset"
/>
</el-select>
</el-form-item>
<el-form-item label="js脚本设置"> <el-form-item label="js脚本设置">
<el-input type="textarea" v-model="nodeAttrForm.JScript" style="width: 100%" /> <el-input type="textarea" v-model="nodeAttrForm.JScript" style="width: 100%" />
</el-form-item> </el-form-item>
@ -1552,6 +1586,7 @@ import DigitalFlopNode from '@/views/boardGenerate/nodes/form/digitalFlopNode.vu
import NightingaleRoseDiagramNode from '@/views/boardGenerate/nodes/board/nightingaleRoseDiagramNode.vue'; import NightingaleRoseDiagramNode from '@/views/boardGenerate/nodes/board/nightingaleRoseDiagramNode.vue';
import IconNode from '@/views/boardGenerate/nodes/form/iconNode.vue'; import IconNode from '@/views/boardGenerate/nodes/form/iconNode.vue';
import InputNode from '@/views/boardGenerate/nodes/form/inputNode.vue'; import InputNode from '@/views/boardGenerate/nodes/form/inputNode.vue';
import ButtonNode from '@/views/boardGenerate/nodes/form/buttonNode.vue';
import SelectNode from '@/views/boardGenerate/nodes/form/selectNode.vue'; import SelectNode from '@/views/boardGenerate/nodes/form/selectNode.vue';
import TimeNode from '@/views/boardGenerate/nodes/form/timeNode.vue'; import TimeNode from '@/views/boardGenerate/nodes/form/timeNode.vue';

@ -7,7 +7,7 @@
<div class="custom-node" <div class="custom-node"
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}"> :style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}">
<el-button :type="isErr ? 'danger':'primary'" <el-button :type="isErr ? 'danger':'primary'"
:style="{width:props.dimensions.width +'px',height:props.dimensions.height+'px'}" :style="{width:props.dimensions.width*props.ratioWidth +'px',height:props.dimensions.height*props.ratioHeight+'px'}"
:icon="Connection">{{ props.data.customData.name }} :icon="Connection">{{ props.data.customData.name }}
</el-button> </el-button>
<span style="color:#fff"> <span style="color:#fff">
@ -97,16 +97,19 @@ const formulaFun = (formula) => {
let data = formula.replace(/\$\{\s*([^}]+?)\s*\}/g, (_, key) => { let data = formula.replace(/\$\{\s*([^}]+?)\s*\}/g, (_, key) => {
let infos = key.split(','); let infos = key.split(',');
if (infos.length === 1) { if (infos.length === 1) {
return props.inputData[infos[0]] || ''; return props.inputData[infos[0]] || '%%';
} }
if (infos.length === 2) { if (infos.length === 2) {
return `AND ${infos[0]} = ${props.inputData[infos[1]]}`; return `AND ${infos[0]} = ${props.inputData[infos[1]] || '%%'}`;
} }
}); });
return data; return data;
}; };
let timestamp = Date.now();
const getOutputData = () => { const getOutputData = () => {
if (Date.now() < timestamp + 900) {
return;
}
let params = props.inputData; let params = props.inputData;
(Object.keys(props.inputData) || []).forEach((item) => { (Object.keys(props.inputData) || []).forEach((item) => {
params[item.name] = props.inputData[item.name]; params[item.name] = props.inputData[item.name];
@ -163,23 +166,13 @@ const getOutputData = () => {
isErr.value = true; isErr.value = true;
}); });
} }
querySql(formulaFun(props.data.customData.SQL), props.data.customData.db).then((res) => {
isErr.value = false;
let data = res;
let output = {};
props.data.customData.outputData.forEach(item => {
output[item.fieldOne] = parseData(data, item.fieldTwo);
});
props.data.outputData = output;
}).catch(e => {
isErr.value = true;
});
} }
}; };
onMounted(() => { onMounted(() => {
getOutputData(); setTimeout(() => {
getOutputData();
}, 1000);
}); });
@ -189,9 +182,9 @@ watch(() => JSON.parse(JSON.stringify([props.inputData])), (obj1, obj2) => {
} }
}, { deep: true, immediate: true }); }, { deep: true, immediate: true });
let interval = setInterval(() => { let interval = props.data.options?.timeout === -1 ? null : setInterval(() => {
getOutputData(); getOutputData();
}, Math.max(props.data.options?.timeout || 5 * 1000, 1000)); }, Math.max((props.data.options?.timeout || 5) * 1000, 1000));
onBeforeUnmount(() => { onBeforeUnmount(() => {
clearInterval(interval); clearInterval(interval);

@ -0,0 +1,130 @@
<template>
<div style="position: relative;"
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px'}">
<div class="border1" v-if="!props.isView"></div>
<div class="border2" v-if="!props.isView"></div>
<div class="border3" v-if="!props.isView"></div>
<div class="border4" v-if="!props.isView"></div>
<NodeResizer @resizeEnd="(e) => $emit('resize', e)" color="#fff"
v-if="!props.isView && !props.isHideHandle && props.selected" @resize="resize" />
<div class="custom-node"
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}">
<el-button style="width: 100%;height: 100%;border:0" @click="sendPulse"
:style="{backgroundColor: props.data.options.backgroundColor,color:props.data.options.color,}">
{{ props.data.options.text }}
</el-button>
</div>
<Handle v-if="!props.isView" :id="`${props.id}.-t`" type="target" :position="Position.Left" />
<Handle v-if="!props.isView" :id="`${props.id}.-s`" type="source" :position="Position.Right" />
</div>
</template>
<script setup>
import { defineEmits, defineProps, ref } from 'vue';
import { NodeResizer } from '@vue-flow/node-resizer';
import { Handle, Position } from '@vue-flow/core';
const input = ref('');
const props = defineProps({
ratioWidth: {
type: Number,
required: false,
default: 1
},
ratioHeight: {
type: Number,
required: false,
default: 1
},
isView: {
type: Boolean,
required: false
},
inputData: {
type: Object,
required: false
},
id: {
type: String,
required: true
},
isHideHandle: {
type: Boolean,
required: false
},
selected: {
type: Boolean,
required: false
},
data: {
type: Object,
required: true
},
dimensions: {
type: Object,
required: true
}
});
const emit = defineEmits(['resize']);
const resize = (e) => {
emit('resize', e, props.id);
};
const sendPulse = () => {
if (props.data.options.sendType.includes('ok')) {
props.data.outputData.ok = Math.floor(new Date().getTime() / 1000);
console.log('ok');
}
if (props.data.options.sendType.includes('reset')) {
props.data.outputData.reset = Math.floor(new Date().getTime() / 1000);
console.log('reset');
}
};
</script>
<style scoped>
.custom-node {
position: absolute;
}
.border1 {
position: absolute;
top: -1px;
width: 100%;
height: 1px;
background: transparent;
-webkit-backdrop-filter: invert(1);
backdrop-filter: invert(1);
}
.border2 {
position: absolute;
top: 0;
left: -1px;
width: 1px;
height: 100%;
background: transparent;
-webkit-backdrop-filter: invert(1);
backdrop-filter: invert(1);
}
.border3 {
position: absolute;
top: 0;
right: -1px;
width: 1px;
height: 100%;
background: transparent;
-webkit-backdrop-filter: invert(1);
backdrop-filter: invert(1);
}
.border4 {
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 1px;
background: transparent;
-webkit-backdrop-filter: invert(1);
backdrop-filter: invert(1);
}
</style>

@ -5,7 +5,8 @@
<div class="custom-node" <div class="custom-node"
:style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}"> :style="{width:props.dimensions.width*props.ratioWidth+'px',height:props.dimensions.height*props.ratioHeight+'px',pointerEvents:props.isView?'auto': 'none'}">
<el-button type="primary" :style="{width:props.dimensions.width +'px',height:props.dimensions.height+'px'}" <el-button type="primary"
:style="{width:props.dimensions.width *props.ratioWidth +'px',height:props.dimensions.height*props.ratioHeight+'px'}"
:icon="Refresh">数据映射 :icon="Refresh">数据映射
</el-button> </el-button>
</div> </div>

@ -295,15 +295,17 @@ const getOption = (e) => {
} else if (e === 'customBoard') { } else if (e === 'customBoard') {
return { title: '', yNames: [] }; return { title: '', yNames: [] };
} else if (e === 'data') { } else if (e === 'data') {
return { timeout: 5000 }; return { timeout: 5 };
} else if (e === 'staticData') { } else if (e === 'staticData') {
return { defaultInputArea: '', field: 'input', defaultDataType: '' }; return { defaultInputArea: '', field: 'input', defaultDataType: '' };
} else if (e === 'customData') { } else if (e === 'customData') {
return { timeout: 5000 }; return { timeout: 5 };
} else if (e === 'map') { } else if (e === 'map') {
return { dataMap: [] }; return { dataMap: [] };
} else if (e === 'inputNode') { } else if (e === 'inputNode') {
return { field: 'input', defaultInput: '' }; return { field: 'input', defaultInput: '' };
} else if (e === 'buttonNode') {
return { backgroundColor: '#409EFF', color: '#fff', text: '按钮', sendType: ['ok'] };
} else if (e === 'selectNode') { } else if (e === 'selectNode') {
return { field: 'select', defaultInput: '', labelField: 'label', valueField: 'value' }; return { field: 'select', defaultInput: '', labelField: 'label', valueField: 'value' };
} else if (e === 'time') { } else if (e === 'time') {
@ -361,6 +363,8 @@ const getNodeSize = (e) => {
return { width: 150, height: 50 }; return { width: 150, height: 50 };
} else if (e === 'inputNode') { } else if (e === 'inputNode') {
return { width: 100, height: 30 }; return { width: 100, height: 30 };
} else if (e === 'buttonNode') {
return { width: 100, height: 30 };
} else if (e === 'staticData') { } else if (e === 'staticData') {
return { width: 100, height: 60 }; return { width: 100, height: 60 };
} else if (e === 'text') { } else if (e === 'text') {

@ -53,6 +53,10 @@
<InputNode :ratioWidth="ratioWidth" :ratioHeight="ratioHeight" :isView="true" :inputData=getInputData(i.id) <InputNode :ratioWidth="ratioWidth" :ratioHeight="ratioHeight" :isView="true" :inputData=getInputData(i.id)
v-bind="i"></InputNode> v-bind="i"></InputNode>
</template> </template>
<template v-if="i.type === 'buttonNode'">
<ButtonNode :ratioWidth="ratioWidth" :ratioHeight="ratioHeight" :isView="true" :inputData=getInputData(i.id)
v-bind="i"></ButtonNode>
</template>
<template v-if="i.type === 'selectNode'"> <template v-if="i.type === 'selectNode'">
<SelectNode :ratioWidth="ratioWidth" :ratioHeight="ratioHeight" :isView="true" :inputData=getInputData(i.id) <SelectNode :ratioWidth="ratioWidth" :ratioHeight="ratioHeight" :isView="true" :inputData=getInputData(i.id)
v-bind="i"></SelectNode> v-bind="i"></SelectNode>
@ -163,6 +167,7 @@ import BarNode from './nodes/board/barNode.vue';
import BackgroundBarNode from './nodes/board/backgroundBarNode.vue'; import BackgroundBarNode from './nodes/board/backgroundBarNode.vue';
import MultiBarsNode from './nodes/board/multiBarsNode.vue'; import MultiBarsNode from './nodes/board/multiBarsNode.vue';
import InputNode from './nodes/form/inputNode.vue'; import InputNode from './nodes/form/inputNode.vue';
import ButtonNode from './nodes/form/buttonNode.vue';
import SelectNode from './nodes/form/selectNode.vue'; import SelectNode from './nodes/form/selectNode.vue';
import MapNode from './nodes/form/mapNode.vue'; import MapNode from './nodes/form/mapNode.vue';
import CustomBoardNode from './nodes/board/customBoardNode.vue'; import CustomBoardNode from './nodes/board/customBoardNode.vue';

Loading…
Cancel
Save