update 国内标准、车型项目库列表按钮权限,查询组件按钮权限

This commit is contained in:
赵霄
2023-09-11 18:22:57 +08:00
parent ddaa858fc1
commit bdf84b06c1
5 changed files with 91 additions and 35 deletions
+7 -1
View File
@@ -109,7 +109,7 @@
{{ !toggleSearchStatus ? $t('open') : $t('putAway') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
<a-button type="primary" @click="searchQuery" style="margin-left: 8px">{{$t('query')}}</a-button>
<a-button type="primary" @click="searchQuery" style="margin-left: 8px" v-has="searchHas">{{$t('query')}}</a-button>
<a-button style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</div>
</a-row>
@@ -141,6 +141,12 @@ export default {
minLength: {
type: Number,
default: 3
},
// 查询权限
searchHas: {
type: String,
required: false,
default: null
}
// searchQueryList: {
// type: Array,
@@ -32,7 +32,9 @@
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'vehicleItemLibrary:search'">
{{ $t('query') }}
</a-button>
</span>
</a-col>
</a-row>
@@ -41,15 +43,19 @@
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'vehicleItemLibrary:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导出-->
<a-button icon="upload" type="primary" ghost @click="handleExportXls($t('projectLibrary.vehicleItemLibrary.vehicleItemLibrary'))">
<a-button icon="upload"
type="primary"
ghost
@click="handleExportXls($t('projectLibrary.vehicleItemLibrary.vehicleItemLibrary'))"
v-has="'vehicleItemLibrary:export'">
{{ $t('export') }}
</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'vehicleItemLibrary:batchDel'">{{ $t('batchDelete') }}</a-button>
<!-- PMS信息同步-->
<a-button type="primary" icon="setting" ghost @click="handlePMSInfoSynchronization">
<a-button type="primary" icon="setting" ghost @click="handlePMSInfoSynchronization" v-has="'vehicleItemLibrary:PMSInfoSynchronization'">
{{ $t('projectLibrary.vehicleItemLibrary.PMSInfoSynchronization') }}
</a-button>
</div>
@@ -66,7 +72,6 @@
@change="handleTableChange">
<template v-slot:operation="{text, record}">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>
<a-divider type="vertical" />
<a-dropdown placement="bottomCenter">
@@ -130,7 +135,7 @@ export default {
},
// 项目负责人
{
dataIndex: 'projectLeader',
dataIndex: 'nameWorkNo',
title: this.$t('projectLibrary.vehicleItemLibrary.projectLeader'),
width: 250
},
@@ -152,23 +157,26 @@ export default {
// 查看
{
text: this.$t('view'),
clickEvent: 'handleCollection',
has: ''
clickEvent: 'handleDetail',
has: 'vehicleItemLibrary:detail'
},
// PMS详情
{
text: this.$t('projectLibrary.vehicleItemLibrary.PMSDetails'),
clickEvent: 'handleShare',
has: ''
clickEvent: 'handlePMSDetail',
has: 'vehicleItemLibrary:pmsDetail'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: ''
has: 'vehicleItemLibrary:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: ''
has: 'vehicleItemLibrary:delete'
}
],
needFilterTableBtn: true, // 是否需要过滤表格操作列没有权限的按钮
@@ -191,6 +199,9 @@ export default {
this[operation.clickEvent](record)
}
},
handleDetail () {
}
}
}
</script>
@@ -44,7 +44,7 @@
<!--项目负责人-->
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('projectLibrary.vehicleItemLibrary.projectLeader')">
<user-selection v-decorator="['projectLeader', validatorRules.projectLeader]"
<user-selection v-decorator="['projectLeader', validatorRules.projectLeader]" :name-str="model.nameWorkNo"
:placeholder="$t('pleaseSelect') + $t('projectLibrary.vehicleItemLibrary.projectLeader')" />
</a-form-item>
</a-col>
@@ -8,17 +8,19 @@
<span>{{ part }}</span>
<div class="detail-page-part-title-operate-box" v-if="index === 0">
<!-- 更新记录-->
<a-button type="link" @click="handleOpenUpdateRecord">
<a-button type="link" @click="handleOpenUpdateRecord" v-has="btnPermission.updateRecord">
<i class="iconfont icon-root-list" />
{{ $t('standardRegulationLibrary.updateRecord') }}
</a-button>
<!-- 提交问题-->
<a-button type="link" @click="submitQuestion">
<a-button type="link" @click="submitQuestion" v-has="btnPermission.submitQuestion">
<a-icon type="database" />
{{ $t('standardRegulationLibrary.submitQuestion') }}
</a-button>
<!-- 分享-->
<a-button type="link" @click="handleShare"><i class="iconfont icon-share-internal" />{{ $t('share') }}</a-button>
<a-button type="link" @click="handleShare" v-has="btnPermission.share">
<i class="iconfont icon-share-internal" />{{ $t('share') }}
</a-button>
</div>
</div>
<div class="detail-page-part-form" v-if="index !== 3">
@@ -33,7 +35,7 @@
<div class="detail-page-process-manuscript-title">
<span>{{ formItem.dbFieldTxt }}</span>
<!-- 标准分解单-->
<a-button type="primary" ghost icon="file-text" @click="previewStandardResolutionSheet">
<a-button type="primary" ghost icon="file-text" @click="previewStandardResolutionSheet" v-has="btnPermission.standardResolutionSheet">
{{ $t('standardRegulationLibrary.standardResolutionSheet') }}
</a-button>
</div>
@@ -44,9 +46,9 @@
</div>
<div class="detail-page-process-manuscript-file-operate">
<!-- 下载-->
<a-button type="link" icon="download">{{ $t('download') }}</a-button>
<a-button type="link" icon="download" v-has="btnPermission.download">{{ $t('download') }}</a-button>
<!-- 无水印下载-->
<a-button type="link">
<a-button type="link" v-has="btnPermission.unwatermarkedDownload">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
@@ -77,6 +79,15 @@ import SubmitQuestionModal from './modules/SubmitQuestionModal.vue'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal.vue'
const DomesticStandardPermission = {
updateRecord: 'domesticStandard:updateRecord', // 更新记录
submitQuestion: 'domesticStandard:submitQuestion', // 提交问题
share: 'domesticStandard:share', // 分享
standardResolutionSheet: 'domesticStandard:standardResolutionSheet', // 标准分解单
download: 'domesticStandard:download', // 下载
unwatermarkedDownload: 'domesticStandard:unwatermarkedDownload' // 无水印下载
}
export default {
name: 'StandardDetailPage',
components: { UploadRecordModal, SubmitQuestionModal, UserSelectModal, StandardResolutionSheetModal },
@@ -103,6 +114,18 @@ export default {
computed: {
pageTitle () {
return TagsTypeEnums.nameOfIndex(this.$route.query.type)
},
btnPermission () {
let permission = {}
switch (this.$route.query.type) {
// 国内标准法规
case TagsTypeEnums.DOMESTIC_LIST.value + '':
permission = DomesticStandardPermission
break
default:
break
}
return permission
}
},
created () {
@@ -21,13 +21,17 @@
</a-tooltip>
<template v-if="record.key === mouseInNodeKey">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" @click.stop="handleAddTreeNode(record)"></a-button>
<a-button icon="plus"
class="tree-operate-node-btn"
@click.stop="handleAddTreeNode(record)"
v-has="'domesticStandard:tree:add'"></a-button>
<!-- 编辑-->
<a-button class="tree-operate-node-btn" @click.stop="handleEditTreeNode(record)">
<a-button class="tree-operate-node-btn" @click.stop="handleEditTreeNode(record)" v-has="'domesticStandard:tree:edit'">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
v-has="'domesticStandard:tree:delete'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
@@ -43,19 +47,21 @@
<search ref="searchRef"
:url="url"
:get-query-condition-func="getQueryConditionFunc"
search-has="domesticStandard:search"
@search="searchQuery"
@reset="searchReset" />
</div>
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'domesticStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入-->
<a-upload name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
v-has="'domesticStandard:import'"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
@@ -63,6 +69,7 @@
<a-button icon="upload"
type="primary"
ghost
v-has="'domesticStandard:export'"
@click="handleExportXls($t('standardRegulationLibrary.domesticStandard.exportFileName'))">
{{ $t('export') }}
</a-button>
@@ -70,19 +77,26 @@
<a-button icon="upload"
type="primary"
ghost
v-has="'domesticStandard:exportFile'"
@click="handleFileExport($t('standardRegulationLibrary.domesticStandard.exportFileName'))">
{{ $t('exportWithFile') }}
</a-button>
<!-- 模板下载-->
<a-button type="primary" icon="download" ghost @click="downTemplate($t('standardRegulationLibrary.domesticStandard.templateName'))">
<a-button type="primary"
icon="download"
ghost
v-has="'domesticStandard:downTemplate'"
@click="downTemplate($t('standardRegulationLibrary.domesticStandard.templateName'))">
{{ $t('templateDownload') }}
</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'domesticStandard:batchDel'">{{ $t('batchDelete') }}</a-button>
<!-- 配置标准-->
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard">{{ $t('standardRegulationLibrary.configStandard') }}</a-button>
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard" v-has="'domesticStandard:configStandard'">
{{ $t('standardRegulationLibrary.configStandard') }}
</a-button>
<!-- 移出标准-->
<a-button type="primary" icon="minus-circle" ghost @click="handleRemoveStandard">
<a-button type="primary" icon="minus-circle" ghost @click="handleRemoveStandard" v-has="'domesticStandard:removeStandard'">
{{ $t('standardRegulationLibrary.removeStandard') }}
</a-button>
</div>
@@ -118,7 +132,7 @@
<template v-slot:operation="{text, record}">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)">
<a @click="operationClick(operationList[0],record)" v-has="operationList[0].has">
<i class="iconfont icon-star1" v-show="record.collectionFlag === yesValue" />
<i class="iconfont icon-star" v-show="!record.collectionFlag || record.collectionFlag === noValue" />
</a>
@@ -127,7 +141,7 @@
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<a @click="operationClick(operation,record)" v-has="operation.has">
<div class="operate-btn">
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
@@ -215,22 +229,25 @@ export default {
{
text: this.$t('standardRegulationLibrary.domesticStandard.cancelCollection'),
clickEvent: 'handleCollection',
has: ''
has: 'domesticStandard:collection'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: ''
has: 'domesticStandard:edit'
},
// 分享
{
text: this.$t('share'),
clickEvent: 'handleShare',
has: ''
has: 'domesticStandard:share'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: ''
has: 'domesticStandard:delete'
}
],
getTableHeaderFunc: getDomesticStandardTableHeader,
@@ -243,7 +260,6 @@ export default {
exportZipUrl: '', // 带文件导出
importExcelUrl: '' // 导入
},
dataSource: [{ id: 1, collectionFlag: '1', standard_name: '标准001', standard_number: 'BZ001' }],
yesValue: YesOrNoEnum.YES.value,
noValue: YesOrNoEnum.NO.value,
nowShareId: null, // 当前正在分享的数据的id