fix 80385
This commit is contained in:
@@ -51,18 +51,7 @@
|
|||||||
{{ $t('export') }}
|
{{ $t('export') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<!-- 批量删除-->
|
<!-- 批量删除-->
|
||||||
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'vehicleItemLibrary:batchDel'">{{
|
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'vehicleItemLibrary:batchDel'">{{ $t('batchDelete') }}</a-button>
|
||||||
$t('batchDelete')
|
|
||||||
}}
|
|
||||||
</a-button>
|
|
||||||
<!-- PMS信息同步-->
|
|
||||||
<!--<a-button type="primary"-->
|
|
||||||
<!-- icon="setting"-->
|
|
||||||
<!-- ghost-->
|
|
||||||
<!-- @click="handlePMSInfoSynchronization"-->
|
|
||||||
<!-- v-has="'vehicleItemLibrary:PMSInfoSynchronization'">-->
|
|
||||||
<!-- {{ $t('projectLibrary.vehicleItemLibrary.PMSInfoSynchronization') }}-->
|
|
||||||
<!--</a-button>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -101,11 +90,21 @@ import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
|||||||
import JTable from '../../../components/jero/JTable.vue'
|
import JTable from '../../../components/jero/JTable.vue'
|
||||||
import VehicleItemLibraryModal from './modules/VehicleItemLibraryModal.vue'
|
import VehicleItemLibraryModal from './modules/VehicleItemLibraryModal.vue'
|
||||||
import { ProjectSource } from '../../../enums/commonEnums'
|
import { ProjectSource } from '../../../enums/commonEnums'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VehicleItemLibrary',
|
name: 'VehicleItemLibrary',
|
||||||
components: { JTable, VehicleItemLibraryModal },
|
components: { JTable, VehicleItemLibraryModal },
|
||||||
mixins: [JeroListMixin],
|
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 () {
|
data () {
|
||||||
return {
|
return {
|
||||||
columns: [
|
columns: [
|
||||||
@@ -158,30 +157,23 @@ export default {
|
|||||||
clickEvent: 'handleDetail',
|
clickEvent: 'handleDetail',
|
||||||
has: 'vehicleItemLibrary:detail'
|
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'),
|
text: this.$t('edit'),
|
||||||
clickEvent: 'handleEdit',
|
clickEvent: 'handleEdit',
|
||||||
has: 'vehicleItemLibrary:edit',
|
has: 'vehicleItemLibrary:edit',
|
||||||
show: (record) => {
|
show: (record) => {
|
||||||
console.log(record)
|
return this.isAdmin || record.createBy === this.userInfo.username
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
{
|
{
|
||||||
text: this.$t('delete'),
|
text: this.$t('delete'),
|
||||||
clickEvent: 'handleDelete',
|
clickEvent: 'handleDelete',
|
||||||
has: 'vehicleItemLibrary:delete'
|
has: 'vehicleItemLibrary:delete',
|
||||||
|
show: (record) => {
|
||||||
|
return this.isAdmin || record.createBy === this.userInfo.username
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
needFilterTableBtn: true, // 是否需要过滤表格操作列没有权限的按钮
|
needFilterTableBtn: true, // 是否需要过滤表格操作列没有权限的按钮
|
||||||
@@ -194,15 +186,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handlePMSInfoSynchronization () {
|
|
||||||
|
|
||||||
},
|
|
||||||
handleDetail ({ id, projectName }) {
|
handleDetail ({ id, projectName }) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/projectLibrary/VehicleItemLibraryDetail',
|
path: '/projectLibrary/VehicleItemLibraryDetail',
|
||||||
query: {
|
query: { id, projectName }
|
||||||
id, projectName
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,11 +156,13 @@ import JTable from '../../../components/jero/JTable.vue'
|
|||||||
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
|
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
|
||||||
import { StandardSource, EvaluateProcessStatus } from '../../../enums/commonEnums'
|
import { StandardSource, EvaluateProcessStatus } from '../../../enums/commonEnums'
|
||||||
import VehicleProjectSelectionDrawer from '../../../components/selection/VehicleProjectSelectionDrawer'
|
import VehicleProjectSelectionDrawer from '../../../components/selection/VehicleProjectSelectionDrawer'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VehicleItemLibraryDetail',
|
name: 'VehicleItemLibraryDetail',
|
||||||
components: { JTable, InternalDetailPage, StandardSelectionModal, VehicleProjectSelectionDrawer },
|
components: { JTable, InternalDetailPage, StandardSelectionModal, VehicleProjectSelectionDrawer },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
StandardSource,
|
StandardSource,
|
||||||
@@ -303,7 +305,7 @@ export default {
|
|||||||
has: 'vehicleItemLibrary:detail:delete',
|
has: 'vehicleItemLibrary:detail:delete',
|
||||||
show: (record) => {
|
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: {
|
computed: {
|
||||||
pageTitle () {
|
pageTitle () {
|
||||||
return `《${this.$route.query.projectName}》${this.$t('details')}`
|
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 () {
|
created () {
|
||||||
|
|||||||
Reference in New Issue
Block a user