Commit a5b82dcb2881acc0449b50ba12903f9a0b15070c
1 parent
4bad9ea3
1、水波图添加外围边框自定义
2、水波图随着缩放跟着缩放问题处理
Showing
2 changed files
with
88 additions
and
6 deletions
src/views/bigscreenDesigner/designer/tools/configure/texts/widget-water-level-pond.js
| ... | ... | @@ -88,7 +88,45 @@ export const widgetWaterLevelPond= { |
| 88 | 88 | placeholder: '', |
| 89 | 89 | value: '' |
| 90 | 90 | }, |
| 91 | - [{ | |
| 91 | + [ | |
| 92 | + { | |
| 93 | + name: '自定义外圈设置', | |
| 94 | + list: [ | |
| 95 | + { | |
| 96 | + type: 'el-switch', | |
| 97 | + label: '显示', | |
| 98 | + name: 'isOutShow', | |
| 99 | + required: false, | |
| 100 | + placeholder: '', | |
| 101 | + value: false, | |
| 102 | + }, | |
| 103 | + // { | |
| 104 | + // type: 'el-switch', | |
| 105 | + // label: '边框角度', | |
| 106 | + // name: 'outBorderRadius', | |
| 107 | + // required: false, | |
| 108 | + // placeholder: '', | |
| 109 | + // value: 0 | |
| 110 | + // }, | |
| 111 | + { | |
| 112 | + type: 'el-input-number', | |
| 113 | + label: '粗度设置', | |
| 114 | + name: 'outBorder', | |
| 115 | + required: false, | |
| 116 | + placeholder: '', | |
| 117 | + value: 10 | |
| 118 | + }, | |
| 119 | + { | |
| 120 | + type: 'vue-color', | |
| 121 | + label: '颜色', | |
| 122 | + name: 'outBorderColor', | |
| 123 | + required: false, | |
| 124 | + placeholder: '', | |
| 125 | + value: '#19c3eb' | |
| 126 | + } | |
| 127 | + ], | |
| 128 | + }, | |
| 129 | + { | |
| 92 | 130 | name: '水位图配色', |
| 93 | 131 | list: [ |
| 94 | 132 | { | ... | ... |
src/views/bigscreenDesigner/designer/widget/text/widgetWaterLevelPond.vue
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | --> |
| 4 | 4 | <template> |
| 5 | 5 | <!-- <div id="widget-water-pond-level" :style="styleObj">--> |
| 6 | - <dv-water-level-pond :config="options" :style="styleObj"/> | |
| 6 | + <dv-water-level-pond :config="options" :style="styleObj" v-if="isRouterAlive" /> | |
| 7 | 7 | <!-- </div>--> |
| 8 | 8 | </template> |
| 9 | 9 | <script> |
| ... | ... | @@ -32,13 +32,23 @@ export default { |
| 32 | 32 | optionsStyle: {}, // 样式 |
| 33 | 33 | optionsData: {}, // 数据 |
| 34 | 34 | optionsCollapse: {}, // 图标属性 |
| 35 | - optionsSetup: {} | |
| 35 | + optionsSetup: {}, | |
| 36 | + flagInter: null, | |
| 37 | + isRouterAlive:true | |
| 36 | 38 | }; |
| 37 | 39 | }, |
| 40 | + provide(){ | |
| 41 | + return{ | |
| 42 | + reload:this.reload | |
| 43 | + } | |
| 44 | + }, | |
| 45 | + beforeDestroy() { | |
| 46 | + clearInterval(this.flagInter); | |
| 47 | + }, | |
| 38 | 48 | computed: { |
| 39 | 49 | ...mapState('dataSource', ['staticData','staticRefreshTime']), |
| 40 | 50 | styleObj() { |
| 41 | - return { | |
| 51 | + const style = { | |
| 42 | 52 | position: this.ispreview ? "absolute" : "static", |
| 43 | 53 | width: this.optionsStyle.width + "px", |
| 44 | 54 | height: this.optionsStyle.height + "px", |
| ... | ... | @@ -46,6 +56,21 @@ export default { |
| 46 | 56 | top: this.optionsStyle.top + "px", |
| 47 | 57 | background: this.optionsSetup.background |
| 48 | 58 | }; |
| 59 | + if(this.optionsSetup.isOutShow){ | |
| 60 | + let borderRadius = 0; | |
| 61 | + if(this.optionsSetup.shape=='rect'){ | |
| 62 | + borderRadius = 0; | |
| 63 | + }else if(this.optionsSetup.shape=='roundRect'){ | |
| 64 | + borderRadius = 3; | |
| 65 | + }else if(this.optionsSetup.shape=='round'){ | |
| 66 | + borderRadius = 50; | |
| 67 | + } | |
| 68 | + const border = this.optionsSetup.outBorder +"px solid "+ this.optionsSetup.outBorderColor; | |
| 69 | + style.borderRadius= borderRadius+"%"; | |
| 70 | + style['border']= border; | |
| 71 | + // console.log("style",style); | |
| 72 | + } | |
| 73 | + return style; | |
| 49 | 74 | }, |
| 50 | 75 | }, |
| 51 | 76 | watch: { |
| ... | ... | @@ -105,7 +130,7 @@ export default { |
| 105 | 130 | }, |
| 106 | 131 | setShowText(dataArray) { |
| 107 | 132 | this.options.data = dataArray; |
| 108 | - this.options={...this.options}; | |
| 133 | + this.reload(); | |
| 109 | 134 | }, |
| 110 | 135 | // 数据修改 |
| 111 | 136 | setOptionsData() { |
| ... | ... | @@ -130,7 +155,14 @@ export default { |
| 130 | 155 | getEchartData() { |
| 131 | 156 | const dataArray = this.getShowText(); |
| 132 | 157 | this.setShowText(dataArray); |
| 133 | - } | |
| 158 | + }, | |
| 159 | + // vue hack 之强制刷新组件 | |
| 160 | + reload(){ | |
| 161 | + this.isRouterAlive=false; | |
| 162 | + this.$nextTick(function(){ | |
| 163 | + this.isRouterAlive=true; | |
| 164 | + }) | |
| 165 | + }, | |
| 134 | 166 | } |
| 135 | 167 | }; |
| 136 | 168 | |
| ... | ... | @@ -141,4 +173,16 @@ export default { |
| 141 | 173 | height: 100%; |
| 142 | 174 | overflow: hidden; |
| 143 | 175 | } |
| 176 | +//.dv-water-pond-level { | |
| 177 | +// //max-width: 90%; | |
| 178 | +// border: 10px solid #19c3eb; | |
| 179 | +// border-radius: 50%; | |
| 180 | +// //ellipse { | |
| 181 | +// // stroke: transparent !important; | |
| 182 | +// //} | |
| 183 | +// // | |
| 184 | +// //text { | |
| 185 | +// // font-size: 40px; | |
| 186 | +// //} | |
| 187 | +//} | |
| 144 | 188 | </style> | ... | ... |