修改已知bug1

This commit is contained in:
qq787203167
2022-06-02 17:57:24 +08:00
parent 38285044f1
commit ea8ad5cd20
3 changed files with 131 additions and 120 deletions
@@ -1,10 +1,10 @@
<template> <template>
<div class="collection"> <div class="collection">
<a-card :bordered="false"> <a-card :bordered="false">
<div class="collection-search-wrapper"> <div class="collection-search-wrapper">
<div class="collection-search-header"> <div class="collection-search-header">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<div class="box-title-text"> <div class="box-title-text">
@@ -43,206 +43,209 @@
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
</a-form> </a-form>
</div>
</div> </div>
</div> </div>
<div class="table-operator"> </div>
<div class="operator-text" @click="handleBatCancel"> <div class="table-operator">
<a-icon type="delete" /> <div class="operator-text" @click="handleBatCancel">
{{ $t('BatchCancel') }} <a-icon type="delete"/>
</div> {{ $t('BatchCancel') }}
</div> </div>
<div class="colloction-table"> </div>
<a-table <div class="colloction-table">
ref="table" <a-table
size="middle" ref="table"
rowKey="id" size="middle"
:scroll="{x: '100%'}" rowKey="id"
:columns="columns" :scroll="{x: '100%'}"
:dataSource="tableData" :columns="columns"
:pagination="false" :dataSource="tableData"
:loading="loading" :pagination="false"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :loading="loading"
> :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
>
<span slot="serialNumber" slot-scope="text, record"> <span slot="serialNumber" slot-scope="text, record">
<a class="table-del" @click="onDetail(record)">{{record.serialNumber}}</a> <a class="table-del" @click="onDetail(record)">{{record.serialNumber}}</a>
</span> </span>
<span slot="serialtitle" slot-scope="text, record"> <span slot="serialtitle" slot-scope="text, record">
<a class="table-del" @click="onDetail(record)">{{record.title}}</a> <a class="table-del" @click="onDetail(record)">{{record.title}}</a>
</span> </span>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a class="table-del" @click="onCancel(record)">{{$t('CancelCollection')}}</a> <a class="table-del" @click="onCancel(record)">{{$t('CancelCollection')}}</a>
</span> </span>
</a-table> </a-table>
<div class="page" v-if="tableData.length > 0"> <div class="page" v-if="tableData.length > 0">
<a-pagination <a-pagination
:show-total="total => $t('total')+` ${total} `+ $t('strip')" :show-total="total => $t('total')+` ${total} `+ $t('strip')"
show-quick-jumper show-quick-jumper
show-size-changer show-size-changer
:current="queryParams.pageNo" :current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
@change="onChangePage" @change="onChangePage"
@showSizeChange="SizeChange" @showSizeChange="SizeChange"
/> />
</div>
</div> </div>
</a-card> </div>
</div> </a-card>
</div>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage' import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
export default { export default {
name:'collection', name: 'collection',
data(){ data() {
return{ return {
selectedRowKeys:[], selectedRowKeys: [],
queryParams:{ queryParams: {
pageNo:1, pageNo: 1,
pageSize:10 pageSize: 10
}, //搜索条件 }, //搜索条件
total:0, total: 0,
//列表表头 //列表表头
columns: [ columns: [
{ {
title: this.$t('standard'), title: this.$t('standard'),
dataIndex: 'serialNumber', dataIndex: 'serialNumber',
key: 'serialNumber', key: 'serialNumber',
scopedSlots: {customRender: 'serialNumber'}, scopedSlots: { customRender: 'serialNumber' },
align: "center", align: 'center',
ellipsis: true, ellipsis: true,
width: 180, width: 180
}, },
{ {
title: this.$t('title'), title: this.$t('title'),
align: "center", align: 'center',
scopedSlots: {customRender: 'serialtitle'}, scopedSlots: { customRender: 'serialtitle' },
width: 180, width: 180,
ellipsis: true, ellipsis: true,
dataIndex: 'title', dataIndex: 'title'
}, },
{ {
title: this.$t('status'), title: this.$t('status'),
align: "center", align: 'center',
width: 180, width: 180,
ellipsis: true, ellipsis: true,
dataIndex: 'state', dataIndex: 'state'
}, },
{ {
title: this.$t('collectionTime'), title: this.$t('collectionTime'),
align: "center", align: 'center',
width: 180, width: 180,
ellipsis: true, ellipsis: true,
dataIndex: 'createTime', dataIndex: 'createTime'
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
dataIndex: 'action', dataIndex: 'action',
scopedSlots: {customRender: 'action'}, scopedSlots: { customRender: 'action' },
align: "center", align: 'center',
fixed: 'right', fixed: 'right',
width: 170 width: 170
} }
], ],
tableData:[], //列表数据 tableData: [], //列表数据
selecIds:[], selecIds: [],
loading:false, loading: false
} }
}, },
mounted() { mounted() {
this.loadData() this.loadData()
}, },
methods:{ methods: {
//获取列表数据 //获取列表数据
loadData(){ loadData() {
let params={ let params = {
...this.queryParams ...this.queryParams
} }
this.loading=true this.loading = true
postAction(`collection/onlCgformCollection/page`,params).then(res=>{ postAction(`collection/onlCgformCollection/page`, params).then(res => {
if(res.success){ if (res.success) {
this.tableData= [ ...res.result.records ] this.tableData = [...res.result.records]
this.total=res.result.total this.total = res.result.total
this.loading=false this.loading = false
} }
}) })
},//搜索 },//搜索
searchQuery(){ searchQuery() {
this.loadData() this.loadData()
}, },
//批量取消收藏 //批量取消收藏
handleBatCancel(){ handleBatCancel() {
let params={ let params = {
ids:this.selecIds.join(',') ids: this.selecIds.join(',')
} }
if(this.selecIds&&this.selecIds.length>0){ if (this.selecIds && this.selecIds.length > 0) {
this.$confirm({ this.$confirm({
title: this.$t('BatchCancelCollection'), title: this.$t('BatchCancelCollection'),
content: '', content: '',
onOk: onOk:
async () => { async () => {
deleteAction(`collection/onlCgformCollection/deleteBatch`,params).then(res=> { deleteAction(`collection/onlCgformCollection/deleteBatch`, params).then(res => {
if(res.success){ if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!==1){ if (this.selecIds.length == this.tableData.length && this.queryParams.pageNo !== 1) {
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.loadData() this.loadData()
}else{ } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
}, },
onCancel() {}, onCancel() {
}); }
}else{ })
} else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
//取消收藏 //取消收藏
onCancel(record){ onCancel(record) {
let params={ let params = {
id:record.id id: record.id
} }
this.$confirm({ this.$confirm({
title: this.$t('confirmCancelCollection'), title: this.$t('confirmCancelCollection'),
content: '', content: '',
onOk: onOk:
async () => { async () => {
deleteAction(`collection/onlCgformCollection/delete`,params).then(res=> { deleteAction(`collection/onlCgformCollection/delete`, params).then(res => {
if(res.success){ if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
if(this.tableData.length==1&&this.queryParams.pageNo!==1){ if (this.tableData.length == 1 && this.queryParams.pageNo !== 1) {
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo = this.queryParams.pageNo - 1
} }
this.loadData() this.loadData()
}else{ } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
}, },
onCancel() {}, onCancel() {
}); }
})
}, },
//清空 //清空
searchReset(){ searchReset() {
this.queryParams={ this.queryParams = {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
} }
this.loadData() this.loadData()
}, },
//点击页数 //点击页数
onChangePage(page,pageSize){ onChangePage(page, pageSize) {
this.queryParams.pageNo = page this.queryParams.pageNo = page
this.loadData() this.loadData()
}, },
//一页显示条数 //一页显示条数
SizeChange(page,pageSize){ SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize this.queryParams.pageSize = pageSize
this.queryParams.pageNo=1 this.queryParams.pageNo = 1
this.loadData() this.loadData()
}, },
//选择框 //选择框
@@ -255,21 +258,25 @@
// ids.push(item.id) // ids.push(item.id)
// }) // })
// } // }
this.selecIds=rows this.selecIds = rows
// console.log('selectedRowKeys changed: ', ids); // console.log('selectedRowKeys changed: ', ids);
}, },
//点击编号 //点击编号
numberClick(records){ numberClick(records) {
}, },
//点击名称 //点击名称
titleClick(records){ titleClick(records) {
}, },
onDetail(item) { onDetail(item) {
let newUrl = this.$router.resolve({ let newUrl = this.$router.resolve({
path: '/docManage/library/detail', path: '/docManage/library/detail',
query: { id:item.documentId } query: {
id: item.documentId,
serial_number: item.serialNumber,
title: item.title
}
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
} }
@@ -278,17 +285,20 @@
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.collection{
.collection-search-wrapper{ .collection {
.collection-search-wrapper {
margin-bottom: 20px; margin-bottom: 20px;
} }
.colloction-table{
.page{ .colloction-table {
.page {
margin-top: 20px; margin-top: 20px;
text-align: right; text-align: right;
} }
} }
} }
.box-title-text { .box-title-text {
line-height: 1.4; line-height: 1.4;
display: flex; display: flex;
@@ -335,17 +345,18 @@
/* display: flex;*/ /* display: flex;*/
/* }*/ /* }*/
/* }*/ /* }*/
/*.ant-col-md-6{*/ /*.ant-col-md-6{*/
/* display: flex;*/ /* display: flex;*/
/*}*/ /*}*/
/*.table-page-search-submitButtons{*/ /*.table-page-search-submitButtons{*/
/* float: none!important;*/ /* float: none!important;*/
/*}*/ /*}*/
/*}*/ /*}*/
.box-input .ant-select-selection__rendered { .box-input .ant-select-selection__rendered {
line-height: 38px; line-height: 38px;
height: 38px; height: 38px;
} }
.box-input .ant-select-selection--single { .box-input .ant-select-selection--single {
height: 38px; height: 38px;
} }
@@ -20,7 +20,7 @@
> >
<span slot="projectStatusTitle"> <span slot="projectStatusTitle">
<span>{{this.$t('CurrentStatusOfTheProject')}}</span><br/> <span>{{this.$t('CurrentStatusOfTheProject')}}</span><br/>
<span>{{'('+$t('red')+'/'+$t('yellow')+'/'+$t('green')+')'}}</span> <span>{{'('+$t('red')+'/'+$t('yellow')+'/'+$t('green')+'/'+$t('blue')+')'}}</span>
</span> </span>
<span slot="CertificationProgressTitle"> <span slot="CertificationProgressTitle">
<span>{{this.$t('CertificationProgress')}}</span><br/> <span>{{this.$t('CertificationProgress')}}</span><br/>
@@ -74,7 +74,7 @@
> >
<span slot="projectStatusTitle"> <span slot="projectStatusTitle">
<span>{{this.$t('CurrentStatusOfTheProject')}}</span><br/> <span>{{this.$t('CurrentStatusOfTheProject')}}</span><br/>
<span>{{'('+$t('red')+'/'+$t('yellow')+'/'+$t('green')+')'}}</span> <span>{{'('+$t('red')+'/'+$t('yellow')+'/'+$t('green')+'/'+$t('blue')+')'}}</span>
</span> </span>
<span slot="CertificationProgressTitle"> <span slot="CertificationProgressTitle">
<span>{{this.$t('CertificationProgress')}}</span><br/> <span>{{this.$t('CertificationProgress')}}</span><br/>