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