Commit fabca00f7a369559465397cdec2070f612db5cd7

Authored by xingyu4j
1 parent 70b8dcb1

refactor: button

Showing 27 changed files with 807 additions and 817 deletions
yudao-ui-admin-vue3/src/utils/auth.ts
1   -import { useCache } from '@/hooks/web/useCache'
  1 +import Cookies from 'js-cookie'
2 2 import { TokenType } from '@/api/login/types'
3 3 import { decrypt, encrypt } from '@/utils/jsencrypt'
4 4  
5   -const { wsCache } = useCache()
6 5 const AccessTokenKey = 'ACCESS_TOKEN'
7 6 const RefreshTokenKey = 'REFRESH_TOKEN'
8 7  
9 8 // 获取token
10 9 export const getAccessToken = () => {
11 10 // 此处与TokenKey相同,此写法解决初始化时Cookies中不存在TokenKey报错
12   - return wsCache.get('ACCESS_TOKEN')
  11 + return Cookies.get(AccessTokenKey) ? Cookies.get(AccessTokenKey) : Cookies.get('ACCESS_TOKEN')
13 12 }
14 13  
15 14 // 刷新token
16 15 export const getRefreshToken = () => {
17   - return wsCache.get(RefreshTokenKey)
  16 + return Cookies.get(RefreshTokenKey)
18 17 }
19 18  
20 19 // 设置token
21 20 export const setToken = (token: TokenType) => {
22   - wsCache.set(RefreshTokenKey, token.refreshToken, { exp: token.expiresTime })
23   - wsCache.set(AccessTokenKey, token.accessToken)
  21 + Cookies.set(RefreshTokenKey, token.refreshToken, token.expiresTime)
  22 + Cookies.set(AccessTokenKey, token.accessToken)
24 23 }
25 24  
26 25 // 删除token
27 26 export const removeToken = () => {
28   - wsCache.delete(AccessTokenKey)
29   - wsCache.delete(RefreshTokenKey)
  27 + Cookies.remove(AccessTokenKey)
  28 + Cookies.remove(RefreshTokenKey)
  29 +}
  30 +
  31 +/** 格式化token(jwt格式) */
  32 +export const formatToken = (token: string): string => {
  33 + return 'Bearer ' + token
30 34 }
31 35 // ========== 账号相关 ==========
32 36  
... ... @@ -35,40 +39,40 @@ const PasswordKey = 'PASSWORD'
35 39 const RememberMeKey = 'REMEMBER_ME'
36 40  
37 41 export const getUsername = () => {
38   - return wsCache.get(UsernameKey)
  42 + return Cookies.get(UsernameKey)
39 43 }
40 44  
41 45 export const setUsername = (username: string) => {
42   - wsCache.set(UsernameKey, username)
  46 + Cookies.set(UsernameKey, username)
43 47 }
44 48  
45 49 export const removeUsername = () => {
46   - wsCache.delete(UsernameKey)
  50 + Cookies.remove(UsernameKey)
47 51 }
48 52  
49 53 export const getPassword = () => {
50   - const password = wsCache.get(PasswordKey)
  54 + const password = Cookies.get(PasswordKey)
51 55 return password ? decrypt(password) : undefined
52 56 }
53 57  
54 58 export const setPassword = (password: string) => {
55   - wsCache.set(PasswordKey, encrypt(password))
  59 + Cookies.set(PasswordKey, encrypt(password))
56 60 }
57 61  
58 62 export const removePassword = () => {
59   - wsCache.delete(PasswordKey)
  63 + Cookies.remove(PasswordKey)
60 64 }
61 65  
62 66 export const getRememberMe = () => {
63   - return wsCache.get(RememberMeKey) === 'true'
  67 + return Cookies.get(RememberMeKey) === 'true'
64 68 }
65 69  
66 70 export const setRememberMe = (rememberMe: string) => {
67   - wsCache.set(RememberMeKey, rememberMe)
  71 + Cookies.set(RememberMeKey, rememberMe)
68 72 }
69 73  
70 74 export const removeRememberMe = () => {
71   - wsCache.delete(RememberMeKey)
  75 + Cookies.remove(RememberMeKey)
72 76 }
73 77  
74 78 // ========== 租户相关 ==========
... ... @@ -77,25 +81,25 @@ const TenantIdKey = 'TENANT_ID'
77 81 const TenantNameKey = 'TENANT_NAME'
78 82  
79 83 export const getTenantName = () => {
80   - return wsCache.get(TenantNameKey)
  84 + return Cookies.get(TenantNameKey)
81 85 }
82 86  
83 87 export const setTenantName = (username: string) => {
84   - wsCache.set(TenantNameKey, username)
  88 + Cookies.set(TenantNameKey, username)
85 89 }
86 90  
87 91 export const removeTenantName = () => {
88   - wsCache.delete(TenantNameKey)
  92 + Cookies.remove(TenantNameKey)
89 93 }
90 94  
91 95 export const getTenantId = () => {
92   - return wsCache.get(TenantIdKey)
  96 + return Cookies.get(TenantIdKey)
93 97 }
94 98  
95 99 export const setTenantId = (username: string) => {
96   - wsCache.set(TenantIdKey, username)
  100 + Cookies.set(TenantIdKey, username)
97 101 }
98 102  
99 103 export const removeTenantId = () => {
100   - wsCache.delete(TenantIdKey)
  104 + Cookies.remove(TenantIdKey)
101 105 }
... ...
yudao-ui-admin-vue3/src/views/bpm/form/index.vue
... ... @@ -94,7 +94,7 @@ getList()
94 94 <ContentWrap>
95 95 <!-- 操作工具栏 -->
96 96 <div class="mb-10px">
97   - <el-button type="primary" v-hasPermi="['bpm:form:create']" @click="handleCreate">
  97 + <el-button type="primary" v-hasPermi="['bpm:form:create']" @click="handleCreate()">
98 98 <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
99 99 </el-button>
100 100 </div>
... ... @@ -152,15 +152,16 @@ getList()
152 152 />
153 153 <!-- 操作按钮 -->
154 154 <template #footer>
155   - <el-button
  155 + <!-- 按钮:保存 -->
  156 + <XButton
156 157 v-if="['create', 'update'].includes(actionType)"
157 158 type="primary"
  159 + :title="t('action.save')"
158 160 :loading="actionLoading"
159   - @click="submitForm"
160   - >
161   - {{ t('action.save') }}
162   - </el-button>
163   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  161 + @click="submitForm()"
  162 + />
  163 + <!-- 按钮:关闭 -->
  164 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
