update 国内标准-批量删除页面效果修改,树查询数据
This commit is contained in:
@@ -372,30 +372,40 @@ export const ConfigurableTableMixin = {
|
|||||||
}
|
}
|
||||||
if (this.selectedRowKeys.length <= 0) {
|
if (this.selectedRowKeys.length <= 0) {
|
||||||
this.$message.warning(this.$t('selectARecord'))
|
this.$message.warning(this.$t('selectARecord'))
|
||||||
} else {
|
return
|
||||||
let ids = this.selectedRowKeys.join(',')
|
}
|
||||||
const that = this
|
const ids = this.selectedRowKeys.join(',')
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: this.$t('confirmBatchDeletion'),
|
title: this.$t('confirmBatchDeletion'),
|
||||||
content: this.$t('deleteAData'),
|
content: this.$t('deleteAData'),
|
||||||
onOk: function () {
|
onOk: () => {
|
||||||
that.loading = true
|
this.loading = true
|
||||||
postAction(that.url.delete, { ids: ids }).then((res) => {
|
postAction(this.url.delete, { ids: ids }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 重新计算分页问题
|
// 重新计算分页问题
|
||||||
that.reCalculatePage(that.selectedRowKeys.length)
|
this.reCalculatePage(this.selectedRowKeys.length)
|
||||||
that.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
that.loadData()
|
this.loadData()
|
||||||
that.onClearSelected()
|
this.onClearSelected()
|
||||||
} else {
|
} else {
|
||||||
that.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
reCalculatePage (count) {
|
||||||
|
// 总数量-count
|
||||||
|
const total = this.ipagination.total - count
|
||||||
|
// 获取删除后的分页数
|
||||||
|
const currentIndex = Math.ceil(total / this.ipagination.pageSize)
|
||||||
|
// 删除后的分页数<所在当前页
|
||||||
|
if (currentIndex < this.ipagination.current) {
|
||||||
|
this.ipagination.current = currentIndex
|
||||||
}
|
}
|
||||||
|
console.log('currentIndex', currentIndex)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<a-card :bordered="false" class="page-left-right-layout">
|
<a-card :bordered="false" class="page-left-right-layout">
|
||||||
<!-- 树部分-->
|
<!-- 树部分-->
|
||||||
<div class="page-left-box">
|
<div class="page-left-box">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="treeLoading">
|
||||||
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
|
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
|
||||||
<a-input-search v-model="treeInput"
|
<a-input-search v-model="treeInput"
|
||||||
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
|
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
|
||||||
@search="handleTreeSearch" />
|
@search="handleTreeSearch" />
|
||||||
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData">
|
<a-tree :show-line="true" :show-icon="true" :tree-data="treeData" :selected-keys="selectedTreeKeys">
|
||||||
<a-icon type="folder" slot="folder" class="tree-icon" />
|
<a-icon type="folder" slot="folder" class="tree-icon" />
|
||||||
<a-icon type="file" slot="file" class="tree-icon" />
|
<a-icon type="file" slot="file" class="tree-icon" />
|
||||||
|
|
||||||
@@ -252,7 +252,8 @@ export default {
|
|||||||
noValue: YesOrNoEnum.NO.value,
|
noValue: YesOrNoEnum.NO.value,
|
||||||
nowShareInfo: {}, // 当前正在分享的数据
|
nowShareInfo: {}, // 当前正在分享的数据
|
||||||
selectedTreeKeys: [], // 选中的树节点
|
selectedTreeKeys: [], // 选中的树节点
|
||||||
tableSlotField: ['standard_name', 'standard_number'] // 表格中需要插槽的字段
|
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
|
||||||
|
treeLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -268,13 +269,19 @@ export default {
|
|||||||
* 获取树数据
|
* 获取树数据
|
||||||
*/
|
*/
|
||||||
initTreeData () {
|
initTreeData () {
|
||||||
|
this.treeLoading = true
|
||||||
getDomesticStandardTree({ nodeName: this.treeInput }).then(res => {
|
getDomesticStandardTree({ nodeName: this.treeInput }).then(res => {
|
||||||
|
this.treeData = []
|
||||||
|
this.selectedTreeKeys = []
|
||||||
|
this.filters.nodeCode = null
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const treeData = res.result || []
|
const treeData = res.result || []
|
||||||
this.treeData = this.dealTreeData(treeData)
|
this.treeData = this.dealTreeData(treeData)
|
||||||
} else {
|
} else {
|
||||||
this.$message.warn(res.message)
|
this.$message.warn(res.message)
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.treeLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -433,6 +440,8 @@ export default {
|
|||||||
*/
|
*/
|
||||||
handleSelectTreeNode ({ dataRef }) {
|
handleSelectTreeNode ({ dataRef }) {
|
||||||
this.selectedTreeKeys = [dataRef.key]
|
this.selectedTreeKeys = [dataRef.key]
|
||||||
|
this.filters.nodeCode = dataRef.nodeCode
|
||||||
|
this.loadData(1)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 配置标准
|
* 配置标准
|
||||||
|
|||||||
Reference in New Issue
Block a user