|
|
@@ -14,18 +14,18 @@
|
|
|
|
|
|
<template #toolbarTop>
|
|
|
<a-space>
|
|
|
- <a-button type="primary" size="small">新增</a-button>
|
|
|
- <a-button danger size="small">删除</a-button>
|
|
|
+ <a-button type="primary" size="middle">新增</a-button>
|
|
|
+ <a-button danger size="middle">删除</a-button>
|
|
|
</a-space>
|
|
|
</template>
|
|
|
|
|
|
<template #toolbarLeft>
|
|
|
<a-space>
|
|
|
- <a-button type="primary" size="small" @click="openModal"> 表格选择器弹窗 </a-button>
|
|
|
+ <a-button type="primary" size="middle" @click="openModal"> 表格选择器弹窗 </a-button>
|
|
|
|
|
|
- <a-button type="primary" size="small" @click="openModalBase"> 弹窗 </a-button>
|
|
|
+ <a-button type="primary" size="middle" @click="openModalBase"> 弹窗 </a-button>
|
|
|
|
|
|
- <a-button type="primary" size="small" @click="handleRefreshTable"> 刷新表格事件 </a-button>
|
|
|
+ <a-button type="primary" size="middle" @click="handleRefreshTable"> 刷新表格事件 </a-button>
|
|
|
<span>累计客户:XXX|黑名单客户:XXX|S级客户 </span>
|
|
|
</a-space>
|
|
|
</template>
|
|
|
@@ -47,10 +47,12 @@
|
|
|
|
|
|
<script setup lang="jsx">
|
|
|
import BsTable, { useBsTable } from '/@/components/BsUi/Table/index.js';
|
|
|
- import { onMounted, ref } from 'vue';
|
|
|
+ import {h, onMounted, ref} from 'vue';
|
|
|
import AddOrEditDrawer from '/@/views/table-demo/components/AddOrEditDrawer.vue';
|
|
|
import DemoTableSelectorModal from '/@/views/table-demo/components/DemoTableSelectorModal.vue';
|
|
|
import DemoBaseModal from '/@/views/table-demo/components/DemoBaseModal.vue';
|
|
|
+ import { message } from 'ant-design-vue';
|
|
|
+ import {SearchOutlined} from "@ant-design/icons-vue";
|
|
|
|
|
|
const addOrEditDrawerRef = ref(null);
|
|
|
const demoTableSelectorModal = ref(null);
|
|
|
@@ -85,6 +87,45 @@
|
|
|
} = useBsTable({
|
|
|
tableOptions: {
|
|
|
url: '/api/get-table',
|
|
|
+ toolbarTopConfig: {
|
|
|
+ enable: true,
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ code: 'btn1',
|
|
|
+ title: '新增',
|
|
|
+ props: {
|
|
|
+ type: 'primary',
|
|
|
+ disabled: false,
|
|
|
+ icon: h(SearchOutlined),
|
|
|
+ onClick(event) {
|
|
|
+ message.success('ok');
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'btn2',
|
|
|
+ title: '禁用新增',
|
|
|
+ props: {
|
|
|
+ type: 'primary',
|
|
|
+ danger: true,
|
|
|
+ onClick(event) {
|
|
|
+ setValue("toolbarTopConfig.buttons.0.props.disabled", true)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'btn3',
|
|
|
+ title: '解禁新增',
|
|
|
+ props: {
|
|
|
+ type: 'text',
|
|
|
+ danger: true,
|
|
|
+ onClick(event) {
|
|
|
+ setValue("toolbarTopConfig.buttons.0.props.disabled", false)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
gridOptions: {
|
|
|
loading: false,
|
|
|
columns: [
|