@befly-addon/admin 1.0.30 → 1.0.32

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.
@@ -22,9 +22,9 @@
22
22
  <span class="col-module">{{ log.module }}</span>
23
23
  <span class="col-ip">{{ log.ip }}</span>
24
24
  <span class="col-status">
25
- <TinyTag :type="log.status === 'success' ? 'success' : 'danger'" size="small">
25
+ <t-tag :type="log.status === 'success' ? 'success' : 'danger'" size="small">
26
26
  {{ log.status === 'success' ? '成功' : '失败' }}
27
- </TinyTag>
27
+ </t-tag>
28
28
  </span>
29
29
  </div>
30
30
  </div>
@@ -34,7 +34,6 @@
34
34
  </template>
35
35
 
36
36
  <script setup>
37
- import { Tag as TinyTag } from '@opentiny/vue';
38
37
  import IconLucideFileText from '~icons/lucide/file-text';
39
38
 
40
39
  // 组件内部数据
@@ -1,19 +1,17 @@
1
1
  <template>
2
2
  <div class="section-block">
3
3
  <div class="section-content">
4
- <TinyButton type="primary" size="large" @click="handleClearCache">
4
+ <t-button type="primary" size="large" @click="handleClearCache">
5
5
  <template #prefix>
6
6
  <IconLucideRotateCw />
7
7
  </template>
8
8
  刷新缓存
9
- </TinyButton>
9
+ </t-button>
10
10
  </div>
11
11
  </div>
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { useRouter, useRoute } from 'vue-router';
16
- import { Button as TinyButton } from '@opentiny/vue';
17
15
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
18
16
  const handleClearCache = () => {
19
17
  console.log('刷新缓存');
@@ -18,7 +18,7 @@
18
18
  <span class="notification-title">{{ notification.title }}</span>
19
19
  <span class="notification-time">{{ formatTime(notification.createdAt) }}</span>
20
20
  </div>
21
- <TinyTag v-if="!notification.isRead" type="primary" size="small">新</TinyTag>
21
+ <t-tag v-if="!notification.isRead" type="primary" size="small">新</t-tag>
22
22
  </div>
23
23
  </div>
24
24
  </div>
@@ -30,7 +30,6 @@ import IconLucideBell from '~icons/lucide/bell';
30
30
  import IconLucideCheckCircle from '~icons/lucide/check-circle';
31
31
  import IconLucideAlertTriangle from '~icons/lucide/alert-triangle';
32
32
  import IconLucideXCircle from '~icons/lucide/x-circle';
33
- import { Tag as TinyTag } from '@opentiny/vue';
34
33
  import IconLucideInfo from '~icons/lucide/info';
35
34
  import IconLucideCheck from '~icons/lucide/check';
36
35
  import IconLucideX from '~icons/lucide/x';
@@ -40,7 +40,6 @@
40
40
 
41
41
  <script setup>
42
42
  import IconLucideDisc from '~icons/lucide/disc';
43
- import { Progress as TinyProgress } from '@opentiny/vue';
44
43
  import IconLucideCpu from '~icons/lucide/cpu';
45
44
  import IconLucideHardDrive from '~icons/lucide/hard-drive';
46
45
  import IconLucideActivity from '~icons/lucide/activity';
@@ -26,12 +26,12 @@
26
26
 
27
27
  <!-- 仅 dev 角色显示刷新缓存按钮 -->
28
28
  <div v-if="$Data.userInfo.roleCode === 'dev'" class="user-actions">
29
- <TinyButton type="primary" size="mini" :loading="$Data.refreshing" @click="$Method.handleRefreshCache">
29
+ <t-button type="primary" size="mini" :loading="$Data.refreshing" @click="$Method.handleRefreshCache">
30
30
  <template #icon>
31
31
  <IconLucideRotateCw />
32
32
  </template>
33
33
  刷新缓存
34
- </TinyButton>
34
+ </t-button>
35
35
  </div>
36
36
  </div>
37
37
  </template>
@@ -39,7 +39,6 @@
39
39
  <script setup>
40
40
  import IconLucidePhone from '~icons/lucide/phone';
41
41
  import IconLucideClock from '~icons/lucide/clock';
42
- import { Button as TinyButton } from '@opentiny/vue';
43
42
  import IconLucideUser from '~icons/lucide/user';
44
43
  import IconLucideMail from '~icons/lucide/mail';
45
44
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
@@ -1,32 +1,31 @@
1
1
  <template>
2
- <TinyForm :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="90px" label-position="left" :show-message="false">
3
- <TinyFormItem prop="account" label="账号">
4
- <TinyInput v-model="$Data.formData.account" placeholder="请输入用户名或邮箱" size="large" clearable>
2
+ <t-form :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="90px" label-position="left" :show-message="false">
3
+ <t-form-item prop="account" label="账号">
4
+ <t-input v-model="$Data.formData.account" placeholder="请输入用户名或邮箱" size="large" clearable>
5
5
  <template #prefix-icon>
6
6
  <IconLucideUser />
7
7
  </template>
8
- </TinyInput>
9
- </TinyFormItem>
8
+ </t-input>
9
+ </t-form-item>
10
10
 
11
- <TinyFormItem prop="password" label="密码">
12
- <TinyInput v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
11
+ <t-form-item prop="password" label="密码">
12
+ <t-input v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
13
13
  <template #prefix-icon>
14
14
  <IconLucideLock />
15
15
  </template>
16
- </TinyInput>
17
- </TinyFormItem>
16
+ </t-input>
17
+ </t-form-item>
18
18
 
19
19
  <div class="form-footer">
20
20
  <a href="#" class="forgot-password">忘记密码?</a>
21
21
  </div>
22
22
 
23
- <TinyButton theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.apiLogin"> 登录 </TinyButton>
24
- </TinyForm>
23
+ <t-button theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.apiLogin"> 登录 </t-button>
24
+ </t-form>
25
25
  </template>
26
26
 
27
27
  <script setup>
28
- import { useRouter, useRoute } from 'vue-router';
29
- import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Modal } from '@opentiny/vue';
28
+ import { useRouter } from 'vue-router';
30
29
  import IconLucideUser from '~icons/lucide/user';
