102 lines
1.9 KiB
Plaintext
102 lines
1.9 KiB
Plaintext
<template>
|
|
<BreadPage>
|
|
<ani-table> </ani-table>
|
|
</BreadPage>
|
|
</template>
|
|
|
|
<script setup lang="tsx">
|
|
import { api } from "@/api";
|
|
import { createColumn, updateColumn, useAniTable } from "@/components";
|
|
|
|
const [aniTable, aniCtx] = useAniTable({
|
|
data: async (model, paging) => {
|
|
return api.<%= tag %>.<%= operationId %>({ ...model, ...paging });
|
|
},
|
|
columns: [
|
|
{
|
|
title: "用户描述",
|
|
dataIndex: "description",
|
|
},
|
|
createColumn,
|
|
updateColumn,
|
|
{
|
|
title: "操作",
|
|
type: "button",
|
|
width: 180,
|
|
buttons: [
|
|
{
|
|
type: "modify",
|
|
text: "修改",
|
|
},
|
|
{
|
|
type: "delete",
|
|
text: "删除",
|
|
onClick: async ({ record }) => {
|
|
return api.<%= tag %>.<%= operationId %>(record.id);
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
search: {
|
|
items: [
|
|
{
|
|
extend: "nickname",
|
|
required: false,
|
|
type: 'search',
|
|
enableLoad: true,
|
|
itemProps: {
|
|
hideLabel: true,
|
|
},
|
|
nodeProps: {
|
|
placeholder: "用户昵称",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
create: {
|
|
title: "新建用户",
|
|
modalProps: {
|
|
width: 732,
|
|
maskClosable: false,
|
|
},
|
|
formProps: {
|
|
layout: "vertical",
|
|
class: "!grid grid-cols-2 gap-x-6",
|
|
},
|
|
items: [
|
|
{
|
|
field: "username",
|
|
label: "登录账号",
|
|
type: "input",
|
|
required: true,
|
|
},
|
|
],
|
|
submit: ({ model }) => {
|
|
return api.<%= tag %>.<%= operationId %>(model);
|
|
},
|
|
},
|
|
modify: {
|
|
extend: true,
|
|
title: "修改用户",
|
|
submit: ({ model }) => {
|
|
return api.<%= tag %>.<%= operationId %>(model.id, model);
|
|
},
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style scoped></style>
|
|
|
|
<%_ if(false) { _%>
|
|
<route lang="json">
|
|
{
|
|
"meta": {
|
|
"sort": 10301,
|
|
"title": "用户管理",
|
|
"icon": "icon-park-outline-user"
|
|
}
|
|
}
|
|
</route>
|
|
<%_ } _%>
|