@morya-ui/mcp 0.4.2 → 0.4.4

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,6 +1,6 @@
1
1
  {
2
- "generatedAt": "2026-10-09T09:32:19.868Z",
3
- "catalogGeneratedAt": "2026-10-09T09:31:59.453Z",
2
+ "generatedAt": "2026-10-10T16:01:08.098Z",
3
+ "catalogGeneratedAt": "2026-10-10T16:01:00.709Z",
4
4
  "components": [
5
5
  {
6
6
  "id": "Accordion",
@@ -1,161 +1,161 @@
1
- <script setup lang="ts">
2
- /**
3
- * 黄金样例:仪表盘页
4
- * @see DESIGN.md · morya-ui-pages references/page-layouts.md · visual-craft § Ops polish
5
- */
6
- import {
7
- MAlert,
8
- MBreadcrumb,
9
- MCard,
10
- MConfigProvider,
11
- MGrid,
12
- MGridItem,
13
- MLayout,
14
- MLayoutContent,
15
- MLayoutHeader,
16
- MPageContent,
17
- MEmpty,
18
- MPageHeader,
19
- MPageStat,
20
- MStatistic,
21
- MStatus,
22
- MTable,
23
- MTag,
24
- zhCN,
25
- } from 'morya-ui'
26
-
27
- const stats = [
28
- { label: '总用户', value: '12,480', trend: '+8.2%', trendDirection: 'up' as const, trendLabel: '较上月', icon: 'users' },
29
- { label: '今日活跃', value: '1,926', trend: '+3.1%', trendDirection: 'up' as const, trendLabel: '较昨日', icon: 'activity' },
30
- { label: '待处理工单', value: '47', trend: '-12%', trendDirection: 'down' as const, trendLabel: '较上周', trendSeverity: 'warn' as const, icon: 'clipboard' },
31
- { label: '系统健康', value: '99.9%', trend: '稳定', trendSeverity: 'secondary' as const, icon: 'heart' },
32
- ]
33
-
34
- const recentColumns = [
35
- { key: 'id', label: '工单号', width: 96 },
36
- { key: 'title', label: '标题' },
37
- { key: 'priority', label: '优先级', width: 96 },
38
- { key: 'status', label: '状态', width: 110 },
39
- ]
40
-
41
- const recentRows = [
42
- { id: 'WO-1024', title: '登录异常反馈', priority: 'high', status: 'open' },
43
- { id: 'WO-1023', title: '导出任务超时', priority: 'medium', status: 'progress' },
44
- { id: 'WO-1022', title: '权限配置咨询', priority: 'low', status: 'done' },
45
- ]
46
-
47
- function prioritySeverity(p: string) {
48
- if (p === 'high') return 'danger'
49
- if (p === 'medium') return 'warn'
50
- return 'secondary'
51
- }
52
-
53
- function priorityLabel(p: string) {
54
- if (p === 'high') return '高'
55
- if (p === 'medium') return '中'
56
- return '低'
57
- }
58
-
59
- function statusLabel(s: string) {
60
- if (s === 'open') return '待处理'
61
- if (s === 'progress') return '进行中'
62
- return '已完成'
63
- }
64
-
65
- function statusSeverity(s: string) {
66
- if (s === 'open') return 'warn'
67
- if (s === 'progress') return 'info'
68
- return 'success'
69
- }
70
- </script>
71
-
72
- <template>
73
- <MConfigProvider :locale="zhCN">
74
- <MLayout fill-viewport>
75
- <MLayoutHeader padding="var(--m-space-4) var(--m-space-6)">
76
- <MBreadcrumb :model="[{ label: '首页' }, { label: '仪表盘' }]" />
77
- </MLayoutHeader>
78
-
79
- <MLayoutContent>
80
- <MPageContent density="spacious">
81
- <MPageHeader
82
- title="运营概览"
83
- description="关注今日活跃与待处理工单,异常优先下钻。"
84
- />
85
-
86
- <MAlert
87
- severity="info"
88
- title="报表管道延迟约 15 分钟"
89
- description="实时告警仍可用;看板数字以管道落库为准。"
90
- closable
91
- />
92
-
93
- <MGrid :cols="4" :x-gap="16" :y-gap="16" responsive="screen">
94
- <MGridItem v-for="item in stats" :key="item.label" :span="1">
95
- <MPageStat
96
- :label="item.label"
97
- :value="item.value"
98
- :trend="item.trend"
99
- :trend-severity="item.trendSeverity ?? 'primary'"
100
- :trend-direction="item.trendDirection"
101
- :trend-label="item.trendLabel"
102
- :icon="item.icon"
103
- />
104
- </MGridItem>
105
- </MGrid>
106
-
107
- <MGrid :cols="2" :x-gap="16" :y-gap="16" responsive="screen">
108
- <MGridItem :span="1">
109
- <MCard title="趋势概览" shadow="always">
110
- <MEmpty
111
- title="还没有趋势数据"
112
- description="接入图表后将展示近 7 日活跃与转化。"
113
- illustration="activity-low"
114
- />
115
- </MCard>
116
- </MGridItem>
117
- <MGridItem :span="1">
118
- <MCard title="最近工单" shadow="always">
119
- <div class="dashboard-plain-stats">
120
- <MStatistic title="本周新建" :value="128" />
121
- <MStatistic title="平均处理时长" :value="2.4" suffix="h" :precision="1" />
122
- </div>
123
- <MTable
124
- :columns="recentColumns"
125
- :rows="recentRows"
126
- size="small"
127
- :paginator="false"
128
- bordered
129
- row-key="id"
130
- aria-label="最近工单"
131
- >
132
- <template #cell-priority="{ value }">
133
- <MTag
134
- :value="priorityLabel(String(value))"
135
- :severity="prioritySeverity(String(value))"
136
- />
137
- </template>
138
- <template #cell-status="{ value }">
139
- <MStatus
140
- :label="statusLabel(String(value))"
141
- :severity="statusSeverity(String(value))"
142
- />
143
- </template>
144
- </MTable>
145
- </MCard>
146
- </MGridItem>
147
- </MGrid>
148
- </MPageContent>
149
- </MLayoutContent>
150
- </MLayout>
151
- </MConfigProvider>
152
- </template>
153
-
154
- <style scoped>
155
- .dashboard-plain-stats {
156
- display: flex;
157
- flex-wrap: wrap;
158
- gap: var(--m-space-6);
159
- margin-bottom: var(--m-space-4);
160
- }
161
- </style>
1
+ <script setup lang="ts">
2
+ /**
3
+ * 黄金样例:仪表盘页
4
+ * @see DESIGN.md · morya-ui-pages references/page-layouts.md · visual-craft § Ops polish
5
+ */
6
+ import {
7
+ MAlert,
8
+ MBreadcrumb,
9
+ MCard,
10
+ MConfigProvider,
11
+ MGrid,
12
+ MGridItem,
13
+ MLayout,
14
+ MLayoutContent,
15
+ MLayoutHeader,
16
+ MPageContent,
17
+ MEmpty,
18
+ MPageHeader,
19
+ MPageStat,
20
+ MStatistic,
21
+ MStatus,
22
+ MTable,
23
+ MTag,
24
+ zhCN,
25
+ } from 'morya-ui'
26
+
27
+ const stats = [
28
+ { label: '总用户', value: '12,480', trend: '+8.2%', trendDirection: 'up' as const, trendLabel: '较上月', icon: 'users' },
29
+ { label: '今日活跃', value: '1,926', trend: '+3.1%', trendDirection: 'up' as const, trendLabel: '较昨日', icon: 'activity' },
30
+ { label: '待处理工单', value: '47', trend: '-12%', trendDirection: 'down' as const, trendLabel: '较上周', trendType: 'warning' as const, icon: 'clipboard' },
31
+ { label: '系统健康', value: '99.9%', trend: '稳定', trendType: 'secondary' as const, icon: 'heart' },
32
+ ]
33
+
34
+ const recentColumns = [
35
+ { key: 'id', label: '工单号', width: 96 },
36
+ { key: 'title', label: '标题' },
37
+ { key: 'priority', label: '优先级', width: 96 },
38
+ { key: 'status', label: '状态', width: 110 },
39
+ ]
40
+
41
+ const recentRows = [
42
+ { id: 'WO-1024', title: '登录异常反馈', priority: 'high', status: 'open' },
43
+ { id: 'WO-1023', title: '导出任务超时', priority: 'medium', status: 'progress' },
44
+ { id: 'WO-1022', title: '权限配置咨询', priority: 'low', status: 'done' },
45
+ ]
46
+
47
+ function priorityType(p: string) {
48
+ if (p === 'high') return 'danger'
49
+ if (p === 'medium') return 'warning'
50
+ return 'secondary'
51
+ }
52
+
53
+ function priorityLabel(p: string) {
54
+ if (p === 'high') return '高'
55
+ if (p === 'medium') return '中'
56
+ return '低'
57
+ }
58
+
59
+ function statusLabel(s: string) {
60
+ if (s === 'open') return '待处理'
61
+ if (s === 'progress') return '进行中'
62
+ return '已完成'
63
+ }
64
+
65
+ function statusType(s: string) {
66
+ if (s === 'open') return 'warning'
67
+ if (s === 'progress') return 'info'
68
+ return 'success'
69
+ }
70
+ </script>
71
+
72
+ <template>
73
+ <MConfigProvider :locale="zhCN">
74
+ <MLayout fill-viewport>
75
+ <MLayoutHeader padding="var(--m-space-4) var(--m-space-6)">
76
+ <MBreadcrumb :model="[{ label: '首页' }, { label: '仪表盘' }]" />
77
+ </MLayoutHeader>
78
+
79
+ <MLayoutContent>
80
+ <MPageContent density="spacious">
81
+ <MPageHeader
82
+ title="运营概览"
83
+ description="关注今日活跃与待处理工单,异常优先下钻。"
84
+ />
85
+
86
+ <MAlert
87
+ type="info"
88
+ title="报表管道延迟约 15 分钟"
89
+ description="实时告警仍可用;看板数字以管道落库为准。"
90
+ closable
91
+ />
92
+
93
+ <MGrid :cols="4" :x-gap="16" :y-gap="16" responsive="screen">
94
+ <MGridItem v-for="item in stats" :key="item.label" :span="1">
95
+ <MPageStat
96
+ :label="item.label"
97
+ :value="item.value"
98
+ :trend="item.trend"
99
+ :trend-type="item.trendType ?? 'primary'"
100
+ :trend-direction="item.trendDirection"
101
+ :trend-label="item.trendLabel"
102
+ :icon="item.icon"
103
+ />
104
+ </MGridItem>
105
+ </MGrid>
106
+
107
+ <MGrid :cols="2" :x-gap="16" :y-gap="16" responsive="screen">
108
+ <MGridItem :span="1">
109
+ <MCard title="趋势概览" shadow="always">
110
+ <MEmpty
111
+ title="还没有趋势数据"
112
+ description="接入图表后将展示近 7 日活跃与转化。"
113
+ illustration="activity-low"
114
+ />
115
+ </MCard>
116
+ </MGridItem>
117
+ <MGridItem :span="1">
118
+ <MCard title="最近工单" shadow="always">
119
+ <div class="dashboard-plain-stats">
120
+ <MStatistic title="本周新建" :value="128" />
121
+ <MStatistic title="平均处理时长" :value="2.4" suffix="h" :precision="1" />
122
+ </div>
123
+ <MTable
124
+ :columns="recentColumns"
125
+ :rows="recentRows"
126
+ size="small"
127
+ :paginator="false"
128
+ bordered
129
+ row-key="id"
130
+ aria-label="最近工单"
131
+ >
132
+ <template #cell-priority="{ value }">
133
+ <MTag
134
+ :value="priorityLabel(String(value))"
135
+ :type="priorityType(String(value))"
136
+ />
137
+ </template>
138
+ <template #cell-status="{ value }">
139
+ <MStatus
140
+ :label="statusLabel(String(value))"
141
+ :type="statusType(String(value))"
142
+ />
143
+ </template>
144
+ </MTable>
145
+ </MCard>
146
+ </MGridItem>
147
+ </MGrid>
148
+ </MPageContent>
149
+ </MLayoutContent>
150
+ </MLayout>
151
+ </MConfigProvider>
152
+ </template>
153
+
154
+ <style scoped>
155
+ .dashboard-plain-stats {
156
+ display: flex;
157
+ flex-wrap: wrap;
158
+ gap: var(--m-space-6);
159
+ margin-bottom: var(--m-space-4);
160
+ }
161
+ </style>
@@ -1,147 +1,147 @@
1
- <script setup lang="ts">
2
- /**
3
- * 黄金样例:详情页
4
- * @see DESIGN.md · morya-ui-pages references/page-layouts.md · visual-craft § Ops polish
5
- */
6
- import {
7
- MBreadcrumb,
8
- MButton,
9
- MCard,
10
- MConfigProvider,
11
- MDescriptions,
12
- MDescriptionsItem,
13
- MDivider,
14
- MLayout,
15
- MLayoutContent,
16
- MLayoutHeader,
17
- MList,
18
- MListItem,
19
- MListItemMeta,
20
- MPageContent,
21
- MPageHeader,
22
- MPageSection,
23
- MSpace,
24
- MStatus,
25
- MTag,
26
- zhCN,
27
- } from 'morya-ui'
28
-
29
- const profile = {
30
- name: '林晓',
31
- email: 'linxiao@example.com',
32
- role: '成员',
33
- dept: '产品设计',
34
- joinedAt: '2025-03-12',
35
- status: 'active' as const,
36
- }
37
-
38
- const activityRows = [
39
- { id: '1', time: '2026-09-20 14:22', action: '更新了个人资料', channel: 'Web' },
40
- { id: '2', time: '2026-09-18 09:05', action: '重置了登录密码', channel: 'Web' },
41
- { id: '3', time: '2026-09-12 18:41', action: '加入「产品设计」部门', channel: 'Admin' },
42
- ]
43
- </script>
44
-
45
- <template>
46
- <MConfigProvider :locale="zhCN">
47
- <MLayout fill-viewport>
48
- <MLayoutHeader padding="var(--m-space-4) var(--m-space-6)">
49
- <MBreadcrumb
50
- :model="[
51
- { label: '首页', to: '/' },
52
- { label: '用户管理', to: '/users' },
53
- { label: profile.name },
54
- ]"
55
- />
56
- </MLayoutHeader>
57
-
58
- <MLayoutContent>
59
- <MPageContent>
60
- <MPageHeader
61
- :title="profile.name"
62
- description="查看账号摘要、属性与近期活动。编辑走同页弹窗或独立表单页,勿做成营销落地。"
63
- >
64
- <template #actions>
65
- <MSpace>
66
- <MStatus
67
- :label="profile.status === 'active' ? '启用' : '停用'"
68
- :severity="profile.status === 'active' ? 'success' : 'secondary'"
69
- />
70
- <MButton type="primary">
71
- 编辑
72
- </MButton>
73
- <MButton>
74
- 返回
75
- </MButton>
76
- <MButton type="text" danger>
77
- 删除
78
- </MButton>
79
- </MSpace>
80
- </template>
81
- </MPageHeader>
82
-
83
- <MPageSection title="摘要">
84
- <MSpace wrap style="gap: var(--m-space-2)">
85
- <MTag :value="profile.role" />
86
- <MTag :value="profile.dept" severity="info" />
87
- </MSpace>
88
- <p class="detail-lead">
89
- 工作邮箱 {{ profile.email }} · 入职 {{ profile.joinedAt }}
90
- </p>
91
- </MPageSection>
92
-
93
- <MDescriptions title="基本信息" bordered :column="2">
94
- <MDescriptionsItem label="姓名">
95
- {{ profile.name }}
96
- </MDescriptionsItem>
97
- <MDescriptionsItem label="邮箱">
98
- {{ profile.email }}
99
- </MDescriptionsItem>
100
- <MDescriptionsItem label="角色">
101
- {{ profile.role }}
102
- </MDescriptionsItem>
103
- <MDescriptionsItem label="部门">
104
- {{ profile.dept }}
105
- </MDescriptionsItem>
106
- <MDescriptionsItem label="入职日期">
107
- {{ profile.joinedAt }}
108
- </MDescriptionsItem>
109
- <MDescriptionsItem label="状态">
110
- <MStatus
111
- :label="profile.status === 'active' ? '启用' : '停用'"
112
- :severity="profile.status === 'active' ? 'success' : 'secondary'"
113
- />
114
- </MDescriptionsItem>
115
- </MDescriptions>
116
-
117
- <MDivider />
118
-
119
- <MCard title="近期活动">
120
- <MList
121
- :items="activityRows"
122
- row-key="id"
123
- size="small"
124
- >
125
- <template #item="{ item }">
126
- <MListItem>
127
- <MListItemMeta
128
- :title="item.action"
129
- :description="`${item.time} · ${item.channel}`"
130
- />
131
- </MListItem>
132
- </template>
133
- </MList>
134
- </MCard>
135
- </MPageContent>
136
- </MLayoutContent>
137
- </MLayout>
138
- </MConfigProvider>
139
- </template>
140
-
141
- <style scoped>
142
- .detail-lead {
143
- margin: var(--m-space-3) 0 0;
144
- color: var(--m-color-text-muted);
145
- font-size: var(--m-font-size-sm);
146
- }
147
- </style>
1
+ <script setup lang="ts">
2
+ /**
3
+ * 黄金样例:详情页
4
+ * @see DESIGN.md · morya-ui-pages references/page-layouts.md · visual-craft § Ops polish
5
+ */
6
+ import {
7
+ MBreadcrumb,
8
+ MButton,
9
+ MCard,
10
+ MConfigProvider,
11
+ MDescriptions,
12
+ MDescriptionsItem,
13
+ MDivider,
14
+ MLayout,
15
+ MLayoutContent,
16
+ MLayoutHeader,
17
+ MList,
18
+ MListItem,
19
+ MListItemMeta,
20
+ MPageContent,
21
+ MPageHeader,
22
+ MPageSection,
23
+ MSpace,
24
+ MStatus,
25
+ MTag,
26
+ zhCN,
27
+ } from 'morya-ui'
28
+
29
+ const profile = {
30
+ name: '林晓',
31
+ email: 'linxiao@example.com',
32
+ role: '成员',
33
+ dept: '产品设计',
34
+ joinedAt: '2025-03-12',
35
+ status: 'active' as const,
36
+ }
37
+
38
+ const activityRows = [
39
+ { id: '1', time: '2026-09-20 14:22', action: '更新了个人资料', channel: 'Web' },
40
+ { id: '2', time: '2026-09-18 09:05', action: '重置了登录密码', channel: 'Web' },
41
+ { id: '3', time: '2026-09-12 18:41', action: '加入「产品设计」部门', channel: 'Admin' },
42
+ ]
43
+ </script>
44
+
45
+ <template>
46
+ <MConfigProvider :locale="zhCN">
47
+ <MLayout fill-viewport>
48
+ <MLayoutHeader padding="var(--m-space-4) var(--m-space-6)">
49
+ <MBreadcrumb
50
+ :model="[
51
+ { label: '首页', to: '/' },
52
+ { label: '用户管理', to: '/users' },
53
+ { label: profile.name },
54
+ ]"
55
+ />
56
+ </MLayoutHeader>
57
+
58
+ <MLayoutContent>
59
+ <MPageContent>
60
+ <MPageHeader
61
+ :title="profile.name"
62
+ description="查看账号摘要、属性与近期活动。编辑走同页弹窗或独立表单页,勿做成营销落地。"
63
+ >
64
+ <template #actions>
65
+ <MSpace>
66
+ <MStatus
67
+ :label="profile.status === 'active' ? '启用' : '停用'"
68
+ :type="profile.status === 'active' ? 'success' : 'secondary'"
69
+ />
70
+ <MButton type="primary">
71
+ 编辑
72
+ </MButton>
73
+ <MButton>
74
+ 返回
75
+ </MButton>
76
+ <MButton type="text" danger>
77
+ 删除
78
+ </MButton>
79
+ </MSpace>
80
+ </template>
81
+ </MPageHeader>
82
+
83
+ <MPageSection title="摘要">
84
+ <MSpace wrap style="gap: var(--m-space-2)">
85
+ <MTag :value="profile.role" />
86
+ <MTag :value="profile.dept" type="info" />
87
+ </MSpace>
88
+ <p class="detail-lead">
89
+ 工作邮箱 {{ profile.email }} · 入职 {{ profile.joinedAt }}
90
+ </p>
91
+ </MPageSection>
92
+
93
+ <MDescriptions title="基本信息" bordered :column="2">
94
+ <MDescriptionsItem label="姓名">
95
+ {{ profile.name }}
96
+ </MDescriptionsItem>
97
+ <MDescriptionsItem label="邮箱">
98
+ {{ profile.email }}
99
+ </MDescriptionsItem>
100
+ <MDescriptionsItem label="角色">
101
+ {{ profile.role }}
102
+ </MDescriptionsItem>
103
+ <MDescriptionsItem label="部门">
104
+ {{ profile.dept }}
105
+ </MDescriptionsItem>
106
+ <MDescriptionsItem label="入职日期">
107
+ {{ profile.joinedAt }}
108
+ </MDescriptionsItem>
109
+ <MDescriptionsItem label="状态">
110
+ <MStatus
111
+ :label="profile.status === 'active' ? '启用' : '停用'"
112
+ :type="profile.status === 'active' ? 'success' : 'secondary'"
113
+ />
114
+ </MDescriptionsItem>
115
+ </MDescriptions>
116
+
117
+ <MDivider />
118
+
119
+ <MCard title="近期活动">
120
+ <MList
121
+ :items="activityRows"
122
+ row-key="id"
123
+ size="small"
124
+ >
125
+ <template #item="{ item }">
126
+ <MListItem>
127
+ <MListItemMeta
128
+ :title="item.action"
129
+ :description="`${item.time} · ${item.channel}`"
130
+ />
131
+ </MListItem>
132
+ </template>
133
+ </MList>
134
+ </MCard>
135
+ </MPageContent>
136
+ </MLayoutContent>
137
+ </MLayout>
138
+ </MConfigProvider>
139
+ </template>
140
+
141
+ <style scoped>
142
+ .detail-lead {
143
+ margin: var(--m-space-3) 0 0;
144
+ color: var(--m-color-text-muted);
145
+ font-size: var(--m-font-size-sm);
146
+ }
147
+ </style>