Commit 280dfa8c authored by Jenny's avatar Jenny

feat: 切换数据

parent 501600d2
...@@ -11,7 +11,8 @@ const install = (Vue, vm) => { ...@@ -11,7 +11,8 @@ const install = (Vue, vm) => {
}, },
// 配置请求头信息 // 配置请求头信息
config.header = { config.header = {
"Content-Type": "application/json" "Content-Type": "application/json",
"Type": "wx"
} }
return config return config
}) })
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
components: { components: {
uniEcCanvas uniEcCanvas
}, },
onHide() {
clearInterval(this.changeTimer)
},
methods: { methods: {
initChart() { initChart() {
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
'animation-duration':`${elementInfo.marquee.speed ? elementInfo.marquee.speed : defaultSpeed}s` 'animation-duration':`${elementInfo.marquee.speed ? elementInfo.marquee.speed : defaultSpeed}s`
}" }"
> >
{{ text }} {{ elementData.dataList.text || elementInfo.option.title.text }}
</p> </p>
</view> </view>
</template> </template>
...@@ -27,9 +27,7 @@ export default { ...@@ -27,9 +27,7 @@ export default {
}; };
}, },
methods: { methods: {
initChart() { initChart() {}
this.text = this.elementData.dataList.text || this.elementInfo.option.title.text
}
} }
} }
</script> </script>
......
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
watch: { watch: {
'elementInfo.data': { 'elementInfo.data': {
handler(newVal) { handler(newVal) {
if(this.elementInfo.hide) return false
if (newVal.dataType === 'static') { if (newVal.dataType === 'static') {
this.handleStaticData(newVal) this.handleStaticData(newVal)
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<template v-for="(element, index) in reportData"> <template v-for="(element, index) in reportData">
<view <view
class="view-element" class="view-element"
v-if="!element.hide" v-show="!element.hide"
:key="element.id" :key="element.id"
:style="{ :style="{
width: `${element.width * scale}px`, width: `${element.width * scale}px`,
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
* 组件交互 - 组件 * 组件交互 - 组件
*/ */
uni.$on('handleLinkComp', ({ showData, hideData }) => { uni.$on('handleLinkComp', ({ showData, hideData }) => {
this.reportData.map(item => { this.reportData = this.reportData.map(item => {
if(showData.includes(item.id)) item.hide = false if(showData.includes(item.id)) item.hide = false
if(hideData.includes(item.id)) item.hide = true if(hideData.includes(item.id)) item.hide = true
return item return item
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
*/ */
handleValueChange(index, paramName, value) { handleValueChange(index, paramName, value) {
if(index.length && paramName && value) { if(index.length && paramName && value) {
this.reportData.map(item => { this.reportData = this.reportData.map(item => {
const flag = index.includes(item.id) const flag = index.includes(item.id)
if(flag && item.type === 'BasicText' && item.data.dataType === 'static') { if(flag && item.type === 'BasicText' && item.data.dataType === 'static') {
this.$set(item.data.dataList, 'text', value) this.$set(item.data.dataList, 'text', value)
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
position: relative; position: relative;
height: 100%; height: 100%;
user-select: none; user-select: none;
overflow: auto; // overflow: auto;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
background-position: center; background-position: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment