修改角色切换

This commit is contained in:
qq787203167
2022-06-07 10:18:42 +08:00
parent 44f1fcf07e
commit 5c2569ad67
2 changed files with 437 additions and 413 deletions
+435 -412
View File
@@ -14,14 +14,17 @@
@change="tableOnChange" @change="tableOnChange"
@onHeaderRow='onHeaderRow' @onHeaderRow='onHeaderRow'
> >
<span slot="titleName" slot-scope="text"> <div :slot="'titleName'+(index+1)" v-for="(item,index) in content">
<span style='padding-right: 20px'>{{ text.sortOrder }} </span><a-button @click='onClickSee(text)'>查看</a-button> <span style='padding-right: 20px'>{{ item.db_field_txt }} </span>
</span> <a-button @click='onClickSee(item)'>查看</a-button>
<span slot="operationbtn" slot-scope="record"> </div>
<span slot="operationbtn" slot-scope="record">
<span v-if='homo === 1'> <span v-if='homo === 1'>
<!-- 认证工程师 --> <!-- 认证工程师 -->
<span v-if='record.state == "待发起收集" || record.state == "工程接口人退回" || record.state == "变更"'> <span v-if='record.state == "待发起收集" || record.state == "工程接口人退回" || record.state == "变更"'>
<span @click='ondataValueTobeinitiated(record)'>{{ record.dataValue == null? '--': record.dataValue}}</span> <span
@click='ondataValueTobeinitiated(record)'>{{ record.dataValue == null? '--': record.dataValue}}</span>
</span> </span>
<span v-else> <span v-else>
<span @click='dataValueTobeinitiated'>{{ record.dataValue }}</span> <span @click='dataValueTobeinitiated'>{{ record.dataValue }}</span>
@@ -32,12 +35,12 @@
</span> </span>
</span> </span>
<span slot="detailClick" slot-scope="text,record"> <span slot="detailClick" slot-scope="text,record">
<collection-type :detailDate='text' /> <collection-type :detailDate='text'/>
</span> </span>
</a-table> </a-table>
</div> </div>
<!-- 修改工程接口人---> <!-- 修改工程接口人--->
<a-modal v-model="areaVisible" :title="$t('modifyprojectInterfacePerson')" width='500px' :footer="null"> <a-modal v-model="areaVisible" :title="$t('modifyprojectInterfacePerson')" width='500px' :footer="null">
<a-form-model <a-form-model
class='tag-module' class='tag-module'
ref='ruleForm' ref='ruleForm'
@@ -48,28 +51,30 @@
> >
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='24'> <a-col :span='24'>
<a-form-model-item ref='region' :label="$t('engineeringInterfacePerson')" prop='region'> <a-form-model-item ref='region' :label="$t('engineeringInterfacePerson')" prop='region'>
<a-select :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')" v-model="Dateline.querySdt"> <a-select :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')" v-model="Dateline.querySdt">
<a-select-option v-for="(item, key) in querySdtList" :key="key" :value="item.value"> <a-select-option v-for="(item, key) in querySdtList" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label "> <span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }} {{ item.label }}
</span> </span>
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<div class="imports-footer"> <div class="imports-footer">
<div class="imports-footer-wrap"> <div class="imports-footer-wrap">
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit" v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('preservation')}}</a-button> <a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit"
v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('preservation')}}
</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button> <a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
</div> </div>
</div> </div>
</a-modal> </a-modal>
<!-- 配置信息---> <!-- 配置信息--->
<a-modal v-model="areaVisibleView" :title="$t('configurationInformation')" width='550px' :footer="null"> <a-modal v-model="areaVisibleView" :title="$t('configurationInformation')" width='550px' :footer="null">
<div class="content-text"> <div class="content-text">
<div class="text-field"> <div class="text-field">
<span class="text-field-left" :title="$t('configurationName')">{{$t('configurationName')}}:</span> <span class="text-field-left" :title="$t('configurationName')">{{$t('configurationName')}}:</span>
@@ -106,272 +111,281 @@
</template> </template>
<script> <script>
import eventBUs from '../../common/event' import eventBUs from '../../common/event'
import { getAction, postAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import CollectionType from '@/components/CollectionType' import CollectionType from '@/components/CollectionType'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import axios from 'axios' import axios from 'axios'
import Vue from 'vue' import Vue from 'vue'
import VueDraggableResizable from 'vue-draggable-resizable' import VueDraggableResizable from 'vue-draggable-resizable'
export default {
name: 'index',
props: {
//接口
url: {
type: Object,
default: {}
},
// 详细列表得一条数据
paramsManifest: {
type: Object,
default: {},
require: true
},
formInline: {
type: Object,
default: true
}
},
components: {
CollectionType,
VueDraggableResizable
},
data() {
this.components = {
header: {
cell: (h, props, children) => {
const { key, ...restProps } = props
// 此处的this.columns 是定义的table的表头属性变量 export default {
name: 'index',
const col = this.columns.find((col) => { props: {
const k = col.dataIndex || col.key //接口
return k === key url: {
}) type: Object,
default: {}
if (!col || !col.width) {
return h('th', { ...restProps }, [...children])
}
const dragProps = {
key: col.dataIndex || col.key,
class: 'table-draggable-handle',
attrs: {
w: 10,
x: col.width,
z: 1,
axis: 'x',
draggable: true,
resizable: false,
},
on: {
dragging: (x, y) => {
col.width = Math.max(x, 1)
},
},
}
const drag = h('vue-draggable-resizable', { ...dragProps })
return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag])
},
}, },
} // 详细列表得一条数据
return { paramsManifest: {
token:Vue.ls.get(ACCESS_TOKEN), type: Object,
jsonBody: [], default: {},
checkboxList: [], require: true
tableAll: false,
indeterminate: false,
columns: [],
selectedRowKeys: [],
selectedRowrowValue: [],
dataSource: [],
pageNo: 1,
pageSize: 10,
total: 0,
searchParmes: {},
loading: false,
orderBy: '1',
orderByField: '',
LoginUserType: '', // 登陆人角色状态
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
areaVisible: false,
form: {},
rules: {
// templatetitle: [
// { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
// ]
}, },
wrapperCol: { formInline: {
xs: { span: 24 }, type: Object,
sm: { span: 14 } default: true
},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
querySdtList: [], // 工程接口人
Dateline: {},
getquerySdtId: '', // 当前工程接口人的id
areaVisibleView: false, // 查看配置得弹框
configDetail: {}, // 查看配置得详细信息
}
},
mounted() {
},
methods: {
// 查看配置详细信息
onClickSee(val) {
let _this = this
this.areaVisibleView = true
axios({
url: `/jero-boot/params/config/getById?id=${val.sortColumn.dataIndex}`,
method: 'get',
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
this.configDetail = res.data.result
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
},
// 获取工程接口人
getquerySdtList(record) {
// 当前工程接口人的id
this.getquerySdtId = record.id
getAction(this.url.getquerySdtList, {projectId: this.$route.query.id, dutyTerritory: record.dutyTerritory}).then((res) => {
if (res.success) {
this.querySdtList = res.result
}
})
},
// 工程接口人 保存
handleSubmit(record) {
let _this = this
let param = {sdt: this.Dateline.querySdt, ids: this.getquerySdtId}
axios({
url: '/jero-boot/params/collectManifest/updateSdt',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.areaVisible = false
this.getLoginUserType()
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
},
// 工程接口人 取消
cancleImports() {
this.areaVisible = false
},
// 点击工程接口人的详情人员 有权限
ondataValueTobeinitiated(record) {
this.areaVisible = true
this.getquerySdtList(record)
},
dataValueTobeinitiated() {
this.$message.warning(this.$t('certifiedEngineer')+this.$t('and')+this.$t('Statusis')+this.$t('CollectionInitiated')+this.$t('ReturnedPerson')+this.$t('alteration')+this.$t('toHavePermission'))
},
// 点击工程接口人的详情人员 无权限
ondataValueNot() {
this.$message.warning(this.$t('operatethisbutton'))
},
onHeaderRow(column, index) {
console.log(column, index)
},
getLoginUserType() {
let params = {
paramsManifestId: this.paramsManifest.id,
projectId: this.$route.query.id
} }
getAction(this.url.getLoginUserType, params).then((res) => { },
if (res.success) { components: {
this.LoginUserType = res.result CollectionType,
this.getTableList() VueDraggableResizable
this.$emit('LoginUserType', this.LoginUserType) },
res.result.split(',').forEach((item,index) => { data() {
if(item === 'homo') { this.components = {
this.homo = 1 header: {
} else if(item === 'sdt') { cell: (h, props, children) => {
this.sdt = 1 const { key, ...restProps } = props
} else if(item === 'dre') {
this.dre = 1 // 此处的this.columns 是定义的table的表头属性变量
const col = this.columns.find((col) => {
const k = col.dataIndex || col.key
return k === key
})
if (!col || !col.width) {
return h('th', { ...restProps }, [...children])
}
const dragProps = {
key: col.dataIndex || col.key,
class: 'table-draggable-handle',
attrs: {
w: 10,
x: col.width,
z: 1,
axis: 'x',
draggable: true,
resizable: false
},
on: {
dragging: (x, y) => {
col.width = Math.max(x, 1)
}
}
}
const drag = h('vue-draggable-resizable', { ...dragProps })
return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag])
}
}
}
return {
token: Vue.ls.get(ACCESS_TOKEN),
jsonBody: [],
checkboxList: [],
tableAll: false,
indeterminate: false,
columns: [],
content: [],
selectedRowKeys: [],
selectedRowrowValue: [],
dataSource: [],
pageNo: 1,
pageSize: 10,
total: 0,
searchParmes: {},
loading: false,
orderBy: '1',
orderByField: '',
LoginUserType: '', // 登陆人角色状态
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
areaVisible: false,
form: {},
rules: {
// templatetitle: [
// { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
// ]
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
querySdtList: [], // 工程接口人
Dateline: {},
getquerySdtId: '', // 当前工程接口人的id
areaVisibleView: false, // 查看配置得弹框
configDetail: {} // 查看配置得详细信息
}
},
mounted() {
},
methods: {
// 查看配置详细信息
onClickSee(val) {
let _this = this
this.areaVisibleView = true
axios({
url: `/jero-boot/params/config/getById?id=${val.sortColumn.dataIndex}`,
method: 'get',
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
console.log(res)
if (res.data.success) {
this.configDetail = res.data.result
} else {
_this.$message.warning(res.data.result)
} }
}) })
.catch((error) => {
console.log(error)
})
},
// 获取工程接口人
getquerySdtList(record) {
// 当前工程接口人的id
this.getquerySdtId = record.id
getAction(this.url.getquerySdtList, {
projectId: this.$route.query.id,
dutyTerritory: record.dutyTerritory
}).then((res) => {
if (res.success) {
this.querySdtList = res.result
}
})
},
// 工程接口人 保存
handleSubmit(record) {
let _this = this
let param = { sdt: this.Dateline.querySdt, ids: this.getquerySdtId }
axios({
url: '/jero-boot/params/collectManifest/updateSdt',
method: 'post',
data: param,
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.areaVisible = false
this.getLoginUserType()
} else {
_this.$message.warning(res.data.result)
}
})
.catch((error) => {
console.log(error)
})
},
// 工程接口人 取消
cancleImports() {
this.areaVisible = false
},
// 点击工程接口人的详情人员 有权限
ondataValueTobeinitiated(record) {
this.areaVisible = true
this.getquerySdtList(record)
},
dataValueTobeinitiated() {
this.$message.warning(this.$t('certifiedEngineer') + this.$t('and') + this.$t('Statusis') + this.$t('CollectionInitiated') + this.$t('ReturnedPerson') + this.$t('alteration') + this.$t('toHavePermission'))
},
// 点击工程接口人的详情人员 无权限
ondataValueNot() {
this.$message.warning(this.$t('operatethisbutton'))
},
onHeaderRow(column, index) {
console.log(column, index)
},
getLoginUserType() {
let params = {
paramsManifestId: this.paramsManifest.id,
projectId: this.$route.query.id
} }
}) getAction(this.url.getLoginUserType, params).then((res) => {
}, if (res.success) {
getData() { this.LoginUserType = res.result
let paramsManifestid this.getTableList()
let url this.$emit('LoginUserType', this.LoginUserType)
if(this.$route.query.it === undefined) { res.result.split(',').forEach((item, index) => {
// 页面跳转 if (item === 'homo') {
paramsManifestid = this.paramsManifest.id this.homo = 1
url = this.url.tableHeader } else if (item === 'sdt') {
} else { this.sdt = 1
// 历史版本 } else if (item === 'dre') {
paramsManifestid = this.$route.query.it this.dre = 1
url = 'params/collectManifestHistory/getHeader' }
} })
let params = { }
paramsManifestId: paramsManifestid, })
flag: '7' },
} getData() {
getAction(url, params).then((res) => { let paramsManifestid
if (res.success) { let url
var jsonHead = res.result if (this.$route.query.it === undefined) {
this.columns = [] // 页面跳转
jsonHead.forEach((res, index) => { paramsManifestid = this.paramsManifest.id
// 配置列 url = this.url.tableHeader
if(res.type) { } else {
this.columns.push({ // 历史版本
dataIndex: res.db_field_name, paramsManifestid = this.$route.query.it
align: 'center', url = 'params/collectManifestHistory/getHeader'
ellipsis: true, }
sorter: res.sort, let params = {
sortOrder: res.db_field_txt paramsManifestId: paramsManifestid,
}) flag: '7'
}
getAction(url, params).then((res) => {
if (res.success) {
var jsonHead = res.result
this.columns = []
let num = 0
this.content = []
jsonHead.forEach((res, index) => {
// 配置列
if (res.type) {
this.columns.push({
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
sorter: res.sort,
sortOrder: res.db_field_txt
})
num++
this.content.push(res)
this.columns[index].scopedSlots = { this.columns[index].scopedSlots = {
customRender: 'detailClick', customRender: 'detailClick',
title: 'titleName' title: 'titleName' + num
} }
// 非配置列 // 非配置列
} else { } else {
this.columns.push({ this.columns.push({
title: res.db_field_txt, title: res.db_field_txt,
@@ -380,168 +394,177 @@ export default {
ellipsis: true, ellipsis: true,
sorter: res.sort sorter: res.sort
}) })
if(res.click) { if (res.click) {
// 工程接口人列表修改 // 工程接口人列表修改
this.columns[index].scopedSlots = { this.columns[index].scopedSlots = {
customRender: 'operationbtn' customRender: 'operationbtn'
}
} }
} }
} })
}) this.columns = [...this.columns]
console.log(this.columns)
}
})
},
tableOnChange(pagination, filters, sorter) {
console.log(pagination, filters, sorter, 'iiiiiiiiiiiiiiiii')
},
getTableListReset() {
let params = {
paramsManifestId: this.paramsManifest.id,
userTypes: this.LoginUserType
} }
}) this.loading = true
}, this.$emit('listReset', '')
tableOnChange(pagination, filters, sorter) { getAction(this.url.tableList, params).then((res) => {
console.log(pagination,filters,sorter,'iiiiiiiiiiiiiiiii') if (res.success) {
}, this.dataSource = res.result
getTableListReset() { this.total = res.result.total
let params = { this.loading = false
paramsManifestId: this.paramsManifest.id, } else {
userTypes: this.LoginUserType, this.loading = false
} }
this.loading = true })
this.$emit('listReset', '') },
getAction(this.url.tableList, params).then((res) => { getTableList() {
if (res.success) { let paramsManifestid
this.dataSource = res.result let url
this.total = res.result.total if (this.$route.query.it === undefined) {
this.loading = false // 页面跳转
paramsManifestid = this.paramsManifest.id
url = this.url.tableList
} else { } else {
this.loading = false console.log('历史版本呢')
// 历史版本
paramsManifestid = this.$route.query.it
url = 'params/collectManifestHistory/list'
} }
}) let params = {
}, userTypes: this.LoginUserType,
getTableList() { paramsManifestId: paramsManifestid,
let paramsManifestid ...this.formInline
let url
if(this.$route.query.it === undefined) {
// 页面跳转
paramsManifestid = this.paramsManifest.id
url = this.url.tableList
} else {
console.log('历史版本呢')
// 历史版本
paramsManifestid = this.$route.query.it
url = 'params/collectManifestHistory/list'
}
let params = {
userTypes: this.LoginUserType,
paramsManifestId: paramsManifestid,
...this.formInline
}
this.loading = true
getAction(url, params).then((res) => {
if (res.success) {
this.dataSource = res.result
this.total = res.result.total
this.loading = false
} else {
this.loading = false
} }
}) this.loading = true
getAction(url, params).then((res) => {
if (res.success) {
this.dataSource = res.result
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
onChange(page, pageSize) {
// this.pageNo = page
// this.getTableList()
},
onSelectChange(value, rowValue) {
this.selectedRowKeys = value
this.selectedRowrowValue = rowValue
this.$emit('value', value)
this.$emit('rowValue', rowValue)
},
OperationClick(ol, item) {
// this.$emit(ol.ClickEvent, item)
},
detailClick(item, index) {
// this.$emit('detailClick', item)
}
}, },
onChange(page, pageSize) { watch: {
// this.pageNo = page paramsManifest(newVal, oldVal) {
// this.getTableList() this.getData()
}, this.getLoginUserType()
onSelectChange(value,rowValue) { }
this.selectedRowKeys = value
this.selectedRowrowValue = rowValue
this.$emit('value',value)
this.$emit('rowValue', rowValue)
},
OperationClick(ol, item) {
// this.$emit(ol.ClickEvent, item)
},
detailClick(item, index) {
// this.$emit('detailClick', item)
}
},
watch: {
paramsManifest(newVal, oldVal) {
this.getData()
this.getLoginUserType()
} }
} }
}
</script> </script>
<style lang='less'> <style lang='less'>
.imports-footer{ .imports-footer {
.imports-footer-wrap{ .imports-footer-wrap {
margin:20px 0; margin: 20px 0;
text-align: center; text-align: center;
.imports-sub{
margin-right: 20px; .imports-sub {
margin-right: 20px;
}
} }
} }
}
.table .ant-table-column-title {
font-weight: bold;
}
.ant-table td { .table .ant-table-column-title {
white-space: nowrap; font-weight: bold;
} }
.content-text {
width: 100%; .ant-table td {
display: flex; white-space: nowrap;
flex-wrap: wrap; }
.text-field {
width: 50%; .content-text {
margin-bottom: 8px; width: 100%;
display: flex; display: flex;
.text-field-left { flex-wrap: wrap;
width: 70px;
display: inline-block;
font-size: 16px;
color: #040B29;
font-weight: 400;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.text-field-right { .text-field {
display: inline-block; width: 50%;
font-size: 16px; margin-bottom: 8px;
text-overflow: ellipsis; display: flex;
white-space: nowrap;
overflow: hidden; .text-field-left {
color: #040B29; width: 70px;
font-weight: 400; display: inline-block;
font-size: 16px;
color: #040B29;
font-weight: 400;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.text-field-right {
display: inline-block;
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #040B29;
font-weight: 400;
}
} }
} }
}
</style> </style>
<style scoped> <style scoped>
.box { .box {
width: 100%; width: 100%;
height: calc(100% - 100px); height: calc(100% - 100px);
overflow: auto; overflow: auto;
} }
.text { .text {
margin-right: 10px; margin-right: 10px;
} }
.page { .page {
text-align: right; text-align: right;
margin-top: 20px; margin-top: 20px;
} }
.table-draggable-handle {
/* width: 10px !important; */ .table-draggable-handle {
height: 100% !important; /* width: 10px !important; */
left: auto !important; height: 100% !important;
right: -5px; left: auto !important;
cursor: col-resize; right: -5px;
touch-action: none; cursor: col-resize;
border: none; touch-action: none;
position: absolute; border: none;
transform: none !important; position: absolute;
bottom: 0; transform: none !important;
} bottom: 0;
.resize-table-th { }
position: relative;
} .resize-table-th {
position: relative;
}
</style> </style>
@@ -144,7 +144,7 @@
for (let j = 0; j < timeDataList.length; j++) { for (let j = 0; j < timeDataList.length; j++) {
let time = JSON.stringify(timeDataList[j].time).slice(1, 11) let time = JSON.stringify(timeDataList[j].time).slice(1, 11)
if (time == list[i]) { if (time == list[i]) {
data.push([i, timeDataList[j].index, 14, j]) data.push([i, timeDataList[j].index, 12, j])
} }
} }
} }
@@ -231,6 +231,7 @@
series: [ series: [
{ {
type: 'scatter', type: 'scatter',
color:['#21c9cc'],
symbolSize: function(val) { symbolSize: function(val) {
return val[2] * 2 return val[2] * 2
}, },