@morya-ui/mcp 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,168 +1,168 @@
1
- <script setup lang="ts">
2
- /**
3
- * 黄金样例:列表页 · dense(高密度工具台)
4
- * structure: list · style: dense
5
- * 镜像区块顺序;气质跟 styleDirection / 参考走,不要把本文件当唯一审美。
6
- * @see list-page.vue · style-presets.md · page-layouts.md
7
- */
8
- import {
9
- MBreadcrumb,
10
- MButton,
11
- MConfigProvider,
12
- MEmpty,
13
- MInput,
14
- MLayout,
15
- MLayoutContent,
16
- MLayoutHeader,
17
- MLayoutSider,
18
- MMenu,
19
- MPageContent,
20
- MPageFilters,
21
- MPageHeader,
22
- MSelect,
23
- MSpace,
24
- MStatus,
25
- MTable,
26
- zhCN,
27
- } from 'morya-ui'
28
- import { ref } from 'vue'
29
-
30
- const keyword = ref('')
31
- const status = ref<string | undefined>()
32
- const siderCollapsed = ref(false)
33
-
34
- const menuModel = [
35
- { key: 'users', label: '用户管理', icon: 'user', to: '/users' },
36
- { key: 'roles', label: '角色管理', icon: 'shield', to: '/roles' },
37
- { key: 'settings', label: '系统设置', icon: 'settings', to: '/settings' },
38
- ]
39
-
40
- const statusOptions = [
41
- { label: '全部', value: '' },
42
- { label: '启用', value: 'active' },
43
- { label: '停用', value: 'inactive' },
44
- ]
45
-
46
- function resetFilters() {
47
- keyword.value = ''
48
- status.value = undefined
49
- }
50
-
51
- const columns = [
52
- { key: 'name', label: '名称' },
53
- { key: 'status', label: '状态', width: 96 },
54
- { key: 'updatedAt', label: '更新', width: 110 },
55
- { key: 'actions', label: '操作', width: 120 },
56
- ]
57
-
58
- const rows = [
59
- { id: '1', name: '示例项目 A', status: 'active', updatedAt: '09-01' },
60
- { id: '2', name: '示例项目 B', status: 'inactive', updatedAt: '08-28' },
61
- { id: '3', name: '示例项目 C', status: 'active', updatedAt: '08-25' },
62
- { id: '4', name: '示例项目 D', status: 'active', updatedAt: '08-20' },
63
- { id: '5', name: '示例项目 E', status: 'inactive', updatedAt: '08-15' },
64
- { id: '6', name: '示例项目 F', status: 'active', updatedAt: '08-12' },
65
- { id: '7', name: '示例项目 G', status: 'inactive', updatedAt: '08-10' },
66
- { id: '8', name: '示例项目 H', status: 'active', updatedAt: '08-08' },
67
- ]
68
- </script>
69
-
70
- <template>
71
- <MConfigProvider :locale="zhCN">
72
- <MLayout has-sider fill-viewport>
73
- <MLayoutSider v-model:collapsed="siderCollapsed" bordered :collapsed-width="64">
74
- <MMenu
75
- :model="menuModel"
76
- :collapsed="siderCollapsed"
77
- :collapsed-width="64"
78
- selected-key="users"
79
- />
80
- </MLayoutSider>
81
-
82
- <MLayout>
83
- <MLayoutHeader padding="var(--m-space-3) var(--m-space-4)">
84
- <MBreadcrumb :model="[{ label: '首页', to: '/' }, { label: '用户管理' }]" />
85
- </MLayoutHeader>
86
-
87
- <MLayoutContent>
88
- <MPageContent fill density="compact">
89
- <MPageHeader title="用户管理">
90
- <template #actions>
91
- <MButton size="small" type="primary">
92
- 新建
93
- </MButton>
94
- </template>
95
- </MPageHeader>
96
-
97
- <MPageFilters aria-label="筛选" variant="plain">
98
- <MSpace wrap>
99
- <MInput
100
- v-model="keyword"
101
- placeholder="搜索"
102
- clearable
103
- size="small"
104
- style="width: 11rem"
105
- />
106
- <MSelect
107
- v-model="status"
108
- :options="statusOptions"
109
- placeholder="状态"
110
- clearable
111
- size="small"
112
- style="width: 8rem"
113
- />
114
- </MSpace>
115
- <template #actions>
116
- <MButton size="small">
117
- 查询
118
- </MButton>
119
- <MButton size="small" @click="resetFilters" type="text">
120
- 重置
121
- </MButton>
122
- </template>
123
- </MPageFilters>
124
-
125
- <MTable
126
- :columns="columns"
127
- :rows="rows"
128
- :rows-per-page="10"
129
- fill
130
- paginator
131
- size="small"
132
- striped
133
- bordered
134
- row-key="id"
135
- aria-label="用户列表"
136
- >
137
- <template #cell-status="{ value }">
138
- <MStatus
139
- :label="value === 'active' ? '启用' : '停用'"
140
- :type="value === 'active' ? 'success' : 'secondary'"
141
- />
142
- </template>
143
- <template #cell-actions>
144
- <MSpace>
145
- <MButton size="small" type="text">
146
- 编辑
147
- </MButton>
148
- <MButton size="small" type="text" danger>
149
- 删除
150
- </MButton>
151
- </MSpace>
152
- </template>
153
- <template #empty>
154
- <MEmpty title="暂无数据" description="创建后在此浏览。" icon="user">
155
- <template #extra>
156
- <MButton size="small" type="primary">
157
- 新建
158
- </MButton>
159
- </template>
160
- </MEmpty>
161
- </template>
162
- </MTable>
163
- </MPageContent>
164
- </MLayoutContent>
165
- </MLayout>
166
- </MLayout>
167
- </MConfigProvider>
168
- </template>
1
+ <script setup lang="ts">
2
+ /**
3
+ * 黄金样例:列表页 · dense(高密度工具台)
4
+ * structure: list · style: dense
5
+ * 镜像区块顺序;气质跟 styleDirection / 参考走,不要把本文件当唯一审美。
6
+ * @see list-page.vue · style-presets.md · page-layouts.md
7
+ */
8
+ import {
9
+ MBreadcrumb,
10
+ MButton,
11
+ MConfigProvider,
12
+ MEmpty,
13
+ MInput,
14
+ MLayout,
15
+ MLayoutContent,
16
+ MLayoutHeader,
17
+ MLayoutSider,
18
+ MMenu,
19
+ MPageContent,
20
+ MPageFilters,
21
+ MPageHeader,
22
+ MSelect,
23
+ MSpace,
24
+ MStatus,
25
+ MTable,
26
+ zhCN,
27
+ } from 'morya-ui'
28
+ import { ref } from 'vue'
29
+
30
+ const keyword = ref('')
31
+ const status = ref<string | undefined>()
32
+ const siderCollapsed = ref(false)
33
+
34
+ const menuModel = [
35
+ { key: 'users', label: '用户管理', icon: 'user', to: '/users' },
36
+ { key: 'roles', label: '角色管理', icon: 'shield', to: '/roles' },
37
+ { key: 'settings', label: '系统设置', icon: 'settings', to: '/settings' },
38
+ ]
39
+
40
+ const statusOptions = [
41
+ { label: '全部', value: '' },
42
+ { label: '启用', value: 'active' },
43
+ { label: '停用', value: 'inactive' },
44
+ ]
45
+
46
+ function resetFilters() {
47
+ keyword.value = ''
48
+ status.value = undefined
49
+ }
50
+
51
+ const columns = [
52
+ { key: 'name', label: '名称' },
53
+ { key: 'status', label: '状态', width: 96 },
54
+ { key: 'updatedAt', label: '更新', width: 110 },
55
+ { key: 'actions', label: '操作', width: 120 },
56
+ ]
57
+
58
+ const rows = [
59
+ { id: '1', name: '示例项目 A', status: 'active', updatedAt: '09-01' },
60
+ { id: '2', name: '示例项目 B', status: 'inactive', updatedAt: '08-28' },
61
+ { id: '3', name: '示例项目 C', status: 'active', updatedAt: '08-25' },
62
+ { id: '4', name: '示例项目 D', status: 'active', updatedAt: '08-20' },
63
+ { id: '5', name: '示例项目 E', status: 'inactive', updatedAt: '08-15' },
64
+ { id: '6', name: '示例项目 F', status: 'active', updatedAt: '08-12' },
65
+ { id: '7', name: '示例项目 G', status: 'inactive', updatedAt: '08-10' },
66
+ { id: '8', name: '示例项目 H', status: 'active', updatedAt: '08-08' },
67
+ ]
68
+ </script>
69
+
70
+ <template>
71
+ <MConfigProvider :locale="zhCN">
72
+ <MLayout has-sider fill-viewport>
73
+ <MLayoutSider v-model:collapsed="siderCollapsed" bordered :collapsed-width="64">
74
+ <MMenu
75
+ :model="menuModel"
76
+ :collapsed="siderCollapsed"
77
+ :collapsed-width="64"
78
+ selected-key="users"
79
+ />
80
+ </MLayoutSider>
81
+
82
+ <MLayout>
83
+ <MLayoutHeader padding="var(--m-space-3) var(--m-space-4)">
84
+ <MBreadcrumb :model="[{ label: '首页', to: '/' }, { label: '用户管理' }]" />
85
+ </MLayoutHeader>
86
+
87
+ <MLayoutContent>
88
+ <MPageContent fill density="compact">
89
+ <MPageHeader title="用户管理">
90
+ <template #actions>
91
+ <MButton size="small" type="primary">
92
+ 新建
93
+ </MButton>
94
+ </template>
95
+ </MPageHeader>
96
+
97
+ <MPageFilters aria-label="筛选" variant="plain">
98
+ <MSpace wrap>
99
+ <MInput
100
+ v-model="keyword"
101
+ placeholder="搜索"
102
+ clearable
103
+ size="small"
104
+ style="width: 11rem"
105
+ />
106
+ <MSelect
107
+ v-model="status"
108
+ :options="statusOptions"
109
+ placeholder="状态"
110
+ clearable
111
+ size="small"
112
+ style="width: 8rem"
113
+ />
114
+ </MSpace>
115
+ <template #actions>
116
+ <MButton size="small">
117
+ 查询
118
+ </MButton>
119
+ <MButton size="small" @click="resetFilters" type="text">
120
+ 重置
121
+ </MButton>
122
+ </template>
123
+ </MPageFilters>
124
+
125
+ <MTable
126
+ :columns="columns"
127
+ :rows="rows"
128
+ :rows-per-page="10"
129
+ fill
130
+ paginator
131
+ size="small"
132
+ striped
133
+ bordered
134
+ row-key="id"
135
+ aria-label="用户列表"
136
+ >
137
+ <template #cell-status="{ value }">
138
+ <MStatus
139
+ :label="value === 'active' ? '启用' : '停用'"
140
+ :type="value === 'active' ? 'success' : 'secondary'"
141
+ />
142
+ </template>
143
+ <template #cell-actions>
144
+ <MSpace>
145
+ <MButton size="small" type="text">
146
+ 编辑
147
+ </MButton>
148
+ <MButton size="small" type="text" danger>
149
+ 删除
150
+ </MButton>
151
+ </MSpace>
152
+ </template>
153
+ <template #empty>
154
+ <MEmpty title="暂无数据" description="创建后在此浏览。" icon="user">
155
+ <template #extra>
156
+ <MButton size="small" type="primary">
157
+ 新建
158
+ </MButton>
159
+ </template>
160
+ </MEmpty>
161
+ </template>
162
+ </MTable>
163
+ </MPageContent>
164
+ </MLayoutContent>
165
+ </MLayout>
166
+ </MLayout>
167
+ </MConfigProvider>
168
+ </template>