From 929fb3b7371f4363852f1ab0a51ff5e751b84583 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 18 Sep 2023 10:01:10 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B0=81=E8=A3=85=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=88=97=EF=BC=8C=E6=9C=89=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/jero/JTable.vue | 141 ++++++++++++++++++ .../check/CheckList.vue | 57 +++---- .../plan/PlanList.vue | 15 +- .../reviewMeeting/ReviewMeetingList.vue | 1 + .../myCollection/MyCollection.vue | 1 + .../EnterpriseLevelMapList.vue | 1 + .../FriendshipLinkList.vue | 1 + .../internalWorkGroup/WorkingGroupList.vue | 1 + 8 files changed, 192 insertions(+), 26 deletions(-) diff --git a/src/components/jero/JTable.vue b/src/components/jero/JTable.vue index 05b490a8..d39ebdc4 100644 --- a/src/components/jero/JTable.vue +++ b/src/components/jero/JTable.vue @@ -23,6 +23,69 @@ + + +
{ + return [] + } + }, + // 操作列显示更多前的最大个数 + operateMaxNum: { + type: Number, + required: false, + default: 1 + }, + // 操作列对于哪个字段有特殊判断 + operSpecialJudgeField: { + type: String, + required: false, + default: '' + }, + // 操作列需要特殊判断的字段是哪些值时,过滤不符合条件按钮 + operSpecialJudgeValue: { + type: [Array, String, Boolean], + required: false, + default: true + }, + // 操作列特殊判断时需要删掉的按钮 + operSpecialJudgeDelBtn: { + type: [String, Array], + required: false, + default: '' } }, data () { @@ -193,6 +289,51 @@ export default { } }, methods: { + isHasPermission, + // 操作列特殊判断,返回经过特殊判断后的操作列数据 + operSpecialJudge (record) { + let operationList = [] + if (typeof this.operSpecialJudgeValue === 'boolean' || typeof this.operSpecialJudgeValue === 'string') { + // 只需要判断某个字段是否符合某一个值 + if (record[this.operSpecialJudgeField] === this.operSpecialJudgeValue) { + // 符合特殊条件,需要过滤操作按钮 + if (this.operSpecialJudgeDelBtn && typeof this.operSpecialJudgeDelBtn === 'string') { + // 是字符串类型,只需要过滤掉一个操作按钮 + operationList = this.operationList.filter(item => item.text !== this.operSpecialJudgeDelBtn) + } else if (this.operSpecialJudgeDelBtn && typeof this.operSpecialJudgeDelBtn === 'object') { + // 是数组类型需要过滤掉多个操作按钮 + operationList = this.operationList.filter(item => !this.operSpecialJudgeDelBtn.includes(item.text)) + } else { + operationList = this.operationList + } + } else { + // 不符合条件,不需要过滤 + operationList = this.operationList + } + } else if (typeof this.operSpecialJudgeValue === 'object') { + // 需要判断某个字段是否符合某些值 + if (this.operSpecialJudgeValue.includes(record[this.operSpecialJudgeField])) { + // 符合特殊条件,需要过滤操作按钮 + if (this.operSpecialJudgeDelBtn && typeof this.operSpecialJudgeDelBtn === 'string') { + // 是字符串类型,只需要过滤掉一个操作按钮 + operationList = this.operationList.filter(item => item.text !== this.operSpecialJudgeDelBtn) + } else if (this.operSpecialJudgeDelBtn && typeof this.operSpecialJudgeDelBtn === 'object') { + // 师叔祖类型需要过滤掉多个操作按钮 + operationList = this.operationList.filter(item => !this.operSpecialJudgeDelBtn.includes(item.text)) + } else { + operationList = this.operationList + } + } else { + // 不符合条件,不需要过滤 + operationList = this.operationList + } + } + return operationList + }, + // 操作栏按钮点击 + operationClick (operation, record) { + this.$emit('operationClick', operation, record) + }, // 将父组件的columns进行处理:增加设置列按钮 setResultColumns (columns) { // 深度克隆,防止直接修改父组件数据 diff --git a/src/views/enterpriseStandardLibrary/check/CheckList.vue b/src/views/enterpriseStandardLibrary/check/CheckList.vue index 6e709534..5065f1ca 100644 --- a/src/views/enterpriseStandardLibrary/check/CheckList.vue +++ b/src/views/enterpriseStandardLibrary/check/CheckList.vue @@ -105,6 +105,12 @@ :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + operSpecialJudgeField="delayFlag" + :operSpecialJudgeValue="false" + :operSpecialJudgeDelBtn="$t('enterpriseStandardLibrary.check.deferredCheck')" + :operationList="operationList" + :operateMaxNum="operateMaxNum" + @operationClick="operationClick" @change="handleTableChange"> @@ -125,31 +131,31 @@ -
- - -
+ + + + + + + + + + + + + + + + + + + + + + + + +
@@ -288,6 +294,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 200 } ], diff --git a/src/views/enterpriseStandardLibrary/plan/PlanList.vue b/src/views/enterpriseStandardLibrary/plan/PlanList.vue index 2de40065..793d812e 100644 --- a/src/views/enterpriseStandardLibrary/plan/PlanList.vue +++ b/src/views/enterpriseStandardLibrary/plan/PlanList.vue @@ -176,7 +176,7 @@ -
+
{{ $t('view') }} {{ $t('delete') }}
@@ -198,6 +198,18 @@ export default { mixins: [JeroListMixin], data () { return { + operationList: [ + { + text: this.$t('view'), + clickEvent: 'handleDetail', + has: 'enterpriseStandardLibrary:plan:detail' + }, + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'enterpriseStandardLibrary:plan:delete' + } + ], categoryTreeList: [], // 组织机构下拉框数据 labelCol: { span: 4 @@ -378,6 +390,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 200 } ], diff --git a/src/views/enterpriseStandardLibrary/reviewMeeting/ReviewMeetingList.vue b/src/views/enterpriseStandardLibrary/reviewMeeting/ReviewMeetingList.vue index 5eda6ff9..8f757c34 100644 --- a/src/views/enterpriseStandardLibrary/reviewMeeting/ReviewMeetingList.vue +++ b/src/views/enterpriseStandardLibrary/reviewMeeting/ReviewMeetingList.vue @@ -169,6 +169,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 170 } ], diff --git a/src/views/personalCenter/myCollection/MyCollection.vue b/src/views/personalCenter/myCollection/MyCollection.vue index 301f10a6..8a2bac7f 100644 --- a/src/views/personalCenter/myCollection/MyCollection.vue +++ b/src/views/personalCenter/myCollection/MyCollection.vue @@ -122,6 +122,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 200 } ], diff --git a/src/views/system/enterpriseLevelMapManage/EnterpriseLevelMapList.vue b/src/views/system/enterpriseLevelMapManage/EnterpriseLevelMapList.vue index f98f4b11..bf72b4d1 100644 --- a/src/views/system/enterpriseLevelMapManage/EnterpriseLevelMapList.vue +++ b/src/views/system/enterpriseLevelMapManage/EnterpriseLevelMapList.vue @@ -69,6 +69,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 100 } ], diff --git a/src/views/system/firendshipLinkManage/FriendshipLinkList.vue b/src/views/system/firendshipLinkManage/FriendshipLinkList.vue index 1ff3a48b..51f6426f 100644 --- a/src/views/system/firendshipLinkManage/FriendshipLinkList.vue +++ b/src/views/system/firendshipLinkManage/FriendshipLinkList.vue @@ -126,6 +126,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 170 } ], diff --git a/src/views/system/internalWorkGroup/WorkingGroupList.vue b/src/views/system/internalWorkGroup/WorkingGroupList.vue index fb197dd8..6970703b 100644 --- a/src/views/system/internalWorkGroup/WorkingGroupList.vue +++ b/src/views/system/internalWorkGroup/WorkingGroupList.vue @@ -227,6 +227,7 @@ export default { title: this.$t('operation'), scopedSlots: { customRender: 'action' }, align: 'center', + fixed: 'right', width: 170 } ],