diff --git a/src/views/system/bindingParts/BindingParts.vue b/src/views/system/bindingParts/BindingParts.vue index 12e9e180..4f3d240a 100644 --- a/src/views/system/bindingParts/BindingParts.vue +++ b/src/views/system/bindingParts/BindingParts.vue @@ -61,7 +61,7 @@ -
+
{{ $t('newlyAdded') }} @@ -124,6 +124,8 @@ import BingingPartsModal from './modules/BingingPartsModal' import ClauseModal from './modules/ClauseModal' import { isHasPermission } from '../../../utils/hasPermission' import { isTreeNodeHaveBind, useBindingRelationship } from '../../../api/api' +import { mapActions } from 'vuex' +import { triggerWindowResizeEvent } from '@/utils/util' export default { name: 'BindingParts', @@ -197,7 +199,32 @@ export default { disableMixinCreated: true, isCanAdd: false, // 是否可以新增 isCanUseBind: false, // 是否有使用绑定关系按钮 - isHaveBindResult: {} // 是否有绑定结果 + isHaveBindResult: {}, // 是否有绑定结果 + type: '2' // 操作类型 1是操作 2是查看 + } + }, + watch: { + type: { + immediate: true, + handler (val) { + if (val && val + '' === '2') { + // 是查看,隐藏操作栏 + this.columns = this.columns.filter(item => item.title !== this.$t('operation')) + } else { + // 是操作,显示操作栏 + if (!this.columns.find(item => item.title === this.$t('operation'))) { + this.columns.push( + { // 操作 + title: this.$t('operation'), + scopedSlots: { customRender: 'action' }, + align: 'center', + fixed: 'right', + width: 170 + } + ) + } + } + } } }, created () { @@ -213,9 +240,15 @@ export default { this.queryParam.partNo = partNo } this.loadData() + // 收起侧边栏 + this.setSidebar(false) + triggerWindowResizeEvent() + // 设置操作类型 + this.type = this.$route.query.type || '2' }, methods: { isHasPermission, + ...mapActions(['setSidebar']), /** * 判断分类树下有没有绑定关系,传入零部件分类内部码 * @param partCategoryNum 分类内部码