添加创建者权限

This commit is contained in:
qq787203167
2022-06-10 15:33:13 +08:00
parent d09e7e3481
commit 5087161562
4 changed files with 80 additions and 25 deletions
+28 -7
View File
@@ -11,7 +11,7 @@
</a-upload> </a-upload>
<div class="loading-box" v-if="spinning"> <div class="loading-box" v-if="spinning">
<div class="loading-content"> <div class="loading-content">
<a-icon class="loading" type="loading" /> <a-icon class="loading" type="loading"/>
<div class="loading-tips"> <div class="loading-tips">
{{this.$t('Importing')}}... {{this.$t('Importing')}}...
</div> </div>
@@ -127,6 +127,23 @@
} }
this.spinning = false this.spinning = false
} else { } else {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if (token && data.message.includes('Token失效')) {
Modal.error({
title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
}
})
return
}
let { message } = info.file.response let { message } = info.file.response
let { name } = info.file let { name } = info.file
let content = [] let content = []
@@ -185,7 +202,7 @@
} }
</style> </style>
<style scoped lang="less"> <style scoped lang="less">
.loading-box{ .loading-box {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@@ -195,20 +212,24 @@
background-color: rgba(255, 255, 255, 0.9); background-color: rgba(255, 255, 255, 0.9);
border-radius: 8px; border-radius: 8px;
user-select: none; user-select: none;
.loading-content{
.loading-content {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
color: #21c9cc; color: #21c9cc;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
text-align: center; text-align: center;
.loading{
font-size:28px ; .loading {
font-size: 28px;
} }
.spin-loading{
.spin-loading {
animation: rotating 2s linear infinite; animation: rotating 2s linear infinite;
} }
.loading-tips{
.loading-tips {
margin-top: 5px; margin-top: 5px;
font-size: 16px; font-size: 16px;
color: #21c9cc; color: #21c9cc;
@@ -9,7 +9,7 @@
</a-button> </a-button>
</div> </div>
<div class="box-title-text" v-if="isInput"> <div class="box-title-text" v-if="isInput">
<a-input class="box-input" :value="value" <a-input :class="{'box-input':!isClass}" :value="value"
readonly readonly
@click.native="standardClick" @click.native="standardClick"
:placeholder="$t('PleaseSelect')+query.db_field_txt"/> :placeholder="$t('PleaseSelect')+query.db_field_txt"/>
@@ -54,7 +54,7 @@
export default { export default {
name: 'index', name: 'index',
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput'], props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass'],
data() { data() {
return { return {
loading: true, loading: true,
@@ -133,18 +133,18 @@
}, },
handleSubmit() { handleSubmit() {
// if (this.userIds && this.userIds.length > 0) { // if (this.userIds && this.userIds.length > 0) {
if (this.isSingleChoice) { if (this.isSingleChoice) {
if (this.userIds.length > 1) { if (this.userIds.length > 1) {
this.$message.warning(this.$t('onlyOnePersonCanBeSelected')) this.$message.warning(this.$t('onlyOnePersonCanBeSelected'))
return return
}
} }
let userIds = JSON.parse(JSON.stringify(this.userIds)) }
let userName = JSON.parse(JSON.stringify(this.userName)) let userIds = JSON.parse(JSON.stringify(this.userIds))
this.$emit('input', userName.join(',')) let userName = JSON.parse(JSON.stringify(this.userName))
this.$emit('change', this.query.db_field_name, userIds.join(',')) this.$emit('input', userName.join(','))
this.visible = false this.$emit('change', this.query.db_field_name, userIds.join(','),this.query.subscript)
this.treeVisible = false this.visible = false
this.treeVisible = false
// } else { // } else {
// this.$message.warning(this.$t('pleaseSelectPersonFirst')) // this.$message.warning(this.$t('pleaseSelectPersonFirst'))
// } // }
@@ -114,6 +114,14 @@
tree-checkable tree-checkable
:placeholder="$t('PleaseSelect')" :placeholder="$t('PleaseSelect')"
/> />
<PersonnelSelection
v-else-if="item.type == 'Personnel'"
:query="{db_field_name:'valueId',db_field_txt:'',subscript:index}"
:isInput="true"
:isClass="true"
:personneQuery="item"
@change="PersonnelSelectionChange"
v-model="item.valueName"/>
<!-- 下拉多选 --> <!-- 下拉多选 -->
<template v-else-if="item.type==='list_multi'"> <template v-else-if="item.type==='list_multi'">
<j-multi-select-tag v-if="item.options" v-model="item.val" :options="item.options" :placeholder="$t('pleaseSelect')"/> <j-multi-select-tag v-if="item.options" v-model="item.val" :options="item.options" :placeholder="$t('pleaseSelect')"/>
@@ -239,11 +247,11 @@
import JSelectMultiUser from '@/components/jerobiz/JSelectMultiUser' import JSelectMultiUser from '@/components/jerobiz/JSelectMultiUser'
import JMultiSelectTag from '@/components/dict/JMultiSelectTag' import JMultiSelectTag from '@/components/dict/JMultiSelectTag'
import JAreaLinkage from '@comp/jero/JAreaLinkage' import JAreaLinkage from '@comp/jero/JAreaLinkage'
import PersonnelSelection from '@/components/PersonnelSelection/index'
export default { export default {
name: 'index', name: 'index',
mixins: [mixinDevice], mixins: [mixinDevice],
components: { JAreaLinkage, JMultiSelectTag, JDate, JSelectDepart, JSelectMultiUser }, components: { JAreaLinkage, JMultiSelectTag, JDate, JSelectDepart, JSelectMultiUser ,PersonnelSelection},
props: { props: {
/* /*
fieldList: [{ fieldList: [{
@@ -426,6 +434,7 @@
this.queryParamsModel.splice(index, 1) this.queryParamsModel.splice(index, 1)
}, },
handleSelected(node, item) { handleSelected(node, item) {
console.log(node)
let { type, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef let { type, options, dictCode, dictTable, dictText, customReturnField, popup } = node.dataRef
item['type'] = type item['type'] = type
item['options'] = options item['options'] = options
@@ -438,6 +447,8 @@
item['popup'] = popup item['popup'] = popup
} }
this.$set(item, 'val', undefined) this.$set(item, 'val', undefined)
this.$set(item, 'valueName', undefined)
this.$set(item, 'valueId', undefined)
}, },
handleOpen() { handleOpen() {
this.show() this.show()
@@ -602,7 +613,12 @@
handleChangeJPopup(item, e, values) { handleChangeJPopup(item, e, values) {
item.val = values[item.popup['destFields']] item.val = values[item.popup['destFields']]
}, },
PersonnelSelectionChange(value, id,index){
console.log(index)
this.queryParamsModel[index].val = id
this.queryParamsModel[index].valueId = id
console.log(this.queryParamsModel)
},
} }
} }
</script> </script>
@@ -682,7 +682,7 @@
} }
], ],
visibleFile: false, visibleFile: false,
JLoading:false, JLoading: false,
formInlineComment: {}, formInlineComment: {},
rulesComment: { rulesComment: {
commentContent: [ commentContent: [
@@ -797,6 +797,24 @@
value: 'region', value: 'region',
text: this.$t('zoneOfApplication'), text: this.$t('zoneOfApplication'),
dictCode: 'region'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框 dictCode: 'region'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: 'Personnel',
value: 'regulationOwnerId',
valueName:'regulationOwnerIdName',
text: this.$t('regulatoryEngineer')
},
{
type: 'Personnel',
value: 'homologationEngineerId',
valueName:'homologationEngineerIdName',
text: this.$t('certifiedEngineer')
},
{
type: 'Personnel',
value: 'engineeringInterfacePerson',
valueName:'engineeringInterfacePersonName',
text: this.$t('engineeringInterfacePerson')
} }
], ],
visibleRoleSwitching: false, visibleRoleSwitching: false,
@@ -866,7 +884,7 @@
this.isDisplay = false this.isDisplay = false
} }
this.JLoading = false this.JLoading = false
}else{ } else {
this.JLoading = false this.JLoading = false
} }
}) })