feat: asset详细视图 基本功能实现

This commit is contained in:
zhangyu
2021-10-13 18:24:09 +08:00
parent 3029a0db41
commit cfca72366c
35 changed files with 264 additions and 65 deletions

View File

@@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "nz-icon"; /* Project id 2030432 */ font-family: "nz-icon"; /* Project id 2030432 */
src: url('iconfont.woff2?t=1631239483571') format('woff2'), src: url('iconfont.woff2?t=1634120008778') format('woff2'),
url('iconfont.woff?t=1631239483571') format('woff'), url('iconfont.woff?t=1634120008778') format('woff'),
url('iconfont.ttf?t=1631239483571') format('truetype'); url('iconfont.ttf?t=1634120008778') format('truetype');
} }
.nz-icon { .nz-icon {
@@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.nz-icon-guide1:before {
content: "\e744";
}
.nz-icon-wailian:before {
content: "\e745";
}
.nz-icon-liebiao:before {
content: "\e742";
}
.nz-icon-xiangxishitu:before {
content: "\e743";
}
.nz-icon-dingshishijian:before { .nz-icon-dingshishijian:before {
content: "\e73f"; content: "\e73f";
} }
@@ -109,10 +125,6 @@
content: "\e63e"; content: "\e63e";
} }
.nz-icon-guide:before {
content: "\e669";
}
.nz-icon-more3:before { .nz-icon-more3:before {
content: "\e725"; content: "\e725";
} }

View File

@@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "nz-icon"; /* Project id 2030432 */ font-family: "nz-icon"; /* Project id 2030432 */
src: url('./font/iconfont.woff2?t=1631239483571') format('woff2'), src: url('./font/iconfont.woff2?t=1634120008778') format('woff2'),
url('./font/iconfont.woff?t=1631239483571') format('woff'), url('./font/iconfont.woff?t=1634120008778') format('woff'),
url('./font/iconfont.ttf?t=1631239483571') format('truetype'); url('./font/iconfont.ttf?t=1634120008778') format('truetype');
} }
.nz-icon { .nz-icon {
@@ -13,6 +13,22 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.nz-icon-guide1:before {
content: "\e744";
}
.nz-icon-wailian:before {
content: "\e745";
}
.nz-icon-liebiao:before {
content: "\e742";
}
.nz-icon-xiangxishitu:before {
content: "\e743";
}
.nz-icon-dingshishijian:before { .nz-icon-dingshishijian:before {
content: "\e73f"; content: "\e73f";
} }
@@ -109,10 +125,6 @@
content: "\e63e"; content: "\e63e";
} }
.nz-icon-guide:before {
content: "\e669";
}
.nz-icon-more3:before { .nz-icon-more3:before {
content: "\e725"; content: "\e725";
} }

View File

