fix 80385

This commit is contained in:
赵霄
2024-01-31 14:01:34 +08:00
parent 4651cd5037
commit 122d1968fb
2 changed files with 27 additions and 31 deletions
@@ -51,18 +51,7 @@
{{ $t('export') }}
</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"-->
<!-- v-has="'vehicleItemLibrary:PMSInfoSynchronization'">-->
<!-- {{ $t('projectLibrary.vehicleItemLibrary.PMSInfoSynchronization') }}-->
<!--</a-button>-->
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'vehicleItemLibrary:batchDel'">{{ $t('batchDelete') }}</a-button>
</div>
<div>
@@ -101,11 +90,21 @@ import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
import JTable from '../../../components/jero/JTable.vue'
import VehicleItemLibraryModal from './modules/VehicleItemLibraryModal.vue'
import { ProjectSource } from '../../../enums/commonEnums'
import { mapGetters } from 'vuex'
export default {
name: 'VehicleItemLibrary',
components: { JTable, VehicleItemLibraryModal },
mixins: [JeroListMixin],
computed: {
...mapGetters(['userInfo']),
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
data () {
return {
columns: [
@@ -158,30 +157,23 @@ export default {
clickEvent: 'handleDetail',
has: 'vehicleItemLibrary:detail'
},
// // PMS详情
// {
// text: this.$t('projectLibrary.vehicleItemLibrary.PMSDetails'),
// clickEvent: 'handlePMSDetail',
// has: 'vehicleItemLibrary:pmsDetail',
// show: (record) => {
// return record.projectSource === ProjectSource.PMS.value
// }
// },
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'vehicleItemLibrary:edit',
show: (record) => {
console.log(record)
return true
return this.isAdmin || record.createBy === this.userInfo.username
}
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'vehicleItemLibrary:delete'
has: 'vehicleItemLibrary:delete',
show: (record) => {
return this.isAdmin || record.createBy === this.userInfo.username
}
}
],
needFilterTableBtn: true, // 是否需要过滤表格操作列没有权限的按钮
@@ -194,15 +186,10 @@ export default {
}
},
methods: {
handlePMSInfoSynchronization () {
},
handleDetail ({ id, projectName }) {
this.$router.push({
path: '/projectLibrary/VehicleItemLibraryDetail',
query: {
id, projectName
}
query: { id, projectName }
})
}
}
@@ -156,11 +156,13 @@ import JTable from '../../../components/jero/JTable.vue'
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
import { StandardSource, EvaluateProcessStatus } from '../../../enums/commonEnums'
import VehicleProjectSelectionDrawer from '../../../components/selection/VehicleProjectSelectionDrawer'
import { mapGetters } from 'vuex'
export default {
name: 'VehicleItemLibraryDetail',
components: { JTable, InternalDetailPage, StandardSelectionModal, VehicleProjectSelectionDrawer },
mixins: [JeroListMixin],
data () {
return {
StandardSource,
@@ -303,7 +305,7 @@ export default {
has: 'vehicleItemLibrary:detail:delete',
show: (record) => {
// 已评估和未评估的数据可以删除
return record.processStatus === EvaluateProcessStatus.notEvaluated.value || record.processStatus === EvaluateProcessStatus.evaluated.value
return (record.processStatus === EvaluateProcessStatus.notEvaluated.value || record.processStatus === EvaluateProcessStatus.evaluated.value) && (this.isAdmin || record.createBy === this.userInfo.username)
}
}
]
@@ -312,6 +314,13 @@ export default {
computed: {
pageTitle () {
return `${this.$route.query.projectName}${this.$t('details')}`
},
...mapGetters(['userInfo']),
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
created () {