feat:asset 详细视图添加

This commit is contained in:
zhangyu
2021-10-14 14:14:25 +08:00
parent cfca72366c
commit 4e501cfc11
10 changed files with 73 additions and 30 deletions

View File

@@ -1,14 +1,14 @@
<template>
<div style="line-height: 32px;">
<div style="display: inline-block;margin-right: 20px" v-for="(item,key) in detailSearchListCopy" :key='key'>
<span class="search-detail-title">{{item.label}} :</span>
<div class="search-detail-box" :class="[selectValue[item.key].length?'select-dropdown':'',detailSearchListCopy[key].dropShow?'show-my-dropdpwn':'']" v-for="(item,key) in detailSearchListCopy" :key='key'>
<span class="search-detail-title" v-if="!selectValue[item.key].length">{{item.label}} :</span>
<span v-if="item.type === 'checkBox'">
<el-dropdown
class="detail-dropdown"
type="primary"
:trigger="'click'"
:hide-on-click="false"
@visible-change="searchStr = detailSearchListCopy[key].searchStr"
@visible-change="(val)=>{showDropDown(val, key)}"
>
<div>
<div class="detail-top-search" v-if="selectValue[item.key].length">
@@ -129,6 +129,10 @@ export default {
const obj = oldChildren.find(item => item.id == arr[0])
const children = obj.children.find(item => item.id == arr[1])
return children.name
},
showDropDown (val, key) {
this.searchStr = this.detailSearchListCopy[key].searchStr
this.detailSearchListCopy[key].dropShow = val
}
},
watch: {
@@ -141,7 +145,6 @@ export default {
this.detailSearchListCopy[key].searchStr = ''
this.detailSearchListCopy[key].oldChildren = JSON.parse(JSON.stringify(this.detailSearchListCopy[key].children))
})
console.log(this.detailSearchListCopy)
}
},
selectValue: {
@@ -154,14 +157,38 @@ export default {
}
</script>
<style scoped>
<style scoped lang="scss">
.search-detail-box{
display: inline-block;
margin-right: 20px;
transition: background-color .1s ease-out;
padding-left: 10px;
border-radius: 2px;
}
.search-detail-box:hover{
background-color: rgba(9,30,66,.13);
}
.search-detail-box.select-dropdown{
background-color: rgba(9,30,66,.13);
}
.search-detail-box.show-my-dropdpwn{
background-color: #344563;
color: #fff;
.search-detail-title{
color: #fff;
}
.detail-top-search{
color: #fff;
}
.search-value{
color: #fff;
}
}
.detail-dropdown{
border: 1px solid #E7EAED;
padding: 0 10px;
height: 30px;
line-height: 30px;
border-radius: 2px;
margin-left: 5px;
}
.search-detail-title {
font-size: 14px;
@@ -180,10 +207,10 @@ export default {
.detail-top-search {
display: inline-block;
vertical-align: bottom;
width: 100px;
overflow: hidden;
text-overflow:ellipsis;
white-space:nowrap;
max-width: 100px;
}
</style>
<style lang="scss">

View File

@@ -1,7 +1,7 @@
<template>
<div class="detail-left-box">
<div class="order-box">
<el-select v-model="orderBy" size="small" clearable placeholder="排序方式">
<el-select v-model="orderBy" size="small" placeholder="排序方式">
<el-option
v-for="item in tableTitle"
v-if="item.sortable==='custom'"

View File

@@ -39,14 +39,14 @@
</div>
</div>
<div class="nz-detail-view-right">
<detailViewRight
@getTableData = 'getTableData'
ref="detailViewRight"
v-if="detailViewRightObj"
:from="from"
:obj="detailViewRightObj"
:target-tab="'panelTab'"
/>
<!-- <detailViewRight-->
<!-- @getTableData = 'getTableData'-->
<!-- ref="detailViewRight"-->
<!-- v-if="detailViewRightObj"-->
<!-- :from="from"-->
<!-- :obj="detailViewRightObj"-->
<!-- :target-tab="'panelTab'"-->
<!-- />-->
</div>
</div>
</div>
@@ -153,7 +153,6 @@ export default {
this.$emit('getTableData')
},
changeDetailType (item) {
console.log(item)
this.$emit('changeDetailType', item)
}
},
@@ -166,7 +165,6 @@ export default {
immediate: true,
deep: true,
handler (n) {
console.log(n)
this.showLayout = [...n]
}
}

View File

@@ -109,7 +109,6 @@ export default {
obj: {
immediate: true,
handler (n) {
console.log(n)
if ((this.from === fromRoute.asset) && n) {
const assetSub = { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: false }
if (n.childrenNum) {

View File

@@ -38,7 +38,6 @@ export default {
selectValue: {
immediate: true,
handler (n) {
console.log(n)
this.cascaderData = []
if (n && this.type !== 'fields') {
n.forEach(item => {

View File

@@ -96,7 +96,7 @@ export default {
})
}
if (this.detailType === 'view') {
this.$refs.dataTable.$refs.dataTable.scrollTop = 0
this.$refs.dataDetail.$refs.dataTable.scrollTop = 0
}
}
})

View File

@@ -14,7 +14,7 @@ export default {
},
data () {
return {
orderBy: '',
orderBy: 'id',
orderType: 'ascending',
renderFirst: ''
}
@@ -35,7 +35,6 @@ export default {
orderByFa: {
immediate: true,
handler (n) {
console.log(n)
const index = n.indexOf('-')
this.renderFirst = false
if (index !== -1) {
@@ -45,6 +44,10 @@ export default {
this.orderBy = n
this.orderType = 'ascending'
}
if (!n) {
this.orderBy = 'id'
this.orderType = 'ascending'
}
setTimeout(() => {
this.renderFirst = true
})
@@ -52,7 +55,6 @@ export default {
},
orderBy: {
handler (n) {
console.log(n)
if (this.renderFirst) {
this.$emit('orderDetail', this.orderBy, this.orderType)
}

View File

@@ -25,7 +25,6 @@ export default {
this.titleSearchList.model.children.forEach(model => {
const brand = model.children.find(children => modelId == children.id)
if (brand) {
console.log(brand)
this.selectValue.modelIdsDetail.push(brand.brandId + '-' + modelId)
}
})
@@ -71,6 +70,20 @@ export default {
this.$refs.dataList.$refs.searchInput.searchLabelList = this.$refs.dataList.$refs.searchInput.searchLabelList.filter(item => searchLabel.label !== item.label)
}
})
if (this.orderBy && this.$refs.dataTable.$refs.dataTable) {
const index = this.orderBy.indexOf('-')
let orderBy = ''
let orderType = ''
if (index !== -1) {
orderBy = this.orderBy.slice(index + 1)
orderType = 'descending'
} else {
orderBy = this.orderBy
orderType = 'ascending'
}
this.$refs.dataTable.$refs.dataTable.sort(orderBy, orderType)
}
}, 100)
},
detailViewRightShow (item) {

View File

@@ -2,7 +2,7 @@
<div>
<nz-data-list
v-loading="detailViewLoading"
v-if="detailType === 'list'"
v-show="detailType === 'list'"
ref="dataList"
:api="url"
:custom-table-title.sync="tools.customTableTitle"
@@ -78,7 +78,7 @@
</nz-data-list>
<nzDetailView
v-loading="detailViewLoading || tools.loading"
v-if="detailType !== 'list'"
v-show="detailType !== 'list'"
:api="url"
ref="dataList"
:layout="dataListLayout"
@@ -116,7 +116,7 @@
<template v-slot:nz-detail-view-list>
<asset-detail
class="data-detail"
ref="dataTable"
ref="dataDetail"
:orderByFa="orderBy"
v-loading="tools.loading"
:detailViewRightObj="detailViewRightObj"
@@ -370,6 +370,7 @@ export default {
children: [],
show: false,
showMore: false,
dropShow: false,
width: 0,
index: -1
},
@@ -380,6 +381,7 @@ export default {
children: [],
show: false,
showMore: false,
dropShow: false,
width: 0,
index: -1
},
@@ -393,6 +395,7 @@ export default {
],
show: true,
showMore: false,
dropShow: false,
width: 0,
index: -1
},
@@ -403,6 +406,7 @@ export default {
children: [],
show: false,
showMore: false,
dropShow: false,
width: 0,
index: -1
},
@@ -413,6 +417,7 @@ export default {
children: [],
show: false,
showMore: false,
dropShow: false,
width: 0,
index: -1
}

View File

@@ -410,7 +410,7 @@ export default {
return { tableData: filterLevelData, tableChartData: temp }
},
filterLogType (data) {
const logData = data.filter(l => l.resultType === 'streamsFormat')
const logData = data.filter(l => l && (l.resultType === 'streamsFormat'))
let allTableData = []
// 合并
logData.forEach(d => {