@@ -359,6 +359,9 @@ export default {
if (state) { if (state) {
this.state = state this.state = state
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.$set(this.searchLabel, 'state', this.state) this.$set(this.searchLabel, 'state', this.state)

View File

@@ -218,6 +218,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.$set(this.searchLabel, 'pids', this.obj.id) this.$set(this.searchLabel, 'pids', this.obj.id)

View File

@@ -218,6 +218,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
if (this.from === fromRoute.model) { if (this.from === fromRoute.model) {

View File

@@ -125,6 +125,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -112,6 +112,9 @@ export default {
}, },
methods: { methods: {
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
const params = { const params = {
...this.searchLabel, ...this.searchLabel,
pageNo: this.pageObj.pageNo, pageNo: this.pageObj.pageNo,

View File

@@ -120,6 +120,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -124,6 +124,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -22,7 +22,7 @@
<i class="nz-icon nz-icon-arrow-down search-value"/> <i class="nz-icon nz-icon-arrow-down search-value"/>
</div> </div>
<el-dropdown-menu slot="dropdown" class="detail-top-search-dropdown"> <el-dropdown-menu slot="dropdown" class="detail-top-search-dropdown">
<div><el-input size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}"/></div> <div style="text-align: center;"><el-input style="width: calc(100% - 40px)" size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}" suffix-icon="el-icon-search"/></div>
<el-checkbox-group v-model="selectValue[item.key]"> <el-checkbox-group v-model="selectValue[item.key]">
<el-dropdown-item v-for="(item3,index3) in item.children" :key="index3" :title="item3.name"> <el-dropdown-item v-for="(item3,index3) in item.children" :key="index3" :title="item3.name">
<el-checkbox :label="item3.id">{{item3.name}}</el-checkbox> <el-checkbox :label="item3.id">{{item3.name}}</el-checkbox>
@@ -51,10 +51,10 @@
<i class="nz-icon nz-icon-arrow-down search-value"/> <i class="nz-icon nz-icon-arrow-down search-value"/>
</div> </div>
<el-dropdown-menu slot="dropdown" class="detail-top-search-dropdown"> <el-dropdown-menu slot="dropdown" class="detail-top-search-dropdown">
<div><el-input size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}"/></div> <div style="text-align: center;"><el-input style="width: calc(100% - 40px)" size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}" suffix-icon="el-icon-search"/></div>
<el-checkbox-group v-model="selectValue[item.key]"> <el-checkbox-group v-model="selectValue[item.key]">
<el-dropdown-item v-for="(item3,index3) in item.children" :key="index3" > <el-dropdown-item v-for="(item3,index3) in item.children" :key="index3" >
<span :title="item3.name"> {{item3.name}}</span> <span :title="item3.name" class="children-title-name"> {{item3.name}}</span>
<el-checkbox :label="item3.id+'-'+item4.id" :key="index4" v-for="(item4,index4) in item3.children">{{item4.name}}</el-checkbox> <el-checkbox :label="item3.id+'-'+item4.id" :key="index4" v-for="(item4,index4) in item3.children">{{item4.name}}</el-checkbox>
</el-dropdown-item> </el-dropdown-item>
</el-checkbox-group> </el-checkbox-group>
@@ -109,8 +109,20 @@ export default {
}, },
methods: { methods: {
searchStrChange (val, key) { searchStrChange (val, key) {
if (this.detailSearchListCopy[key].type === 'checkBox') {
this.detailSearchListCopy[key].searchStr = val this.detailSearchListCopy[key].searchStr = val
this.detailSearchListCopy[key].children = this.detailSearchListCopy[key].oldChildren.filter(children => children.name.indexOf(val) !== -1) this.detailSearchListCopy[key].children = this.detailSearchListCopy[key].oldChildren.filter(children => children.name.indexOf(val) !== -1)
} else {
this.detailSearchListCopy[key].searchStr = val
const arr = []
this.detailSearchListCopy[key].oldChildren.forEach(item => {
const children = item.children.filter(children => children.name.indexOf(val) !== -1)
if (children && children.length) {
arr.push({ ...item, children: children })
}
})
this.detailSearchListCopy[key].children = arr
}
}, },
getSearchStr (oldChildren, label) { getSearchStr (oldChildren, label) {
const arr = label.split('-') const arr = label.split('-')
@@ -179,6 +191,7 @@ export default {
max-height: 300px; max-height: 300px;
overflow-y: auto; overflow-y: auto;
.el-dropdown-menu__item{ .el-dropdown-menu__item{
background: #fff !important;
padding: 0; padding: 0;
max-width: 200px; max-width: 200px;
overflow: hidden; overflow: hidden;
@@ -197,6 +210,22 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
} }
.el-checkbox:hover{
color: #fa901c;
background-color: #fafafa !important;
}
.children-title-name{
width: calc(100% - 20px);
height: 36px;
padding-left: 20px;
font-size: 12px;
color: #909399;
line-height: 30px;
}
}
.el-dropdown-menu__item:not(.is-disabled):hover{
color: #606266;
background: #fff !important;
} }
} }
.clear-all-select{ .clear-all-select{

View File

@@ -1,16 +1,21 @@
<template> <template>
<div class="detail-left-box"> <div class="detail-left-box">
<div class="order-box"> <div class="order-box">
<el-select v-model="orderBy" placeholder="请选择"> <el-select v-model="orderBy" size="small" clearable placeholder="排序方式">
<el-option <el-option
v-for="item in tableTitle" v-for="item in tableTitle"
v-if="item.sortable==='custom'"
:key="item.prop" :key="item.prop"
:label="item.label" :label="item.label"
:value="item.prop"> :value="item.prop">
</el-option> </el-option>
</el-select> </el-select>
<el-button @click="orderTypeChange" size="small" style="height: 32px;padding: 0 5px 0 5px">
<i class="nz-icon nz-icon-jiantou-top" v-if="orderType=='ascending'" />
<i class="nz-icon nz-icon-jiantou-down" v-if="orderType=='descending'" />
</el-button>
</div> </div>
<ul class="detail-row-box"> <ul class="detail-row-box" ref="dataTable">
<li v-for="(item,index) in tableData" :key="index" class="detail-row" @click="detailViewRightShow(item)" :class="item.id === detailViewRightObj.id ? 'selected' : ''"> <li v-for="(item,index) in tableData" :key="index" class="detail-row" @click="detailViewRightShow(item)" :class="item.id === detailViewRightObj.id ? 'selected' : ''">
<div class="detail-row-info"> <div class="detail-row-info">
<div class="asset-manageIp" :title="item.name"> <div class="asset-manageIp" :title="item.name">
@@ -37,9 +42,6 @@ import detailViewLeftMixin from '@/components/common/mixin/detailViewLeftMixin'
export default { export default {
name: 'assetDetail', name: 'assetDetail',
mixins: [detailViewLeftMixin], mixins: [detailViewLeftMixin],
props: {
detailViewRightObj: {}
},
data () { data () {
return { return {
tableTitle: [ tableTitle: [
@@ -141,26 +143,7 @@ export default {
show: false, show: false,
minWidth: 120 minWidth: 120
} }
], ]
orderBy: '',
orderType: 'ascending'
}
},
methods: {
detailViewRightShow (item) {
this.$emit('detailViewRightShow', item)
}
},
watch: {
orderBy: {
handler (n) {
this.$emit('orderDetail', n, this.orderType)
}
},
orderType: {
handler (n) {
this.$emit('orderDetail', this.orderBy, n)
}
} }
} }
} }
@@ -168,9 +151,11 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.order-box{ .order-box{
display: flex;
height:40px; height:40px;
padding: 0 15px; padding: 0 15px;
line-height: 40px line-height: 40px;
align-items: center;
} }
.detail-row-box{ .detail-row-box{
height: calc(100% - 40px); height: calc(100% - 40px);

View File

@@ -20,7 +20,7 @@
@command="changeDetailType"> @command="changeDetailType">
<button class="top-tool-btn table-column-setting" <button class="top-tool-btn table-column-setting"
type="button"> type="button">
<i class="nz-icon nz-icon-guzhangshuju" /> <i class="nz-icon nz-icon-xiangxishitu" />
</button> </button>
<el-dropdown-menu slot="dropdown" > <el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">列表</el-dropdown-item> <el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">列表</el-dropdown-item>

View File

@@ -2,25 +2,25 @@
<div style="height: 100%"> <div style="height: 100%">
<div v-if="from === fromRoute.asset" class="detail-title-box"> <div v-if="from === fromRoute.asset" class="detail-title-box">
<div> <div>
<span class="detail-title-key">Data center :</span> <span class="detail-title-value">{{obj.dc.name}}</span> <span class="detail-title-key">Data center :</span> <span class="detail-title-value">{{obj.dc?obj.dc.name:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">Cabinet :</span> <span class="detail-title-value">{{obj.cabinet.name}}</span> <span class="detail-title-key">Cabinet :</span> <span class="detail-title-value">{{obj.cabinet?obj.cabinet.name:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">Alert :</span> <span class="detail-title-value"><i :class="obj.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert"></i> {{obj.alertNum}}</span> <span class="detail-title-key">Alert :</span> <span class="detail-title-value"><i :class="obj.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert"></i> {{obj.alertNum?obj.alertNum:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">Endpoint :</span> <span class="detail-title-value"><i class="nz-icon nz-icon-overview-endpoint monitorColor"></i> {{obj.endpointNum}}</span> <span class="detail-title-key">Endpoint :</span> <span class="detail-title-value"><i class="nz-icon nz-icon-overview-endpoint monitorColor"></i> {{obj.endpointNum?obj.endpointNum:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">Brand :</span> <span class="detail-title-value">{{obj.brand.name}}</span> <span class="detail-title-key">Brand :</span> <span class="detail-title-value">{{obj.brand?obj.brand.name:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">Brand :</span> <span class="detail-title-value">{{obj.model.name}}</span> <span class="detail-title-key">Brand :</span> <span class="detail-title-value">{{obj.model?obj.model.name:'-'}}</span>
</div> </div>
<div> <div>
<span class="detail-title-key">SN :</span> <span class="detail-title-value">{{obj.sn}}</span> <span class="detail-title-key">SN :</span> <span class="detail-title-value">{{obj.sn?obj.sn:'-'}}</span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -44,7 +44,9 @@ export default {
n.forEach(item => { n.forEach(item => {
if (this.item.children.find(children => children.id == item)) { if (this.item.children.find(children => children.id == item)) {
this.cascaderData.push([item]) this.cascaderData.push([item])
setTimeout(() => {
this.$emit('resize', [item]) this.$emit('resize', [item])
})
} }
}) })
} else if (n && this.type === 'fields') { } else if (n && this.type === 'fields') {
@@ -52,8 +54,10 @@ export default {
if (obj[this.item.id]) { if (obj[this.item.id]) {
obj[this.item.id].forEach(item => { obj[this.item.id].forEach(item => {
this.cascaderData.push([item]) this.cascaderData.push([item])
setTimeout(() => {
this.$emit('resize', [item]) this.$emit('resize', [item])
}) })
})
} }
} }
} }

View File

@@ -15,6 +15,7 @@ export default {
pages: 1, pages: 1,
total: 0 total: 0
}, },
orderBy: '',
/* 工具参数 */ /* 工具参数 */
tools: { tools: {
loading: true, // 是否显示table加载动画 loading: true, // 是否显示table加载动画
@@ -70,6 +71,11 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
} else {
delete this.searchLabel.orderBy
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true
@@ -89,6 +95,9 @@ export default {
this.toTopBtnHandler(this.scrollbarWrap) this.toTopBtnHandler(this.scrollbarWrap)
}) })
} }
if (this.detailType === 'view') {
this.$refs.dataTable.$refs.dataTable.scrollTop = 0
}
} }
}) })
}, },
@@ -173,13 +182,10 @@ export default {
this.$set(this.searchLabel, item, searchObj[item]) this.$set(this.searchLabel, item, searchObj[item])
} }
} }
if (this.$refs.dataTable) {
this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0
}
this.getTableData() this.getTableData()
}, },
tableDataSort (orderBy) { tableDataSort (orderBy) {
this.$set(this.searchLabel, 'orderBy', orderBy) this.orderBy = orderBy
this.getTableData() this.getTableData()
}, },
tableTitleReset (src, dist) { tableTitleReset (src, dist) {

View File

@@ -8,12 +8,62 @@ export default {
}, },
tableId: { tableId: {
type: String type: String
} },
detailViewRightObj: {},
orderByFa: {}
}, },
data () { data () {
return { return {
orderBy: '',
orderType: 'ascending',
renderFirst: ''
} }
}, },
methods: { methods: {
detailViewRightShow (item) {
this.$emit('detailViewRightShow', item)
},
orderTypeChange () {
if (this.orderType === 'ascending') {
this.orderType = 'descending'
} else {
this.orderType = 'ascending'
}
}
},
watch: {
orderByFa: {
immediate: true,
handler (n) {
console.log(n)
const index = n.indexOf('-')
this.renderFirst = false
if (index !== -1) {
this.orderBy = n.slice(index + 1)
this.orderType = 'descending'
} else {
this.orderBy = n
this.orderType = 'ascending'
}
setTimeout(() => {
this.renderFirst = true
})
}
},
orderBy: {
handler (n) {
console.log(n)
if (this.renderFirst) {
this.$emit('orderDetail', this.orderBy, this.orderType)
}
}
},
orderType: {
handler (n) {
if (this.renderFirst) {
this.$emit('orderDetail', this.orderBy, n)
}
}
}
} }
} }

