Commit f46d5e05 authored by leon's avatar leon

fix: report detail same deal with index

parent 48774168
<template> <template>
<view <view class="viewport-wrapper" :style="[styleObject]">
class="canvas"
:style="[styleObject]"
>
<view class="viewport-wrapper" :style="{
width: `${reportInfo.width * scale}px`,
height: `${reportInfo.height * scale}px`
}">
<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`,
...@@ -55,11 +48,11 @@ ...@@ -55,11 +48,11 @@
<!-- 远程图片 --> <!-- 远程图片 -->
<RemoteImage v-if="element.type == 'RemoteImage'" :elementInfo="element"></RemoteImage> <RemoteImage v-if="element.type == 'RemoteImage'" :elementInfo="element"></RemoteImage>
<!-- 普通表格 --> <!-- 普通表格 -->
<NormalTable v-if="element.type == 'NormalTable'" :elementInfo="element"></NormalTable> <!-- <NormalTable v-if="element.type == 'NormalTable'" :elementInfo="element"></NormalTable> -->
<Table v-if="element.type == 'NormalTable'" :elementInfo="element"></Table>
</view> </view>
</template> </template>
</view> </view>
</view>
</template> </template>
<script> <script>
...@@ -102,7 +95,7 @@ ...@@ -102,7 +95,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
...@@ -152,6 +145,7 @@ ...@@ -152,6 +145,7 @@
async getReportCharts() { async getReportCharts() {
clearInterval(this.timename) clearInterval(this.timename)
let res = await this.$u.api.getReportCharts({id: this.detailId}) let res = await this.$u.api.getReportCharts({id: this.detailId})
uni.stopPullDownRefresh()
const { Status, Result: { info, list } } = res.data const { Status, Result: { info, list } } = res.data
if (Status === 'true') { if (Status === 'true') {
if(info.dataUrl) { if(info.dataUrl) {
...@@ -181,7 +175,7 @@ ...@@ -181,7 +175,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)
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
async getReportCharts() { async getReportCharts() {
clearInterval(this.timename) clearInterval(this.timename)
let res = await this.$u.api.getReportCharts({id: '61cd2ba1c06bffbdae442c4f'}) let res = await this.$u.api.getReportCharts({id: '61cd2ba1c06bffbdae442c4f'})
uni.stopPullDownRefresh()
const { Status, Result: { info, list } } = res.data const { Status, Result: { info, list } } = res.data
if (Status === 'true') { if (Status === 'true') {
if(info.dataUrl) { if(info.dataUrl) {
......
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