31
30
  import IconLucideLock from '~icons/lucide/lock';
32
31
  import { $Http } from '@/plugins/http';
@@ -76,7 +75,7 @@ const $Method = {
76
75
  $Storage.local.set('userInfo', res.data.userInfo);
77
76
  }
78
77
 
79
- Modal.message({
78
+ MessagePlugin.info({
80
79
  message: '登录成功',
81
80
  status: 'success'
82
81
  });
@@ -1,43 +1,42 @@
1
1
  <template>
2
- <TinyForm :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="70px" label-position="left">
3
- <TinyFormItem prop="username" label="用户名">
4
- <TinyInput v-model="$Data.formData.username" placeholder="请输入用户名" size="large" clearable>
2
+ <t-form :model="$Data.formData" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)" class="login-form" label-width="70px" label-position="left">
3
+ <t-form-item prop="username" label="用户名">
4
+ <t-input v-model="$Data.formData.username" placeholder="请输入用户名" size="large" clearable>
5
5
  <template #prefix-icon>
6
6
  <IconLucideUser />
7
7
  </template>
8
- </TinyInput>
9
- </TinyFormItem>
8
+ </t-input>
9
+ </t-form-item>
10
10
 
11
- <TinyFormItem prop="email" label="邮箱">
12
- <TinyInput v-model="$Data.formData.email" placeholder="请输入邮箱" size="large" clearable>
11
+ <t-form-item prop="email" label="邮箱">
12
+ <t-input v-model="$Data.formData.email" placeholder="请输入邮箱" size="large" clearable>
13
13
  <template #prefix-icon>
14
14
  <IconLucideMail />
15
15
  </template>
16
- </TinyInput>
17
- </TinyFormItem>
16
+ </t-input>
17
+ </t-form-item>
18
18
 
19
- <TinyFormItem prop="password" label="密码">
20
- <TinyInput v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
19
+ <t-form-item prop="password" label="密码">
20
+ <t-input v-model="$Data.formData.password" type="password" placeholder="请输入密码" size="large" clearable>
21
21
  <template #prefix-icon>
22
22
  <IconLucideLock />
23
23
  </template>
24
- </TinyInput>
25
- </TinyFormItem>
24
+ </t-input>
25
+ </t-form-item>
26
26
 
27
- <TinyFormItem prop="nickname" label="昵称">
28
- <TinyInput v-model="$Data.formData.nickname" placeholder="请输入昵称(选填)" size="large" clearable>
27
+ <t-form-item prop="nickname" label="昵称">
28
+ <t-input v-model="$Data.formData.nickname" placeholder="请输入昵称(选填)" size="large" clearable>
29
29
  <template #prefix-icon>
30
30
  <IconLucideSmile />
31
31
  </template>
32
- </TinyInput>
33
- </TinyFormItem>
32
+ </t-input>
33
+ </t-form-item>
34
34
 
35
- <TinyButton theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.handleSubmit"> 注册 </TinyButton>
36
- </TinyForm>
35
+ <t-button theme="primary" class="auth-btn" size="large" :loading="$Data.loading" @click="$Method.handleSubmit"> 注册 </t-button>
36
+ </t-form>
37
37
  </template>
38
38
 
39
39
  <script setup>
40
- import { Button as TinyButton, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput } from '@opentiny/vue';
41
40
  import IconLucideUser from '~icons/lucide/user';
42
41
  import IconLucideMail from '~icons/lucide/mail';
43
42
  import IconLucideLock from '~icons/lucide/lock';
@@ -1,35 +1,34 @@
1
1
  <template>
2
- <TinyDialogBox v-model:visible="$Data.visible" :title="$Prop.actionType === 'add' ? '添加菜单' : '编辑菜单'" width="600px" :append-to-body="true" :show-footer="true" top="10vh">
3
- <TinyForm :model="$Data.formData" label-width="120px" label-position="left" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)">
4
- <TinyFormItem label="菜单名称" prop="name">
5
- <TinyInput v-model="$Data.formData.name" placeholder="请输入菜单名称" />
6
- </TinyFormItem>
7
- <TinyFormItem label="菜单路径" prop="path">
8
- <TinyInput v-model="$Data.formData.path" placeholder="请输入菜单路径,如:/user" />
9
- </TinyFormItem>
10
- <TinyFormItem label="图标" prop="icon">
11
- <TinyInput v-model="$Data.formData.icon" placeholder="请输入图标名称,如:User" />
12
- </TinyFormItem>
13
- <TinyFormItem label="排序" prop="sort">
14
- <TinyNumeric v-model="$Data.formData.sort" :min="0" :max="9999" />
15
- </TinyFormItem>
16
- <TinyFormItem label="状态" prop="state">
17
- <TinyRadioGroup v-model="$Data.formData.state">
18
- <TinyRadio :label="1">正常</TinyRadio>
19
- <TinyRadio :label="2">禁用</TinyRadio>
20
- </TinyRadioGroup>
21
- </TinyFormItem>
22
- </TinyForm>
2
+ <t-dialog v-model:visible="$Data.visible" :title="$Prop.actionType === 'add' ? '添加菜单' : '编辑菜单'" width="600px" :append-to-body="true" :show-footer="true" top="10vh">
3
+ <t-form :model="$Data.formData" label-width="120px" label-position="left" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)">
4
+ <t-form-item label="菜单名称" prop="name">
5
+ <t-input v-model="$Data.formData.name" placeholder="请输入菜单名称" />
6
+ </t-form-item>
7
+ <t-form-item label="菜单路径" prop="path">
8
+ <t-input v-model="$Data.formData.path" placeholder="请输入菜单路径,如:/user" />
9
+ </t-form-item>
10
+ <t-form-item label="图标" prop="icon">
11
+ <t-input v-model="$Data.formData.icon" placeholder="请输入图标名称,如:User" />
12
+ </t-form-item>
13
+ <t-form-item label="排序" prop="sort">
14
+ <t-input-number v-model="$Data.formData.sort" :min="0" :max="9999" />
15
+ </t-form-item>
16
+ <t-form-item label="状态" prop="state">
17
+ <t-radio-group v-model="$Data.formData.state">
18
+ <t-radio :label="1">正常</t-radio>
19
+ <t-radio :label="2">禁用</t-radio>
20
+ </t-radio-group>
21
+ </t-form-item>
22
+ </t-form>
23
23
  <template #footer>
