[update] 封装表格操作列,有特殊判断

This commit is contained in:
lideqin
2023-09-18 10:01:10 +08:00
parent 838bf6d651
commit 929fb3b737
8 changed files with 192 additions and 26 deletions
@@ -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 @@
</template>
<!-- 操作栏 -->
<div slot="action" slot-scope="{text, record}" class="action-span-cell">
<template v-if="record.delayFlag && isHasPermission(operationList[0].has)">
<a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>
<template v-if="operationList.length > operateMaxNum">
<a-divider type="vertical" />
<a-dropdown placement="bottomCenter">
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<div class="operate-btn">
{{ operation.text }}
</div>
</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
</template>
<template v-else-if="operationList.length > 0">
<template v-for="(operation, index) in operationList.slice(1)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
</template>
</template>
</div>
<!--<div slot="action" slot-scope="{text, record}" class="action-span-cell">-->
<!-- <template v-if="record.delayFlag && isHasPermission(operationList[0].has)">-->
<!-- <a @click="operationClick(operationList[0],record)">{{ operationList[0].text }}</a>-->
<!-- <template v-if="operationList.length > operateMaxNum">-->
<!-- <a-divider type="vertical" />-->
<!-- <a-dropdown placement="bottomCenter">-->
<!-- <a-icon type="more" class="operate-icon-btn operate-icon-more" />-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">-->
<!-- <a @click="operationClick(operation,record)">-->
<!-- <div class="operate-btn">-->
<!-- {{ operation.text }}-->
<!-- </div>-->
<!-- </a>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
<!-- </template>-->
<!-- </template>-->
<!-- <template v-else-if="operationList.length > 0">-->
<!-- <template v-for="(operation, index) in operationList.slice(1)">-->
<!-- <a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>-->
<!-- </template>-->
<!-- </template>-->
<!--</div>-->
</j-table>
</div>
@@ -288,6 +294,7 @@ export default {
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 200
}
],
@@ -176,7 +176,7 @@
</template>
<!-- 操作栏 -->
<div slot="action" slot-scope="{text, record}" class="action-span-cell">
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleDetail(record)" class="table-ope-btn" v-has="'enterpriseStandardLibrary:plan:detail'">{{ $t('view') }}</a>
<a @click="handleDelete(record.id)" class="table-ope-btn" v-if="record.allowDel" v-has="'enterpriseStandardLibrary:plan:delete'">{{ $t('delete') }}</a>
</div>
@@ -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
}
],
@@ -169,6 +169,7 @@ export default {
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 170
}
],