Browse Source

👣 提供原生模板

master
wangxiang 3 years ago
parent
commit
c38510dc5d
  1. 31
      kicc-ui/src/views/system/config/index.vue
  2. 3
      kicc-ui/src/views/system/role/index.vue
  3. 3
      kicc-ui/src/views/system/user/index.vue

31
kicc-ui/src/views/system/config/index.vue

@ -46,6 +46,7 @@
</AFormItem> </AFormItem>
</AForm> </AForm>
<ATable ref="tableElRef" <ATable ref="tableElRef"
rowKey="id"
:loading="state.loading" :loading="state.loading"
:size="state.selectedKeys[0]" :size="state.selectedKeys[0]"
:dataSource="state.dataSource" :dataSource="state.dataSource"
@ -56,6 +57,10 @@
y: state.tableHeight, y: state.tableHeight,
scrollToFirstRowOnChange: true scrollToFirstRowOnChange: true
}" }"
:rowSelection="{
type: 'checkbox',
onChange: handleSelectionChange
}"
:pagination="{ :pagination="{
current: 1, current: 1,
pageSize: 10, pageSize: 10,
@ -71,9 +76,20 @@
<div class="flex items-center"> <div class="flex items-center">
<BasicTitle>{{ '参数配置列表' }}</BasicTitle> <BasicTitle>{{ '参数配置列表' }}</BasicTitle>
<div :class="`${headerPrefixCls}__toolbar`"> <div :class="`${headerPrefixCls}__toolbar`">
<a-button type="primary">新增</a-button> <a-button v-auth="['config_add']"
<a-button type="primary">编辑</a-button> type="primary"
<a-button type="primary">删除</a-button> @click="handleAdd()"
>新增参数</a-button>
<a-button v-auth="['config_edit']"
type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改参数</a-button>
<a-button v-auth="['config_del']"
type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除参数</a-button>
<ADivider type="vertical"/> <ADivider type="vertical"/>
<div class="table-settings"> <div class="table-settings">
<!--重做--> <!--重做-->
@ -274,11 +290,10 @@
} }
/** 处理多选框选中数据 */ /** 处理多选框选中数据 */
function handleSelectionChange(selection?: Recordable) { function handleSelectionChange(selectedRowKeys: string[]) {
const rawRows = toRaw(selection?.rows) || []; state.ids = selectedRowKeys;
state.ids = rawRows.map(item => item.id); state.single = selectedRowKeys.length != 1;
state.single = rawRows.length != 1; state.multiple = !selectedRowKeys.length;
state.multiple = !rawRows.length;
} }
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ /** 新增按钮操作,行内新增与工具栏局域新增通用 */

3
kicc-ui/src/views/system/role/index.vue

@ -97,7 +97,8 @@
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
fixed: false fixed: false
} },
handleSearchInfoFn: () => clearSelectedRowKeys()
}); });
/** 处理多选框选中数据 */ /** 处理多选框选中数据 */

3
kicc-ui/src/views/system/user/index.vue

@ -132,7 +132,8 @@
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
fixed: false fixed: false
} },
handleSearchInfoFn: () => clearSelectedRowKeys()
}); });
/** 处理多选框选中数据 */ /** 处理多选框选中数据 */

Loading…
Cancel
Save