[add] 权限工程接口人

This commit is contained in:
zhaomeijing
2022-05-16 16:31:05 +08:00
parent dadb953d5f
commit 305ca79397
4 changed files with 117 additions and 45 deletions
+1
View File
@@ -707,6 +707,7 @@ module.exports = {
uploadTime: 'Upload time', uploadTime: 'Upload time',
enclosure: 'enclosure', enclosure: 'enclosure',
// 认证 // 认证
operatethisbutton: 'You do not have permission to operate this button',
ParameterLibrary: 'Parameter Library', ParameterLibrary: 'Parameter Library',
referenceparameter: 'reference Parameter', referenceparameter: 'reference Parameter',
Assignedby: 'Assignedby', Assignedby: 'Assignedby',
+1
View File
@@ -716,6 +716,7 @@ module.exports = {
uploadTime: '上传时间', uploadTime: '上传时间',
enclosure: '附件', enclosure: '附件',
// 认证 // 认证
operatethisbutton: '没有权限操作此按钮',
ParameterLibrary: '参数库', ParameterLibrary: '参数库',
referenceparameter: '引用参数', referenceparameter: '引用参数',
Assignedby: '分配填写人', Assignedby: '分配填写人',
@@ -73,6 +73,7 @@ export default {
indeterminate: false, indeterminate: false,
columns: [], columns: [],
selectedRowKeys: [], selectedRowKeys: [],
selectedRowrowValue: [],
dataSource: [], dataSource: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@@ -81,6 +82,7 @@ export default {
loading: false, loading: false,
orderBy: '1', orderBy: '1',
orderByField: '', orderByField: '',
LoginUserType: '', // 登陆人角色状态
homo: 0, // 认证工程师 homo: 0, // 认证工程师
sdt: 0, // 工程接口人 sdt: 0, // 工程接口人
dre: 0, // 填写人 dre: 0, // 填写人
@@ -98,6 +100,8 @@ export default {
} }
getAction(this.url.getLoginUserType, params).then((res) => { getAction(this.url.getLoginUserType, params).then((res) => {
if (res.success) { if (res.success) {
this.LoginUserType = res.result
this.$emit('LoginUserType', this.LoginUserType)
res.result.split(',').forEach((item,index) => { res.result.split(',').forEach((item,index) => {
if(item === 'homo') { if(item === 'homo') {
this.homo = 1 this.homo = 1
@@ -190,8 +194,8 @@ export default {
// this.getTableList() // this.getTableList()
}, },
onSelectChange(value,rowValue) { onSelectChange(value,rowValue) {
console.log(value,rowValue)
this.selectedRowKeys = value this.selectedRowKeys = value
this.selectedRowrowValue = rowValue
this.$emit('value',value) this.$emit('value',value)
this.$emit('rowValue', rowValue) this.$emit('rowValue', rowValue)
}, },
@@ -64,12 +64,12 @@
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight"> <a-popconfirm overlayClassName='popconfirm' placement="bottomRight">
<template slot="title" id="popconfirm"> <template slot="title" id="popconfirm">
<!-- 下发收集 --> <!-- 下发收集 -->
<div @click="handleAdd" class="operator-text-title"> <div @click="distributionAndCollection" class="operator-text-title">
<a-icon type="plus"/> <a-icon type="plus"/>
{{$t('distributionAndCollection')}} {{$t('distributionAndCollection')}}
</div> </div>
<!-- 冻结配置--> <!-- 冻结配置-->
<div @click="handleAdd" class="operator-text-title"> <div @click="freezeConfiguration" class="operator-text-title">
<a-icon type="plus"/> <a-icon type="plus"/>
{{$t('FreezeConfiguration')}} {{$t('FreezeConfiguration')}}
</div> </div>
@@ -121,7 +121,7 @@
</div> </div>
<div style="width: 100%"> <div style="width: 100%">
<!-- 表格-10控件--> <!-- 表格-10控件-->
<table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue' :formInline='formInline' @value='value'/> <table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue' :formInline='formInline' @LoginUserType='LoginUserType' @value='value'/>
</div> </div>
<!-- 添加---> <!-- 添加--->
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null"> <a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
@@ -217,8 +217,11 @@ export default {
rowId: '', rowId: '',
version: 0, version: 0,
itemId: '', itemId: '',
selectedRowKeysValue: [], selectedRowKeysValue: [], // table列表所选得数据
token:Vue.ls.get(ACCESS_TOKEN), token:Vue.ls.get(ACCESS_TOKEN),
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
} }
}, },
props: { props: {
@@ -230,6 +233,45 @@ export default {
}, },
mounted() {}, mounted() {},
methods:{ methods:{
// 判断是否有权限 认证工程师 待发起收集
// 添加 批量删除 下发收集 冻结配置 工程接口人列修改
permission() {
// 判断是否具有提交权限
// 认证工程师
// 定义开关 0为没有权限 1为有权限
let flag = 1
if(this.homo) {
if(this.selectedRowKeysValue.length == 0) {
flag = 0
this.$message.success(this.$t('selectLeastOne'))
} else {
this.selectedRowKeysValue.forEach((item, index) => {
if(item.state !== '待发起收集') {
flag = 0
}
})
if(flag === 1) {
flag = 1
} else {
this.$message.warning(this.$t('operatethisbutton'))
}
}
}else {
this.$message.success(this.$t('operatethisbutton'))
}
return flag
},
LoginUserType(val) {
val.split(',').forEach((item,index) => {
if(item === 'homo') {
this.homo = 1
} else if(item === 'sdt') {
this.sdt = 1
} else if(item === 'dre') {
this.dre = 1
}
})
},
// 表格所选中得行内容 // 表格所选中得行内容
rowValue(val) { rowValue(val) {
this.selectedRowKeysValue = val this.selectedRowKeysValue = val
@@ -239,9 +281,29 @@ export default {
this.selectedRowKeys = val, this.selectedRowKeys = val,
this.selectedRowKeysArray = val.join(',') this.selectedRowKeysArray = val.join(',')
}, },
// 冻结配置
freezeConfiguration() {
// 先判断是否有权限
let permission = this.permission()
if(permission) {
console.log('拥有冻结配置权限')
}
},
// 下发收集
distributionAndCollection() {
// 先判断是否有权限
let permission = this.permission()
if(permission) {
console.log('拥有下发收集权限')
}
},
// 添加 // 添加
handleAdd() { handleAdd() {
this.areaVisible = true // 先判断是否有权限
let permission = this.permission()
if(permission) {
this.areaVisible = true
}
}, },
// 提交 // 提交
handleSubmit() { handleSubmit() {
@@ -284,47 +346,51 @@ export default {
this.$refs.CollectionTabel.getTableListReset() this.$refs.CollectionTabel.getTableListReset()
}, },
handleDel(){ handleDel(){
let param={ // 先判断是否有权限
ids: this.selectedRowKeysArray let permission = this.permission()
} if(permission) {
if (this.selectedRowKeys.length > 0) { let param={
let _this = this ids: this.selectedRowKeysArray
this.$confirm({ }
content: _this.$t('ConfirmBatchDeletion'), if (this.selectedRowKeys.length > 0) {
onOk() { let _this = this
axios({ this.$confirm({
url: '/jero-boot/params/collectManifest/deleteBatch', content: _this.$t('ConfirmBatchDeletion'),
method: 'post', onOk() {
data: param, axios({
transformRequest: [function (data) { url: '/jero-boot/params/collectManifest/deleteBatch',
let ret = '' method: 'post',
for (let it in data) { data: param,
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' transformRequest: [function (data) {
} let ret = ''
return ret for (let it in data) {
}], ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
headers: { }
'Content-Type': 'application/x-www-form-urlencoded', return ret
'X-Access-Token':_this.token }],
} headers: {
}) 'Content-Type': 'application/x-www-form-urlencoded',
.then( (res) =>{ 'X-Access-Token':_this.token
if (res.data.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.$refs.CollectionTabel.getData()
_this.$refs.CollectionTabel.getTableList()
}else{
_this.$message.warning(_this.$t('operationFailed'))
} }
}) })
.catch( (error) =>{ .then( (res) =>{
console.log(error); if (res.data.success) {
}); _this.$message.success(_this.$t('OperationSuccessful'))
} _this.selectedRowKeys = []
}) _this.$refs.CollectionTabel.getData()
} else { _this.$refs.CollectionTabel.getTableList()
this.$message.warning(this.$t('selectLeastOne')) }else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
} }
}, },
pageOnChange() { pageOnChange() {