update 文档比对操作栏按钮显隐处理
This commit is contained in:
@@ -58,14 +58,14 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<!-- 没有特殊判断,直接渲染operationList -->
|
<!-- 没有特殊判断,直接渲染operationList -->
|
||||||
<!-- 需要更多按钮的情况 -->
|
<!-- 需要更多按钮的情况 -->
|
||||||
<template v-if="operationList.length > operateMaxNum + 1">
|
<template v-if="getLineOperationList(record).length > operateMaxNum + 1">
|
||||||
<a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>
|
<a @click="operationClick(getLineOperationList(record)[0],record)">{{ getLineOperationList(record)[0].text }}</a>
|
||||||
<template v-if="operationList.length > operateMaxNum">
|
<template v-if="getLineOperationList(record).length > operateMaxNum">
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-dropdown placement="bottomCenter">
|
<a-dropdown placement="bottomCenter">
|
||||||
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
|
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
|
||||||
<a-menu slot="overlay">
|
<a-menu slot="overlay">
|
||||||
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
|
<a-menu-item v-for="(operation, index) in getLineOperationList(record).slice(operateMaxNum)" :key="index">
|
||||||
<a @click="operationClick(operation,record)">
|
<a @click="operationClick(operation,record)">
|
||||||
<div class="operate-btn">
|
<div class="operate-btn">
|
||||||
{{ operation.text }}
|
{{ operation.text }}
|
||||||
@@ -76,9 +76,10 @@
|
|||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="operationList.length > 0">
|
<template v-else-if="getLineOperationList(record).length > 0">
|
||||||
<template v-for="(operation, index) in operationList">
|
<template v-for="(operation, index) in getLineOperationList(record)">
|
||||||
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
|
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
|
||||||
|
<a-divider type="vertical" v-if="index !== getLineOperationList(record).length - 1"/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -591,6 +592,20 @@ export default {
|
|||||||
Vue.ls.remove(J_TABLE_KEYS)
|
Vue.ls.remove(J_TABLE_KEYS)
|
||||||
this.resteColumns() // 这里只能刷新当前的表
|
this.resteColumns() // 这里只能刷新当前的表
|
||||||
this.$message.success('成功清除全局JTable的缓存!')
|
this.$message.success('成功清除全局JTable的缓存!')
|
||||||
|
},
|
||||||
|
getLineOperationList (record) {
|
||||||
|
const hasPermissionList = this.operationList.filter(tt => !tt.has || isHasPermission(tt.has))
|
||||||
|
const lineOperateList = []
|
||||||
|
hasPermissionList.forEach(item => {
|
||||||
|
if (!item.show) {
|
||||||
|
lineOperateList.push(item)
|
||||||
|
} else if (typeof item.show === 'function') {
|
||||||
|
if (item.show(record)) {
|
||||||
|
lineOperateList.push(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return lineOperateList
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -50,37 +50,11 @@
|
|||||||
:can-drag="true"
|
:can-drag="true"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="ipagination"
|
:pagination="ipagination"
|
||||||
:scroll="{x: '100%', y:'calc(100vh - 280px)'}"
|
:scroll="{x: '100%'}"
|
||||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||||
|
:operation-list="operationList"
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
>
|
@operationClick="operationClick">
|
||||||
<template v-slot:operation="{text,record}">
|
|
||||||
<a class="text-operation" @click="comparisonResultsClick(record)">{{ $t('docTool.comparison.comparisonResults') }}</a>
|
|
||||||
|
|
||||||
<a-divider type="vertical" v-if="record.createBy === userInfoQuery.username || administrators" />
|
|
||||||
|
|
||||||
<a-dropdown v-if="record.createBy === userInfoQuery.username || administrators">
|
|
||||||
<a class="ant-dropdown-link">
|
|
||||||
{{ $t('more') }}
|
|
||||||
<a-icon type="down" />
|
|
||||||
</a>
|
|
||||||
<a-menu slot="overlay">
|
|
||||||
<a-menu-item>
|
|
||||||
<a v-if="record.createBy === userInfoQuery.username || administrators" @click="subscribe(record)">
|
|
||||||
{{ !record.releaseState || record.releaseState === 'draft' ? $t('release') : $t('withdraw') }}
|
|
||||||
</a>
|
|
||||||
</a-menu-item>
|
|
||||||
<a-menu-item>
|
|
||||||
<a v-if="(record.createBy === userInfoQuery.username || administrators) && record.releaseState === 'draft'"
|
|
||||||
@click="edit(record)">{{ $t('edit') }}</a>
|
|
||||||
</a-menu-item>
|
|
||||||
<a-menu-item>
|
|
||||||
<a v-if="(record.createBy === userInfoQuery.username || administrators) && record.releaseState === 'draft'"
|
|
||||||
@click="deleteData(record)">{{ $t('delete') }}</a>
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</a-dropdown>
|
|
||||||
</template>
|
|
||||||
<template v-slot:serialNumberRight="{text,record}">
|
<template v-slot:serialNumberRight="{text,record}">
|
||||||
<a @click="serialNumberRightClick(record)" :title="text">{{ text }}</a>
|
<a @click="serialNumberRightClick(record)" :title="text">{{ text }}</a>
|
||||||
</template>
|
</template>
|
||||||
@@ -111,28 +85,9 @@ export default {
|
|||||||
deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
|
deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
dataSource: [
|
|
||||||
{ id: 1 }
|
|
||||||
],
|
|
||||||
selectedRowKeys: [],
|
|
||||||
selectionRows: [],
|
|
||||||
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/download',
|
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/download',
|
||||||
downLoadImgUrl: window._CONFIG.domianWebImgURL + '/sys/common/download',
|
downLoadImgUrl: window._CONFIG.domianWebImgURL + '/sys/common/download',
|
||||||
/* 分页参数 */
|
|
||||||
ipagination: {
|
|
||||||
current: 1,
|
|
||||||
pageSize: 50,
|
|
||||||
pageSizeOptions: ['10', '50', '100', '150', '200'],
|
|
||||||
showTotal: (total, range) => {
|
|
||||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
|
|
||||||
},
|
|
||||||
showQuickJumper: true,
|
|
||||||
showSizeChanger: true,
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
queryParam: {},
|
|
||||||
userInfoQuery: {},
|
userInfoQuery: {},
|
||||||
administrators: false,
|
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('number') + ' 1',
|
title: this.$t('number') + ' 1',
|
||||||
@@ -196,29 +151,77 @@ export default {
|
|||||||
title: this.$t('operation'),
|
title: this.$t('operation'),
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 310,
|
width: 310,
|
||||||
scopedSlots: { customRender: 'operation' }
|
scopedSlots: { customRender: 'action' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
operationList: [
|
||||||
|
// 对比结果
|
||||||
|
{
|
||||||
|
text: this.$t('docTool.comparison.comparisonResults'),
|
||||||
|
clickEvent: 'comparisonResultsClick',
|
||||||
|
has: 'domesticStandard:collection'
|
||||||
|
},
|
||||||
|
// 发布
|
||||||
|
{
|
||||||
|
text: this.$t('release'),
|
||||||
|
clickEvent: 'subscribe',
|
||||||
|
has: 'domesticStandard:collection',
|
||||||
|
show: (record) => {
|
||||||
|
return (record.createBy === this.userInfo.username || this.administrators) && (!record.releaseState || record.releaseState === 'draft')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 撤回
|
||||||
|
{
|
||||||
|
text: this.$t('withdraw'),
|
||||||
|
clickEvent: 'subscribe',
|
||||||
|
has: 'domesticStandard:collection',
|
||||||
|
show: (record) => {
|
||||||
|
return (record.createBy === this.userInfo.username || this.administrators) && !(!record.releaseState || record.releaseState === 'draft')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
{
|
||||||
|
text: this.$t('edit'),
|
||||||
|
clickEvent: 'edit',
|
||||||
|
has: 'domesticStandard:collection',
|
||||||
|
show: (record) => {
|
||||||
|
return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
{
|
||||||
|
text: this.$t('delete'),
|
||||||
|
clickEvent: 'comparisonResultsClick',
|
||||||
|
has: 'domesticStandard:collection',
|
||||||
|
show: (record) => {
|
||||||
|
return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
computed: {
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
administrators () {
|
||||||
|
let flag = false
|
||||||
|
if (this.userInfo.userRoleList && this.userInfo.userRoleList.length > 0) {
|
||||||
|
this.userInfo.userRoleList.forEach(res => {
|
||||||
|
if (res.roleCode === 'admin') {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return flag
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
if (this.$route.query.serialNumber) {
|
if (this.$route.query.serialNumber) {
|
||||||
this.queryParam.serialNumber = this.$route.query.serialNumber
|
this.queryParam.serialNumber = this.$route.query.serialNumber
|
||||||
this.queryParam = { ...this.queryParam }
|
this.queryParam = { ...this.queryParam }
|
||||||
}
|
}
|
||||||
this.userInfoQuery = this.userInfo()
|
|
||||||
this.administrators = false
|
|
||||||
if (this.userInfoQuery.userRoleList && this.userInfoQuery.userRoleList.length > 0) {
|
|
||||||
this.userInfoQuery.userRoleList.forEach(res => {
|
|
||||||
if (res.roleCode === 'admin') {
|
|
||||||
this.administrators = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loadData(1)
|
this.loadData(1)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapGetters(['userInfo']),
|
|
||||||
getList () {
|
getList () {
|
||||||
this.dataSource = [{ id: 1, serialNumberLeft: '11' }]
|
this.dataSource = [{ id: 1, serialNumberLeft: '11' }]
|
||||||
},
|
},
|
||||||
@@ -230,7 +233,7 @@ export default {
|
|||||||
const idList = []
|
const idList = []
|
||||||
const selectionRows = JSON.parse(JSON.stringify(this.selectionRows))
|
const selectionRows = JSON.parse(JSON.stringify(this.selectionRows))
|
||||||
for (let i = 0; i < selectionRows.length; i++) {
|
for (let i = 0; i < selectionRows.length; i++) {
|
||||||
if (selectionRows[i].createBy === this.userInfoQuery.username &&
|
if (selectionRows[i].createBy === this.userInfo.username &&
|
||||||
selectionRows[i].releaseState === 'draft') {
|
selectionRows[i].releaseState === 'draft') {
|
||||||
idList.push(selectionRows[i].id)
|
idList.push(selectionRows[i].id)
|
||||||
}
|
}
|
||||||
@@ -256,7 +259,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 对比结果按钮点击
|
// 对比结果按钮点击
|
||||||
comparisonResultsClick (item) {
|
comparisonResultsClick (item) {
|
||||||
if (item.createBy === this.userInfoQuery.username && item.releaseState === 'draft') {
|
if (item.createBy === this.userInfo.username && item.releaseState === 'draft') {
|
||||||
item.isDisplay = 2
|
item.isDisplay = 2
|
||||||
} else {
|
} else {
|
||||||
item.isDisplay = 1
|
item.isDisplay = 1
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<internal-detail-page :title="$t('docTool.comparison.documentComparison')" :content-padding="0" :loading="loading">
|
<internal-detail-page :title="$t('docTool.comparison.documentComparison')" :content-padding="0" :loading="loading">
|
||||||
<template v-slot:titleRightCustom>
|
<template v-slot:titleRightCustom>
|
||||||
|
<!--查看比对结果-->
|
||||||
<a-button class="header-btn" type="primary" icon="eye" ghost @click="viewTheComparisonResultsClick">
|
<a-button class="header-btn" type="primary" icon="eye" ghost @click="viewTheComparisonResultsClick">
|
||||||
{{ $t('docTool.comparison.viewTheComparisonResults') }}
|
{{ $t('docTool.comparison.viewTheComparisonResults') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<!--添加全文评论-->
|
||||||
<a-button class="header-btn" type="primary" icon="message" ghost @click="addFullTextCommentClick">
|
<a-button class="header-btn" type="primary" icon="message" ghost @click="addFullTextCommentClick">
|
||||||
{{ $t('docTool.comparison.addFullTextComment') }}
|
{{ $t('docTool.comparison.addFullTextComment') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<!--关闭/打开自动匹配-->
|
||||||
<a-button class="header-btn" type="primary" :icon="isMatching?'close-circle':'check-circle'" ghost @click="turnOffAutomaticMatchingClick">
|
<a-button class="header-btn" type="primary" :icon="isMatching?'close-circle':'check-circle'" ghost @click="turnOffAutomaticMatchingClick">
|
||||||
{{ isMatching ? $t('docTool.comparison.turnOffAutomaticMatching') : $t('docTool.comparison.turnOnAutoMatch') }}
|
{{ isMatching ? $t('docTool.comparison.turnOffAutomaticMatching') : $t('docTool.comparison.turnOnAutoMatch') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -106,7 +109,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { postAction, getAction } from '../../../api/manage.js'
|
import { postAction, getAction } from '../../../api/manage.js'
|
||||||
// 添加全文评论弹框
|
// 添加全文评论弹框
|
||||||
import ComparisonAddFullComment from '../modules/ComparisonAddFullComment.vue'
|
import ComparisonAddFullComment from './modules/ComparisonAddFullComment.vue'
|
||||||
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
|
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { putAction } from '@/api/manage'
|
import { putAction } from '../../../../api/manage.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ComparisonAddFullComment',
|
name: 'ComparisonAddFullComment',
|
||||||
Reference in New Issue
Block a user