标签库测试反馈修改

This commit is contained in:
Xia Zekun
2024-03-22 18:55:07 +08:00
committed by fengchenchen
parent 1930918269
commit 0d30539feb
2 changed files with 83 additions and 18 deletions
+10 -8
View File
@@ -261,7 +261,7 @@ module.exports = {
userExists: '用户名已存在',
workNoExists: '工号已存在',
handStamp: '手写章',
uploadHandStamp:'上传手写章'
uploadHandStamp: '上传手写章'
},
// 高级查询
superQuery: {
@@ -477,8 +477,8 @@ module.exports = {
enterQuantity: '请输入数量',
numberRows: '行数',
numberColumns: '列数',
maximumSelection:'最多选择',
pieceOfData:'条数据'
maximumSelection: '最多选择',
pieceOfData: '条数据'
},
// 文档比对
comparison: {
@@ -638,11 +638,13 @@ module.exports = {
selectedData: '已选数据'
},
// 属性标识管理
attributeIdentification:{
labelName:'标签名称',
firstLabel:'一级标签',
secondLabel:'二级标签',
thirdLabel:'三级标签',
attributeIdentification: {
labelName: '标签名称',
firstLabel: '一级标签',
secondLabel: '二级标签',
thirdLabel: '三级标签',
labelDelete: '请再次确认是否删除1级/2级标签。删除后该标签无法重新添加,同时该标签目录下所有标签都会被删除',
batchDelete: '您正在进行批量删除。1级/2级标签无法手动添加,请谨慎删除1级/2级标签。如果您选中了1级/2级标签,同时该标签目录下所有标签都会被删除'
},
// 系统管理
@@ -49,7 +49,7 @@
<!-- 操作栏 -->
<template slot="action" slot-scope="text, record, index" class="action-span-cell">
<a @click="handleEdit(record, index)" v-show='handleShowEdit(record)' class="table-ope-btn">{{ $t('edit') }}</a>
<a @click="handleDelete(index)" class="table-ope-btn" style="margin-left: 8px">{{ $t('delete') }}</a>
<a @click="handleDelete(record)" class="table-ope-btn" style="margin-left: 8px">{{ $t('delete') }}</a>
</template>
</a-table>
</div>
@@ -65,7 +65,7 @@ import AttributeIdentificationModal from './modules/AttributeIdentificationModal
export default {
name: 'TreeSelectModal',
components:{AttributeIdentificationModal},
components: { AttributeIdentificationModal },
mixins: [JeroListMixin],
props: {
dictId: {
@@ -89,7 +89,7 @@ export default {
type: Boolean,
required: false,
default: false
},
}
},
computed: {
rowSelection () {
@@ -107,9 +107,10 @@ export default {
},
data () {
return {
url:{
queryLabelTree:'/laws/lawsLabelDatabase/queryLabelTree',
deleteBatch:'/laws/lawsLabelDatabase/deleteBatch'
url: {
queryLabelTree: '/laws/lawsLabelDatabase/queryLabelTree',
deleteBatch: '/laws/lawsLabelDatabase/deleteBatch',
delete: '/laws/lawsLabelDatabase/delete'
},
confirmLoading: false,
queryParam: {},
@@ -124,8 +125,8 @@ export default {
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '200'],
pageSize: 10,
pageSizeOptions: ['10', '20', '30', '100', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + total + this.$t('strip')
},
@@ -151,7 +152,7 @@ export default {
searchField: 'nodeName'
}
},
mounted() {
mounted () {
this.searchQuery()
},
methods: {
@@ -213,7 +214,7 @@ export default {
this.dataSourceRight = selectedRows
}
},
handleShowEdit(record){
handleShowEdit (record) {
// console.log('handlwShow record',record)
// 只有第三级标签允许修改
return record.code.split('-').length === 3
@@ -228,6 +229,68 @@ export default {
// 清空列表选中
this.onClearSelected()
},
handleDelete: function (record) {
if (!this.url.delete) {
this.$message.warning('请设置url.delete属性!')
return
}
console.log('record', record)
const that = this
let content = this.$t('areYouSure')
if (record.code.split('-').length <= 2) {
content = this.$t('attributeIdentification.labelDelete')
}
this.$confirm({
title: this.$t('confirmDeletion'),
content: content,
onOk: function () {
postAction(that.url.delete, { id: record.id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
that.ipagination.current -= 1
}
that.loadData()
} else {
that.$message.warning(res.message)
}
})
}
})
},
batchDel: function () {
if (!this.url.deleteBatch) {
this.$message.warning('请设置url.deleteBatch属性!')
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning(this.$t('selectARecord'))
} else {
const ids = this.selectedRowKeys.join(',')
const that = this
this.$confirm({
title: this.$t('confirmBatchDeletion'),
content: this.$t('attributeIdentification.batchDelete'),
onOk: function () {
that.loading = true
postAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) {
// 重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message)
that.loadData()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.loading = false
})
}
})
}
}
}
}
</script>