fix: 修改打开asset Bottom的下弹框 切换详细视图 图表显示错误的问题

This commit is contained in:
zhangyu
2021-10-15 16:41:14 +08:00
parent ebd8baf38b
commit 08f0733052
9 changed files with 77 additions and 84 deletions

View File

@@ -800,7 +800,6 @@ export default {
},
// chartSite用于区分是全屏显示还是局部显示
initChart (chartInfo, dataArg, ele, legend) {
// console.log(123123132)
const self = this
let minTime = null
let maxTime = null

View File

@@ -212,7 +212,6 @@ export default {
this.firstShow = true // 展示操作按键
this.panelIdInner = panelId
// console.log(chartItem)
this.data = chartItem
this.text = chartItem.param.text
this.screenText = chartItem.param.text

View File

@@ -20,7 +20,7 @@
@command="changeDetailType">
<button class="top-tool-btn table-column-setting"
type="button">
<i class="nz-icon nz-icon-xiangxishitu" />
<i class="nz-icon nz-icon-detail-view" />
</button>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">{{$t('asset.detail.list')}}</el-dropdown-item>

View File

@@ -131,7 +131,6 @@ export default {
if (this.changeMoreNum) {
let height = 2
this.$refs.searchContentBox.forEach(item => {
console.log(item.offsetHeight)
height += item.offsetHeight
})
return height

View File

@@ -718,8 +718,8 @@ const en = {
type: 'Types',
pingInfo: 'Ping',
detail: {
list: 'List',
detail: 'View',
list: 'List view',
detail: 'Detail view',
orderBy: 'OrderBy',
orderByLabel: 'Order by {label}'
}

View File

@@ -16,9 +16,8 @@ export default {
if (this.detailType === flag) {
return
}
if (this.$refs.dataList) {
this.$refs.dataList.bottomBox.showSubList = false
}
this.$refs.dataList.bottomBox.showSubList = false
this.detailViewRightObj = ''
this.detailType = flag
let dataList = ''
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
@@ -67,7 +66,6 @@ export default {
this.$refs[dataList].$refs.searchInput.sreach_num = 0
this.searchMsg.searchLabelList.forEach(searchLabel => {
if (this.searchLabel[searchLabel.label]) {
console.log(searchLabel.label, this.searchLabel[searchLabel.label])
this.$refs[dataList].$refs.searchInput.select_list.push({
...searchLabel,
val: this.searchLabel[searchLabel.label]
@@ -88,7 +86,7 @@ export default {
orderBy = this.orderBy
orderType = 'ascending'
}
// this.$refs.dataTable.$refs.dataTable.sort(orderBy, orderType)
this.$refs.dataTable.$refs.dataTable.sort(orderBy, orderType)
}
}, 100)
},

View File

@@ -119,7 +119,6 @@ export default {
if (this.editDc.id) {
const param = { ...this.editDc }
const attr = this.$refs.latlngPicker.getAttribute()
console.log(attr)
param.latitude = attr.latitude
param.longitude = attr.longitude
this.$put('/dc', param).then(response => {

View File

@@ -25,7 +25,7 @@
@command="changeDetailType">
<button class="top-tool-btn table-column-setting"
type="button">
<i class="nz-icon nz-icon-liebiao" />
<i class="nz-icon nz-icon-list-view" />
</button>
<el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">{{$t('asset.detail.list')}}</el-dropdown-item>

View File

@@ -1,5 +1,73 @@
<template>
<div>
<nzDetailView
v-loading="detailViewLoading || tools.loading"
v-if="detailType !== 'list'"
:api="url"
ref="detailList"
:layout="dataListLayout"
:from="fromRoute.asset"
:search-msg="searchMsg"
:detailType="detailType"
:detailViewRightObj="detailViewRightObj"
@search="search"
@changeDetailType="changeDetailType"
>
<template v-slot:top-tool-left>
<detailViewTopSearch :selectValue.sync="selectValue" :detailSearchList="detailSearchList" @reload="reloadTable" />
</template>
<template v-slot:top-tool-right>
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
<i class="nz-icon nz-icon-create-square"></i>
</button>
<top-tool-more-options
ref="export"
id="model"
:params="searchLabel"
:params2="searchCheckBox"
:permissions="{
import: 'asset_add',
export: 'asset_view'
}"
class="top-tool-export margin-l-10 margin-r-10"
export-file-name="asset"
export-url="/asset/asset/export"
import-url="/asset/asset/import"
@afterImport="getTableData"
>
</top-tool-more-options>
</template>
<template v-slot:nz-detail-view-list>
<asset-detail
class="data-detail"
ref="dataDetail"
:orderByFa="orderBy"
v-loading="tools.loading"
:detailViewRightObj="detailViewRightObj"
:api="url"
:table-data="tableData"
@detailViewRightShow = 'detailViewRightShow'
@orderDetail="orderDetail"
>
</asset-detail>
</template>
<!-- 分页组件 -->
<template v-slot:pagination>
<el-pagination
@current-change="pageNo"
:current-page.sync="pageObj.pageNo"
:page-size="20"
:total="pageObj.total"
layout="prev, slot, next"
small
>
<template>
<el-input-number ref="jumpInput" v-model="pageObj.pageNo" :controls="false" :min="1" :max="pageObj.pages" class="jump-input" @change="getTableData" @keyup.enter.native="getTableData" size="mini"/>
<span class="jump-pages">/&nbsp{{pageObj.pages}}</span>
</template>
</el-pagination>
</template>
</nzDetailView>
<nz-data-list
v-loading="detailViewLoading"
v-show="detailType === 'list'"
@@ -76,74 +144,6 @@
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
</template>
</nz-data-list>
<nzDetailView
v-loading="detailViewLoading || tools.loading"
v-if="detailType !== 'list'"
:api="url"
ref="detailList"
:layout="dataListLayout"
:from="fromRoute.asset"
:search-msg="searchMsg"
:detailType="detailType"
:detailViewRightObj="detailViewRightObj"
@search="search"
@changeDetailType="changeDetailType"
>
<template v-slot:top-tool-left>
<detailViewTopSearch :selectValue.sync="selectValue" :detailSearchList="detailSearchList" @reload="reloadTable" />
</template>
<template v-slot:top-tool-right>
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
<i class="nz-icon nz-icon-create-square"></i>
</button>
<top-tool-more-options
ref="export"
id="model"
:params="searchLabel"
:params2="searchCheckBox"
:permissions="{
import: 'asset_add',
export: 'asset_view'
}"
class="top-tool-export margin-l-10 margin-r-10"
export-file-name="asset"
export-url="/asset/asset/export"
import-url="/asset/asset/import"
@afterImport="getTableData"
>
</top-tool-more-options>
</template>
<template v-slot:nz-detail-view-list>
<asset-detail
class="data-detail"
ref="dataDetail"
:orderByFa="orderBy"
v-loading="tools.loading"
:detailViewRightObj="detailViewRightObj"
:api="url"
:table-data="tableData"
@detailViewRightShow = 'detailViewRightShow'
@orderDetail="orderDetail"
>
</asset-detail>
</template>
<!-- 分页组件 -->
<template v-slot:pagination>
<el-pagination
@current-change="pageNo"
:current-page.sync="pageObj.pageNo"
:page-size="20"
:total="pageObj.total"
layout="prev, slot, next"
small
>
<template>
<el-input-number ref="jumpInput" v-model="pageObj.pageNo" :controls="false" :min="1" :max="pageObj.pages" class="jump-input" @change="getTableData" @keyup.enter.native="getTableData" size="mini"/>
<span class="jump-pages">/&nbsp{{pageObj.pages}}</span>
</template>
</el-pagination>
</template>
</nzDetailView>
<transition name="right-box">
<asset-box v-if="rightBox.show"
ref="assetBox"
@@ -659,7 +659,6 @@ export default {
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
this.tools.loading = false
if (response.code === 200) {
console.log(response)
if (response.statistics && this.$route.path === '/asset') {
this.setSearchData(response.statistics)
}
@@ -700,8 +699,8 @@ export default {
this.detailSearchList.model.show = true
})
} else {
this.titleSearchList[key].children = statistics[keys]
this.detailSearchList[key].children = statistics[keys]
this.titleSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id } })
this.detailSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id } })
}
this.titleSearchList[key].show = true
this.detailSearchList[key].show = true