Commit ac12636f34f0e52cee984323d7799902614607f6

Authored by chenxt
1 parent 1520b27d

动态图片加载

src/views/bigscreenDesigner/designer/components/dynamicForm.vue
@@ -513,7 +513,6 @@ export default { @@ -513,7 +513,6 @@ export default {
513 } 513 }
514 } 514 }
515 this.formData = Object.assign({}, this.formData); 515 this.formData = Object.assign({}, this.formData);
516 - console.log("🚀 ~ setDefaultValue ~ this.formData :", this.formData )  
517 } 516 }
518 }, 517 },
519 // 是否显示 那种格式 518 // 是否显示 那种格式
src/views/bigscreenDesigner/designer/widget/div/widgetDtImage.vue
@@ -13,7 +13,8 @@ export default { @@ -13,7 +13,8 @@ export default {
13 components: {}, 13 components: {},
14 props: { 14 props: {
15 value: Object, 15 value: Object,
16 - ispreview: Boolean 16 + ispreview: Boolean,
  17 + staticData: Object
17 }, 18 },
18 data() { 19 data() {
19 return { 20 return {
@@ -64,7 +65,17 @@ export default { @@ -64,7 +65,17 @@ export default {
64 this.initData(); 65 this.initData();
65 }, 66 },
66 deep: true 67 deep: true
67 - } 68 + },
  69 + staticData: {
  70 + handler(newVal) {
  71 + if (newVal && Object.keys(newVal).length > 0) {
  72 + this.getEchartData();
  73 + }
  74 + },
  75 + deep: true,
  76 + immediate: true // 立即执行一次
  77 + },
  78 +
68 }, 79 },
69 created() { 80 created() {
70 this.options = this.value; 81 this.options = this.value;
@@ -73,6 +84,7 @@ export default { @@ -73,6 +84,7 @@ export default {
73 this.options = this.value; 84 this.options = this.value;
74 this.optionsData = this.value.data; 85 this.optionsData = this.value.data;
75 this.setPicValue(); 86 this.setPicValue();
  87 +
76 }, 88 },
77 methods: { 89 methods: {
78 // vue hack 之强制刷新组件 90 // vue hack 之强制刷新组件
@@ -98,6 +110,7 @@ export default { @@ -98,6 +110,7 @@ export default {
98 this.getEchartData(); 110 this.getEchartData();
99 } 111 }
100 }, 112 },
  113 +
101 dynamicDataFn(refreshTime) { 114 dynamicDataFn(refreshTime) {
102 if (this.ispreview) { 115 if (this.ispreview) {
103 this.flagInter = setInterval(() => { 116 this.flagInter = setInterval(() => {
@@ -111,17 +124,20 @@ export default { @@ -111,17 +124,20 @@ export default {
111 const imageAdressOld =this.imageAdress; 124 const imageAdressOld =this.imageAdress;
112 const imageAdressNew =this.getShowPic(); 125 const imageAdressNew =this.getShowPic();
113 //this.imageAdress = this.getShowPic(); 126 //this.imageAdress = this.getShowPic();
114 - this.imageAdressShow = this.isNotBlank(this.imageAdress); 127 +
115 // console.log("this.imageAdress",imageAdressOld, imageAdressNew,(imageAdressOld!==imageAdressNew) ) 128 // console.log("this.imageAdress",imageAdressOld, imageAdressNew,(imageAdressOld!==imageAdressNew) )
116 if(imageAdressOld!==imageAdressNew){ 129 if(imageAdressOld!==imageAdressNew){
117 this.imageAdress = imageAdressNew; 130 this.imageAdress = imageAdressNew;
118 this.reload(); 131 this.reload();
119 } 132 }
  133 + this.imageAdressShow = this.isNotBlank(this.imageAdress);
  134 +
120 }, 135 },
121 getShowPic() { 136 getShowPic() {
122 const {textPic, slectedDataType} = this.transStyle; 137 const {textPic, slectedDataType} = this.transStyle;
123 const key = this.staticData[slectedDataType] || textPic; 138 const key = this.staticData[slectedDataType] || textPic;
124 const dataPic = this.value.setup.dynamicAddPicAdress; 139 const dataPic = this.value.setup.dynamicAddPicAdress;
  140 + console.log("🚀 ~ dataPic:", dataPic, this.staticData)
125 // if(this.isBlank(key) || this.isBlankArray(dataPic)){ 141 // if(this.isBlank(key) || this.isBlankArray(dataPic)){
126 // return this.transStyle.imageAdress; 142 // return this.transStyle.imageAdress;
127 // } 143 // }
src/views/bigscreenDesigner/designer/widget/widget.vue
@@ -34,7 +34,7 @@ import WidgetFunnel from "./funnel/widgetFunnel.vue"; @@ -34,7 +34,7 @@ import WidgetFunnel from "./funnel/widgetFunnel.vue";
34 import WidgetGauge from "./percent/widgetGauge.vue"; 34 import WidgetGauge from "./percent/widgetGauge.vue";
35 import WidgetPieNightingaleRoseArea from "./pie/widgetPieNightingaleRose"; 35 import WidgetPieNightingaleRoseArea from "./pie/widgetPieNightingaleRose";
36 import widgetTable from "./table/widgetTable.vue"; 36 import widgetTable from "./table/widgetTable.vue";
37 -import widgetRotateRanking from "./table/WidgetRotateRanking.vue"; 37 +// import widgetRotateRanking from "./table/WidgetRotateRanking.vue";
38 import widgetLineMap from "./map/widgetLineMap.vue"; 38 import widgetLineMap from "./map/widgetLineMap.vue";
39 import widgetPiePercentageChart from "./percent/widgetPiePercentageChart"; 39 import widgetPiePercentageChart from "./percent/widgetPiePercentageChart";
40 import widgetAirBubbleMap from "./map/widgetAirBubbleMap"; 40 import widgetAirBubbleMap from "./map/widgetAirBubbleMap";
src/views/bigscreenDesigner/viewer/index.vue
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 v-model="widget.value" 10 v-model="widget.value"
11 :index="index" 11 :index="index"
12 :type="widget.type" 12 :type="widget.type"
  13 + :value="widget.value"
13 /> 14 />
14 </div> 15 </div>
15 </div> 16 </div>
@@ -36,6 +37,7 @@ export default { @@ -36,6 +37,7 @@ export default {
36 }, 37 },
37 mounted() { 38 mounted() {
38 this.getData(); 39 this.getData();
  40 +
39 }, 41 },
40 methods: { 42 methods: {
41 ...mapMutations('dataSource', ['SET_STATIC_DATA','SET_REFRESHTIME']), 43 ...mapMutations('dataSource', ['SET_STATIC_DATA','SET_REFRESHTIME']),
@@ -63,6 +65,7 @@ export default { @@ -63,6 +65,7 @@ export default {
63 }; 65 };
64 // 赋值到全局变量 66 // 赋值到全局变量
65 this.setMasterData(data.dashboard); 67 this.setMasterData(data.dashboard);
  68 +
66 data.dashboard.widgets.forEach((item, index) => { 69 data.dashboard.widgets.forEach((item, index) => {
67 item.value.widgetId = item.value.setup.widgetId 70 item.value.widgetId = item.value.setup.widgetId
68 item.value.widgetCode = item.value.setup.widgetCode 71 item.value.widgetCode = item.value.setup.widgetCode