Commit ae498fddd1d5997a1d878c83c36b8b4320e575b7
1 parent
9bd021af
1、鼠标批量移动
Showing
5 changed files
with
88 additions
and
23 deletions
src/mixins/queryform.js
| ... | ... | @@ -115,11 +115,11 @@ export default { |
| 115 | 115 | // widget-radar 雷达图 |
| 116 | 116 | // widget-select 下拉框 |
| 117 | 117 | const chartType = params.chartType |
| 118 | - if (chartType == "widget-linechart" || | |
| 119 | - chartType == "widget-barlinechart" | |
| 120 | - ) { | |
| 118 | + if (chartType == "widget-linechart") { | |
| 121 | 119 | return this.barOrLineChartFn(params.chartProperties, data); |
| 122 | - }else if ( chartType == "widget-barchart") { | |
| 120 | + }else if (chartType == "widget-barlinechart" ) { | |
| 121 | + return this.barLineChartFn(params.chartProperties, data); | |
| 122 | + } else if ( chartType == "widget-barchart") { | |
| 123 | 123 | return this.barOrLineChartFn(params.chartProperties, data); |
| 124 | 124 | } else if ( |
| 125 | 125 | chartType == "widget-piechart" || |
| ... | ... | @@ -160,7 +160,7 @@ export default { |
| 160 | 160 | // console.log(ananysicData); |
| 161 | 161 | return ananysicData; |
| 162 | 162 | }, |
| 163 | - // 柱状图、折线图、柱线图 | |
| 163 | + // 柱状图、折线图 | |
| 164 | 164 | barOrLineChartFn(chartProperties, data) { |
| 165 | 165 | const ananysicData = {}; |
| 166 | 166 | const xAxisList = []; |
| ... | ... | @@ -195,6 +195,43 @@ export default { |
| 195 | 195 | // console.log("11111",ananysicData); |
| 196 | 196 | return ananysicData; |
| 197 | 197 | }, |
| 198 | + //、柱线图 | |
| 199 | + barLineChartFn(chartProperties, data) { | |
| 200 | + const ananysicData = {}; | |
| 201 | + const xAxisList = []; | |
| 202 | + const series = []; | |
| 203 | + // legend: { | |
| 204 | + // data: ['Forest'] | |
| 205 | + // }, | |
| 206 | + for (const key in chartProperties) { | |
| 207 | + const obj = {}; | |
| 208 | + const seriesData = []; | |
| 209 | + const value = chartProperties[key]; | |
| 210 | + obj["type"] = value; | |
| 211 | + obj["name"] = key; | |
| 212 | + if(value=='xAxis' || value=='bar'|| value=='line'){ | |
| 213 | + for (let i = 0; i < data.length; i++) { | |
| 214 | + if (value.startsWith("xAxis")) { | |
| 215 | + // 代表为x轴 | |
| 216 | + xAxisList[i] = data[i][key]; | |
| 217 | + } else { | |
| 218 | + // 其他的均为series展示数据 | |
| 219 | + seriesData[i] = data[i][value]; | |
| 220 | + } | |
| 221 | + } | |
| 222 | + // console.log("seriesData",seriesData); | |
| 223 | + // console.log("xAxisList",xAxisList); | |
| 224 | + obj["data"] = seriesData; | |
| 225 | + if (!obj["type"].startsWith("xAxis")) { | |
| 226 | + series.push(obj); | |
| 227 | + } | |
| 228 | + } | |
| 229 | + } | |
| 230 | + ananysicData["xAxis"] = xAxisList; | |
| 231 | + ananysicData["series"] = series; | |
| 232 | + console.log("11111",ananysicData); | |
| 233 | + return ananysicData; | |
| 234 | + }, | |
| 198 | 235 | //堆叠图 |
| 199 | 236 | stackChartFn(chartProperties, val) { |
| 200 | 237 | const ananysicData = {}; | ... | ... |
src/views/bigscreenDesigner/designer/index.vue
| ... | ... | @@ -1473,29 +1473,28 @@ export default { |
| 1473 | 1473 | }, |
| 1474 | 1474 | //输入删除键删除 |
| 1475 | 1475 | entryDelete(index){ |
| 1476 | - this.widgets.splice(index, 1); | |
| 1477 | - //调用删除 | |
| 1478 | - // this.selectMore.push(index); | |
| 1479 | - // this.deletelayerOne(); | |
| 1480 | - }, | |
| 1481 | - deletelayer() { | |
| 1482 | - this.widgets.splice(this.rightClickIndex, 1); | |
| 1483 | - // this.selectMore.push(this.rightClickIndex); | |
| 1484 | - // this.deletelayerOne(); | |
| 1485 | - }, | |
| 1486 | - // 删除 | |
| 1487 | - deletelayerOne() { | |
| 1476 | + // this.widgets.splice(index, 1); | |
| 1488 | 1477 | this.selectMore = this.setUnique(this.selectMore); |
| 1489 | 1478 | //首先复制右选节点,再复制其他选择节点 |
| 1490 | 1479 | let widgetsCp = []; |
| 1491 | 1480 | if(this.isNotBlankArray(this.selectMore)){ |
| 1492 | 1481 | for(let i = 0; i< this.widgets.length;i++){ |
| 1493 | - if(this.selectMore.indexOf(i)<0){ | |
| 1482 | + if(this.selectMore.indexOf(i)<0 && index!=i){ | |
| 1494 | 1483 | widgetsCp.push(this.widgets[i]); |
| 1495 | 1484 | } |
| 1496 | 1485 | } |
| 1497 | 1486 | } |
| 1498 | 1487 | this.widgets = widgetsCp; |
| 1488 | + this.setShiftEntFalse(); | |
| 1489 | + }, | |
| 1490 | + deletelayer() { | |
| 1491 | + this.deletelayerMore(); | |
| 1492 | + //this.widgets.splice(this.rightClickIndex, 1); | |
| 1493 | + }, | |
| 1494 | + // 删除 | |
| 1495 | + deletelayerMore() { | |
| 1496 | + //键盘输入删除 | |
| 1497 | + this.entryDelete(this.rightClickIndex); | |
| 1499 | 1498 | }, |
| 1500 | 1499 | // 锁定 |
| 1501 | 1500 | lockLayer() { | ... | ... |
src/views/bigscreenDesigner/designer/tools/configure/texts/widget-text.js
| ... | ... | @@ -23,8 +23,16 @@ export const widgetText = { |
| 23 | 23 | placeholder: '', |
| 24 | 24 | value: '文本框', |
| 25 | 25 | }, |
| 26 | + // { | |
| 27 | + // type: 'el-input-text', | |
| 28 | + // label: '文本内容', | |
| 29 | + // name: 'text', | |
| 30 | + // required: false, | |
| 31 | + // placeholder: '', | |
| 32 | + // value: '文本框', | |
| 33 | + // }, | |
| 26 | 34 | { |
| 27 | - type: 'el-input-text', | |
| 35 | + type: 'el-input-textarea', | |
| 28 | 36 | label: '文本内容', |
| 29 | 37 | name: 'text', |
| 30 | 38 | required: false, |
| ... | ... | @@ -99,6 +107,14 @@ export const widgetText = { |
| 99 | 107 | ], |
| 100 | 108 | value: 'center' |
| 101 | 109 | }, |
| 110 | + { | |
| 111 | + type: 'el-switch', | |
| 112 | + label: '识别换行符', | |
| 113 | + name: 'whiteSpace', | |
| 114 | + required: false, | |
| 115 | + placeholder: '', | |
| 116 | + value: true, | |
| 117 | + } | |
| 102 | 118 | ], |
| 103 | 119 | data:[], |
| 104 | 120 | // 坐标 | ... | ... |
src/views/bigscreenDesigner/designer/widget/barline/widgetBarlinechart.vue
| ... | ... | @@ -79,7 +79,7 @@ export default { |
| 79 | 79 | yAxisIndex: 0, |
| 80 | 80 | data: [], |
| 81 | 81 | itemStyle: { |
| 82 | - barBorderRadius: null | |
| 82 | + barBorderRadius: null, | |
| 83 | 83 | } |
| 84 | 84 | }, |
| 85 | 85 | { |
| ... | ... | @@ -131,6 +131,7 @@ export default { |
| 131 | 131 | methods: { |
| 132 | 132 | // 修改图标options属性 |
| 133 | 133 | editorOptions() { |
| 134 | + this.setOptionsColor(); | |
| 134 | 135 | this.setOptionsTitle(); |
| 135 | 136 | this.setOptionsX(); |
| 136 | 137 | this.setOptionsY(); |
| ... | ... | @@ -140,7 +141,6 @@ export default { |
| 140 | 141 | this.setOptionsData(); |
| 141 | 142 | this.setOptionsMargin(); |
| 142 | 143 | this.setOptionsLegend(); |
| 143 | - this.setOptionsColor(); | |
| 144 | 144 | }, |
| 145 | 145 | // 标题修改 |
| 146 | 146 | setOptionsTitle() { |
| ... | ... | @@ -421,7 +421,19 @@ export default { |
| 421 | 421 | for (let i = 0; i < customColor.length; i++) { |
| 422 | 422 | arrColor.push(customColor[i].color); |
| 423 | 423 | } |
| 424 | - this.options.color = arrColor; | |
| 424 | + const itemStyle = { | |
| 425 | + normal: { | |
| 426 | + color: params => { | |
| 427 | + return arrColor[params.dataIndex]; | |
| 428 | + }, | |
| 429 | + barBorderRadius: optionsSetup.radius | |
| 430 | + } | |
| 431 | + }; | |
| 432 | + for (const key in this.options.series) { | |
| 433 | + if (this.options.series[key].type == "bar") { | |
| 434 | + this.options.series[key].itemStyle = itemStyle; | |
| 435 | + } | |
| 436 | + } | |
| 425 | 437 | this.options = Object.assign({}, this.options); |
| 426 | 438 | }, |
| 427 | 439 | // 数据处理 | ... | ... |
src/views/bigscreenDesigner/designer/widget/text/widgetText.vue
| ... | ... | @@ -51,7 +51,8 @@ export default { |
| 51 | 51 | height: this.transStyle.height + "px", |
| 52 | 52 | left: this.transStyle.left + "px", |
| 53 | 53 | top: this.transStyle.top + "px", |
| 54 | - right: this.transStyle.right + "px" | |
| 54 | + right: this.transStyle.right + "px", | |
| 55 | + whiteSpace: this.transStyle.whiteSpace ? "pre-line": "normal" | |
| 55 | 56 | }; |
| 56 | 57 | }, |
| 57 | 58 | }, | ... | ... |