164 165 </template>
165 166 </XModal>
166 167 </template>
... ...
yudao-ui-admin-vue3/src/views/bpm/group/index.vue
... ... @@ -118,7 +118,7 @@ onMounted(async () =&gt; {
118 118 <ContentWrap>
119 119 <!-- 操作工具栏 -->
120 120 <div class="mb-10px">
121   - <el-button type="primary" v-hasPermi="['bpm:user-group:create']" @click="handleCreate">
  121 + <el-button type="primary" v-hasPermi="['bpm:user-group:create']" @click="handleCreate()">
122 122 <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
123 123 </el-button>
124 124 </div>
... ... @@ -206,17 +206,17 @@ onMounted(async () =&gt; {
206 206 </span>
207 207 </template>
208 208 </Descriptions>
209   - <!-- 操作按钮 -->
210 209 <template #footer>
211   - <el-button
  210 + <!-- 按钮:保存 -->
  211 + <XButton
212 212 v-if="['create', 'update'].includes(actionType)"
213 213 type="primary"
  214 + :title="t('action.save')"
214 215 :loading="actionLoading"
215   - @click="submitForm"
216   - >
217   - {{ t('action.save') }}
218   - </el-button>
219   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  216 + @click="submitForm()"
  217 + />
  218 + <!-- 按钮:关闭 -->
  219 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
220 220 </template>
221 221 </XModal>
222 222 </template>
... ...
yudao-ui-admin-vue3/src/views/bpm/model/index.vue
... ... @@ -113,7 +113,7 @@ getList()
113 113 <ContentWrap>
114 114 <!-- 操作工具栏 -->
115 115 <div class="mb-10px">
116   - <el-button type="primary" v-hasPermi="['bpm:model:create']" @click="handleCreate">
  116 + <el-button type="primary" v-hasPermi="['bpm:model:create']" @click="handleCreate()">
117 117 <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
118 118 </el-button>
119 119 </div>
... ... @@ -202,15 +202,16 @@ getList()
202 202 />
203 203 <!-- 操作按钮 -->
204 204 <template #footer>
205   - <el-button
  205 + <!-- 按钮:保存 -->
  206 + <XButton
206 207 v-if="['create', 'update'].includes(actionType)"
207 208 type="primary"
  209 + :title="t('action.save')"
208 210 :loading="actionLoading"
209   - @click="submitForm"
210   - >
211   - {{ t('action.save') }}
212   - </el-button>
213   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  211 + @click="submitForm()"
  212 + />
  213 + <!-- 按钮:关闭 -->
  214 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
214 215 </template>
215 216 </XModal>
216 217 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
... ... @@ -2,7 +2,7 @@
2 2 import { ref, unref, onMounted } from 'vue'
3 3 import { ContentDetailWrap } from '@/components/ContentDetailWrap'
4 4 import { BasicInfoForm, CloumInfoForm, GenInfoForm } from './components'
5   -import { ElTabs, ElTabPane, ElButton, ElMessage } from 'element-plus'
  5 +import { ElTabs, ElTabPane, ElMessage } from 'element-plus'
6 6 import { getCodegenTableApi, updateCodegenTableApi } from '@/api/infra/codegen'
7 7 import { useRouter, useRoute } from 'vue-router'
8 8 import { useI18n } from '@/hooks/web/useI18n'
... ... @@ -70,9 +70,7 @@ onMounted(() =&gt; {
70 70 </el-tab-pane>
71 71 </el-tabs>
72 72 <template #right>
73   - <el-button type="primary" :loading="loading" @click="submitForm">
74   - {{ t('action.save') }}
75   - </el-button>
  73 + <XButton type="primary" :title="t('action.save')" :loading="loading" @click="submitForm()" />
76 74 </template>
77 75 </ContentDetailWrap>
78 76 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/config/index.vue
... ... @@ -178,15 +178,16 @@ getList()
178 178 </Descriptions>
179 179 <!-- 操作按钮 -->
180 180 <template #footer>
181   - <el-button
  181 + <!-- 按钮:保存 -->
  182 + <XButton
182 183 v-if="['create', 'update'].includes(actionType)"
183 184 type="primary"
  185 + :title="t('action.save')"
184 186 :loading="actionLoading"
185   - @click="submitForm"
186   - >
187   - {{ t('action.save') }}
188   - </el-button>
189   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  187 + @click="submitForm()"
  188 + />
  189 + <!-- 按钮:关闭 -->
  190 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
190 191 </template>
191 192 </XModal>
192 193 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/index.vue
... ... @@ -147,15 +147,16 @@ onMounted(async () =&gt; {
147 147 />
148 148 <!-- 操作按钮 -->
149 149 <template #footer>
150   - <el-button
  150 + <!-- 按钮:保存 -->
  151 + <XButton
151 152 v-if="['create', 'update'].includes(actionType)"
152 153 type="primary"
  154 + :title="t('action.save')"
153 155 :loading="loading"
154   - @click="submitForm"
155   - >
156   - {{ t('action.save') }}
157   - </el-button>
158   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  156 + @click="submitForm()"
  157 + />
  158 + <!-- 按钮:关闭 -->
  159 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
159 160 </template>
160 161 </XModal>
161 162 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
... ... @@ -192,15 +192,16 @@ getList()
192 192 />
193 193 <!-- 操作按钮 -->
194 194 <template #footer>
195   - <el-button
  195 + <!-- 按钮:保存 -->
  196 + <XButton
196 197 v-if="['create', 'update'].includes(actionType)"
197 198 type="primary"
  199 + :title="t('action.save')"
198 200 :loading="actionLoading"
199   - @click="submitForm"
200   - >
201   - {{ t('action.save') }}
202   - </el-button>
203   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  201 + @click="submitForm()"
  202 + />
  203 + <!-- 按钮:关闭 -->
  204 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
204 205 </template>
205 206 </XModal>
206 207 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/job/index.vue
... ... @@ -235,15 +235,16 @@ getList()
235 235 </Descriptions>
236 236 <!-- 操作按钮 -->
237 237 <template #footer>
238   - <el-button
  238 + <!-- 按钮:保存 -->
  239 + <XButton
239 240 v-if="['create', 'update'].includes(actionType)"
240 241 type="primary"
  242 + :title="t('action.save')"
241 243 :loading="actionLoading"
242   - @click="submitForm"
243   - >
244   - {{ t('action.save') }}
245   - </el-button>
246   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  244 + @click="submitForm()"
  245 + />
  246 + <!-- 按钮:关闭 -->
  247 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
247 248 </template>
248 249 </XModal>
249 250 </template>
... ...
yudao-ui-admin-vue3/src/views/pay/app/index.vue
... ... @@ -171,15 +171,16 @@ getList()
171 171 />
172 172 <!-- 操作按钮 -->
173 173 <template #footer>
174   - <el-button
  174 + <!-- 按钮:保存 -->
  175 + <XButton
175 176 v-if="['create', 'update'].includes(actionType)"
176 177 type="primary"
  178 + :title="t('action.save')"
177 179 :loading="actionLoading"
178   - @click="submitForm"
179   - >
180   - {{ t('action.save') }}
181   - </el-button>
182   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  180 + @click="submitForm()"
  181 + />
  182 + <!-- 按钮:关闭 -->
  183 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
183 184 </template>
184 185 </XModal>
185 186 </template>
... ...
yudao-ui-admin-vue3/src/views/pay/merchant/index.vue
... ... @@ -171,15 +171,16 @@ getList()
171 171 />
172 172 <!-- 操作按钮 -->
173 173 <template #footer>
174   - <el-button
  174 + <!-- 按钮:保存 -->
  175 + <XButton
175 176 v-if="['create', 'update'].includes(actionType)"
176 177 type="primary"
  178 + :title="t('action.save')"
177 179 :loading="actionLoading"
178   - @click="submitForm"
179   - >
180   - {{ t('action.save') }}
181   - </el-button>
182   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  180 + @click="submitForm()"
  181 + />
  182 + <!-- 按钮:关闭 -->
  183 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
183 184 </template>
184 185 </XModal>
185 186 </template>
... ...
yudao-ui-admin-vue3/src/views/pay/order/index.vue
... ... @@ -155,15 +155,16 @@ getList()
155 155 />
156 156 <!-- 操作按钮 -->
157 157 <template #footer>
158   - <el-button
  158 + <!-- 按钮:保存 -->
  159 + <XButton
159 160 v-if="['create', 'update'].includes(actionType)"
160 161 type="primary"
  162 + :title="t('action.save')"
161 163 :loading="actionLoading"
162   - @click="submitForm"
163   - >
164   - {{ t('action.save') }}
165   - </el-button>
166   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  164 + @click="submitForm()"
  165 + />
  166 + <!-- 按钮:关闭 -->
  167 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
167 168 </template>
168 169 </XModal>
169 170 </template>
... ...
yudao-ui-admin-vue3/src/views/system/dept/index.vue
... ... @@ -48,7 +48,7 @@ const getUserList = async () =&gt; {
48 48 userOption.value = res
49 49 }
50 50 // 新增
51   -const handleAdd = (data: { id: number }) => {
  51 +const handleCreate = (data: { id: number }) => {
52 52 // 重置表单
53 53 deptParentId.value = data.id
54 54 formTitle.value = '新增部门'
... ... @@ -110,9 +110,13 @@ onMounted(async () =&gt; {
110 110 <template #header>
111 111 <div class="card-header">
112 112 <span>部门列表</span>
113   - <el-button type="primary" v-hasPermi="['system:dept:create']" @click="handleAdd">
114   - 新增根节点
115   - </el-button>
  113 + <XButton
  114 + type="primary"
  115 + preIcon="ep:zoom-in"
  116 + title="新增根节点"
  117 + v-hasPermi="['system:dept:create']"
  118 + @click="handleCreate"
  119 + />
116 120 </div>
117 121 </template>
118 122 <div class="custom-tree-container">
... ... @@ -133,30 +137,24 @@ onMounted(async () =&gt; {
133 137 <span class="custom-tree-node">
134 138 <span>{{ node.label }}</span>
135 139 <span>
136   - <el-button
137   - link
138   - type="primary"
  140 + <XTextButton
  141 + preIcon="ep:zoom-in"
  142 + :title="t('action.add')"
139 143 v-hasPermi="['system:dept:create']"
140   - @click="handleAdd(data)"
141   - >
142   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
143   - </el-button>
144   - <el-button
145   - link
146   - type="primary"
  144 + @click="handleCreate(data)"
  145 + />
  146 + <XTextButton
  147 + preIcon="ep:edit"
  148 + :title="t('action.edit')"
147 149 v-hasPermi="['system:dept:update']"
148 150 @click="handleUpdate(data)"
149   - >
150   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
151   - </el-button>
152   - <el-button
153   - link
154   - type="primary"
  151 + />
  152 + <XTextButton
  153 + preIcon="ep:delete"
  154 + :title="t('action.del')"
155 155 v-hasPermi="['system:dept:delete']"
156 156 @click="handleDelete(data)"
157   - >
158   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
159   - </el-button>
  157 + />
160 158 </span>
161 159 </span>
162 160 </template>
... ... @@ -195,16 +193,16 @@ onMounted(async () =&gt; {
195 193 </el-select>
196 194 </template>
197 195 </Form>
198   - <!-- 操作按钮 -->
199   - <el-button
  196 + <!-- 按钮:保存 -->
  197 + <XButton
200 198 type="primary"
  199 + :title="t('action.save')"
201 200 v-hasPermi="['system:dept:update']"
202 201 :loading="loading"
203   - @click="submitForm"
204   - >
205   - {{ t('action.save') }}
206   - </el-button>
207   - <el-button type="danger" @click="showForm = false">{{ t('common.cancel') }}</el-button>
  202 + @click="submitForm()"
  203 + />
  204 + <!-- 按钮:关闭 -->
  205 + <XButton :loading="loading" :title="t('dialog.close')" @click="showForm = false" />
208 206 </div>
209 207 </el-card>
210 208 </div>
... ...
yudao-ui-admin-vue3/src/views/system/errorCode/index.vue
... ... @@ -59,7 +59,7 @@
59 59 type="primary"
60 60 :title="t('action.save')"
61 61 :loading="actionLoading"
62   - @click="submitForm"
  62 + @click="submitForm()"
63 63 />
64 64 <!-- 按钮:关闭 -->
65 65 <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
... ...
yudao-ui-admin-vue3/src/views/system/menu/index.vue
... ... @@ -234,7 +234,7 @@
234 234 v-if="['create', 'update'].includes(actionType)"
235 235 type="primary"
236 236 :loading="actionLoading"
237   - @click="submitForm"
  237 + @click="submitForm()"
238 238 :title="t('action.save')"
239 239 />
240 240 <!-- 按钮:关闭 -->
... ...
yudao-ui-admin-vue3/src/views/system/notice/index.vue
... ... @@ -59,7 +59,7 @@
59 59 type="primary"
60 60 :title="t('action.save')"
61 61 :loading="actionLoading"
62   - @click="submitForm"
  62 + @click="submitForm()"
63 63 />
64 64 <!-- 按钮:关闭 -->
65 65 <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue
... ... @@ -69,7 +69,7 @@
69 69 type="primary"
70 70 :title="t('action.save')"
71 71 :loading="actionLoading"
72   - @click="submitForm"
  72 + @click="submitForm()"
73 73 />
74 74 <!-- 按钮:关闭 -->
75 75 <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
... ...
yudao-ui-admin-vue3/src/views/system/oauth2/token/index.vue
... ... @@ -20,7 +20,7 @@
20 20 <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
21 21 <!-- 操作按钮 -->
22 22 <template #footer>
23   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  23 + <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
24 24 </template>
25 25 </XModal>
26 26 </template>
... ...
yudao-ui-admin-vue3/src/views/system/post/index.vue
... ... @@ -66,7 +66,7 @@
66 66 type="primary"
67 67 :title="t('action.save')"
68 68 :loading="actionLoading"
69   - @click="submitForm"
  69 + @click="submitForm()"
70 70 />
71 71 <!-- 按钮:关闭 -->
72 72 <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
... ...
yudao-ui-admin-vue3/src/views/system/role/index.vue
  1 +<template>
  2 + <!-- 搜索工作区 -->
  3 + <ContentWrap>
  4 + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  5 + </ContentWrap>
  6 + <ContentWrap>
  7 + <!-- 操作工具栏 -->
  8 + <div class="mb-10px">
  9 + <XButton
  10 + type="primary"
  11 + preIcon="ep:zoom-in"
  12 + :title="t('action.add')"
  13 + v-hasPermi="['system:role:create']"
  14 + @click="handleCreate()"
  15 + />
  16 + </div>
  17 + <!-- 列表 -->
  18 + <Table
  19 + :columns="allSchemas.tableColumns"
  20 + :selection="false"
  21 + :data="tableObject.tableList"
  22 + :loading="tableObject.loading"
  23 + :pagination="{
  24 + total: tableObject.total
  25 + }"
  26 + v-model:pageSize="tableObject.pageSize"
  27 + v-model:currentPage="tableObject.currentPage"
  28 + @register="register"
  29 + >
  30 + <template #type="{ row }">
  31 + <DictTag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="row.type" />
  32 + </template>
  33 + <template #status="{ row }">
  34 + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  35 + </template>
  36 + <template #createTime="{ row }">
  37 + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  38 + </template>
  39 + <template #action="{ row }">
  40 + <XTextButton
  41 + preIcon="ep:edit"
  42 + :title="t('action.edit')"
  43 + v-hasPermi="['system:role:update']"
  44 + @click="handleUpdate(row.id)"
  45 + />
  46 + <XTextButton
  47 + preIcon="ep:view"
  48 + :title="t('action.detail')"
  49 + v-hasPermi="['system:role:update']"
  50 + @click="handleDetail(row.id)"
  51 + />
  52 + <XTextButton
  53 + preIcon="ep:basketball"
  54 + title="菜单权限"
  55 + v-hasPermi="['system:permission:assign-role-menu']"
  56 + @click="handleScope('menu', row)"
  57 + />
  58 + <XTextButton
  59 + preIcon="ep:coin"
  60 + title="数据权限"
  61 + v-hasPermi="['system:permission:assign-role-data-scope']"
  62 + @click="handleScope('data', row)"
  63 + />
  64 + <XTextButton
  65 + preIcon="ep:delete"
  66 + :title="t('action.del')"
  67 + v-hasPermi="['system:role:delete']"
  68 + @click="delList(row.id, false)"
  69 + />
  70 + </template>
  71 + </Table>
  72 + </ContentWrap>
  73 +
  74 + <XModal v-model="dialogVisible" :title="dialogTitle">
  75 + <!-- 对话框(添加 / 修改) -->
  76 + <Form
  77 + v-if="['create', 'update'].includes(actionType)"
  78 + :schema="allSchemas.formSchema"
  79 + :rules="rules"
  80 + ref="formRef"
  81 + />
  82 + <!-- 对话框(详情) -->
  83 + <Descriptions
  84 + v-if="actionType === 'detail'"
  85 + :schema="allSchemas.detailSchema"
  86 + :data="detailRef"
  87 + />
  88 + <!-- 操作按钮 -->
  89 + <template #footer>
  90 + <XButton
  91 + v-if="['create', 'update'].includes(actionType)"
  92 + type="primary"
  93 + :title="t('action.save')"
  94 + :loading="loading"
  95 + @click="submitForm()"
  96 + />
  97 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
  98 + </template>
  99 + </XModal>
  100 + <XModal v-model="dialogScopeVisible" :title="dialogScopeTitle">
  101 + <el-form :model="dataScopeForm">
  102 + <el-form-item label="角色名称">
  103 + <el-input v-model="dataScopeForm.name" :disabled="true" />
  104 + </el-form-item>
  105 + <el-form-item label="角色标识">
  106 + <el-input v-model="dataScopeForm.code" :disabled="true" />
  107 + </el-form-item>
  108 + <!-- 分配角色的数据权限对话框 -->
  109 + <el-form-item label="权限范围" v-if="actionScopeType === 'data'">
  110 + <el-select v-model="dataScopeForm.dataScope">
  111 + <el-option
  112 + v-for="item in dataScopeDictDatas"
  113 + :key="parseInt(item.value)"
  114 + :label="item.label"
  115 + :value="parseInt(item.value)"
  116 + />
  117 + </el-select>
  118 + </el-form-item>
  119 + <!-- 分配角色的菜单权限对话框 -->
  120 + <el-form-item
  121 + label="权限范围"
  122 + v-if="
  123 + actionScopeType === 'menu' || dataScopeForm.dataScope === SystemDataScopeEnum.DEPT_CUSTOM
  124 + "
  125 + >
  126 + <el-card class="box-card">
  127 + <template #header>
  128 + 父子联动(选中父节点,自动选择子节点):
  129 + <el-switch v-model="checkStrictly" inline-prompt active-text="是" inactive-text="否" />
  130 + 全选/全不选:
  131 + <el-switch
  132 + v-model="treeNodeAll"
  133 + inline-prompt
  134 + active-text="是"
  135 + inactive-text="否"
  136 + @change="handleCheckedTreeNodeAll()"
  137 + />
  138 + </template>
  139 + <el-tree
  140 + ref="treeRef"
  141 + node-key="id"
  142 + show-checkbox
  143 + :default-checked-keys="defaultCheckedKeys"
  144 + :check-strictly="!checkStrictly"
  145 + :props="defaultProps"
  146 + :data="treeOptions"
  147 + empty-text="加载中,请稍后"
  148 + />
  149 + </el-card>
  150 + </el-form-item>
  151 + </el-form>
  152 + <!-- 操作按钮 -->
  153 + <template #footer>
  154 + <XButton type="primary" :title="t('action.save')" :loading="loading" @click="submitScope()" />
  155 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogScopeVisible = false" />
  156 + </template>
  157 + </XModal>
  158 +</template>
1 159 <script setup lang="ts">
2 160 import { onMounted, reactive, ref, unref } from 'vue'
3 161 import dayjs from 'dayjs'
... ... @@ -57,10 +215,10 @@ const handleCreate = () =&gt; {
57 215 }
58 216  
59 217 // 修改操作
60   -const handleUpdate = async (row: RoleVO) => {
  218 +const handleUpdate = async (rowId: number) => {
61 219 setDialogTile('update')
62 220 // 设置数据
63   - const res = await RoleApi.getRoleApi(row.id)
  221 + const res = await RoleApi.getRoleApi(rowId)
64 222 unref(formRef)?.setValues(res)
65 223 }
66 224  
... ... @@ -183,171 +341,3 @@ onMounted(() =&gt; {
183 341 init()
184 342 })
185 343 </script>
186   -
187   -<template>
188   - <!-- 搜索工作区 -->
189   - <ContentWrap>
190   - <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
191   - </ContentWrap>
192   - <ContentWrap>
193   - <!-- 操作工具栏 -->
194   - <div class="mb-10px">
195   - <el-button type="primary" v-hasPermi="['system:role:create']" @click="handleCreate">
196   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
197   - </el-button>
198   - </div>
199   - <!-- 列表 -->
200   - <Table
201   - :columns="allSchemas.tableColumns"
202   - :selection="false"
203   - :data="tableObject.tableList"
204   - :loading="tableObject.loading"
205   - :pagination="{
206   - total: tableObject.total
207   - }"
208   - v-model:pageSize="tableObject.pageSize"
209   - v-model:currentPage="tableObject.currentPage"
210   - @register="register"
211   - >
212   - <template #type="{ row }">
213   - <DictTag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="row.type" />
214   - </template>
215   - <template #status="{ row }">
216   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
217   - </template>
218   - <template #createTime="{ row }">
219   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
220   - </template>
221   - <template #action="{ row }">
222   - <el-button
223   - link
224   - type="primary"
225   - v-hasPermi="['system:role:update']"
226   - @click="handleUpdate(row)"
227   - >
228   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
229   - </el-button>
230   - <el-button
231   - link
232   - type="primary"
233   - v-hasPermi="['system:role:update']"
234   - @click="handleDetail(row)"
235   - >
236   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
237   - </el-button>
238   - <el-button
239   - link
240   - type="primary"
241   - v-hasPermi="['system:permission:assign-role-menu']"
242   - @click="handleScope('menu', row)"
243   - >
244   - <Icon icon="ep:basketball" class="mr-1px" /> 菜单权限
245   - </el-button>
246   - <el-button
247   - link
248   - type="primary"
249   - v-hasPermi="['system:permission:assign-role-data-scope']"
250   - @click="handleScope('data', row)"
251   - >
252   - <Icon icon="ep:coin" class="mr-1px" /> 数据权限
253   - </el-button>
254   - <el-button
255   - link
256   - type="primary"
257   - v-hasPermi="['system:role:delete']"
258   - @click="delList(row.id, false)"
259   - >
260   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
261   - </el-button>
262   - </template>
263   - </Table>
264   - </ContentWrap>
265   -
266   - <XModal v-model="dialogVisible" :title="dialogTitle">
267   - <!-- 对话框(添加 / 修改) -->
268   - <Form
269   - v-if="['create', 'update'].includes(actionType)"
270   - :schema="allSchemas.formSchema"
271   - :rules="rules"
272   - ref="formRef"
273   - />
274   - <!-- 对话框(详情) -->
275   - <Descriptions
276   - v-if="actionType === 'detail'"
277   - :schema="allSchemas.detailSchema"
278   - :data="detailRef"
279   - />
280   - <!-- 操作按钮 -->
281   - <template #footer>
282   - <el-button
283   - v-if="['create', 'update'].includes(actionType)"
284   - type="primary"
285   - :loading="loading"
286   - @click="submitForm"
287   - >
288   - {{ t('action.save') }}
289   - </el-button>
290   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
291   - </template>
292   - </XModal>
293   - <XModal v-model="dialogScopeVisible" :title="dialogScopeTitle">
294   - <el-form :model="dataScopeForm">
295   - <el-form-item label="角色名称">
296   - <el-input v-model="dataScopeForm.name" :disabled="true" />
297   - </el-form-item>
298   - <el-form-item label="角色标识">
299   - <el-input v-model="dataScopeForm.code" :disabled="true" />
300   - </el-form-item>
301   - <!-- 分配角色的数据权限对话框 -->
302   - <el-form-item label="权限范围" v-if="actionScopeType === 'data'">
303   - <el-select v-model="dataScopeForm.dataScope">
304   - <el-option
305   - v-for="item in dataScopeDictDatas"
306   - :key="parseInt(item.value)"
307   - :label="item.label"
308   - :value="parseInt(item.value)"
309   - />
310   - </el-select>
311   - </el-form-item>
312   - <!-- 分配角色的菜单权限对话框 -->
313   - <el-form-item
314   - label="权限范围"
315   - v-if="
316   - actionScopeType === 'menu' || dataScopeForm.dataScope === SystemDataScopeEnum.DEPT_CUSTOM
317   - "
318   - >
319   - <el-card class="box-card">
320   - <template #header>
321   - 父子联动(选中父节点,自动选择子节点):
322   - <el-switch v-model="checkStrictly" inline-prompt active-text="是" inactive-text="否" />
323   - 全选/全不选:
324   - <el-switch
325   - v-model="treeNodeAll"
326   - inline-prompt
327   - active-text="是"
328   - inactive-text="否"
329   - @change="handleCheckedTreeNodeAll()"
330   - />
331   - </template>
332   - <el-tree
333   - ref="treeRef"
334   - node-key="id"
335   - show-checkbox
336   - :default-checked-keys="defaultCheckedKeys"
337   - :check-strictly="!checkStrictly"
338   - :props="defaultProps"
339   - :data="treeOptions"
340   - empty-text="加载中,请稍后"
341   - />
342   - </el-card>
343   - </el-form-item>
344   - </el-form>
345   - <!-- 操作按钮 -->
346   - <template #footer>
347   - <el-button type="primary" :loading="loading" @click="submitScope">
348   - {{ t('action.save') }}
349   - </el-button>
350   - <el-button @click="dialogScopeVisible = false">{{ t('dialog.close') }}</el-button>
351   - </template>
352   - </XModal>
353   -</template>
... ...
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
  1 +<template>
  2 + <!-- 搜索工作区 -->
  3 + <ContentWrap>
  4 + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  5 + </ContentWrap>
  6 + <ContentWrap>
  7 + <!-- 操作工具栏 -->
  8 + <div class="mb-10px">
  9 + <XButton
  10 + type="primary"
  11 + preIcon="ep:zoom-in"
  12 + :title="t('action.add')"
  13 + v-hasPermi="['system:sensitive-word:create']"
  14 + @click="handleCreate()"
  15 + />
  16 + <XButton
  17 + type="warning"
  18 + preIcon="ep:download"
  19 + :title="t('action.export')"
  20 + v-hasPermi="['system:sensitive-word:export']"
  21 + @click="exportList('敏感词数据.xls')"
  22 + />
  23 + </div>
  24 + <!-- 列表 -->
  25 + <Table
  26 + :columns="allSchemas.tableColumns"
  27 + :selection="false"
  28 + :data="tableObject.tableList"
  29 + :loading="tableObject.loading"
  30 + :pagination="{
  31 + total: tableObject.total
  32 + }"
  33 + v-model:pageSize="tableObject.pageSize"
  34 + v-model:currentPage="tableObject.currentPage"
  35 + @register="register"
  36 + >
  37 + <template #tags="{ row }">
  38 + <el-tag
  39 + :disable-transitions="true"
  40 + :key="index"
  41 + v-for="(tag, index) in row.tags"
  42 + :index="index"
  43 + >
  44 + {{ tag }}
  45 + </el-tag>
  46 + </template>
  47 + <template #status="{ row }">
  48 + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  49 + </template>
  50 + <template #createTime="{ row }">
  51 + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  52 + </template>
  53 + <template #action="{ row }">
  54 + <!-- 操作:修改 -->
  55 + <XTextButton
  56 + preIcon="ep:edit"
  57 + :title="t('action.edit')"
  58 + v-hasPermi="['system:sensitive-word:update']"
  59 + @click="handleUpdate(row.id)"
  60 + />
  61 + <!-- 操作:详情 -->
  62 + <XTextButton
  63 + preIcon="ep:view"
  64 + :title="t('action.detail')"
  65 + v-hasPermi="['system:sensitive-word:update']"
  66 + @click="handleDetail(row)"
  67 + />
  68 + <!-- 操作:删除 -->
  69 + <XTextButton
  70 + preIcon="ep:delete"
  71 + :title="t('action.del')"
  72 + v-hasPermi="['system:sensitive-word:delete']"
  73 + @click="delList(row.id, false)"
  74 + />
  75 + </template>
  76 + </Table>
  77 + </ContentWrap>
  78 +
  79 + <XModal v-model="dialogVisible" :title="dialogTitle">
  80 + <!-- 对话框(添加 / 修改) -->
  81 + <Form
  82 + v-if="['create', 'update'].includes(actionType)"
  83 + :schema="allSchemas.formSchema"
  84 + :rules="rules"
  85 + ref="formRef"
  86 + >
  87 + <template #tags>
  88 + <el-select v-model="tags" multiple placeholder="请选择">
  89 + <el-option v-for="item in tagsOptions" :key="item" :label="item" :value="item" />
  90 + </el-select>
  91 + </template>
  92 + </Form>
  93 + <!-- 对话框(详情) -->
  94 + <Descriptions
  95 + v-if="actionType === 'detail'"
  96 + :schema="allSchemas.detailSchema"
  97 + :data="detailRef"
  98 + />
  99 + <!-- 操作按钮 -->
  100 + <template #footer>
  101 + <!-- 按钮:保存 -->
  102 + <XButton
  103 + v-if="['create', 'update'].includes(actionType)"
  104 + type="primary"
  105 + :title="t('action.save')"
  106 + :loading="actionLoading"
  107 + @click="submitForm()"
  108 + />
  109 + <!-- 按钮:关闭 -->
  110 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
  111 + </template>
  112 + </XModal>
  113 +</template>
1 114 <script setup lang="ts">
2 115 import { onMounted, ref, unref } from 'vue'
3 116 import dayjs from 'dayjs'
... ... @@ -45,10 +158,10 @@ const handleCreate = () =&gt; {
45 158 }
46 159  
47 160 // 修改操作
48   -const handleUpdate = async (row: SensitiveWordVO) => {
  161 +const handleUpdate = async (rowId: number) => {
49 162 setDialogTile('update')
50 163 // 设置数据
51   - const res = await SensitiveWordApi.getSensitiveWordApi(row.id)
  164 + const res = await SensitiveWordApi.getSensitiveWordApi(rowId)
52 165 unref(formRef)?.setValues(res)
53 166 }
54 167  
... ... @@ -95,116 +208,3 @@ onMounted(async () =&gt; {
95 208 await getList()
96 209 })
97 210 </script>
98   -
99   -<template>
100   - <!-- 搜索工作区 -->
101   - <ContentWrap>
102   - <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
103   - </ContentWrap>
104   - <ContentWrap>
105   - <!-- 操作工具栏 -->
106   - <div class="mb-10px">
107   - <el-button type="primary" v-hasPermi="['system:post:create']" @click="handleCreate">
108   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
109   - </el-button>
110   - <el-button
111   - type="warning"
112   - v-hasPermi="['system:post:export']"
113   - :loading="tableObject.exportLoading"
114   - @click="exportList('敏感词数据.xls')"
115   - >
116   - <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
117   - </el-button>
118   - </div>
119   - <!-- 列表 -->
120   - <Table
121   - :columns="allSchemas.tableColumns"
122   - :selection="false"
123   - :data="tableObject.tableList"
124   - :loading="tableObject.loading"
125   - :pagination="{
126   - total: tableObject.total
127   - }"
128   - v-model:pageSize="tableObject.pageSize"
129   - v-model:currentPage="tableObject.currentPage"
130   - @register="register"
131   - >
132   - <template #tags="{ row }">
133   - <el-tag
134   - :disable-transitions="true"
135   - :key="index"
136   - v-for="(tag, index) in row.tags"
137   - :index="index"
138   - >
139   - {{ tag }}
140   - </el-tag>
141   - </template>
142   - <template #status="{ row }">
143   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
144   - </template>
145   - <template #createTime="{ row }">
146   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
147   - </template>
148   - <template #action="{ row }">
149   - <el-button
150   - link
151   - type="primary"
152   - v-hasPermi="['system:post:update']"
153   - @click="handleUpdate(row)"
154   - >
155   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
156   - </el-button>
157   - <el-button
158   - link
159   - type="primary"
160   - v-hasPermi="['system:post:update']"
161   - @click="handleDetail(row)"
162   - >
163   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
164   - </el-button>
165   - <el-button
166   - link
167   - type="primary"
168   - v-hasPermi="['system:post:delete']"
169   - @click="delList(row.id, false)"
170   - >
171   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
172   - </el-button>
173   - </template>
174   - </Table>
175   - </ContentWrap>
176   -
177   - <XModal v-model="dialogVisible" :title="dialogTitle">
178   - <!-- 对话框(添加 / 修改) -->
179   - <Form
180   - v-if="['create', 'update'].includes(actionType)"
181   - :schema="allSchemas.formSchema"
182   - :rules="rules"
183   - ref="formRef"
184   - >
185   - <template #tags>
186   - <el-select v-model="tags" multiple placeholder="请选择">
187   - <el-option v-for="item in tagsOptions" :key="item" :label="item" :value="item" />
188   - </el-select>
189   - </template>
190   - </Form>
191   - <!-- 对话框(详情) -->
192   - <Descriptions
193   - v-if="actionType === 'detail'"
194   - :schema="allSchemas.detailSchema"
195   - :data="detailRef"
196   - />
197   - <!-- 操作按钮 -->
198   - <template #footer>
199   - <el-button
200   - v-if="['create', 'update'].includes(actionType)"
201   - type="primary"
202   - :loading="actionLoading"
203   - @click="submitForm"
204   - >
205   - {{ t('action.save') }}
206   - </el-button>
207   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
208   - </template>
209   - </XModal>
210   -</template>
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue
  1 +<template>
  2 + <!-- 搜索工作区 -->
  3 + <ContentWrap>
  4 + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  5 + </ContentWrap>
  6 + <ContentWrap>
  7 + <!-- 操作工具栏 -->
  8 + <div class="mb-10px">
  9 + <XButton
  10 + type="primary"
  11 + preIcon="ep:zoom-in"
  12 + :title="t('action.add')"
  13 + v-hasPermi="['system:sms-channel:create']"
  14 + @click="handleCreate()"
  15 + />
  16 + </div>
  17 + <!-- 列表 -->
  18 + <Table
  19 + :columns="allSchemas.tableColumns"
  20 + :selection="false"
  21 + :data="tableObject.tableList"
  22 + :loading="tableObject.loading"
  23 + :pagination="{
  24 + total: tableObject.total
  25 + }"
  26 + v-model:pageSize="tableObject.pageSize"
  27 + v-model:currentPage="tableObject.currentPage"
  28 + @register="register"
  29 + >
  30 + <template #code="{ row }">
  31 + <DictTag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="row.code" />
  32 + </template>
  33 + <template #status="{ row }">
  34 + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  35 + </template>
  36 + <template #createTime="{ row }">
  37 + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  38 + </template>
  39 + <template #action="{ row }">
  40 + <!-- 操作:修改 -->
  41 + <XTextButton
  42 + preIcon="ep:edit"
  43 + :title="t('action.edit')"
  44 + v-hasPermi="['system:sms-channel:update']"
  45 + @click="handleUpdate(row.id)"
  46 + />
  47 + <!-- 操作:详情 -->
  48 + <XTextButton
  49 + preIcon="ep:view"
  50 + :title="t('action.detail')"
  51 + v-hasPermi="['system:sms-channel:update']"
  52 + @click="handleDetail(row)"
  53 + />
  54 + <!-- 操作:删除 -->
  55 + <XTextButton
  56 + preIcon="ep:delete"
  57 + :title="t('action.del')"
  58 + v-hasPermi="['system:sms-channel:delete']"
  59 + @click="delList(row.id, false)"
  60 + />
  61 + </template>
  62 + </Table>
  63 + </ContentWrap>
  64 +
  65 + <XModal v-model="dialogVisible" :title="dialogTitle">
  66 + <!-- 对话框(添加 / 修改) -->
  67 + <Form
  68 + v-if="['create', 'update'].includes(actionType)"
  69 + :schema="allSchemas.formSchema"
  70 + :rules="rules"
  71 + ref="formRef"
  72 + />
  73 + <!-- 对话框(详情) -->
  74 + <Descriptions
  75 + v-if="actionType === 'detail'"
  76 + :schema="allSchemas.detailSchema"
  77 + :data="detailRef"
  78 + />
  79 + <!-- 操作按钮 -->
  80 + <template #footer>
  81 + <!-- 按钮:保存 -->
  82 + <XButton
  83 + v-if="['create', 'update'].includes(actionType)"
  84 + type="primary"
  85 + :title="t('action.save')"
  86 + :loading="loading"
  87 + @click="submitForm()"
  88 + />
  89 + <!-- 按钮:关闭 -->
  90 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
  91 + </template>
  92 + </XModal>
  93 +</template>
  94 +
1 95 <script setup lang="ts">
2 96 import { ref, unref } from 'vue'
3 97 import dayjs from 'dayjs'
... ... @@ -38,10 +132,10 @@ const handleCreate = () =&gt; {
38 132 }
39 133  
40 134 // 修改操作
41   -const handleUpdate = async (row: SmsChannelVO) => {
  135 +const handleUpdate = async (rowId: number) => {
42 136 setDialogTile('update')
43 137 // 设置数据
44   - const res = await SmsChannelApi.getSmsChannelApi(row.id)
  138 + const res = await SmsChannelApi.getSmsChannelApi(rowId)
45 139 unref(formRef)?.setValues(res)
46 140 }
47 141  
... ... @@ -85,95 +179,3 @@ const handleDetail = async (row: SmsChannelVO) =&gt; {
85 179 // ========== 初始化 ==========
86 180 getList()
87 181 </script>
88   -
89   -<template>
90   - <!-- 搜索工作区 -->
91   - <ContentWrap>
92   - <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
93   - </ContentWrap>
94   - <ContentWrap>
95   - <!-- 操作工具栏 -->
96   - <div class="mb-10px">
97   - <el-button type="primary" v-hasPermi="['system:sms-channel:create']" @click="handleCreate">
98   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
99   - </el-button>
100   - </div>
101   - <!-- 列表 -->
102   - <Table
103   - :columns="allSchemas.tableColumns"
104   - :selection="false"
105   - :data="tableObject.tableList"
106   - :loading="tableObject.loading"
107   - :pagination="{
108   - total: tableObject.total
109   - }"
110   - v-model:pageSize="tableObject.pageSize"
111   - v-model:currentPage="tableObject.currentPage"
112   - @register="register"
113   - >
114   - <template #code="{ row }">
115   - <DictTag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="row.code" />
116   - </template>
117   - <template #status="{ row }">
118   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
119   - </template>
120   - <template #createTime="{ row }">
121   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
122   - </template>
123   - <template #action="{ row }">
124   - <el-button
125   - link
126   - type="primary"
127   - v-hasPermi="['system:sms-channel:update']"
128   - @click="handleUpdate(row)"
129   - >
130   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
131   - </el-button>
132   - <el-button
133   - link
134   - type="primary"
135   - v-hasPermi="['system:sms-channel:update']"
136   - @click="handleDetail(row)"
137   - >
138   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
139   - </el-button>
140   - <el-button
141   - link
142   - type="primary"
143   - v-hasPermi="['system:sms-channel:delete']"
144   - @click="delList(row.id, false)"
145   - >
146   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
147   - </el-button>
148   - </template>
149   - </Table>
150   - </ContentWrap>
151   -
152   - <XModal v-model="dialogVisible" :title="dialogTitle">
153   - <!-- 对话框(添加 / 修改) -->
154   - <Form
155   - v-if="['create', 'update'].includes(actionType)"
156   - :schema="allSchemas.formSchema"
157   - :rules="rules"
158   - ref="formRef"
159   - />
160   - <!-- 对话框(详情) -->
161   - <Descriptions
162   - v-if="actionType === 'detail'"
163   - :schema="allSchemas.detailSchema"
164   - :data="detailRef"
165   - />
166   - <!-- 操作按钮 -->
167   - <template #footer>
168   - <el-button
169   - v-if="['create', 'update'].includes(actionType)"
170   - type="primary"
171   - :loading="loading"
172   - @click="submitForm"
173   - >
174   - {{ t('action.save') }}
175   - </el-button>
176   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
177   - </template>
178   - </XModal>
179   -</template>
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsLog/index.vue
1   -<script setup lang="ts">
2   -import { ref } from 'vue'
3   -import dayjs from 'dayjs'
4   -import { DICT_TYPE } from '@/utils/dict'
5   -import { useTable } from '@/hooks/web/useTable'
6   -import { useI18n } from '@/hooks/web/useI18n'
7   -import type { SmsLogVO } from '@/api/system/sms/smsLog/types'
8   -import { allSchemas } from './sms.log.data'
9   -import * as SmsLoglApi from '@/api/system/sms/smsLog'
10   -const { t } = useI18n() // 国际化
11   -
12   -// ========== 列表相关 ==========
13   -const { register, tableObject, methods } = useTable<SmsLogVO>({
14   - getListApi: SmsLoglApi.getSmsLogPageApi
15   -})
16   -const { getList, setSearchParams } = methods
17   -
18   -// ========== CRUD 相关 ==========
19   -const actionType = ref('') // 操作按钮的类型
20   -const dialogVisible = ref(false) // 是否显示弹出层
21   -const dialogTitle = ref(t('action.detail')) // 弹出层标题
22   -// ========== 详情相关 ==========
23   -const detailRef = ref() // 详情 Ref
24   -const handleDetail = (row: SmsLogVO) => {
25   - // 设置数据
26   - detailRef.value = row
27   - dialogVisible.value = true
28   -}
29   -// ========== 初始化 ==========
30   -getList()
31   -</script>
32   -
33 1 <template>
34 2 <!-- 搜索工作区 -->
35 3 <ContentWrap>
... ... @@ -62,14 +30,7 @@ getList()
62 30 <span>{{ dayjs(row.receiveTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
63 31 </template>
64 32 <template #action="{ row }">
65   - <el-button
66   - link
67   - type="primary"
68   - v-hasPermi="['system:sms-channel:update']"
69   - @click="handleDetail(row)"
70   - >
71   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
72   - </el-button>
  33 + <XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
73 34 </template>
74 35 </Table>
75 36 </ContentWrap>
... ... @@ -83,7 +44,39 @@ getList()
83 44 />
84 45 <!-- 操作按钮 -->
85 46 <template #footer>
86   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  47 + <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
87 48 </template>
88 49 </XModal>
89 50 </template>
  51 +
  52 +<script setup lang="ts">
  53 +import { ref } from 'vue'
  54 +import dayjs from 'dayjs'
  55 +import { DICT_TYPE } from '@/utils/dict'
  56 +import { useTable } from '@/hooks/web/useTable'
  57 +import { useI18n } from '@/hooks/web/useI18n'
  58 +import type { SmsLogVO } from '@/api/system/sms/smsLog/types'
  59 +import { allSchemas } from './sms.log.data'
  60 +import * as SmsLoglApi from '@/api/system/sms/smsLog'
  61 +const { t } = useI18n() // 国际化
  62 +
  63 +// ========== 列表相关 ==========
  64 +const { register, tableObject, methods } = useTable<SmsLogVO>({
  65 + getListApi: SmsLoglApi.getSmsLogPageApi
  66 +})
  67 +const { getList, setSearchParams } = methods
  68 +
  69 +// ========== CRUD 相关 ==========
  70 +const actionType = ref('') // 操作按钮的类型
  71 +const dialogVisible = ref(false) // 是否显示弹出层
  72 +const dialogTitle = ref(t('action.detail')) // 弹出层标题
  73 +// ========== 详情相关 ==========
  74 +const detailRef = ref() // 详情 Ref
  75 +const handleDetail = (row: SmsLogVO) => {
  76 + // 设置数据
  77 + detailRef.value = row
  78 + dialogVisible.value = true
  79 +}
  80 +// ========== 初始化 ==========
  81 +getList()
  82 +</script>
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
  1 +<template>
  2 + <!-- 搜索工作区 -->
  3 + <ContentWrap>
  4 + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  5 + </ContentWrap>
  6 + <ContentWrap>
  7 + <!-- 操作工具栏 -->
  8 + <div class="mb-10px">
  9 + <el-button type="primary" v-hasPermi="['system:sms-channel:create']" @click="handleCreate">
  10 + <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
  11 + </el-button>
  12 + </div>
  13 + <!-- 列表 -->
  14 + <Table
  15 + :columns="allSchemas.tableColumns"
  16 + :selection="false"
  17 + :data="tableObject.tableList"
  18 + :loading="tableObject.loading"
  19 + :pagination="{
  20 + total: tableObject.total
  21 + }"
  22 + v-model:pageSize="tableObject.pageSize"
  23 + v-model:currentPage="tableObject.currentPage"
  24 + @register="register"
  25 + >
  26 + <template #type="{ row }">
  27 + <DictTag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="row.type" />
  28 + </template>
  29 + <template #status="{ row }">
  30 + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  31 + </template>
  32 + <template #createTime="{ row }">
  33 + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  34 + </template>
  35 + <template #action="{ row }">
  36 + <XTextButton
  37 + preIcon="ep:cpu"
  38 + :title="t('action.test')"
  39 + v-hasPermi="['system:sms-template:send-sms']"
  40 + @click="handleSendSms(row)"
  41 + />
  42 + <!-- 操作:修改 -->
  43 + <XTextButton
  44 + preIcon="ep:edit"
  45 + :title="t('action.edit')"
  46 + v-hasPermi="['system:sms-template:update']"
  47 + @click="handleUpdate(row.id)"
  48 + />
  49 + <!-- 操作:详情 -->
  50 + <XTextButton
  51 + preIcon="ep:view"
  52 + :title="t('action.detail')"
  53 + v-hasPermi="['system:sms-template:update']"
  54 + @click="handleDetail(row)"
  55 + />
  56 + <!-- 操作:删除 -->
  57 + <XTextButton
  58 + preIcon="ep:delete"
  59 + :title="t('action.del')"
  60 + v-hasPermi="['system:sms-template:delete']"
  61 + @click="delList(row.id, false)"
  62 + />
  63 + </template>
  64 + </Table>
  65 + </ContentWrap>
  66 +
  67 + <XModal v-model="dialogVisible" :title="dialogTitle">
  68 + <!-- 对话框(添加 / 修改) -->
  69 + <Form
  70 + v-if="['create', 'update'].includes(actionType)"
  71 + :schema="allSchemas.formSchema"
  72 + :rules="rules"
  73 + ref="formRef"
  74 + />
  75 + <!-- 对话框(详情) -->
  76 + <Descriptions
  77 + v-if="actionType === 'detail'"
  78 + :schema="allSchemas.detailSchema"
  79 + :data="detailRef"
  80 + />
  81 + <!-- 操作按钮 -->
  82 + <template #footer>
  83 + <!-- 按钮:保存 -->
  84 + <XButton
  85 + v-if="['create', 'update'].includes(actionType)"
  86 + type="primary"
  87 + :title="t('action.save')"
  88 + :loading="loading"
  89 + @click="submitForm()"
  90 + />
  91 + <!-- 按钮:关闭 -->
  92 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
  93 + </template>
  94 + </XModal>
  95 + <XModal v-model="sendVisible" title="测试">
  96 + <el-form :model="sendSmsForm" :rules="sendSmsRules" label-width="140px">
  97 + <el-form-item label="模板内容" prop="content">
  98 + <el-input
  99 + v-model="sendSmsForm.content"
  100 + type="textarea"
  101 + placeholder="请输入模板内容"
  102 + readonly
  103 + />
  104 + </el-form-item>
  105 + <el-form-item label="手机号" prop="mobile">
  106 + <el-input v-model="sendSmsForm.mobile" placeholder="请输入手机号" />
  107 + </el-form-item>
  108 + <el-form-item
  109 + v-for="param in sendSmsForm.params"
  110 + :key="param"
  111 + :label="'参数 {' + param + '}'"
  112 + :prop="'templateParams.' + param"
  113 + >
  114 + <el-input
  115 + v-model="sendSmsForm.templateParams[param]"
  116 + :placeholder="'请输入 ' + param + ' 参数'"
  117 + />
  118 + </el-form-item>
  119 + </el-form>
  120 + <!-- 操作按钮 -->
  121 + <template #footer>
  122 + <XButton type="primary" :title="t('action.test')" :loading="loading" @click="sendSmsTest()" />
  123 + <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
  124 + </template>
  125 + </XModal>
  126 +</template>
  127 +
1 128 <script setup lang="ts">
2 129 import { ref, unref } from 'vue'
3 130 import dayjs from 'dayjs'
... ... @@ -38,10 +165,10 @@ const handleCreate = () =&gt; {
38 165 }
39 166  
40 167 // 修改操作
41   -const handleUpdate = async (row: SmsTemplateVO) => {
  168 +const handleUpdate = async (rowId: number) => {
42 169 setDialogTile('update')
43 170 // 设置数据
44   - const res = await SmsTemplateApi.getSmsTemplateApi(row.id)
  171 + const res = await SmsTemplateApi.getSmsTemplateApi(rowId)
45 172 unref(formRef)?.setValues(res)
46 173 }
47 174  
... ... @@ -125,136 +252,3 @@ const sendSmsTest = () =&gt; {
125 252 // ========== 初始化 ==========
126 253 getList()
127 254 </script>
128   -
129   -<template>
130   - <!-- 搜索工作区 -->
131   - <ContentWrap>
132   - <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
133   - </ContentWrap>
134   - <ContentWrap>
135   - <!-- 操作工具栏 -->
136   - <div class="mb-10px">
137   - <el-button type="primary" v-hasPermi="['system:sms-channel:create']" @click="handleCreate">
138   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
139   - </el-button>
140   - </div>
141   - <!-- 列表 -->
142   - <Table
143   - :columns="allSchemas.tableColumns"
144   - :selection="false"
145   - :data="tableObject.tableList"
146   - :loading="tableObject.loading"
147   - :pagination="{
148   - total: tableObject.total
149   - }"
150   - v-model:pageSize="tableObject.pageSize"
151   - v-model:currentPage="tableObject.currentPage"
152   - @register="register"
153   - >
154   - <template #type="{ row }">
155   - <DictTag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="row.type" />
156   - </template>
157   - <template #status="{ row }">
158   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
159   - </template>
160   - <template #createTime="{ row }">
161   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
162   - </template>
163   - <template #action="{ row }">
164   - <el-button
165   - link
166   - type="primary"
167   - v-hasPermi="['system:sms-template:send-sms']"
168   - @click="handleSendSms(row)"
169   - >
170   - <Icon icon="ep:cpu" class="mr-1px" /> {{ t('action.test') }}
171   - </el-button>
172   - <el-button
173   - link
174   - type="primary"
175   - v-hasPermi="['system:sms-template:update']"
176   - @click="handleUpdate(row)"
177   - >
178   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
179   - </el-button>
180   - <el-button
181   - link
182   - type="primary"
183   - v-hasPermi="['system:sms-template:update']"
184   - @click="handleDetail(row)"
185   - >
186   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
187   - </el-button>
188   - <el-button
189   - link
190   - type="primary"
191   - v-hasPermi="['system:sms-template:delete']"
192   - @click="delList(row.id, false)"
193   - >
194   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
195   - </el-button>
196   - </template>
197   - </Table>
198   - </ContentWrap>
199   -
200   - <XModal v-model="dialogVisible" :title="dialogTitle">
201   - <!-- 对话框(添加 / 修改) -->
202   - <Form
203   - v-if="['create', 'update'].includes(actionType)"
204   - :schema="allSchemas.formSchema"
205   - :rules="rules"
206   - ref="formRef"
207   - />
208   - <!-- 对话框(详情) -->
209   - <Descriptions
210   - v-if="actionType === 'detail'"
211   - :schema="allSchemas.detailSchema"
212   - :data="detailRef"
213   - />
214   - <!-- 操作按钮 -->
215   - <template #footer>
216   - <el-button
217   - v-if="['create', 'update'].includes(actionType)"
218   - type="primary"
219   - :loading="loading"
220   - @click="submitForm"
221   - >
222   - {{ t('action.save') }}
223   - </el-button>
224   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
225   - </template>
226   - </XModal>
227   - <XModal v-model="sendVisible" title="测试">
228   - <el-form :model="sendSmsForm" :rules="sendSmsRules" label-width="140px">
229   - <el-form-item label="模板内容" prop="content">
230   - <el-input
231   - v-model="sendSmsForm.content"
232   - type="textarea"
233   - placeholder="请输入模板内容"
234   - readonly
235   - />
236   - </el-form-item>
237   - <el-form-item label="手机号" prop="mobile">
238   - <el-input v-model="sendSmsForm.mobile" placeholder="请输入手机号" />
239   - </el-form-item>
240   - <el-form-item
241   - v-for="param in sendSmsForm.params"
242   - :key="param"
243   - :label="'参数 {' + param + '}'"
244   - :prop="'templateParams.' + param"
245   - >
246   - <el-input
247   - v-model="sendSmsForm.templateParams[param]"
248   - :placeholder="'请输入 ' + param + ' 参数'"
249   - />
250   - </el-form-item>
251   - </el-form>
252   - <!-- 操作按钮 -->
253   - <template #footer>
254   - <el-button type="primary" :loading="loading" @click="sendSmsTest">
255   - {{ t('action.test') }}
256   - </el-button>
257   - <el-button @click="sendVisible = false">{{ t('dialog.close') }}</el-button>
258   - </template>
259   - </XModal>
260   -</template>
... ...
yudao-ui-admin-vue3/src/views/system/tenant/index.vue
  1 +<template>
  2 + <!-- 搜索工作区 -->
  3 + <ContentWrap>
  4 + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  5 + </ContentWrap>
  6 + <ContentWrap>
  7 + <!-- 操作工具栏 -->
  8 + <div class="mb-10px">
  9 + <XButton
  10 + type="primary"
  11 + preIcon="ep:zoom-in"
  12 + :title="t('action.add')"
  13 + v-hasPermi="['system:tenant:create']"
  14 + @click="handleCreate()"
  15 + />
  16 + <XButton
  17 + type="warning"
  18 + preIcon="ep:download"
  19 + :title="t('action.export')"
  20 + v-hasPermi="['system:tenant:export']"
  21 + @click="exportList('租户数据.xls')"
  22 + />
  23 + </div>
  24 + <!-- 列表 -->
  25 + <Table
  26 + :columns="allSchemas.tableColumns"
  27 + :selection="false"
  28 + :data="tableObject.tableList"
  29 + :loading="tableObject.loading"
  30 + :pagination="{
  31 + total: tableObject.total
  32 + }"
  33 + v-model:pageSize="tableObject.pageSize"
  34 + v-model:currentPage="tableObject.currentPage"
  35 + @register="register"
  36 + >
  37 + <template #accountCount="{ row }">
  38 + <el-tag> {{ row.accountCount }} </el-tag>
  39 + </template>
  40 + <template #status="{ row }">
  41 + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
  42 + </template>
  43 + <template #packageId="{ row }">
  44 + <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
  45 + <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
  46 + </template>
  47 + <template #expireTime="{ row }">
  48 + <span>{{ dayjs(row.expireTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  49 + </template>
  50 + <template #createTime="{ row }">
  51 + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
  52 + </template>
  53 + <template #action="{ row }">
  54 + <!-- 操作:修改 -->
  55 + <XTextButton
  56 + preIcon="ep:edit"
  57 + :title="t('action.edit')"
  58 + v-hasPermi="['system:tenant:update']"
  59 + @click="handleUpdate(row)"
  60 + />
  61 + <!-- 操作:详情 -->
  62 + <XTextButton
  63 + preIcon="ep:view"
  64 + :title="t('action.detail')"
  65 + v-hasPermi="['system:tenant:update']"
  66 + @click="handleDetail(row)"
  67 + />
  68 + <!-- 操作:删除 -->
  69 + <XTextButton
  70 + preIcon="ep:delete"
  71 + :title="t('action.del')"
  72 + v-hasPermi="['system:tenant:delete']"
  73 + @click="delList(row.id, false)"
  74 + />
  75 + </template>
  76 + </Table>
  77 + </ContentWrap>
  78 +
  79 + <XModal v-model="dialogVisible" :title="dialogTitle">
  80 + <!-- 对话框(添加 / 修改) -->
  81 + <Form
  82 + v-if="['create', 'update'].includes(actionType)"
  83 + :schema="allSchemas.formSchema"
  84 + :rules="rules"
  85 + ref="formRef"
  86 + >
  87 + <template #packageId>
  88 + <el-select v-model="tenantPackageId">
  89 + <el-option
  90 + v-for="item in tenantPackageOptions"
  91 + :key="item.id"
  92 + :label="item.name"
  93 + :value="item.id"
  94 + />
  95 + </el-select>
  96 + </template>
  97 + </Form>
  98 + <!-- 对话框(详情) -->
  99 + <Descriptions
  100 + v-if="actionType === 'detail'"
  101 + :schema="allSchemas.detailSchema"
  102 + :data="detailRef"
  103 + >
  104 + <template #packageId="{ row }">
  105 + <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
  106 + <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
  107 + </template>
  108 + </Descriptions>
  109 + <!-- 操作按钮 -->
  110 + <template #footer>
  111 + <!-- 按钮:保存 -->
  112 + <XButton
  113 + v-if="['create', 'update'].includes(actionType)"
  114 + type="primary"
  115 + :title="t('action.save')"
  116 + :loading="actionLoading"
  117 + @click="submitForm()"
  118 + />
  119 + <!-- 按钮:关闭 -->
  120 + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
  121 + </template>
  122 + </XModal>
  123 +</template>
1 124 <script setup lang="ts">
2 125 import { ref, unref, onMounted } from 'vue'
3 126 import dayjs from 'dayjs'
... ... @@ -114,126 +237,3 @@ onMounted(async () =&gt; {
114 237 await getTenantPackageOptions()
115 238 })
116 239 </script>
117   -
118   -<template>
119   - <!-- 搜索工作区 -->
120   - <ContentWrap>
121   - <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
122   - </ContentWrap>
123   - <ContentWrap>
124   - <!-- 操作工具栏 -->
125   - <div class="mb-10px">
126   - <el-button type="primary" v-hasPermi="['system:tenant:create']" @click="handleCreate">
127   - <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
128   - </el-button>
129   - <el-button
130   - type="warning"
131   - v-hasPermi="['system:tenant:export']"
132   - :loading="tableObject.exportLoading"
133   - @click="exportList('租户数据.xls')"
134   - >
135   - <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
136   - </el-button>
137   - </div>
138   - <!-- 列表 -->
139   - <Table
140   - :columns="allSchemas.tableColumns"
141   - :selection="false"
142   - :data="tableObject.tableList"
143   - :loading="tableObject.loading"
144   - :pagination="{
145   - total: tableObject.total
146   - }"
147   - v-model:pageSize="tableObject.pageSize"
148   - v-model:currentPage="tableObject.currentPage"
149   - @register="register"
150   - >
151   - <template #accountCount="{ row }">
152   - <el-tag> {{ row.accountCount }} </el-tag>
153   - </template>
154   - <template #status="{ row }">
155   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
156   - </template>
157   - <template #packageId="{ row }">
158   - <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
159   - <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
160   - </template>
161   - <template #expireTime="{ row }">
162   - <span>{{ dayjs(row.expireTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
163   - </template>
164   - <template #createTime="{ row }">
165   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
166   - </template>
167   - <template #action="{ row }">
168   - <el-button
169   - link
170   - type="primary"
171   - v-hasPermi="['system:tenant:update']"
172   - @click="handleUpdate(row)"
173   - >
174   - <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
175   - </el-button>
176   - <el-button
177   - link
178   - type="primary"
179   - v-hasPermi="['system:tenant:update']"
180   - @click="handleDetail(row)"
181   - >
182   - <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
183   - </el-button>
184   - <el-button
185   - link
186   - type="primary"
187   - v-hasPermi="['system:tenant:delete']"
188   - @click="delList(row.id, false)"
189   - >
190   - <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
191   - </el-button>
192   - </template>
193   - </Table>
194   - </ContentWrap>
195   -
196   - <XModal v-model="dialogVisible" :title="dialogTitle">
197   - <!-- 对话框(添加 / 修改) -->
198   - <Form
199   - v-if="['create', 'update'].includes(actionType)"
200   - :schema="allSchemas.formSchema"
201   - :rules="rules"
202   - ref="formRef"
203   - >
204   - <template #packageId>
205   - <el-select v-model="tenantPackageId">
206   - <el-option
207   - v-for="item in tenantPackageOptions"
208   - :key="item.id"
209   - :label="item.name"
210   - :value="item.id"
211   - />
212   - </el-select>
213   - </template>
214   - </Form>
215   - <!-- 对话框(详情) -->
216   - <Descriptions
217   - v-if="actionType === 'detail'"
218   - :schema="allSchemas.detailSchema"
219   - :data="detailRef"
220   - >
221   - <template #packageId="{ row }">
222   - <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
223   - <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
224   - </template>
225   - </Descriptions>
226   - <!-- 操作按钮 -->
227   - <template #footer>
228   - <el-button
229   - v-if="['create', 'update'].includes(actionType)"
230   - type="primary"
231   - :loading="actionLoading"
232   - @click="submitForm"
233   - >
234   - {{ t('action.save') }}
235   - </el-button>
236   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
237   - </template>
238   - </XModal>
239   -</template>
... ...
yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue
... ... @@ -185,15 +185,16 @@ onMounted(async () =&gt; {
185 185 </Form>
186 186 <!-- 操作按钮 -->
187 187 <template #footer>
188   - <el-button
  188 + <!-- 按钮:保存 -->
  189 + <XButton
189 190 v-if="['create', 'update'].includes(actionType)"
190 191 type="primary"
  192 + :title="t('action.save')"
191 193 :loading="loading"
192   - @click="submitForm"
193   - >
194   - {{ t('action.save') }}
195   - </el-button>
196   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  194 + @click="submitForm()"
  195 + />
  196 + <!-- 按钮:关闭 -->
  197 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
197 198 </template>
198 199 </XModal>
199 200 </template>
... ...
yudao-ui-admin-vue3/src/views/system/user/index.vue
... ... @@ -459,15 +459,16 @@ onMounted(async () =&gt; {
459 459 </Descriptions>
460 460 <!-- 操作按钮 -->
461 461 <template #footer>
462   - <el-button
  462 + <!-- 按钮:保存 -->
  463 + <XButton
463 464 v-if="['create', 'update'].includes(actionType)"
464 465 type="primary"
  466 + :title="t('action.save')"
465 467 :loading="loading"
466   - @click="submitForm"
467   - >
468   - {{ t('action.save') }}
469   - </el-button>
470   - <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  468 + @click="submitForm()"
  469 + />
  470 + <!-- 按钮:关闭 -->
  471 + <XButton :loading="loading" :title="t('dialog.close')" @click="dialogVisible = false" />
471 472 </template>
472 473 </XModal>
473 474 <!-- 分配用户角色 -->
... ...