对接文档对比

This commit is contained in:
qq787203167
2022-08-05 13:39:08 +08:00
parent 981ab74e67
commit 33680a5c32
6 changed files with 260 additions and 208 deletions
@@ -26,7 +26,7 @@
<div class="title-text" :title="$t('releaseSituation')">
<span>{{$t('releaseSituation')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.releaseCondition"
<j-dict-select-tag class="box-input" v-model="queryParam.releaseState"
:placeholder="$t('PleaseSelect')+$t('releaseSituation')"
:type="'select'"
:triggerChange="false" dictCode="release_condition"/>
@@ -46,6 +46,10 @@
<a-icon type="apartment"/>
{{$t('initiateComparison')}}
</div>
<div @click="BatchDelete" class="operator-text">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div>
<a-table
@@ -63,11 +67,16 @@
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="comparisonResultsClick(record)">{{$t('comparisonResults')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username"
@click="subscribe(record)">
{{!record.state || record.state == 0 ? $t('release') :$t('withdraw')}}
{{!record.releaseState || record.releaseState == 'draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteData(record)">{{$t('delete')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseState == 'draft'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseState == 'draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
<div class="page" v-if="dataSource && dataSource.length > 0">
@@ -88,6 +97,7 @@
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'index',
@@ -100,22 +110,14 @@
deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
},
loading: false,
dataSource: [{}],
dataSource: [],
selectedRowKeys: [],
total: 0,
pageSize: 10,
pageNo: 1,
queryParam: {},
gatherResultList: [
{
value: '1',
name: this.$t('draft')
},
{
value: '2',
name: this.$t('Published')
}
],
userInfoQuery: {},
selectedRowKeysRecord: [],
columns: [
{
title: this.$t('standard') + 1,
@@ -194,9 +196,11 @@
}
},
mounted() {
this.userInfoQuery = this.userInfo()
this.getList()
},
methods: {
...mapGetters(['userInfo']),
searchQuery() {
this.pageNo = 1
this.getList()
@@ -210,7 +214,7 @@
this.pageNo = page
this.getList()
},
SizeChange(page,pageSize) {
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
@@ -238,21 +242,67 @@
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
BatchDelete() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = []
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if (selectedRowKeysRecord[i].createBy == _this.userInfo().username &&
selectedRowKeysRecord[i].releaseState == 'draft') {
idList.push(selectedRowKeysRecord[i].id)
}
}
if (idList.length > 0) {
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
} else {
_this.$message.warning(_this.$t('doNotHavePermissionDeleteData'))
}
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
comparisonResultsClick() {
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
comparisonResultsClick(item) {
if (item.createBy == this.userInfo().username && item.releaseState == 'draft') {
item.isDisplay = 2
} else {
item.isDisplay = 1
}
let newUrl = this.$router.resolve({
path: '/comparisonResults'
path: '/comparisonResults',
query: {
id: item.id,
isDisplay: item.isDisplay
}
})
window.open(newUrl.href, '_blank')
},
subscribe() {
},
edit() {
edit(row) {
let newUrl = this.$router.resolve({
path: '/documentDataComparison'
path: '/documentDataComparison',
query: {
id: row.id
}
})
window.open(newUrl.href, '_blank')
},