24
- <TinyButton @click="$Method.onClose">取消</TinyButton>
25
- <TinyButton type="primary" @click="$Method.onSubmit">确定</TinyButton>
24
+ <t-button @click="$Method.onClose">取消</t-button>
25
+ <t-button type="primary" @click="$Method.onSubmit">确定</t-button>
26
26
  </template>
27
- </TinyDialogBox>
27
+ </t-dialog>
28
28
  </template>
29
29
 
30
30
  <script setup>
31
31
  import { watch } from 'vue';
32
- import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
33
32
  import { $Http } from '@/plugins/http';
34
33
 
35
34
  const $Prop = defineProps({
@@ -114,7 +113,7 @@ const $Method = {
114
113
 
115
114
  const res = await $Http($Prop.actionType === 'add' ? '/addon/admin/menuIns' : '/addon/admin/menuUpd', $Data.formData);
116
115
 
117
- Modal.message({
116
+ MessagePlugin.info({
118
117
  message: $Prop.actionType === 'add' ? '添加成功' : '编辑成功',
119
118
  status: 'success'
120
119
  });
@@ -2,64 +2,53 @@
2
2
  <div class="page-menu page-table">
3
3
  <div class="main-tool">
4
4
  <div class="left">
5
- <TinyButton type="primary" @click="$Method.onAction('add', {})">
5
+ <t-button type="primary" @click="$Method.onAction('add', {})">
6
6
  <template #icon>
7
7
  <IconLucidePlus />
8
8
  </template>
9
9
  添加菜单
10
- </TinyButton>
10
+ </t-button>
11
11
  </div>
12
12
  <div class="right">
13
- <TinyButton @click="$Method.handleRefresh">
13
+ <t-button @click="$Method.handleRefresh">
14
14
  <template #icon>
15
15
  <IconLucideRotateCw />
16
16
  </template>
17
17
  刷新
18
- </TinyButton>
18
+ </t-button>
19
19
  </div>
20
20
  </div>
21
21
  <div class="main-table">
22
- <TinyGrid :data="$Data.menuList" header-cell-class-name="custom-table-cell-class" size="small" height="100%" seq-serial>
23
- <TinyGridColumn type="index" title="序号" :width="60" />
24
- <TinyGridColumn field="name" title="菜单名称" />
25
- <TinyGridColumn field="path" title="路径" :width="200" />
26
- <TinyGridColumn field="icon" title="图标" :width="100">
27
- <template #default="{ row }">
28
- <IconLucideSquare v-if="row.icon" />
29
- <span v-else>-</span>
30
- </template>
31
- </TinyGridColumn>
32
- <TinyGridColumn field="sort" title="排序" :width="80" />
33
- <TinyGridColumn field="state" title="状态" :width="100">
34
- <template #default="{ row }">
35
- <TinyTag v-if="row.state === 1" type="success">正常</TinyTag>
36
- <TinyTag v-else-if="row.state === 2" type="warning">禁用</TinyTag>
37
- <TinyTag v-else type="danger">已删除</TinyTag>
38
- </template>
39
- </TinyGridColumn>
40
- <TinyGridColumn title="操作" :width="120" align="right">
41
- <template #default="{ row }">
42
- <TinyDropdown title="操作" trigger="click" size="small" border visible-arrow @item-click="(data) => $Method.onAction(data.itemData.command, row)">
43
- <template #dropdown>
44
- <TinyDropdownMenu>
45
- <TinyDropdownItem :item-data="{ command: 'upd' }">
46
- <IconLucidePencil />
47
- 编辑
48
- </TinyDropdownItem>
49
- <TinyDropdownItem :item-data="{ command: 'del' }" divided>
50
- <IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
51
- 删除
52
- </TinyDropdownItem>
53
- </TinyDropdownMenu>
54
- </template>
55
- </TinyDropdown>
56
- </template>
57
- </TinyGridColumn>
58
- </TinyGrid>
22
+ <t-table :data="$Data.menuList" :columns="$Data.columns" header-cell-class-name="custom-table-cell-class" size="small" height="100%" row-key="id">
23
+ <template #icon="{ row }">
24
+ <IconLucideSquare v-if="row.icon" />
25
+ <span v-else>-</span>
26
+ </template>
27
+ <template #state="{ row }">
28
+ <t-tag v-if="row.state === 1" theme="success">正常</t-tag>
29
+ <t-tag v-else-if="row.state === 2" theme="warning">禁用</t-tag>
30
+ <t-tag v-else theme="danger">已删除</t-tag>
31
+ </template>
32
+ <template #operation="{ row }">
33
+ <t-dropdown trigger="click" min-column-width="120" @click="(data) => $Method.onAction(data.value, row)">
34
+ <t-button variant="text" size="small">操作</t-button>
35
+ <t-dropdown-menu slot="dropdown">
36
+ <t-dropdown-item value="upd">
37
+ <IconLucidePencil />
38
+ 编辑
39
+ </t-dropdown-item>
40
+ <t-dropdown-item value="del" :divider="true">
41
+ <IconLucideTrash2 style="width: 14px; height: 14px; margin-right: 6px" />
42
+ 删除
43
+ </t-dropdown-item>
44
+ </t-dropdown-menu>
45
+ </t-dropdown>
46
+ </template>
47
+ </t-table>
59
48
  </div>
60
49
 
61
50
  <div class="main-page">
62
- <TinyPager :current-page="$Data.pagerConfig.currentPage" :page-size="$Data.pagerConfig.pageSize" :total="$Data.pagerConfig.total" @current-change="$Method.onPageChange" @size-change="$Method.handleSizeChange" />
51
+ <t-pagination :current-page="$Data.pagerConfig.currentPage" :page-size="$Data.pagerConfig.pageSize" :total="$Data.pagerConfig.total" @current-change="$Method.onPageChange" @size-change="$Method.handleSizeChange" />
63
52
  </div>
64
53
 
65
54
  <!-- 编辑对话框组件 -->
@@ -68,7 +57,6 @@
68
57
  </template>
69
58
 
70
59
  <script setup>
71
- import { Button as TinyButton, Grid as TinyGrid, GridColumn as TinyGridColumn, Tag as TinyTag, Dropdown as TinyDropdown, DropdownMenu as TinyDropdownMenu, DropdownItem as TinyDropdownItem, Pager as TinyPager, Modal } from '@opentiny/vue';
72
60
  import IconLucidePlus from '~icons/lucide/plus';
73
61
  import IconLucideRotateCw from '~icons/lucide/rotate-cw';
74
62
  import IconLucideSquare from '~icons/lucide/square';
@@ -81,6 +69,15 @@ import { $Http } from '@/plugins/http';
81
69
  // 响应式数据
82
70
  const $Data = $ref({
83
71
  menuList: [],
72
+ columns: [
73
+ { colKey: 'index', title: '序号', width: 60, align: 'center' },
74
+ { colKey: 'name', title: '菜单名称' },
75
+ { colKey: 'path', title: '路径', width: 200 },
76
+ { colKey: 'icon', title: '图标', width: 100 },
77
+ { colKey: 'sort', title: '排序', width: 80 },
78
+ { colKey: 'state', title: '状态', width: 100 },
79
+ { colKey: 'operation', title: '操作', width: 120, align: 'right' }
80
+ ],
84
81
  pagerConfig: {
85
82
  currentPage: 1,
86
83
  pageSize: 30,
@@ -110,7 +107,7 @@ const $Method = {
110
107
  $Data.pagerConfig.total = res.data.total || 0;
111
108
  } catch (error) {
112
109
  console.error('加载菜单列表失败:', error);
113
- Modal.message({
110
+ MessagePlugin.info({
114
111
  message: '加载数据失败',
115
112
  status: 'error'
116
113
  });
@@ -119,7 +116,7 @@ const $Method = {
119
116
 
120
117
  // 删除菜单
121
118
  async apiMenuDel(row) {
122
- Modal.confirm({
119
+ DialogPlugin.confirm({
123
120
  header: '确认删除',
124
121
  body: `确定要删除菜单"${row.name}" 吗?`,
125
122
  status: 'warning'
@@ -127,14 +124,14 @@ const $Method = {
127
124
  try {
128
125
  const res = await $Http('/addon/admin/menu/del', { id: row.id });
129
126
  if (res.code === 0) {
130
- Modal.message({ message: '删除成功', status: 'success' });
127
+ MessagePlugin.info({ message: '删除成功', status: 'success' });
131
128
  $Method.apiMenuList();
132
129
  } else {
133
- Modal.message({ message: res.msg || '删除失败', status: 'error' });
130
+ MessagePlugin.info({ message: res.msg || '删除失败', status: 'error' });
134
131
  }
135
132
  } catch (error) {
136
133
  console.error('删除失败:', error);
137
- Modal.message({ message: '删除失败', status: 'error' });
134
+ MessagePlugin.info({ message: '删除失败', status: 'error' });
138
135
  }
139
136
  });
140
137
  },
@@ -9,8 +9,6 @@
9
9
  </template>
10
10
 
11
11
  <script setup>
12
- import { useRouter, useRoute } from 'vue-router';
13
- import { Modal } from '@opentiny/vue';
14
12
  // 新闻页面逻辑
15
13
  </script>
16
14
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <TinyDialogBox v-model:visible="$Data.visible" title="接口权限" width="900px" :append-to-body="true" :show-footer="true" top="5vh" @close="$Method.onClose">
2
+ <t-dialog v-model:visible="$Data.visible" title="接口权限" width="900px" :append-to-body="true" :show-footer="true" top="5vh" @close="$Method.onClose">
3
3
  <div class="comp-role-api">
4
4
  <!-- 搜索框 -->
5
5
  <div class="search-box">
@@ -21,19 +21,18 @@
21
21
 
22
22
  <template #footer>
23
23
  <div class="footer-left">
24
- <TinyButton size="small" @click="$Method.onCheckAll">全选</TinyButton>
25
- <TinyButton size="small" @click="$Method.onUncheckAll">取消全选</TinyButton>
24
+ <t-button size="small" @click="$Method.onCheckAll">全选</t-button>
25
+ <t-button size="small" @click="$Method.onUncheckAll">取消全选</t-button>
26
26
  </div>
27
27
  <div class="footer-right">
28
- <TinyButton @click="$Method.onClose">取消</TinyButton>
29
- <TinyButton type="primary" @click="$Method.onSubmit">保存</TinyButton>
28
+ <t-button @click="$Method.onClose">取消</t-button>
29
+ <t-button type="primary" @click="$Method.onSubmit">保存</t-button>
30
30
  </div>
31
31
  </template>
32
- </TinyDialogBox>
32
+ </t-dialog>
33
33
  </template>
34
34
 
35
35
  <script setup>
36
- import { Button as TinyButton, DialogBox as TinyDialogBox, Search as TinySearch, Checkbox as TinyCheckbox, CheckboxGroup as TinyCheckboxGroup, Modal } from '@opentiny/vue';
37
36
  import { $Http } from '@/plugins/http';
38
37
 
39
38
  const $Prop = defineProps({
@@ -108,7 +107,7 @@ const $Method = {
108
107
  $Data.apiData = Array.from(apiMap.values());
109
108
  } catch (error) {
110
109
  console.error('加载接口失败:', error);
111
- Modal.message({ message: '加载接口失败', status: 'error' });
110
+ MessagePlugin.info({ message: '加载接口失败', status: 'error' });
112
111
  }
113
112
  },
114
113
 
@@ -168,21 +167,21 @@ const $Method = {
168
167
  });
169
168
 
170
169
  if (res.code === 0) {
171
- Modal.message({
170
+ MessagePlugin.info({
172
171
  message: '保存成功',
173
172
  status: 'success'
174
173
  });
175
174
  $Data.visible = false;
176
175
  $Emit('success');
177
176
  } else {
178
- Modal.message({
177
+ MessagePlugin.info({
179
178
  message: res.msg || '保存失败',
180
179
  status: 'error'
181
180
  });
182
181
  }
183
182
  } catch (error) {
184
183
  console.error('保存失败:', error);
185
- Modal.message({
184
+ MessagePlugin.info({
186
185
  message: '保存失败',
187
186
  status: 'error'
188
187
  });
@@ -1,36 +1,35 @@
1
1
  <template>
2
- <TinyDialogBox v-model:visible="$Data.visible" :title="$Prop.actionType === 'upd' ? '更新角色' : '添加角色'" width="600px" :append-to-body="true" :show-footer="true" :esc-closable="false" top="10vh" @close="$Method.onClose">
2
+ <t-dialog v-model:visible="$Data.visible" :title="$Prop.actionType === 'upd' ? '更新角色' : '添加角色'" width="600px" :append-to-body="true" :show-footer="true" :esc-closable="false" top="10vh" @close="$Method.onClose">
3
3
  <div class="comp-role-edit">
4
- <TinyForm :model="$Data.formData" label-width="120px" label-position="left" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)">
5
- <TinyFormItem label="角色名称" prop="name">
6
- <TinyInput v-model="$Data.formData.name" placeholder="请输入角色名称" />
7
- </TinyFormItem>
8
- <TinyFormItem label="角色代码" prop="code">
9
- <TinyInput v-model="$Data.formData.code" placeholder="请输入角色代码,如:admin" />
10
- </TinyFormItem>
11
- <TinyFormItem label="角色描述" prop="description">
12
- <TinyInput v-model="$Data.formData.description" type="textarea" placeholder="请输入角色描述" :rows="3" />
13
- </TinyFormItem>
14
- <TinyFormItem label="排序" prop="sort">
15
- <TinyNumeric v-model="$Data.formData.sort" :min="0" :max="9999" />
16
- </TinyFormItem>
17
- <TinyFormItem label="状态" prop="state">
18
- <TinyRadioGroup v-model="$Data.formData.state">
19
- <TinyRadio :label="1">正常</TinyRadio>
20
- <TinyRadio :label="2">禁用</TinyRadio>
21
- </TinyRadioGroup>
22
- </TinyFormItem>
23
- </TinyForm>
4
+ <t-form :model="$Data.formData" label-width="120px" label-position="left" :rules="$Data2.formRules" :ref="(el) => ($From.form = el)">
5
+ <t-form-item label="角色名称" prop="name">
6
+ <t-input v-model="$Data.formData.name" placeholder="请输入角色名称" />
7
+ </t-form-item>
8
+ <t-form-item label="角色代码" prop="code">
9
+ <t-input v-model="$Data.formData.code" placeholder="请输入角色代码,如:admin" />
10
+ </t-form-item>
11
+ <t-form-item label="角色描述" prop="description">
12
+ <t-input v-model="$Data.formData.description" type="textarea" placeholder="请输入角色描述" :rows="3" />
13
+ </t-form-item>
14
+ <t-form-item label="排序" prop="sort">
15
+ <t-input-number v-model="$Data.formData.sort" :min="0" :max="9999" />
16
+ </t-form-item>
17
+ <t-form-item label="状态" prop="state">
18
+ <t-radio-group v-model="$Data.formData.state">
19
+ <t-radio :label="1">正常</t-radio>
20
+ <t-radio :label="2">禁用</t-radio>
21
+ </t-radio-group>
22
+ </t-form-item>
23
+ </t-form>
24
24
  </div>
25
25
  <template #footer>
26
- <TinyButton @click="$Method.onClose">取消</TinyButton>
27
- <TinyButton type="primary" @click="$Method.onSubmit">确定</TinyButton>
26
+ <t-button @click="$Method.onClose">取消</t-button>
27
+ <t-button type="primary" @click="$Method.onSubmit">确定</t-button>
28
28
  </template>
29
- </TinyDialogBox>
29
+ </t-dialog>
30
30
  </template>
31
31
 
32
32
  <script setup>
33
- import { Button as TinyButton, DialogBox as TinyDialogBox, Form as TinyForm, FormItem as TinyFormItem, Input as TinyInput, Numeric as TinyNumeric, Radio as TinyRadio, RadioGroup as TinyRadioGroup, Modal } from '@opentiny/vue';
34
33
  import { $Http } from '@/plugins/http';
35
34
 
36
35
  const $Prop = defineProps({
@@ -107,7 +106,7 @@ const $Method = {
107
106
 
108
107
  const res = await $Http($Prop.actionType === 'upd' ? '/addon/admin/roleUpd' : '/addon/admin/roleIns', $Data.formData);
109
108
 
110
- Modal.message({
109
+ MessagePlugin.info({
111
110
  message: $Prop.actionType === 'upd' ? '更新成功' : '添加成功',
112
111
  status: 'success'
113
112
  });
@@ -115,7 +114,7 @@ const $Method = {
115
114
  $Emit('success');
116
115
  } catch (error) {
117
116
  console.error('提交失败:', error);
118
- Modal.message({
117
+ MessagePlugin.info({
119
118
  message: '提交失败',
120
119
  status: 'error'
121
120
  });