fix:搜索内容调整 modeil以及more未完善
This commit is contained in:
@@ -1,24 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="line-height: 32px;">
|
<div style="line-height: 32px;">
|
||||||
<div style="display: inline-block;margin-right: 20px" v-for="(item,index) in detailSearchListCopy" :key='index'>
|
<div style="display: inline-block;margin-right: 20px" v-for="(item,key) in detailSearchListCopy" :key='key'>
|
||||||
<span class="search-title">{{item.label}}:</span>
|
<span class="search-detail-title">{{item.label}} :</span>
|
||||||
<span>
|
<span v-if="item.type === 'checkBox'">
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
|
class="detail-dropdown"
|
||||||
type="primary"
|
type="primary"
|
||||||
:trigger="'click'"
|
:trigger="'click'"
|
||||||
:hide-on-click="false"
|
:hide-on-click="false"
|
||||||
|
@visible-change="searchStr = detailSearchListCopy[key].searchStr"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="detail-top-search">
|
<div class="detail-top-search" v-if="selectValue[item.key].length">
|
||||||
<span v-for="(item2,index2) in searchDetailObj[item.key]" :key="item2" class="search-value">
|
<span v-for="(item2,index2) in selectValue[item.key]" :key="item2" class="search-value">
|
||||||
{{item.children.find(dc=>dc.id==item2).name}}<span v-if="index2+1 !== searchDetailObj[item.key].length">,</span>
|
{{item.oldChildren.find(dc=>dc.id==item2).name}}<span v-if="index2+1 !== selectValue[item.key].length">,</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="detail-top-search" style="text-align: center" v-else>
|
||||||
|
All
|
||||||
|
</div>
|
||||||
<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">
|
||||||
<span @click="searchDetailObj[item.key] = []" class="clear-all-select">{{$t('overall.clearAllSelect')}}</span>
|
<div><el-input size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}"/></div>
|
||||||
<el-checkbox-group v-model="searchDetailObj[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>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
@@ -26,6 +31,36 @@
|
|||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else-if="item.type === 'dropdownCheckBox'">
|
||||||
|
<el-dropdown
|
||||||
|
class="detail-dropdown"
|
||||||
|
type="primary"
|
||||||
|
:trigger="'click'"
|
||||||
|
:hide-on-click="false"
|
||||||
|
@visible-change="searchStr = detailSearchListCopy[key].searchStr"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div class="detail-top-search" v-if="selectValue[item.key].length">
|
||||||
|
<span v-for="(item2,index2) in selectValue[item.key]" :key="item2" class="search-value">
|
||||||
|
{{getSearchStr(item.oldChildren,item2)}}<span v-if="index2+1 !== selectValue[item.key].length">,</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="detail-top-search" style="text-align: center" v-else>
|
||||||
|
All
|
||||||
|
</div>
|
||||||
|
<i class="nz-icon nz-icon-arrow-down search-value"/>
|
||||||
|
</div>
|
||||||
|
<el-dropdown-menu slot="dropdown" class="detail-top-search-dropdown">
|
||||||
|
<div><el-input size="small" v-model="searchStr" @input="(val)=>{searchStrChange(val,key)}"/></div>
|
||||||
|
<el-checkbox-group v-model="selectValue[item.key]">
|
||||||
|
<el-dropdown-item v-for="(item3,index3) in item.children" :key="index3" :title="item3.name">
|
||||||
|
{{item3.name}}
|
||||||
|
<el-checkbox :label="item3.id+'-'+item4.id" :key="index4" v-for="(item4,index4) in item3.children">{{item4.name}}</el-checkbox>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -60,13 +95,28 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchDetailObj: {
|
selectValue: {
|
||||||
type: Object
|
type: Object
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
detailSearchListCopy: {}
|
detailSearchListCopy: {},
|
||||||
|
searchStr: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
searchStrChange (val, key) {
|
||||||
|
this.detailSearchListCopy[key].searchStr = val
|
||||||
|
this.detailSearchListCopy[key].children = this.detailSearchListCopy[key].oldChildren.filter(children => children.name.indexOf(val) !== -1)
|
||||||
|
},
|
||||||
|
getSearchStr (oldChildren, label) {
|
||||||
|
const arr = label.split('-')
|
||||||
|
const obj = oldChildren.find(item => item.id == arr[0])
|
||||||
|
const children = obj.children.find(item => item.id == arr[1])
|
||||||
|
return children.name
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -74,14 +124,17 @@ export default {
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
console.log(n)
|
|
||||||
this.detailSearchListCopy = JSON.parse(JSON.stringify(n))
|
this.detailSearchListCopy = JSON.parse(JSON.stringify(n))
|
||||||
|
Object.keys(this.detailSearchListCopy).forEach(key => {
|
||||||
|
this.detailSearchListCopy[key].searchStr = ''
|
||||||
|
this.detailSearchListCopy[key].oldChildren = JSON.parse(JSON.stringify(this.detailSearchListCopy[key].children))
|
||||||
|
})
|
||||||
|
console.log(this.detailSearchListCopy)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchDetailObj: {
|
selectValue: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
console.log(n, 123123123)
|
|
||||||
this.$emit('reload', n)
|
this.$emit('reload', n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +143,15 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-title {
|
.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;
|
font-size: 14px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
@@ -107,11 +168,10 @@ export default {
|
|||||||
.detail-top-search {
|
.detail-top-search {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
max-width: 100px;
|
width: 100px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
margin-left: 5px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="detail-left-box">
|
<div class="detail-left-box">
|
||||||
<div style="height:40px">123</div>
|
<div class="order-box">
|
||||||
|
<el-select v-model="orderBy" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in tableTitle"
|
||||||
|
:key="item.prop"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.prop">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
<ul class="detail-row-box">
|
<ul class="detail-row-box">
|
||||||
<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">
|
||||||
@@ -52,6 +61,16 @@ export default {
|
|||||||
show: true,
|
show: true,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
|
}, {
|
||||||
|
label: this.$t('overall.parent'),
|
||||||
|
prop: 'parent',
|
||||||
|
show: false,
|
||||||
|
minWidth: 110
|
||||||
|
}, {
|
||||||
|
label: this.$t('overall.children'),
|
||||||
|
prop: 'children',
|
||||||
|
show: false,
|
||||||
|
minWidth: 120
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('overall.type'),
|
label: this.$t('overall.type'),
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
@@ -64,6 +83,11 @@ export default {
|
|||||||
show: true,
|
show: true,
|
||||||
minWidth: 110,
|
minWidth: 110,
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
|
}, {
|
||||||
|
label: this.$t('asset.pingInfo'),
|
||||||
|
prop: 'pingInfo',
|
||||||
|
show: true,
|
||||||
|
minWidth: 110
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('overall.dc'),
|
label: this.$t('overall.dc'),
|
||||||
prop: 'dc',
|
prop: 'dc',
|
||||||
@@ -100,25 +124,54 @@ export default {
|
|||||||
show: true,
|
show: true,
|
||||||
minWidth: 110,
|
minWidth: 110,
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
|
}, {
|
||||||
|
label: 'SN',
|
||||||
|
prop: 'sn',
|
||||||
|
show: true,
|
||||||
|
minWidth: 110
|
||||||
}, {
|
}, {
|
||||||
label: 'Talon',
|
label: 'Talon',
|
||||||
prop: 'clientState',
|
prop: 'clientState',
|
||||||
show: true,
|
show: true,
|
||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
minWidth: 150
|
minWidth: 150
|
||||||
|
}, {
|
||||||
|
label: this.$t('asset.purchaseDate'),
|
||||||
|
prop: 'purchaseDate',
|
||||||
|
show: false,
|
||||||
|
minWidth: 120
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
orderBy: '',
|
||||||
|
orderType: 'ascending'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
detailViewRightShow (item) {
|
detailViewRightShow (item) {
|
||||||
this.$emit('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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.order-box{
|
||||||
|
height:40px;
|
||||||
|
padding: 0 15px;
|
||||||
|
line-height: 40px
|
||||||
|
}
|
||||||
.detail-row-box{
|
.detail-row-box{
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -39,14 +39,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nz-detail-view-right">
|
<div class="nz-detail-view-right">
|
||||||
<detailViewRight
|
<!-- <detailViewRight-->
|
||||||
@getTableData = 'getDetail'
|
<!-- @getTableData = 'getTableData'-->
|
||||||
ref="detailViewRight"
|
<!-- ref="detailViewRight"-->
|
||||||
v-if="detailViewRightObj"
|
<!-- v-if="detailViewRightObj"-->
|
||||||
:from="from"
|
<!-- :from="from"-->
|
||||||
:obj="detailViewRightObj"
|
<!-- :obj="detailViewRightObj"-->
|
||||||
:target-tab="'panelTab'"
|
<!-- :target-tab="'panelTab'"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -149,8 +149,8 @@ export default {
|
|||||||
search (searchObj) {
|
search (searchObj) {
|
||||||
this.$emit('search', searchObj)
|
this.$emit('search', searchObj)
|
||||||
},
|
},
|
||||||
getDetail () {
|
getTableData () {
|
||||||
this.$emit('getDetail')
|
this.$emit('getTableData')
|
||||||
},
|
},
|
||||||
changeDetailType (item) {
|
changeDetailType (item) {
|
||||||
console.log(item)
|
console.log(item)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<label class="search-title">{{data.label}}:</label>
|
<label class="search-title">{{data.label}}:</label>
|
||||||
<el-skeleton v-if="data.type === 'checkBox'" :class="skeletonClass(data)" :loading="!data.show" :rows="1" class="search-items">
|
<el-skeleton v-if="data.type === 'checkBox'" :class="skeletonClass(data)" :loading="!data.show" :rows="1" class="search-items">
|
||||||
<template>
|
<template>
|
||||||
<el-checkbox-group v-if="data.type === 'checkBox'" ref="searchContent" v-model="selectValueOut[data.key]" @change="selectValueOut.change === 0 && selectValueOut.change++">
|
<el-checkbox-group v-if="data.type === 'checkBox'" ref="searchContent" v-model="selectValue[data.key]" @change="selectValue.change === 0 && selectValue.change++">
|
||||||
<template v-for="(item, j) in data.children">
|
<template v-for="(item, j) in data.children">
|
||||||
<el-checkbox v-show="j < data.index || data.showMore" :key="j" :label="item.value">{{item.key || item.name || item.label}}</el-checkbox>
|
<el-checkbox v-show="j < data.index || data.showMore" :key="j" :label="item.value">{{item.key || item.name || item.label}}</el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
v-for="(item, j) in data.children"
|
v-for="(item, j) in data.children"
|
||||||
v-show="j < data.index || data.showMore"
|
v-show="j < data.index || data.showMore"
|
||||||
:key="j"
|
:key="j"
|
||||||
|
:selectValue="selectValue[data.key]"
|
||||||
:ref="`${type}_${item.id}_cascader`"
|
:ref="`${type}_${item.id}_cascader`"
|
||||||
:collapse-tags="true"
|
:collapse-tags="true"
|
||||||
:item="item"
|
:item="item"
|
||||||
@@ -138,25 +139,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectValue: {
|
selectValue: {
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
deep: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
this.selectValueOut = { ...n, change: 0 }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selectValueOut: {
|
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
|
||||||
handler (n) {
|
|
||||||
if (n && n.change) {
|
|
||||||
this.$emit('reload', n)
|
this.$emit('reload', n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
selectValueOut: {},
|
|
||||||
contentWidth: 0, // 搜索框内部区域的宽度
|
contentWidth: 0, // 搜索框内部区域的宽度
|
||||||
titleSearchListCopy: {},
|
titleSearchListCopy: {},
|
||||||
widthConstant: {
|
widthConstant: {
|
||||||
@@ -225,16 +215,20 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
const valuesStr = JSON.stringify(values)
|
const valuesStr = JSON.stringify(values)
|
||||||
this.selectValueOut[key] = valuesStr === '{}' || !valuesStr ? null : valuesStr
|
this.selectValue[key] = valuesStr === '{}' || !valuesStr ? null : valuesStr
|
||||||
} else {
|
} else {
|
||||||
const values = new Set()
|
const values = new Set()
|
||||||
cascs.forEach(c => {
|
cascs.forEach(c => {
|
||||||
const nodes = c.$refs.cascader.getCheckedNodes()
|
const nodes = c.$refs.cascader.getCheckedNodes()
|
||||||
nodes.forEach(n => values.add(n.data.id))
|
nodes.forEach(n => values.add(n.data.id))
|
||||||
})
|
})
|
||||||
this.selectValueOut[key] = [...values]
|
this.selectValue[key] = [...values]
|
||||||
|
}
|
||||||
|
if (!this.selectValue.change) {
|
||||||
|
this.selectValue.change = 1
|
||||||
|
} else {
|
||||||
|
this.selectValue.change++
|
||||||
}
|
}
|
||||||
this.selectValueOut.change++
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computeCascWidth (textWidth, labelWidth) { // label + tag + margin
|
computeCascWidth (textWidth, labelWidth) { // label + tag + margin
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<el-cascader
|
<el-cascader
|
||||||
ref="cascader"
|
ref="cascader"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
|
v-model="cascaderData"
|
||||||
:collapse-tags="collapseTags"
|
:collapse-tags="collapseTags"
|
||||||
:options="item.children"
|
:options="item.children"
|
||||||
:props="{ multiple: true, label: 'name', value: 'id' }"
|
:props="{ multiple: true, label: 'name', value: 'id' }"
|
||||||
@@ -29,6 +30,15 @@ export default {
|
|||||||
collapseTags: {
|
collapseTags: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
selectValue: {}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectValue: {
|
||||||
|
immediate: true,
|
||||||
|
handler (n) {
|
||||||
|
console.log(n)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -50,7 +60,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
ready: false
|
ready: false,
|
||||||
|
cascaderData: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -80,9 +80,10 @@ export default {
|
|||||||
response.data.list[i].status = response.data.list[i].status + ''
|
response.data.list[i].status = response.data.list[i].status + ''
|
||||||
}
|
}
|
||||||
this.tableData = response.data.list
|
this.tableData = response.data.list
|
||||||
|
this.detailViewRightObj = this.tableData[0]
|
||||||
this.pageObj.total = response.data.total
|
this.pageObj.total = response.data.total
|
||||||
this.pageObj.pages = response.data.pages
|
this.pageObj.pages = response.data.pages
|
||||||
if (!this.scrollbarWrap) {
|
if (!this.scrollbarWrap && this.$refs.dataTable.$refs.dataTable) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
||||||
this.toTopBtnHandler(this.scrollbarWrap)
|
this.toTopBtnHandler(this.scrollbarWrap)
|
||||||
@@ -114,20 +115,12 @@ export default {
|
|||||||
},
|
},
|
||||||
pageNo (val) {
|
pageNo (val) {
|
||||||
this.pageObj.pageNo = val
|
this.pageObj.pageNo = val
|
||||||
if (this.detailType !== 'view') {
|
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
} else {
|
|
||||||
this.getDetail()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
pageSize (val) {
|
pageSize (val) {
|
||||||
this.pageObj.pageSize = val
|
this.pageObj.pageSize = val
|
||||||
localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val)
|
localStorage.setItem('nz-pageSize-' + localStorage.getItem('nz-username') + '-' + this.tableId, val)
|
||||||
if (this.detailType !== 'view') {
|
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
} else {
|
|
||||||
this.getDetail()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
add () {
|
add () {
|
||||||
this.object = this.newObject()
|
this.object = this.newObject()
|
||||||
@@ -169,7 +162,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dragend () {
|
dragend () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.dataTable.$refs.dataTable.doLayout()
|
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
search (searchObj) {
|
search (searchObj) {
|
||||||
@@ -302,13 +295,9 @@ export default {
|
|||||||
this.tools.customTableTitle = this.tools.customTableTitle.concat(arr)
|
this.tools.customTableTitle = this.tools.customTableTitle.concat(arr)
|
||||||
}
|
}
|
||||||
if (!this.fromBottom) {
|
if (!this.fromBottom) {
|
||||||
if (this.detailType !== 'view') {
|
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
} else {
|
|
||||||
this.getDetail()
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.dataTable.$refs.dataTable.doLayout()
|
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -19,79 +19,27 @@ export default {
|
|||||||
this.detailType = flag
|
this.detailType = flag
|
||||||
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
|
localStorage.setItem('detail-view-' + this.tableId, this.detailType)
|
||||||
this.pageObj.pageNo = 1
|
this.pageObj.pageNo = 1
|
||||||
this.detailViewLoading = true
|
|
||||||
if (flag === 'list') {
|
|
||||||
this.searchLabel = {}
|
|
||||||
this.searchCheckBox = {}
|
|
||||||
this.getTableData()
|
|
||||||
} else {
|
|
||||||
this.getDetail()
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.detailViewLoading = false
|
this.detailViewLoading = false
|
||||||
this.$refs.clickSearch && this.$refs.clickSearch.needMore()
|
this.$refs.clickSearch && this.$refs.clickSearch.needMore()
|
||||||
}, 100)
|
}, 100)
|
||||||
},
|
},
|
||||||
searchDetail (searchObj) {
|
|
||||||
this.searchLabel = {}
|
|
||||||
this.pageObj.pageNo = 1
|
|
||||||
for (const item in searchObj) {
|
|
||||||
if (typeof searchObj[item] !== 'undefined' && searchObj[item] !== null && searchObj[item] !== '') {
|
|
||||||
this.$set(this.searchLabel, item, searchObj[item])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.searchDetailObj) {
|
|
||||||
for (const item in this.searchDetailObj) {
|
|
||||||
if (typeof this.searchDetailObj[item] !== 'undefined' && this.searchDetailObj[item] !== null && this.searchDetailObj[item] !== '') {
|
|
||||||
if (this.searchDetailObj[item].join(',') !== '') {
|
|
||||||
this.$set(this.searchLabel, item, this.searchDetailObj[item].join(','))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.$refs.dataTable) {
|
|
||||||
this.$refs.dataTable.$refs.dataTable.bodyWrapper.scrollTop = 0
|
|
||||||
}
|
|
||||||
this.getDetail()
|
|
||||||
},
|
|
||||||
searchDetailTop () {
|
searchDetailTop () {
|
||||||
if (!this.detailTimer) {
|
if (!this.detailTimer) {
|
||||||
this.detailTimer = setTimeout(() => {
|
this.detailTimer = setTimeout(() => {
|
||||||
this.searchDetail()
|
this.getTableData()
|
||||||
clearTimeout(this.detailTimer)
|
clearTimeout(this.detailTimer)
|
||||||
this.detailTimer = ''
|
this.detailTimer = ''
|
||||||
}, 1000)
|
}, 1000)
|
||||||
} else {
|
} else {
|
||||||
clearTimeout(this.detailTimer)
|
clearTimeout(this.detailTimer)
|
||||||
this.detailTimer = setTimeout(() => {
|
this.detailTimer = setTimeout(() => {
|
||||||
this.searchDetail()
|
this.getTableData()
|
||||||
clearTimeout(this.detailTimer)
|
clearTimeout(this.detailTimer)
|
||||||
this.detailTimer = ''
|
this.detailTimer = ''
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDetail () {
|
|
||||||
const params = {
|
|
||||||
pageNo: this.pageObj.pageNo,
|
|
||||||
pageSize: this.pageObj.pageSize
|
|
||||||
}
|
|
||||||
this.tools.loading = true
|
|
||||||
this.$get(this.url, { ...this.searchLabel, ...params }).then(response => {
|
|
||||||
this.tools.loading = false
|
|
||||||
if (response.code === 200) {
|
|
||||||
this.tableData = response.data.list
|
|
||||||
this.detailViewRightObj = this.tableData[0]
|
|
||||||
this.pageObj.total = response.data.total
|
|
||||||
this.pageObj.pages = response.data.pages
|
|
||||||
if (!this.scrollbarWrap) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
|
||||||
this.toTopBtnHandler(this.scrollbarWrap)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
detailViewRightShow (item) {
|
detailViewRightShow (item) {
|
||||||
this.detailViewRightObj = item
|
this.detailViewRightObj = item
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<span v-else >-</span>
|
<span v-else >-</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'pingInfo'">
|
<template v-else-if="item.prop === 'pingInfo'">
|
||||||
<div class="ping-info">
|
<div class="ping-info" v-if="scope.row.pingInfo">
|
||||||
<div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative">
|
<div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative">
|
||||||
</div>
|
</div>
|
||||||
<div class="active-icon-content">{{$t('asset.assetStatPre')+(scope.row.pingInfo.lastUpdate?utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate):$t('asset.assetStatDown'))}}</div>
|
<div class="active-icon-content">{{$t('asset.assetStatPre')+(scope.row.pingInfo.lastUpdate?utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate):$t('asset.assetStatDown'))}}</div>
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
:detailType="detailType"
|
:detailType="detailType"
|
||||||
@changeDetailType="changeDetailType"
|
@changeDetailType="changeDetailType"
|
||||||
@getTableData="getTableData"
|
@getTableData="getTableData"
|
||||||
@getDetail="getDetail"
|
|
||||||
>
|
>
|
||||||
<template v-slot:top-tool-right>
|
<template v-slot:top-tool-right>
|
||||||
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
|
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
|
||||||
@@ -78,18 +77,19 @@
|
|||||||
</nz-data-list>
|
</nz-data-list>
|
||||||
<nzDetailView
|
<nzDetailView
|
||||||
v-loading="detailViewLoading || tools.loading"
|
v-loading="detailViewLoading || tools.loading"
|
||||||
v-show="detailType !== 'list'"
|
v-if="detailType !== 'list'"
|
||||||
:api="url"
|
:api="url"
|
||||||
|
ref="dataList"
|
||||||
:layout="dataListLayout"
|
:layout="dataListLayout"
|
||||||
:from="fromRoute.asset"
|
:from="fromRoute.asset"
|
||||||
:search-msg="searchMsg"
|
:search-msg="searchMsg"
|
||||||
:detailType="detailType"
|
:detailType="detailType"
|
||||||
:detailViewRightObj="detailViewRightObj"
|
:detailViewRightObj="detailViewRightObj"
|
||||||
@search="searchDetail"
|
@search="search"
|
||||||
@changeDetailType="changeDetailType"
|
@changeDetailType="changeDetailType"
|
||||||
>
|
>
|
||||||
<template v-slot:top-tool-left>
|
<template v-slot:top-tool-left>
|
||||||
<detailViewTopSearch :searchDetailObj.sync="searchDetailObj" :detailSearchList="detailSearchList" @reload="searchDetailTop" />
|
<detailViewTopSearch :selectValue.sync="selectValue" :detailSearchList="detailSearchList" @reload="reloadTable" />
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:top-tool-right>
|
<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">
|
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
<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"
|
||||||
v-loading="tools.loading"
|
v-loading="tools.loading"
|
||||||
:detailViewRightObj="detailViewRightObj"
|
:detailViewRightObj="detailViewRightObj"
|
||||||
:api="url"
|
:api="url"
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
small
|
small
|
||||||
>
|
>
|
||||||
<template>
|
<template>
|
||||||
<el-input-number ref="jumpInput" v-model="pageObj.pageNo" :controls="false" :min="1" :max="pageObj.pages" class="jump-input" @change="getDetail" @keyup.enter.native="getDetail" size="mini"/>
|
<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">/ {{pageObj.pages}}</span>
|
<span class="jump-pages">/ {{pageObj.pages}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
@@ -312,7 +312,7 @@ export default {
|
|||||||
index: -1
|
index: -1
|
||||||
},
|
},
|
||||||
ping: {
|
ping: {
|
||||||
label: 'ping',
|
label: 'Ping',
|
||||||
key: 'ping',
|
key: 'ping',
|
||||||
type: 'checkBox',
|
type: 'checkBox',
|
||||||
children: [
|
children: [
|
||||||
@@ -350,7 +350,9 @@ export default {
|
|||||||
typeIds: [],
|
typeIds: [],
|
||||||
ping: [],
|
ping: [],
|
||||||
modelIds: [],
|
modelIds: [],
|
||||||
fields: ''
|
fields: '',
|
||||||
|
modelIdsDetail: [],
|
||||||
|
fieldsDetail: []
|
||||||
},
|
},
|
||||||
detailSearchList: {
|
detailSearchList: {
|
||||||
dc: {
|
dc: {
|
||||||
@@ -374,7 +376,7 @@ export default {
|
|||||||
index: -1
|
index: -1
|
||||||
},
|
},
|
||||||
ping: {
|
ping: {
|
||||||
label: 'ping',
|
label: 'Ping',
|
||||||
key: 'ping',
|
key: 'ping',
|
||||||
type: 'checkBox',
|
type: 'checkBox',
|
||||||
children: [
|
children: [
|
||||||
@@ -388,7 +390,17 @@ export default {
|
|||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
label: this.$t('asset.model'),
|
label: this.$t('asset.model'),
|
||||||
key: 'modelIds',
|
key: 'modelIdsDetail',
|
||||||
|
type: 'dropdownCheckBox',
|
||||||
|
children: [],
|
||||||
|
show: false,
|
||||||
|
showMore: false,
|
||||||
|
width: 0,
|
||||||
|
index: -1
|
||||||
|
},
|
||||||
|
assetLabel: {
|
||||||
|
label: 'More',
|
||||||
|
key: 'fieldsDetail',
|
||||||
type: 'dropdownCheckBox',
|
type: 'dropdownCheckBox',
|
||||||
children: [],
|
children: [],
|
||||||
show: false,
|
show: false,
|
||||||
@@ -396,12 +408,6 @@ export default {
|
|||||||
width: 0,
|
width: 0,
|
||||||
index: -1
|
index: -1
|
||||||
}
|
}
|
||||||
},
|
|
||||||
searchDetailObj: {
|
|
||||||
dcIds: [],
|
|
||||||
typeIds: [],
|
|
||||||
ping: [],
|
|
||||||
modelIds: []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -544,6 +550,7 @@ export default {
|
|||||||
this.modelData = response.data.list
|
this.modelData = response.data.list
|
||||||
const titleSearchData = {}
|
const titleSearchData = {}
|
||||||
this.modelData.forEach(m => {
|
this.modelData.forEach(m => {
|
||||||
|
m.value = []
|
||||||
if (titleSearchData[m.brand.name]) {
|
if (titleSearchData[m.brand.name]) {
|
||||||
titleSearchData[m.brand.name].children.push(m)
|
titleSearchData[m.brand.name].children.push(m)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user