Merge branch 'master-500-dev-lushangqing' into 'master-500-dev'
增加下拉列表组件,柱线图增加是否与下拉列表联动按钮 See merge request !71
Showing
12 changed files
with
585 additions
and
27 deletions
@@ -2,6 +2,7 @@ import cacheView from "./modules/cachaView" | @@ -2,6 +2,7 @@ import cacheView from "./modules/cachaView" | ||
2 | import tableHead from "./modules/tableHead" | 2 | import tableHead from "./modules/tableHead" |
3 | import buttonVal from "./modules/button"; | 3 | import buttonVal from "./modules/button"; |
4 | import elTreeData from "./modules/elTree"; | 4 | import elTreeData from "./modules/elTree"; |
5 | +import select from "./modules/select"; | ||
5 | 6 | ||
6 | const getters = { | 7 | const getters = { |
7 | sidebar: state => state.app.sidebar, | 8 | sidebar: state => state.app.sidebar, |
@@ -19,5 +20,8 @@ const getters = { | @@ -19,5 +20,8 @@ const getters = { | ||
19 | elTreeDatas:state => state.elTreeData.treeDatas, | 20 | elTreeDatas:state => state.elTreeData.treeDatas, |
20 | //进度条的数据 | 21 | //进度条的数据 |
21 | progressDatas:state => state.progress.progressData, | 22 | progressDatas:state => state.progress.progressData, |
23 | + //下拉选择列表选中数据- | ||
24 | + selectValues:state => state.select.selectValArr, | ||
25 | + | ||
22 | } | 26 | } |
23 | export default getters | 27 | export default getters |
@@ -12,6 +12,7 @@ import tableHead from './modules/tableHead' | @@ -12,6 +12,7 @@ import tableHead from './modules/tableHead' | ||
12 | import buttonVal from "./modules/button"; | 12 | import buttonVal from "./modules/button"; |
13 | import elTreeData from "./modules/elTree"; | 13 | import elTreeData from "./modules/elTree"; |
14 | import progress from "./modules/progress"; | 14 | import progress from "./modules/progress"; |
15 | +import select from "./modules/select"; | ||
15 | 16 | ||
16 | Vue.use(Vuex) | 17 | Vue.use(Vuex) |
17 | 18 | ||
@@ -28,6 +29,7 @@ const store = new Vuex.Store({ | @@ -28,6 +29,7 @@ const store = new Vuex.Store({ | ||
28 | buttonVal, | 29 | buttonVal, |
29 | elTreeData, | 30 | elTreeData, |
30 | progress, | 31 | progress, |
32 | + select, | ||
31 | }, | 33 | }, |
32 | state: { }, | 34 | state: { }, |
33 | plugins: [initPlugin], | 35 | plugins: [initPlugin], |
report-ui/src/store/modules/select.js
0 → 100644
1 | + | ||
2 | +const select = { | ||
3 | + state: { | ||
4 | + selectVal: '', | ||
5 | + selectValArr:[] | ||
6 | + }, | ||
7 | + | ||
8 | + mutations: { | ||
9 | + SELECT_VAL: (state, val) => { | ||
10 | + state.selectVal=val; | ||
11 | + }, | ||
12 | + SELECT_VAL_ARR: (state, val) => { | ||
13 | + state.selectValArr=val; | ||
14 | + } | ||
15 | + }, | ||
16 | + actions: { | ||
17 | + | ||
18 | + } | ||
19 | +} | ||
20 | + | ||
21 | +export default select |
@@ -38,6 +38,14 @@ export const monitorCustomBarLineChart = { | @@ -38,6 +38,14 @@ export const monitorCustomBarLineChart = { | ||
38 | placeholder: '', | 38 | placeholder: '', |
39 | value: true, | 39 | value: true, |
40 | }, | 40 | }, |
41 | + { | ||
42 | + type: 'el-switch', | ||
43 | + label: '与下拉列表联动', | ||
44 | + name: 'isVuexSelect', | ||
45 | + required: false, | ||
46 | + placeholder: '', | ||
47 | + value: false, | ||
48 | + }, | ||
41 | [ | 49 | [ |
42 | { | 50 | { |
43 | name: '折线设置', | 51 | name: '折线设置', |
1 | +/* | ||
2 | +* 下拉列表 | ||
3 | +* author lsq | ||
4 | +* 2022/05/17 | ||
5 | +* */ | ||
6 | +export const monitorSelectOption = { | ||
7 | + code: 'monitor-select-option', | ||
8 | + type: 'html', | ||
9 | + label: '下拉列表', | ||
10 | + icon: 'iconchaolianjie', | ||
11 | + options: { | ||
12 | + setup: [ | ||
13 | + { | ||
14 | + type: 'el-input-text', | ||
15 | + label: '图层名称', | ||
16 | + name: 'layerName', | ||
17 | + required: false, | ||
18 | + placeholder: '', | ||
19 | + value: '背景', | ||
20 | + }, | ||
21 | + { | ||
22 | + type: 'el-input-text', | ||
23 | + label: 'placeholder', | ||
24 | + name: 'placeholderVal', | ||
25 | + required: false, | ||
26 | + placeholder: '', | ||
27 | + value: '请选择', | ||
28 | + }, | ||
29 | + { | ||
30 | + type: 'el-switch', | ||
31 | + label: '是否可清空', | ||
32 | + name: 'clearable', | ||
33 | + required: false, | ||
34 | + placeholder: '', | ||
35 | + value: true | ||
36 | + }, | ||
37 | + { | ||
38 | + type: 'el-switch', | ||
39 | + label: '是否可筛选', | ||
40 | + name: 'filterable', | ||
41 | + required: false, | ||
42 | + placeholder: '', | ||
43 | + value: true | ||
44 | + }, | ||
45 | + /* { | ||
46 | + type: 'el-switch', | ||
47 | + label: '是否可多选', | ||
48 | + name: 'multiple', | ||
49 | + required: false, | ||
50 | + placeholder: '', | ||
51 | + value: false | ||
52 | + },*/ | ||
53 | + { | ||
54 | + type: 'el-switch', | ||
55 | + label: '是否加全部', | ||
56 | + name: 'isAll', | ||
57 | + required: false, | ||
58 | + placeholder: '', | ||
59 | + value: true | ||
60 | + }, | ||
61 | + { | ||
62 | + type: 'el-input-number', | ||
63 | + label: '下拉列表宽度', | ||
64 | + name: 'selectWidth', | ||
65 | + required: false, | ||
66 | + placeholder: '', | ||
67 | + value: '160' | ||
68 | + }, | ||
69 | + /* { | ||
70 | + type: 'el-input-number', | ||
71 | + label: '下拉列表高度', | ||
72 | + name: 'selectHeight', | ||
73 | + required: false, | ||
74 | + placeholder: '', | ||
75 | + value: '28' | ||
76 | + },*/ | ||
77 | + { | ||
78 | + type: 'el-switch', | ||
79 | + label: '加边框', | ||
80 | + name: 'isBorder', | ||
81 | + required: false, | ||
82 | + placeholder: '', | ||
83 | + value: true | ||
84 | + }, | ||
85 | + { | ||
86 | + type: 'vue-color', | ||
87 | + label: '边框颜色', | ||
88 | + name: 'borderColor', | ||
89 | + required: false, | ||
90 | + placeholder: '', | ||
91 | + value: 'rgba(151, 151, 151, 0.13)', | ||
92 | + }, | ||
93 | + { | ||
94 | + type: 'custom-upload', | ||
95 | + label: '标题图标', | ||
96 | + name: 'titleIcon', | ||
97 | + required: false, | ||
98 | + placeholder: '', | ||
99 | + value: require("../../../../../../../assets/images/monitor/capacityAnalysis/icon-trend.png"), | ||
100 | + }, | ||
101 | + { | ||
102 | + type: 'vue-color', | ||
103 | + label: '背景颜色', | ||
104 | + name: 'bgColor', | ||
105 | + required: false, | ||
106 | + placeholder: '', | ||
107 | + value: '', | ||
108 | + }, | ||
109 | + { | ||
110 | + type: 'custom-upload', | ||
111 | + label: '背景图片', | ||
112 | + name: 'imageAdress', | ||
113 | + required: false, | ||
114 | + placeholder: '', | ||
115 | + value: '', | ||
116 | + }, | ||
117 | + { | ||
118 | + type: 'el-input-number', | ||
119 | + label: '字体大小', | ||
120 | + name: 'fontSize', | ||
121 | + required: false, | ||
122 | + placeholder: '', | ||
123 | + value: '14' | ||
124 | + }, | ||
125 | + [ | ||
126 | + { | ||
127 | + name: '标题设置', | ||
128 | + list: [ | ||
129 | + { | ||
130 | + type: 'el-switch', | ||
131 | + label: '是否有标题', | ||
132 | + name: 'isTitle', | ||
133 | + required: false, | ||
134 | + placeholder: '', | ||
135 | + value: false, | ||
136 | + }, | ||
137 | + { | ||
138 | + type: 'el-input-text', | ||
139 | + label: '标题名称', | ||
140 | + name: 'titleName', | ||
141 | + required: false, | ||
142 | + placeholder: '', | ||
143 | + value: '系统信息', | ||
144 | + }, | ||
145 | + | ||
146 | + { | ||
147 | + type: 'el-select', | ||
148 | + label: '字体位置', | ||
149 | + name: 'textAlign', | ||
150 | + required: false, | ||
151 | + placeholder: '', | ||
152 | + selectOptions: [ | ||
153 | + {code: 'center', name: '居中'}, | ||
154 | + {code: 'left', name: '左对齐'}, | ||
155 | + {code: 'right', name: '右对齐'}, | ||
156 | + ], | ||
157 | + value: 'left' | ||
158 | + }, | ||
159 | + | ||
160 | + { | ||
161 | + type: 'el-input-number', | ||
162 | + label: '字体大小', | ||
163 | + name: 'titleFontSize', | ||
164 | + required: false, | ||
165 | + placeholder: '', | ||
166 | + value: '18' | ||
167 | + }, | ||
168 | + { | ||
169 | + type: 'vue-color', | ||
170 | + label: '字体颜色', | ||
171 | + name: 'titleColor', | ||
172 | + required: false, | ||
173 | + placeholder: '', | ||
174 | + value: '#666' | ||
175 | + }, | ||
176 | + { | ||
177 | + type: 'el-select', | ||
178 | + label: '字体粗细', | ||
179 | + name: 'titleFontWeight', | ||
180 | + required: false, | ||
181 | + placeholder: '', | ||
182 | + selectOptions: [ | ||
183 | + {code: 'normal', name: '正常'}, | ||
184 | + {code: 'bold', name: '粗体'}, | ||
185 | + {code: 'bolder', name: '特粗体'}, | ||
186 | + {code: 'lighter', name: '细体'} | ||
187 | + ], | ||
188 | + value: 'normal' | ||
189 | + }, | ||
190 | + ] | ||
191 | + }, | ||
192 | + { | ||
193 | + name: '按钮组设置', | ||
194 | + list: [ | ||
195 | + { | ||
196 | + type: 'el-switch', | ||
197 | + label: '年是否显示', | ||
198 | + name: 'isYear', | ||
199 | + required: false, | ||
200 | + placeholder: '', | ||
201 | + value: true, | ||
202 | + }, | ||
203 | + { | ||
204 | + type: 'el-switch', | ||
205 | + label: '季度是否显示', | ||
206 | + name: 'isQuarter', | ||
207 | + required: false, | ||
208 | + placeholder: '', | ||
209 | + value: true, | ||
210 | + }, | ||
211 | + { | ||
212 | + type: 'el-switch', | ||
213 | + label: '月是否显示', | ||
214 | + name: 'isMonth', | ||
215 | + required: false, | ||
216 | + placeholder: '', | ||
217 | + value: true, | ||
218 | + }, | ||
219 | + ] | ||
220 | + }, | ||
221 | + | ||
222 | + ], | ||
223 | + | ||
224 | + ], | ||
225 | + position: [ | ||
226 | + { | ||
227 | + type: 'el-input-number', | ||
228 | + label: '左边距', | ||
229 | + name: 'left', | ||
230 | + required: false, | ||
231 | + placeholder: '', | ||
232 | + value: 0, | ||
233 | + }, | ||
234 | + { | ||
235 | + type: 'el-input-number', | ||
236 | + label: '上边距', | ||
237 | + name: 'top', | ||
238 | + required: false, | ||
239 | + placeholder: '', | ||
240 | + value: 0, | ||
241 | + }, | ||
242 | + { | ||
243 | + type: 'el-input-number', | ||
244 | + label: '宽度', | ||
245 | + name: 'width', | ||
246 | + required: false, | ||
247 | + placeholder: '该容器在1920px大屏中的宽度', | ||
248 | + value: 550, | ||
249 | + }, | ||
250 | + { | ||
251 | + type: 'el-input-number', | ||
252 | + label: '高度', | ||
253 | + name: 'height', | ||
254 | + required: false, | ||
255 | + placeholder: '该容器在1080px大屏中的高度', | ||
256 | + value: 50, | ||
257 | + }, | ||
258 | + ] | ||
259 | + } | ||
260 | +} |
@@ -60,6 +60,7 @@ import {monitorCustomBarLineChartArray} from "./echartsConfigJson/monitorConfigJ | @@ -60,6 +60,7 @@ import {monitorCustomBarLineChartArray} from "./echartsConfigJson/monitorConfigJ | ||
60 | import {monitorJimuButton} from "./echartsConfigJson/monitorConfigJson/monitor-jimu-button"; | 60 | import {monitorJimuButton} from "./echartsConfigJson/monitorConfigJson/monitor-jimu-button"; |
61 | import {monitorAjButton} from "./echartsConfigJson/monitorConfigJson/monitor-aj-button"; | 61 | import {monitorAjButton} from "./echartsConfigJson/monitorConfigJson/monitor-aj-button"; |
62 | import {monitorCustomScatterWeight} from "./echartsConfigJson/monitorConfigJson/monitor-custom-scatter-weight"; | 62 | import {monitorCustomScatterWeight} from "./echartsConfigJson/monitorConfigJson/monitor-custom-scatter-weight"; |
63 | +import {monitorSelectOption} from "./echartsConfigJson/monitorConfigJson/monitor-select-option"; | ||
63 | 64 | ||
64 | export const {widgetTool,monitor} = { | 65 | export const {widgetTool,monitor} = { |
65 | widgetTool : [ | 66 | widgetTool : [ |
@@ -141,6 +142,8 @@ export const {widgetTool,monitor} = { | @@ -141,6 +142,8 @@ export const {widgetTool,monitor} = { | ||
141 | // AJ报表按钮,弹框展示 | 142 | // AJ报表按钮,弹框展示 |
142 | monitorAjButton, | 143 | monitorAjButton, |
143 | // 散点图 | 144 | // 散点图 |
144 | - monitorCustomScatterWeight | 145 | + monitorCustomScatterWeight, |
146 | + //下拉列表 | ||
147 | + monitorSelectOption | ||
145 | ] | 148 | ] |
146 | } | 149 | } |
@@ -110,10 +110,14 @@ export default { | @@ -110,10 +110,14 @@ export default { | ||
110 | }, | 110 | }, |
111 | computed: { | 111 | computed: { |
112 | //月季度年按钮通过vuex接收值 | 112 | //月季度年按钮通过vuex接收值 |
113 | - ...mapGetters(['buttonVals']), | 113 | + ...mapGetters(['buttonVals','selectValues']), |
114 | buttonVal(){ | 114 | buttonVal(){ |
115 | return this.buttonVals; | 115 | return this.buttonVals; |
116 | }, | 116 | }, |
117 | + //与下拉列表通过vuex联动 | ||
118 | + selectValue(){ | ||
119 | + return this.selectValues; | ||
120 | + }, | ||
117 | //进度条flag数据 | 121 | //进度条flag数据 |
118 | ...mapGetters(['progressDatas']), | 122 | ...mapGetters(['progressDatas']), |
119 | progressData(){ | 123 | progressData(){ |
@@ -175,6 +179,24 @@ export default { | @@ -175,6 +179,24 @@ export default { | ||
175 | 179 | ||
176 | }, | 180 | }, |
177 | deep:true | 181 | deep:true |
182 | + }, | ||
183 | + //监听下拉列表 | ||
184 | + selectValue:{ | ||
185 | + handler(val){ | ||
186 | + if(this.optionsSetup.isVuexSelect){ | ||
187 | + let optionsData=this.optionsData; | ||
188 | + if(this.optionsData.dataType=="dynamicData"){ | ||
189 | + //改变参下拉列表,重新加载动态数据--待测 | ||
190 | + let flag=''; | ||
191 | + if(val){ | ||
192 | + flag=val.join(","); | ||
193 | + } | ||
194 | + this.optionsData.dynamicData.contextData.flag=flag; | ||
195 | + } | ||
196 | + } | ||
197 | + | ||
198 | + }, | ||
199 | + deep:true | ||
178 | } | 200 | } |
179 | }, | 201 | }, |
180 | created() { | 202 | created() { |
@@ -282,15 +282,14 @@ export default { | @@ -282,15 +282,14 @@ export default { | ||
282 | } | 282 | } |
283 | ] | 283 | ] |
284 | } | 284 | } |
285 | - console.log("_+111_+_+_", this.$refs[item.flag]) | ||
286 | - if (this.optionsData.dataType == "dynamicData") { | ||
287 | - console.log("(*)(*)",this.optionsData.dynamicData.contextData.flag,item.flag) | 285 | + if (this.optionsData.dataType == "dynamicData" && this.optionsData.dynamicData.contextData) { |
286 | + // console.log("(*)(*)",this.optionsData.dynamicData.contextData.flag,item.flag) | ||
288 | this.optionsData.dynamicData.contextData.flag = item.flag; | 287 | this.optionsData.dynamicData.contextData.flag = item.flag; |
289 | } | 288 | } |
290 | - this.editorOptions(); | 289 | + this.editorOptions(index); |
291 | 290 | ||
292 | }) | 291 | }) |
293 | - // this.thenData(); | 292 | + this.thenData(); |
294 | // this.forData(); | 293 | // this.forData(); |
295 | }, | 294 | }, |
296 | deep:true | 295 | deep:true |
@@ -305,7 +304,7 @@ export default { | @@ -305,7 +304,7 @@ export default { | ||
305 | }, | 304 | }, |
306 | methods: { | 305 | methods: { |
307 | // 修改图标options属性 | 306 | // 修改图标options属性 |
308 | - editorOptions() { | 307 | + editorOptions(index) { |
309 | // this.forData(); | 308 | // this.forData(); |
310 | 309 | ||
311 | this.setOptionsTitle(); | 310 | this.setOptionsTitle(); |
@@ -314,7 +313,7 @@ export default { | @@ -314,7 +313,7 @@ export default { | ||
314 | this.setOptionsTop(); | 313 | this.setOptionsTop(); |
315 | this.setOptionsBar(); | 314 | this.setOptionsBar(); |
316 | this.setOptionsTooltip(); | 315 | this.setOptionsTooltip(); |
317 | - this.setOptionsData(); | 316 | + this.setOptionsData(index); |
318 | this.setOptionsMargin(); | 317 | this.setOptionsMargin(); |
319 | this.setOptionsLegend(); | 318 | this.setOptionsLegend(); |
320 | this.setOptionsColor(); | 319 | this.setOptionsColor(); |
@@ -637,11 +636,11 @@ export default { | @@ -637,11 +636,11 @@ export default { | ||
637 | }) | 636 | }) |
638 | }, | 637 | }, |
639 | // 数据处理 | 638 | // 数据处理 |
640 | - setOptionsData() { | 639 | + setOptionsData(index) { |
641 | const optionsData = this.optionsData; // 数据类型 静态 or 动态 | 640 | const optionsData = this.optionsData; // 数据类型 静态 or 动态 |
642 | optionsData.dataType == "staticData" | 641 | optionsData.dataType == "staticData" |
643 | ? this.staticDataFn(optionsData.staticData) | 642 | ? this.staticDataFn(optionsData.staticData) |
644 | - : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); | 643 | + : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime,index); |
645 | }, | 644 | }, |
646 | staticDataFn(val) { | 645 | staticDataFn(val) { |
647 | // const series = this.options.series; | 646 | // const series = this.options.series; |
@@ -688,21 +687,21 @@ export default { | @@ -688,21 +687,21 @@ export default { | ||
688 | }*/ | 687 | }*/ |
689 | }) | 688 | }) |
690 | }, | 689 | }, |
691 | - dynamicDataFn(val, refreshTime) { | 690 | + dynamicDataFn(val, refreshTime,index) { |
692 | if (!val) return; | 691 | if (!val) return; |
693 | if (this.ispreview) { | 692 | if (this.ispreview) { |
694 | - this.getEchartData(val); | 693 | + this.getEchartData(val,index); |
695 | this.flagInter = setInterval(() => { | 694 | this.flagInter = setInterval(() => { |
696 | - this.getEchartData(val); | 695 | + this.getEchartData(val,index); |
697 | }, refreshTime); | 696 | }, refreshTime); |
698 | } else { | 697 | } else { |
699 | - this.getEchartData(val); | 698 | + this.getEchartData(val,index); |
700 | } | 699 | } |
701 | }, | 700 | }, |
702 | - async getEchartData(val) { | 701 | + async getEchartData(val,index) { |
703 | const data = this.queryEchartsData(val); | 702 | const data = this.queryEchartsData(val); |
704 | this.chartDataItem.push(data); | 703 | this.chartDataItem.push(data); |
705 | - console.log("900000",this.optionsData.dynamicData?this.optionsData.dynamicData.contextData.flag:'009') | 704 | + // console.log("900000",this.optionsData.dynamicData?this.optionsData.dynamicData.contextData.flag:'009') |
706 | // return await Promise.all(this.chartDataItem)//.then(data => {console.log("data",data,this.optionsData.dynamicData.contextData.flag )}) | 705 | // return await Promise.all(this.chartDataItem)//.then(data => {console.log("data",data,this.optionsData.dynamicData.contextData.flag )}) |
707 | /*if(this.chartData.length==this.chartDataItem.length){ | 706 | /*if(this.chartData.length==this.chartDataItem.length){ |
708 | let arr=[]; | 707 | let arr=[]; |
@@ -713,9 +712,9 @@ export default { | @@ -713,9 +712,9 @@ export default { | ||
713 | }); | 712 | }); |
714 | }) | 713 | }) |
715 | }*/ | 714 | }*/ |
716 | - // data.then(res => { | ||
717 | - // this.renderingFn(res,this.optionsData.dynamicData.contextData.flag); | ||
718 | - // }); | 715 | + data.then(res => { |
716 | + this.renderingFn(res,this.optionsData.dynamicData.contextData.flag); | ||
717 | + }); | ||
719 | }, | 718 | }, |
720 | async thenData(){ | 719 | async thenData(){ |
721 | const res = await this.getEchartData() | 720 | const res = await this.getEchartData() |
1 | +<template> | ||
2 | + <div class="select-option-container" :style="styleObj"> | ||
3 | + <div class="select-option-title" :style="titleStyle"> | ||
4 | + <img :src="imgStyle.titleIcon" alt="" class="icon-title"> | ||
5 | + {{elTreeBtnTitleName}}{{ transStyle.titleName }} | ||
6 | + </div> | ||
7 | + <div class="select-option-item"> | ||
8 | + <el-select v-model="selectVal" @change="selectChange" :style="selectStyle" | ||
9 | + :placeholder="placeholderVal" :clearable="clearable" | ||
10 | + :filterable="filterable" :multiple="multiple"> | ||
11 | + <el-option | ||
12 | + v-for="item in selectOption" | ||
13 | + :key="item.value" | ||
14 | + :label="item.label" | ||
15 | + :value="item.value" | ||
16 | + :disabled="item.disabled" | ||
17 | + /> | ||
18 | + </el-select> | ||
19 | + </div> | ||
20 | + | ||
21 | + </div> | ||
22 | +</template> | ||
23 | + | ||
24 | +<script> | ||
25 | +import {mapGetters} from "vuex"; | ||
26 | +export default { | ||
27 | + name: "selectOption", | ||
28 | + data() { | ||
29 | + return { | ||
30 | + selectVal:'', | ||
31 | + selectOption:[{value:1,label:'选项1',disabled:false},{value:2,label:'选项3',disabled:true}], | ||
32 | + options: {}, | ||
33 | + optionsSetUp: {}, | ||
34 | + optionsPosition:{}, | ||
35 | + optionsData:{}, | ||
36 | + //按钮组 | ||
37 | + btnGroup:[ | ||
38 | + {name:'月',code:'month',isDisplay:'true'}, | ||
39 | + {name:'季度',code:'quarter',isDisplay:'true'}, | ||
40 | + {name:'年',code:'year',isDisplay:'true'}, | ||
41 | + ], | ||
42 | + btnActive:'month', | ||
43 | + dataTitle:'' | ||
44 | + } | ||
45 | + }, | ||
46 | + components: {}, | ||
47 | + props: { | ||
48 | + value: Object, | ||
49 | + ispreview: Boolean | ||
50 | + }, | ||
51 | + computed: { | ||
52 | + //placeholderVal的值 | ||
53 | + placeholderVal(){ | ||
54 | + return this.optionsSetUp.placeholderVal; | ||
55 | + }, | ||
56 | + //是否可清空 | ||
57 | + clearable(){ | ||
58 | + return this.optionsSetUp.clearable; | ||
59 | + }, | ||
60 | + //是否可筛选 | ||
61 | + filterable(){ | ||
62 | + return this.optionsSetUp.filterable; | ||
63 | + }, | ||
64 | + //是否可多选 | ||
65 | + multiple(){ | ||
66 | + return this.optionsSetUp.multiple; | ||
67 | + }, | ||
68 | + elTreeBtnTitleName(){ | ||
69 | + let btnTitleName=this.$route.query.btnTitleName | ||
70 | + return btnTitleName; | ||
71 | + }, | ||
72 | + //下拉列表样式 | ||
73 | + selectStyle(){ | ||
74 | + return{ | ||
75 | + width:this.optionsSetUp.selectWidth+'px', | ||
76 | + // height:this.optionsSetUp.selectHeight+'px' | ||
77 | + } | ||
78 | + }, | ||
79 | + transStyle() { | ||
80 | + return this.objToOne(this.options); | ||
81 | + }, | ||
82 | + styleObj() { | ||
83 | + const allStyle = this.optionsPosition; | ||
84 | + return { | ||
85 | + position: this.ispreview ? "absolute" : "static", | ||
86 | + width: allStyle.width + "px", | ||
87 | + height: allStyle.height + "px", | ||
88 | + left: allStyle.left + "px", | ||
89 | + top: allStyle.top + "px", | ||
90 | + 'background':this.transStyle.bgColor, | ||
91 | + 'border':this.transStyle.isBorder?'0.5px solid '+this.transStyle.borderColor:'none', | ||
92 | + 'box-shadow':this.transStyle.isShadow?'0px 3px 12px '+this.transStyle.borderColor:'none', | ||
93 | + 'background-image':'url(' + this.transStyle.imageAdress + ')', | ||
94 | + // 'background-position':'center', | ||
95 | + 'background-repeat':'no-repeat', | ||
96 | + 'background-size':'contain' | ||
97 | + }; | ||
98 | + }, | ||
99 | + //图片样式 | ||
100 | + imgStyle(){ | ||
101 | + return{ | ||
102 | + titleIcon:this.transStyle.titleIcon | ||
103 | + } | ||
104 | + }, | ||
105 | + //标题样式设置 | ||
106 | + titleStyle(){ | ||
107 | + return{ | ||
108 | + 'display':this.transStyle.isTitle?'flex':'none', | ||
109 | + 'text-align':this.transStyle.textAlign, | ||
110 | + 'font-size':this.transStyle.titleFontSize+'px', | ||
111 | + color: this.transStyle.titleColor, | ||
112 | + 'font-weight': this.transStyle.titleFontWeight | ||
113 | + } | ||
114 | + }, | ||
115 | + btnStyle(){ | ||
116 | + return{ | ||
117 | + 'font-size':this.transStyle.fontSize | ||
118 | + } | ||
119 | + } | ||
120 | + }, | ||
121 | + watch: { | ||
122 | + value: { | ||
123 | + handler(val) { | ||
124 | + this.options = val; | ||
125 | + this.optionsSetUp = val.setup; | ||
126 | + this.optionsPosition = val.position; | ||
127 | + this.handlerData(); | ||
128 | + this.pushAll(); | ||
129 | + this.btnDisplay(); | ||
130 | + | ||
131 | + }, | ||
132 | + deep: true | ||
133 | + } | ||
134 | + }, | ||
135 | + mounted() { | ||
136 | + // this.initImageUrl(); | ||
137 | + this.options=this.value; | ||
138 | + this.optionsSetUp = this.value.setup; | ||
139 | + this.optionsPosition = this.value.position; | ||
140 | + this.handlerData(); | ||
141 | + this.pushAll(); | ||
142 | + this.btnDisplay(); | ||
143 | + | ||
144 | + }, | ||
145 | + methods: { | ||
146 | + //选项是否加全部 | ||
147 | + pushAll(){ | ||
148 | + if(this.optionsSetUp.isAll){ | ||
149 | + this.selectOption.unshift({label:'全部',value:'all'}) | ||
150 | + } | ||
151 | + }, | ||
152 | + //select的change事件 | ||
153 | + selectChange(val){ | ||
154 | + let data=[]; | ||
155 | + if(!this.optionsSetUp.multiple){ | ||
156 | + data.push(val); | ||
157 | + } | ||
158 | + this.$store.commit('SELECT_VAL_ARR', data); | ||
159 | + | ||
160 | + }, | ||
161 | + //计算按钮是否显示 | ||
162 | + btnDisplay(){ | ||
163 | + this.btnGroup.map((item,index)=>{ | ||
164 | + if(item.code=='year'){ | ||
165 | + item.isDisplay=this.transStyle.isYear; | ||
166 | + }else if(item.code=='quarter'){ | ||
167 | + item.isDisplay=this.transStyle.isQuarter; | ||
168 | + }else{ | ||
169 | + item.isDisplay=this.transStyle.isMonth; | ||
170 | + } | ||
171 | + | ||
172 | + }) | ||
173 | + this.btnGroup.some((item, index) => { | ||
174 | + if(item.isDisplay){ | ||
175 | + this.btnActive=item.code; | ||
176 | + return true;//当内部return true时跳出整个循环 | ||
177 | + | ||
178 | + } | ||
179 | + }); | ||
180 | + this.setBtnVal(this.btnActive); | ||
181 | + }, | ||
182 | + changeType(item){ | ||
183 | + this.btnActive=item.code; | ||
184 | + this.setBtnVal(item.code); | ||
185 | + }, | ||
186 | + //传值-vuex-按钮值 | ||
187 | + setBtnVal(val){ | ||
188 | + this.$store.commit('CHANGE_BUTTON',val); | ||
189 | + | ||
190 | + }, | ||
191 | + handlerData() { | ||
192 | + const resData = this.optionsData; | ||
193 | + resData.dataType == "staticData" | ||
194 | + ? this.handlerStaticData(resData.staticData) | ||
195 | + : this.handlerDynamicData(resData.dynamicData, resData.refreshTime); | ||
196 | + }, | ||
197 | + handlerStaticData(data) { | ||
198 | + | ||
199 | + }, | ||
200 | + handlerDynamicData(data, refreshTime) { | ||
201 | + if (!data) return; | ||
202 | + /* if (this.ispreview) { | ||
203 | + this.getEchartData(data); | ||
204 | + this.flagInter = setInterval(() => { | ||
205 | + this.getEchartData(data); | ||
206 | + }, refreshTime); | ||
207 | + } else { | ||
208 | + this.getEchartData(data); | ||
209 | + }*/ | ||
210 | + } | ||
211 | + | ||
212 | + | ||
213 | + }, | ||
214 | +} | ||
215 | +</script> | ||
216 | + | ||
217 | +<style scoped lang="scss"> | ||
218 | +.select-option-container{ | ||
219 | + display: flex; | ||
220 | + align-items: center; | ||
221 | + justify-content: space-between; | ||
222 | + padding:10px; | ||
223 | +} | ||
224 | +.select-option-style{ | ||
225 | + width:60px; | ||
226 | +} | ||
227 | +.select-option-title{ | ||
228 | + padding:5px; | ||
229 | + display: flex; | ||
230 | + align-items: center; | ||
231 | +} | ||
232 | +.icon-title{ | ||
233 | + margin-right:5px; | ||
234 | +} | ||
235 | +.select-option-item{ | ||
236 | + padding:5px; | ||
237 | +} | ||
238 | +</style> |
@@ -92,8 +92,8 @@ export default { | @@ -92,8 +92,8 @@ export default { | ||
92 | let param = { | 92 | let param = { |
93 | type:e.data.type, | 93 | type:e.data.type, |
94 | data:{ | 94 | data:{ |
95 | - resId: e.data.data.resId, | ||
96 | - resType: e.data.data.resType | 95 | + resId: e.data.data?e.data.data.resId:'', |
96 | + resType: e.data.data?e.data.data.resType:'' | ||
97 | } | 97 | } |
98 | 98 | ||
99 | } | 99 | } |
@@ -114,7 +114,6 @@ export default { | @@ -114,7 +114,6 @@ export default { | ||
114 | }, | 114 | }, |
115 | //树节点点击事件 | 115 | //树节点点击事件 |
116 | handleNodeClick(data,node){ | 116 | handleNodeClick(data,node){ |
117 | - console.log("*(*(*(",node,data); | ||
118 | if(this.optionsSetup.isFrame){ | 117 | if(this.optionsSetup.isFrame){ |
119 | this.setSrc(data,node); | 118 | this.setSrc(data,node); |
120 | } | 119 | } |
@@ -184,7 +183,6 @@ export default { | @@ -184,7 +183,6 @@ export default { | ||
184 | } | 183 | } |
185 | 184 | ||
186 | this.iframeSrc=srcName+tokenUrl+busId+resId+resType+btnTitleName+titleName; | 185 | this.iframeSrc=srcName+tokenUrl+busId+resId+resType+btnTitleName+titleName; |
187 | - console.log("iframeSrc",busId+resId+resType+btnTitleName) | ||
188 | }, | 186 | }, |
189 | editorOptions() { | 187 | editorOptions() { |
190 | this.setOptionsData(); | 188 | this.setOptionsData(); |
@@ -220,7 +218,6 @@ export default { | @@ -220,7 +218,6 @@ export default { | ||
220 | getEchartData(val) { | 218 | getEchartData(val) { |
221 | const data = this.queryEchartsData(val); | 219 | const data = this.queryEchartsData(val); |
222 | data.then(res => { | 220 | data.then(res => { |
223 | - console.log("aaaa",res) | ||
224 | if(res[0] && res[0].data){ | 221 | if(res[0] && res[0].data){ |
225 | this.treeData=res[0].data; | 222 | this.treeData=res[0].data; |
226 | this.setSrc(this.treeData[0]) | 223 | this.setSrc(this.treeData[0]) |
@@ -63,6 +63,7 @@ import monitorButtonExport from "./monitor/buttonExport"; | @@ -63,6 +63,7 @@ import monitorButtonExport from "./monitor/buttonExport"; | ||
63 | import monitorJimuButton from "./monitor/monitorJimuButton"; | 63 | import monitorJimuButton from "./monitor/monitorJimuButton"; |
64 | import monitorAjButton from "./monitor/monitorAjButton"; | 64 | import monitorAjButton from "./monitor/monitorAjButton"; |
65 | import monitorCustomScatterWeight from "./monitor/monitorCustomScatterWeight.vue"; | 65 | import monitorCustomScatterWeight from "./monitor/monitorCustomScatterWeight.vue"; |
66 | +import monitorSelectOption from "./monitor/selectOption.vue"; | ||
66 | 67 | ||
67 | export default { | 68 | export default { |
68 | name: "WidgetTemp", | 69 | name: "WidgetTemp", |
@@ -117,7 +118,8 @@ export default { | @@ -117,7 +118,8 @@ export default { | ||
117 | monitorButtonExport, | 118 | monitorButtonExport, |
118 | monitorJimuButton, | 119 | monitorJimuButton, |
119 | monitorAjButton, | 120 | monitorAjButton, |
120 | - monitorCustomScatterWeight | 121 | + monitorCustomScatterWeight, |
122 | + monitorSelectOption | ||
121 | }, | 123 | }, |
122 | model: { | 124 | model: { |
123 | prop: "value", | 125 | prop: "value", |
@@ -74,6 +74,7 @@ import monitorButtonExport from "./monitor/buttonExport"; | @@ -74,6 +74,7 @@ import monitorButtonExport from "./monitor/buttonExport"; | ||
74 | import monitorJimuButton from "./monitor/monitorJimuButton"; | 74 | import monitorJimuButton from "./monitor/monitorJimuButton"; |
75 | import monitorAjButton from "./monitor/monitorAjButton"; | 75 | import monitorAjButton from "./monitor/monitorAjButton"; |
76 | import monitorCustomScatterWeight from "./monitor/monitorCustomScatterWeight"; | 76 | import monitorCustomScatterWeight from "./monitor/monitorCustomScatterWeight"; |
77 | +import monitorSelectOption from "./monitor/selectOption.vue"; | ||
77 | 78 | ||
78 | export default { | 79 | export default { |
79 | name: "Widget", | 80 | name: "Widget", |
@@ -127,7 +128,8 @@ export default { | @@ -127,7 +128,8 @@ export default { | ||
127 | monitorButtonExport, | 128 | monitorButtonExport, |
128 | monitorJimuButton, | 129 | monitorJimuButton, |
129 | monitorAjButton, | 130 | monitorAjButton, |
130 | - monitorCustomScatterWeight | 131 | + monitorCustomScatterWeight, |
132 | + monitorSelectOption | ||
131 | }, | 133 | }, |
132 | model: { | 134 | model: { |
133 | prop: "value", | 135 | prop: "value", |
-
Please register or login to post a comment