fix 80286
This commit is contained in:
@@ -86,6 +86,7 @@ export const ConfigurableTableMixin = {
|
||||
// 过滤没有权限的按钮
|
||||
if (this.needFilterTableBtn) {
|
||||
this.operationList = this.operationList.filter(item => !item.has || isHasPermission(item.has))
|
||||
console.log(this.operationList)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -164,8 +165,11 @@ export const ConfigurableTableMixin = {
|
||||
})
|
||||
if (this.showAction && this.operateColumn) {
|
||||
let width = 0
|
||||
if (this.operationList && this.operationList.length > 0) {
|
||||
if (this.operationList && this.operationList.length > this.operateMaxNum + 1) {
|
||||
width += this.getTextWith(this.operationList[0].text) + this.getTextWith(this.$t('more'))
|
||||
} else if (this.operationList && this.operationList.length > 1) {
|
||||
width += this.getTextWith(this.operationList[0].text) + this.getTextWith(this.operationList[1].text)
|
||||
console.log(width)
|
||||
}
|
||||
const operateColumn = JSON.parse(JSON.stringify(this.operateColumn))
|
||||
operateColumn.width = width || 100
|
||||
@@ -184,7 +188,7 @@ export const ConfigurableTableMixin = {
|
||||
const context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
const dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
return dimension.width + 60
|
||||
},
|
||||
getQueryParams () {
|
||||
const param = Object.assign({}, this.searchParams, this.isorter, this.filters)
|
||||
|
||||
@@ -158,30 +158,66 @@
|
||||
</template>
|
||||
|
||||
<template v-slot:operation="{text, record}">
|
||||
<!-- 收藏-->
|
||||
<a @click="operationClick(operationList[0],record)" v-has="operationList[0].has">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<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)" v-has="operation.has">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<template v-if="operationList.length > operateMaxNum + 1">
|
||||
<!-- 收藏-->
|
||||
<a @click="operationClick(operationList[0],record)"
|
||||
v-if="operationList[0].text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<a v-else @click="operationClick(operationList[0],record)">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operationList[0].text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operationList[0].text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operationList[0].text === $t('delete')" />
|
||||
{{ operationList[0].text }}
|
||||
</div>
|
||||
</a>
|
||||
<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">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template v-else-if="operationList.length > 0">
|
||||
<template v-for="(operation, index) in operationList">
|
||||
<!-- 收藏-->
|
||||
<a :key="index" @click="operationClick(operationList[0],record)"
|
||||
v-if="operation.text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<a v-else @click="operationClick(operation,record)" style="display: inline-block">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
<a-divider type="vertical" v-if="index !== operationList.length - 1" />
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</j-table>
|
||||
</div>
|
||||
@@ -287,7 +323,8 @@ export default {
|
||||
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
|
||||
treeLoading: false,
|
||||
isCollection: false,
|
||||
expandedKeys: [] // 展开的节点
|
||||
expandedKeys: [], // 展开的节点
|
||||
needFilterTableBtn: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -159,30 +159,66 @@
|
||||
</template>
|
||||
|
||||
<template v-slot:operation="{text, record}">
|
||||
<!-- 收藏-->
|
||||
<a @click="operationClick(operationList[0],record)" v-has="operationList[0].has">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<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)" v-has="operation.has">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<template v-if="operationList.length > operateMaxNum + 1">
|
||||
<!-- 收藏-->
|
||||
<a @click="operationClick(operationList[0],record)"
|
||||
v-if="operationList[0].text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<a v-else @click="operationClick(operationList[0],record)">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operationList[0].text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operationList[0].text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operationList[0].text === $t('delete')" />
|
||||
{{ operationList[0].text }}
|
||||
</div>
|
||||
</a>
|
||||
<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">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<template v-else-if="operationList.length > 0">
|
||||
<template v-for="(operation, index) in operationList">
|
||||
<!-- 收藏-->
|
||||
<a :key="index" @click="operationClick(operationList[0],record)"
|
||||
v-if="operation.text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<a v-else @click="operationClick(operation,record)" style="display: inline-block">
|
||||
<div class="operate-btn">
|
||||
<!-- 编辑图标-->
|
||||
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
|
||||
<!-- 分享图标-->
|
||||
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
|
||||
<!-- 删除图标-->
|
||||
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
|
||||
{{ operation.text }}
|
||||
</div>
|
||||
</a>
|
||||
<a-divider type="vertical" v-if="index !== operationList.length - 1" />
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</j-table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user