修改切換角色

This commit is contained in:
qq787203167
2022-06-06 10:47:19 +08:00
parent 24e5af4008
commit e5f47ba041
4 changed files with 111 additions and 9 deletions
+2
View File
@@ -596,6 +596,7 @@ module.exports = {
StandardImplementationDate: 'Standard implementation date',
regulatoryEngineer: 'Regulation Engineer',
certifiedEngineer: 'Homologation Engineer',
regulatoryEngineerOrcertifiedEngineer:'Regulation Engineer Or Homologation Engineer',
engineeringInterfacePerson: 'Engineering Interface',
typeOfDeliverables: 'Type of deliverables',
deliverableTemplate: 'Deliverable template',
@@ -918,4 +919,5 @@ module.exports = {
and: 'and',
judge:'Judge',
pleaseWaitWhileRunning:'Please wait while running',
roleSwitching:'Role switching',
}
+3 -1
View File
@@ -604,6 +604,7 @@ module.exports = {
StandardImplementationDate: '标准实施日期',
regulatoryEngineer: '法规工程师',
certifiedEngineer: '认证工程师',
regulatoryEngineerOrcertifiedEngineer:'法规工程师/认证工程师',
judge: '判断',
engineeringInterfacePerson: '工程接口人',
typeOfDeliverables: '交付物类型',
@@ -922,5 +923,6 @@ module.exports = {
Statusis: '状态为',
toHavePermission: '才有权限',
and: '并且',
pleaseWaitWhileRunning: '运行中请稍等'
pleaseWaitWhileRunning: '运行中请稍等',
roleSwitching:'角色切换',
}
@@ -92,6 +92,10 @@
<a-icon type="user"/>
{{ $t('ExportReport') }}
</div>
<div class="operator-text-title" @click="batSettingClick">
<a-icon type="setting"/>
{{ $t('batSetting') }}
</div>
</template>
<div class="operator-text" style="position: relative">
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
@@ -109,9 +113,9 @@
<a-icon type="plus"/>
{{ $t('add') }}
</div>
<div class="operator-text" @click="batSettingClick">
<div class="operator-text" @click="roleSwitchingClick">
<a-icon type="setting"/>
{{ $t('batSetting') }}
{{ $t('roleSwitching') }}
</div>
</div>
<div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 19px">
@@ -127,6 +131,11 @@
<a-icon type="setting"/>
{{ $t('batSetting') }}
</div>
<div class="operator-text" v-if="this.$route.query.studioEngineer == this.userInfo().id"
@click="roleSwitchingClick">
<a-icon type="setting"/>
{{ $t('roleSwitching') }}
</div>
</div>
</div>
<div style="width: 100%">
@@ -305,6 +314,45 @@
</a-row>
</a-form-model>
</a-modal>
<a-modal
:title="$t('roleSwitching')"
:width="500"
:visible="visibleRoleSwitching"
:confirm-loading="confirmLoadingRoleSwitching"
:maskClosable="false"
@ok="handleOkRoleSwitching"
@cancel="handleCancelRoleSwitching"
>
<a-form-model :model="formInlineRoleSwitching" class="formAdd" :rules="rulesRoleSwitching"
ref="ruleFormRoleSwitching">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-Comment">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('roleSwitching')">{{$t('roleSwitching')}}</span>
</div>
<a-form-model-item class="itemModelComment" :prop="'roleSwitchingCode'">
<a-select allowClear :placeholder="$t('pleaseSelect')+$t('roleSwitching')"
v-model="formInlineRoleSwitching.roleSwitchingCode">
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
<a-select-option :value="'0'">
<span class="itemOption-index" :title="$t('StudioEngineer')">
{{$t('StudioEngineer')}}
</span>
</a-select-option>
<a-select-option :value="'4'">
<span class="itemOption-index" :title="$t('regulatoryEngineerOrcertifiedEngineer')">
{{$t('regulatoryEngineerOrcertifiedEngineer')}}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<resultReportedUpload @resultReportedUploadForm="addModelList" ref="resultReportedUploadRef"/>
</a-card>
</template>
@@ -746,13 +794,26 @@
text: this.$t('zoneOfApplication'),
dictCode: 'region'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
}
]
],
visibleRoleSwitching: false,
confirmLoadingRoleSwitching: false,
formInlineRoleSwitching: {},
rulesRoleSwitching: {
roleSwitchingCode: [
{
required: true,
message: this.$t('roleSwitching') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
}
}
},
mounted() {
if (this.$route.query.studioEngineer == this.userInfo().id) {
this.isDisplay = true
this.formInlineRoleSwitching.roleSwitchingCode = '0'
} else {
this.isDisplay = false
}
@@ -905,6 +966,34 @@
handleAdd() {
this.$refs.addModelRef.addModel()
},
handleOkRoleSwitching() {
this.$refs.ruleFormRoleSwitching.validate(valid => {
if (valid) {
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
}
this.visibleRoleSwitching = false
this.getList()
}
})
},
handleCancelRoleSwitching() {
this.visibleRoleSwitching = false
},
roleSwitchingClick() {
this.visibleRoleSwitching = true
this.$nextTick(() => {
this.$refs.ruleFormRoleSwitching.clearValidate()
if (this.isDisplay) {
this.formInlineRoleSwitching.roleSwitchingCode = '0'
} else {
this.formInlineRoleSwitching.roleSwitchingCode = '4'
}
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
})
},
handleDel() {
if (this.selectedRowKeys.length > 0) {
let _this = this
@@ -995,10 +1084,17 @@
this.getList()
},
getList() {
let roleCode
if (this.isDisplay) {
roleCode = 0
} else {
roleCode = 4
}
let query = {
...this.queryParamQuery,
...this.queryParam,
projectLibraryId: this.$route.query.id
projectLibraryId: this.$route.query.id,
roleCode: roleCode
}
this.loading = true
getAction(this.url.list, query).then((res) => {
@@ -1589,7 +1685,9 @@
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
.popconfirm{
z-index: 999;
}
.popconfirm .ant-popover-buttons {
display: none !important;
}
+3 -3
View File
@@ -136,19 +136,19 @@
title: this.$t('RoleCode'),
align: 'center',
dataIndex: 'roleCode',
width: 180
width: 280
},
{
title: this.$t('roleName'),
align: 'center',
dataIndex: 'roleName',
width: 180
width: 280
},
{
title: this.$t('createTime'),
dataIndex: 'createTime',
align: 'center',
width: 180,
width: 280,
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')