View File

@@ -59,10 +59,30 @@ export default {
setTimeout(() => { setTimeout(() => {
this.detailViewLoading = false this.detailViewLoading = false
this.$refs.clickSearch && this.$refs.clickSearch.needMore() this.$refs.clickSearch && this.$refs.clickSearch.needMore()
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]
})
this.$refs.dataList.$refs.searchInput.sreach_num++
this.$refs.dataList.$refs.searchInput.searchLabelList = this.$refs.dataList.$refs.searchInput.searchLabelList.filter(item => searchLabel.label !== item.label)
}
})
}, 100) }, 100)
}, },
detailViewRightShow (item) { detailViewRightShow (item) {
this.detailViewRightObj = item this.detailViewRightObj = item
},
orderDetail (order, orderType) {
if (orderType === 'ascending') {
this.orderBy = order
} else {
this.orderBy = '-' + order
}
this.getTableData()
} }
} }
} }

View File

@@ -15,11 +15,13 @@ export default {
}, },
tableId: { tableId: {
type: String type: String
} },
orderByFa: {}
}, },
data () { data () {
return { return {
operationWidth: '165' // 操作列宽 operationWidth: '165', // 操作列宽
orderBy: {}
} }
}, },
methods: { methods: {
@@ -80,5 +82,20 @@ export default {
} }
this.$emit('orderBy', orderBy) this.$emit('orderBy', orderBy)
} }
},
watch: {
orderByFa: {
immediate: true,
handler (n) {
if (n) {
const index = n.indexOf('-')
if (index !== -1) {
this.orderBy[n.slice(index + 1)] = 'descending'
} else {
this.orderBy[n] = 'descending'
}
}
}
}
} }
} }

