update--form表单配置项

qianming 2 years ago
parent 5b508f51c1
commit 178ae53530

@ -20,16 +20,8 @@ export const widgetFormTime = {
}, },
{ {
type: 'vue-color', type: 'vue-color',
label: '字体颜色', label: '背景',
name: 'select_color', name: 'select_background',
required: false,
placeholder: '',
value: '#FAD400',
},
{
type: 'vue-color',
label: '字体背景',
name: 'select_fontSize',
required: false, required: false,
placeholder: '', placeholder: '',
value: 'rgba(115,170,229,.5)', value: 'rgba(115,170,229,.5)',
@ -60,57 +52,7 @@ export const widgetFormTime = {
] ]
}] }]
], ],
data: [ data: [],
{
type: 'el-radio-group',
label: '数据类型',
name: 'dataType',
require: false,
placeholder: '',
selectValue: true,
selectOptions: [
{
code: 'staticData',
name: '静态数据',
},
{
code: 'dynamicData',
name: '动态数据',
},
],
value: 'staticData',
},
{
type: 'el-input-number',
label: '刷新时间(毫秒)',
name: 'refreshTime',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
value: 600000
},
{
type: 'el-button',
label: '静态数据',
name: 'staticData',
required: false,
placeholder: '',
relactiveDom: 'dataType',
relactiveDomValue: 'staticData',
value: [],
},
{
type: 'dycustComponents',
label: '',
name: 'dynamicData',
required: false,
placeholder: '',
relactiveDom: 'dataType',
relactiveDomValue: 'dynamicData',
chartType: 'widget-select',
dictKey: 'SELECT_PROPERTIES',
value: '',
},
],
position: [ position: [
{ {
type: 'el-input-number', type: 'el-input-number',
@ -134,7 +76,7 @@ export const widgetFormTime = {
name: 'width', name: 'width',
required: false, required: false,
placeholder: '该容器在1920px大屏中的宽度', placeholder: '该容器在1920px大屏中的宽度',
value: 200, value: 400,
}, },
{ {
type: 'el-input-number', type: 'el-input-number',

@ -25,7 +25,7 @@ export const widgetInput = {
{ {
type: 'vue-color', type: 'vue-color',
label: '字体背景', label: '字体背景',
name: 'select_fontSize', name: 'select_background',
required: false, required: false,
placeholder: '', placeholder: '',
value: 'rgba(115,170,229,.5)', value: 'rgba(115,170,229,.5)',

@ -33,7 +33,7 @@ export const widgetSelect = {
{ {
type: 'vue-color', type: 'vue-color',
label: '字体背景', label: '字体背景',
name: 'select_fontSize', name: 'select_background',
required: false, required: false,
placeholder: '', placeholder: '',
value: 'rgba(115,170,229,.5)', value: 'rgba(115,170,229,.5)',
@ -144,7 +144,7 @@ export const widgetSelect = {
name: 'width', name: 'width',
required: false, required: false,
placeholder: '该容器在1920px大屏中的宽度', placeholder: '该容器在1920px大屏中的宽度',
value: 100, value: 200,
}, },
{ {
type: 'el-input-number', type: 'el-input-number',

@ -91,13 +91,12 @@ export default {
height: this.optionsStyle.height + "px", height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px", left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px", top: this.optionsStyle.top + "px",
background: this.optionsSetup.select_fontSize, background: this.optionsSetup.select_background,
color: this.optionsSetup.select_color,
}; };
}, },
/* eventChange() { eventChange() {
return this.optionsSetup.event || "change"; return "change";
},*/ },
allComponentLinkage() { allComponentLinkage() {
return this.$store.state.designer.allComponentLinkage; return this.$store.state.designer.allComponentLinkage;
}, },
@ -108,7 +107,6 @@ export default {
this.optionsSetup = val.setup; this.optionsSetup = val.setup;
this.optionsData = val.data; this.optionsData = val.data;
this.optionsStyle = val.position; this.optionsStyle = val.position;
this.setOptions();
}, },
deep: true, deep: true,
}, },
@ -117,13 +115,11 @@ export default {
this.optionsSetup = this.value.setup; this.optionsSetup = this.value.setup;
this.optionsData = this.value.data; this.optionsData = this.value.data;
this.optionsStyle = this.value.position; this.optionsStyle = this.value.position;
this.setOptions();
targetWidgetLinkageLogic(this); // - targetWidgetLinkageLogic(this); // -
}, },
methods: { methods: {
change(event) { change(event) {
console.log(event);
const formTimeData = {} const formTimeData = {}
formTimeData['startTime'] = event[0] //startTime formTimeData['startTime'] = event[0] //startTime
formTimeData['endTime'] = event[1] //endTime formTimeData['endTime'] = event[1] //endTime
@ -131,36 +127,6 @@ export default {
currentData: formTimeData, currentData: formTimeData,
}); // - }); // -
}, },
setOptions() {
const optionsData = this.optionsData;
return optionsData.dataType == "staticData"
? this.staticData(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
},
staticData(data) {
this.options = data;
},
//
dynamicDataFn(val, refreshTime) {
if (!val) return;
if (this.ispreview) {
this.getEchartData(val);
this.flagInter = setInterval(() => {
this.getEchartData(val);
}, refreshTime);
} else {
this.getEchartData(val);
}
},
getEchartData(val) {
const data = this.queryEchartsData(val);
data.then((res) => {
this.renderingFn(res);
});
},
renderingFn(val) {
this.options = val;
},
}, },
}; };
</script> </script>

@ -32,13 +32,13 @@ export default {
height: this.optionsStyle.height + "px", height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px", left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px", top: this.optionsStyle.top + "px",
background: this.optionsSetup.select_fontSize, background: this.optionsSetup.select_background,
color: this.optionsSetup.select_color, color: this.optionsSetup.select_color,
}; };
}, },
/* eventChange() { eventChange() {
return this.optionsSetup.event || "change"; return "change";
},*/ },
}, },
watch: { watch: {
value: { value: {

@ -42,13 +42,13 @@ export default {
height: this.optionsStyle.height + "px", height: this.optionsStyle.height + "px",
left: this.optionsStyle.left + "px", left: this.optionsStyle.left + "px",
top: this.optionsStyle.top + "px", top: this.optionsStyle.top + "px",
background: this.optionsSetup.select_fontSize, background: this.optionsSetup.select_background,
color: this.optionsSetup.select_color, color: this.optionsSetup.select_color,
}; };
}, },
/* eventChange() { eventChange() {
return this.optionsSetup.event || "change"; return "change";
},*/ },
allComponentLinkage() { allComponentLinkage() {
return this.$store.state.designer.allComponentLinkage; return this.$store.state.designer.allComponentLinkage;
}, },

Loading…
Cancel
Save