fix:将批量删除按钮放入顶部下拉菜单中

This commit is contained in:
zhangyu
2021-05-14 17:19:21 +08:00
parent e2636bee95
commit 97813ee1da
4 changed files with 21 additions and 5 deletions

View File

@@ -1,6 +1,11 @@
<template>
<div :class="['delete-button',(deleteObjs.length<1?'':'delete-button-light')]">
<button :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete"><span><i class="nz-icon nz-icon-delete" ></i></span></button>
<button v-if="this.type === 'button'" :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete">
<span><i class="nz-icon nz-icon-delete" ></i></span>
</button>
<div v-if="this.type === 'link'" :id="id" :class="{'nz-btn-disabled' : deleteObjs.length<1}" class="top-tool-btn top-tool-btn--delete" @click="batchDelete">
<span><i class="nz-icon nz-icon-delete" ></i>{{title}}</span>
</div>
</div>
</template>
@@ -12,7 +17,14 @@ export default {
deleteObjs: Array,
api: String,
clickFunction: Function,
id: String
id: String,
type: {
type: String,
default: 'button'
},
title: {
type: String
}
},
methods: {
batchDelete: function () {

View File

@@ -108,7 +108,8 @@ const cn = {
silence: '静默',
labels: '标签',
editType: '类型',
searchCondition: '搜索条件'
searchCondition: '搜索条件',
batchDel: '批量删除'
},
setup: {
step0: '欢迎',

View File

@@ -113,7 +113,8 @@ const en = {
copy: 'Copy',
silence: 'Silence',
editType: 'Type',
searchCondition: 'Search condition'
searchCondition: 'Search condition',
batchDel: 'Batches delete'
},
pageSize: '/page',
setup: {

View File

@@ -10,7 +10,6 @@
@search="search"
>
<template v-slot:top-tool-right>
<delete-button id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
<button id="asset-create-asset" v-has="'asset_add'" :title="$t('overall.createAsset')" class="top-tool-btn" @click.stop="add">
<i class="nz-icon nz-icon-create-square"></i>
</button>
@@ -35,6 +34,9 @@
<el-dropdown-item>
<div id="asset-filte" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" v-has="'asset_edit'" @click.stop="showClickSearch"><i class="nz-icon nz-icon-funnel"></i>{{$t('overall.searchCondition')}}</div>
</el-dropdown-item>
<el-dropdown-item>
<delete-button :type="'link'" :title="$t('overall.batchDel')" id="asset-list-batch-delete" v-has="'asset_delete'" :api="url" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true"></delete-button>
</el-dropdown-item>
</div>
</template>
</top-tool-more-options>