View File

@@ -4,6 +4,7 @@
ref="dataTable" ref="dataTable"
:data="tableData" :data="tableData"
:height="height" :height="height"
:default-sort="orderBy"
border border
@header-dragend="dragend" @header-dragend="dragend"
@sort-change="tableDataSort" @sort-change="tableDataSort"

View File

@@ -25,7 +25,7 @@
@command="changeDetailType"> @command="changeDetailType">
<button class="top-tool-btn table-column-setting" <button class="top-tool-btn table-column-setting"
type="button"> type="button">
<i class="nz-icon nz-icon-alert-list" /> <i class="nz-icon nz-icon-liebiao" />
</button> </button>
<el-dropdown-menu slot="dropdown" > <el-dropdown-menu slot="dropdown" >
<el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">列表</el-dropdown-item> <el-dropdown-item :command="'list'" :class="detailType === 'list' ? 'active' : ''">列表</el-dropdown-item>

View File

@@ -595,6 +595,9 @@ export default {
if (state) { if (state) {
this.state = state this.state = state
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.$set(this.searchLabel, 'state', this.state) this.$set(this.searchLabel, 'state', this.state)

View File

@@ -176,6 +176,9 @@ export default {
this.$refs.dataList.showBottomBox('alertRuleAlertMessage', alertRule) this.$refs.dataList.showBottomBox('alertRuleAlertMessage', alertRule)
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -154,6 +154,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -2,7 +2,7 @@
<div> <div>
<nz-data-list <nz-data-list
v-loading="detailViewLoading" v-loading="detailViewLoading"
v-show="detailType === 'list'" v-if="detailType === 'list'"
ref="dataList" ref="dataList"
:api="url" :api="url"
:custom-table-title.sync="tools.customTableTitle" :custom-table-title.sync="tools.customTableTitle"
@@ -55,6 +55,7 @@
<template v-slot:default="slotProps"> <template v-slot:default="slotProps">
<asset-table <asset-table
ref="dataTable" ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading" v-loading="tools.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
@@ -115,12 +116,14 @@
<template v-slot:nz-detail-view-list> <template v-slot:nz-detail-view-list>
<asset-detail <asset-detail
class="data-detail" class="data-detail"
ref="dataDetail" ref="dataTable"
:orderByFa="orderBy"
v-loading="tools.loading" v-loading="tools.loading"
:detailViewRightObj="detailViewRightObj" :detailViewRightObj="detailViewRightObj"
:api="url" :api="url"
:table-data="tableData" :table-data="tableData"
@detailViewRightShow = 'detailViewRightShow' @detailViewRightShow = 'detailViewRightShow'
@orderDetail="orderDetail"
> >
</asset-detail> </asset-detail>
</template> </template>
@@ -256,6 +259,7 @@ export default {
tableId: 'assetTable', // 需要分页的table的id用于记录每页数量 tableId: 'assetTable', // 需要分页的table的id用于记录每页数量
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息
searchLabelList: [{ searchLabelList: [{
id: 'ids',
name: 'ID', name: 'ID',
type: 'input', type: 'input',
label: 'ids', label: 'ids',
@@ -264,21 +268,25 @@ export default {
name: this.$t('overall.name'), name: this.$t('overall.name'),
type: 'input', type: 'input',
label: 'name', label: 'name',
id: 'name',
disabled: false disabled: false
}, { }, {
name: 'SN', name: 'SN',
type: 'input', type: 'input',
label: 'sn', label: 'sn',
id: 'sn',
disabled: false disabled: false
}, { }, {
name: 'IP', name: 'IP',
type: 'input', type: 'input',
label: 'manageIp', label: 'manageIp',
id: 'manageIp',
disabled: false disabled: false
}, { }, {
name: this.$t('asset.state'), name: this.$t('asset.state'),
type: 'assetState', type: 'assetState',
label: 'stateIds', label: 'stateIds',
id: 'stateIds',
readonly: true, readonly: true,
disabled: false disabled: false
}] }]

View File

@@ -177,6 +177,9 @@ export default {
}) })
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -197,6 +197,9 @@ export default {
}) })
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
if (!this.scrollbarWrap) { if (!this.scrollbarWrap) {

View File

@@ -113,6 +113,9 @@ export default {
this.layout = [] this.layout = []
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
// 获取 userId 作为过滤条件传给后台 // 获取 userId 作为过滤条件传给后台

View File

@@ -208,6 +208,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true

View File

@@ -103,6 +103,9 @@ export default {
}, },
methods: { methods: {
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
const params = { const params = {
...this.searchLabel, ...this.searchLabel,
pageNo: this.pageObj.pageNo, pageNo: this.pageObj.pageNo,

View File

@@ -46,6 +46,7 @@
<!-- type="button" @click="batchModify">--> <!-- type="button" @click="batchModify">-->
<!-- <i class="nz-icon-batch-edit nz-icon"></i>--> <!-- <i class="nz-icon-batch-edit nz-icon"></i>-->
<!-- </button>--> <!-- </button>-->
</template> </template>
<template v-slot:search> <template v-slot:search>
<click-search :select-value.sync="selectValue" :title-search-list="titleSearchList" @reload="reloadTable"></click-search> <click-search :select-value.sync="selectValue" :title-search-list="titleSearchList" @reload="reloadTable"></click-search>
@@ -443,6 +444,9 @@ export default {
} }
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
const params = { const params = {

View File

@@ -299,6 +299,9 @@ export default {
this.edit(u, true) this.edit(u, true)
}, },
getTableData () { getTableData () {
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
if (this.searchLabel.projectIds) { if (this.searchLabel.projectIds) {

View File

@@ -122,6 +122,9 @@ export default {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])
} }
} }
if (this.orderBy) {
this.$set(this.searchLabel, 'orderBy', this.orderBy)
}
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo) this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize) this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
this.tools.loading = true this.tools.loading = true