Commit 70b8dcb1741d362371d2d04b9009e98fc922a3c7

Authored by xingyu4j
1 parent cbd2815c

refactor: Descriptions

yudao-ui-admin-vue3/src/hooks/web/useCrudSchemas.ts
... ... @@ -183,6 +183,14 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
183 183 field: schemaItem.field,
184 184 label: schemaItem.detail?.label || schemaItem.label
185 185 }
  186 + if (schemaItem.dictType) {
  187 + descriptionsSchemaItem.dictType = schemaItem.dictType
  188 + }
  189 + if (schemaItem.detail?.dateFormat || schemaItem.formatter == 'formatDate') {
  190 + descriptionsSchemaItem.dateFormat = schemaItem.dateFormat
  191 + ? schemaItem?.detail?.dateFormat
  192 + : 'YYYY-MM-DD HH:mm:ss'
  193 + }
186 194  
187 195 // 删除不必要的字段
188 196 delete descriptionsSchemaItem.show
... ...
yudao-ui-admin-vue3/src/views/bpm/form/index.vue
... ... @@ -149,14 +149,7 @@ getList()
149 149 v-if="actionType === 'detail'"
150 150 :schema="allSchemas.detailSchema"
151 151 :data="detailRef"
152   - >
153   - <template #status="{ row }">
154   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
155   - </template>
156   - <template #createTime="{ row }">
157   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
158   - </template>
159   - </Descriptions>
  152 + />
160 153 <!-- 操作按钮 -->
161 154 <template #footer>
162 155 <el-button
... ...
yudao-ui-admin-vue3/src/views/bpm/group/index.vue
... ... @@ -205,12 +205,6 @@ onMounted(async () =&gt; {
205 205 {{ getUserNickName(userId) + ' ' }}
206 206 </span>
207 207 </template>
208   - <template #status="{ row }">
209   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
210   - </template>
211   - <template #createTime="{ row }">
212   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
213   - </template>
214 208 </Descriptions>
215 209 <!-- 操作按钮 -->
216 210 <template #footer>
... ...
yudao-ui-admin-vue3/src/views/bpm/model/index.vue
... ... @@ -199,11 +199,7 @@ getList()
199 199 v-if="actionType === 'detail'"
200 200 :schema="allSchemas.detailSchema"
201 201 :data="detailRef"
202   - >
203   - <template #createTime="{ row }">
204   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
205   - </template>
206   - </Descriptions>
  202 + />
207 203 <!-- 操作按钮 -->
208 204 <template #footer>
209 205 <el-button
... ...
yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue
... ... @@ -105,14 +105,7 @@ getList()
105 105  
106 106 <XModal v-model="dialogVisible" :title="t('action.detail')">
107 107 <!-- 对话框(详情) -->
108   - <Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
109   - <template #status="{ row }">
110   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
111   - </template>
112   - <template #createTime="{ row }">
113   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
114   - </template>
115   - </Descriptions>
  108 + <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
116 109 <!-- 操作按钮 -->
117 110 <template #footer>
118 111 <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
... ...
yudao-ui-admin-vue3/src/views/infra/apiAccessLog/index.vue
... ... @@ -78,12 +78,6 @@ getList()
78 78 <XModal v-model="dialogVisible" :title="dialogTitle">
79 79 <!-- 对话框(详情) -->
80 80 <Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
81   - <template #userType="{ row }">
82   - <DictTag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />
83   - </template>
84   - <template #beginTime="{ row }">
85   - <span>{{ dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
86   - </template>
87 81 <template #duration="{ row }">
88 82 <span>{{ row.duration + 'ms' }}</span>
89 83 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue
... ... @@ -116,17 +116,7 @@ getList()
116 116  
117 117 <XModal v-model="dialogVisible" :title="dialogTitle">
118 118 <!-- 对话框(详情) -->
119   - <Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
120   - <template #userType="{ row }">
121   - <DictTag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />
122   - </template>
123   - <template #processStatus="{ row }">
124   - <DictTag :type="DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS" :value="row.processStatus" />
125   - </template>
126   - <template #exceptionTime="{ row }">
127   - <span>{{ dayjs(row.exceptionTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
128   - </template>
129   - </Descriptions>
  119 + <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
130 120 <!-- 操作按钮 -->
131 121 <template #footer>
132 122 <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
... ...
yudao-ui-admin-vue3/src/views/infra/config/index.vue
... ... @@ -175,12 +175,6 @@ getList()
175 175 <template #visible="{ row }">
176 176 <span>{{ row.visible ? '是' : '否' }} </span>
177 177 </template>
178   - <template #type="{ row }">
179   - <DictTag :type="DICT_TYPE.INFRA_CONFIG_TYPE" :value="row.type" />
180   - </template>
181   - <template #createTime="{ row }">
182   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
183   - </template>
184 178 </Descriptions>
185 179 <!-- 操作按钮 -->
186 180 <template #footer>
... ...
yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/index.vue
... ... @@ -144,11 +144,7 @@ onMounted(async () =&gt; {
144 144 v-if="actionType === 'detail'"
145 145 :schema="allSchemas.detailSchema"
146 146 :data="detailRef"
147   - >
148   - <template #createTime="{ row }">
149   - <span>{{ row.createTime ? dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') : '' }}</span>
150   - </template>
151   - </Descriptions>
  147 + />
152 148 <!-- 操作按钮 -->
153 149 <template #footer>
154 150 <el-button
... ...
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
... ... @@ -189,17 +189,7 @@ getList()
189 189 v-if="actionType === 'detail'"
190 190 :schema="allSchemas.detailSchema"
191 191 :data="detailRef"
192   - >
193   - <template #storage="{ row }">
194   - <DictTag :type="DICT_TYPE.INFRA_FILE_STORAGE" :value="row.storage" />
195   - </template>
196   - <template #primary="{ row }">
197   - <DictTag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="row.master" />
198   - </template>
199   - <template #createTime="{ row }">
200   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
201   - </template>
202   - </Descriptions>
  192 + />
203 193 <!-- 操作按钮 -->
204 194 <template #footer>
205 195 <el-button
... ...
yudao-ui-admin-vue3/src/views/infra/fileList/index.vue
... ... @@ -161,9 +161,6 @@ getList()
161 161 />
162 162 <span>{{ row.url }}</span>
163 163 </template>
164   - <template #createTime="{ row }">
165   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
166   - </template>
167 164 </Descriptions>
168 165 <!-- 操作按钮 -->
169 166 <template #footer>
... ...
yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue
... ... @@ -98,9 +98,6 @@ onMounted(() =&gt; {
98 98 <XModal v-model="dialogVisible" :title="dialogTitle">
99 99 <!-- 对话框(详情) -->
100 100 <Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
101   - <template #status="{ row }">
102   - <DictTag :type="DICT_TYPE.INFRA_JOB_LOG_STATUS" :value="row.status" />
103   - </template>
104 101 <template #retryInterval="{ row }">
105 102 <span>{{ row.retryInterval + '毫秒' }} </span>
106 103 </template>
... ...
yudao-ui-admin-vue3/src/views/infra/job/index.vue
... ... @@ -226,9 +226,6 @@ getList()
226 226 :schema="allSchemas.detailSchema"
227 227 :data="detailRef"
228 228 >
229   - <template #status="{ row }">
230   - <DictTag :type="DICT_TYPE.INFRA_JOB_STATUS" :value="row.status" />
231   - </template>
232 229 <template #retryInterval="{ row }">
233 230 <span>{{ row.retryInterval + '毫秒' }} </span>
234 231 </template>
... ...
yudao-ui-admin-vue3/src/views/pay/app/index.vue
... ... @@ -168,14 +168,7 @@ getList()
168 168 v-if="actionType === 'detail'"
169 169 :schema="allSchemas.detailSchema"
170 170 :data="detailRef"
171   - >
172   - <template #status="{ row }">
173   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
174   - </template>
175   - <template #createTime="{ row }">
176   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
177   - </template>
178   - </Descriptions>
  171 + />
179 172 <!-- 操作按钮 -->
180 173 <template #footer>
181 174 <el-button
... ...
yudao-ui-admin-vue3/src/views/pay/merchant/index.vue
... ... @@ -168,14 +168,7 @@ getList()
168 168 v-if="actionType === 'detail'"
169 169 :schema="allSchemas.detailSchema"
170 170 :data="detailRef"
171   - >
172   - <template #status="{ row }">
173   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
174   - </template>
175   - <template #createTime="{ row }">
176   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
177   - </template>
178   - </Descriptions>
  171 + />
179 172 <!-- 操作按钮 -->
180 173 <template #footer>
181 174 <el-button
... ...
yudao-ui-admin-vue3/src/views/pay/order/index.vue
1 1 <script setup lang="ts">
2 2 import { ref, unref } from 'vue'
3   -import dayjs from 'dayjs'
4 3 import { ElMessage } from 'element-plus'
5 4 import { DICT_TYPE } from '@/utils/dict'
6 5 import { useTable } from '@/hooks/web/useTable'
... ... @@ -153,14 +152,7 @@ getList()
153 152 v-if="actionType === 'detail'"
154 153 :schema="allSchemas.detailSchema"
155 154 :data="detailRef"
156   - >
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   - </Descriptions>
  155 + />
164 156 <!-- 操作按钮 -->
165 157 <template #footer>
166 158 <el-button
... ...
yudao-ui-admin-vue3/src/views/pay/refund/index.vue
... ... @@ -95,14 +95,7 @@ getList()
95 95  
96 96 <XModal v-model="dialogVisible" :title="dialogTitle">
97 97 <!-- 对话框(详情) -->
98   - <Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
99   - <template #status="{ row }">
100   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
101   - </template>
102   - <template #createTime="{ row }">
103   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
104   - </template>
105   - </Descriptions>
  98 + <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
106 99 <!-- 操作按钮 -->
107 100 <template #footer>
108 101 <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
... ...
yudao-ui-admin-vue3/src/views/system/role/index.vue
... ... @@ -276,17 +276,7 @@ onMounted(() =&gt; {
276 276 v-if="actionType === 'detail'"
277 277 :schema="allSchemas.detailSchema"
278 278 :data="detailRef"
279   - >
280   - <template #type="{ row }">
281   - <DictTag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="row.type" />
282   - </template>
283   - <template #status="{ row }">
284   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
285   - </template>
286   - <template #createTime="{ row }">
287   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
288   - </template>
289   - </Descriptions>
  279 + />
290 280 <!-- 操作按钮 -->
291 281 <template #footer>
292 282 <el-button
... ... @@ -300,7 +290,7 @@ onMounted(() =&gt; {
300 290 <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
301 291 </template>
302 292 </XModal>
303   - <XModal v-model="dialogScopeVisible" :title="dialogScopeTitle" max-height="600px">
  293 + <XModal v-model="dialogScopeVisible" :title="dialogScopeTitle">
304 294 <el-form :model="dataScopeForm">
305 295 <el-form-item label="角色名称">
306 296 <el-input v-model="dataScopeForm.name" :disabled="true" />
... ...
yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue
... ... @@ -193,14 +193,7 @@ onMounted(async () =&gt; {
193 193 v-if="actionType === 'detail'"
194 194 :schema="allSchemas.detailSchema"
195 195 :data="detailRef"
196   - >
197   - <template #status="{ row }">
198   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
199   - </template>
200   - <template #createTime="{ row }">
201   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
202   - </template>
203   - </Descriptions>
  196 + />
204 197 <!-- 操作按钮 -->
205 198 <template #footer>
206 199 <el-button
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue
... ... @@ -162,17 +162,7 @@ getList()
162 162 v-if="actionType === 'detail'"
163 163 :schema="allSchemas.detailSchema"
164 164 :data="detailRef"
165   - >
166   - <template #code="{ row }">
167   - <DictTag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="row.code" />
168   - </template>
169   - <template #status="{ row }">
170   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
171   - </template>
172   - <template #createTime="{ row }">
173   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
174   - </template>
175   - </Descriptions>
  165 + />
176 166 <!-- 操作按钮 -->
177 167 <template #footer>
178 168 <el-button
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsLog/index.vue
... ... @@ -80,17 +80,7 @@ getList()
80 80 v-if="actionType === 'detail'"
81 81 :schema="allSchemas.detailSchema"
82 82 :data="detailRef"
83   - >
84   - <template #code="{ row }">
85   - <DictTag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="row.code" />
86   - </template>
87   - <template #status="{ row }">
88   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
89   - </template>
90   - <template #createTime="{ row }">
91   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
92   - </template>
93   - </Descriptions>
  83 + />
94 84 <!-- 操作按钮 -->
95 85 <template #footer>
96 86 <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
... ...
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
... ... @@ -210,17 +210,7 @@ getList()
210 210 v-if="actionType === 'detail'"
211 211 :schema="allSchemas.detailSchema"
212 212 :data="detailRef"
213   - >
214   - <template #type="{ row }">
215   - <DictTag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="row.code" />
216   - </template>
217   - <template #status="{ row }">
218   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
219   - </template>
220   - <template #createTime="{ row }">
221   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
222   - </template>
223   - </Descriptions>
  213 + />
224 214 <!-- 操作按钮 -->
225 215 <template #footer>
226 216 <el-button
... ...
yudao-ui-admin-vue3/src/views/system/tenant/index.vue
... ... @@ -218,19 +218,10 @@ onMounted(async () =&gt; {
218 218 :schema="allSchemas.detailSchema"
219 219 :data="detailRef"
220 220 >
221   - <template #status="{ row }">
222   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
223   - </template>
224 221 <template #packageId="{ row }">
225 222 <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
226 223 <el-tag v-else type="success"> {{ getPackageName(row.packageId) }} </el-tag>
227 224 </template>
228   - <template #expireTime="{ row }">
229   - <span>{{ dayjs(row.expireTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
230   - </template>
231   - <template #createTime="{ row }">
232   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
233   - </template>
234 225 </Descriptions>
235 226 <!-- 操作按钮 -->
236 227 <template #footer>
... ...
yudao-ui-admin-vue3/src/views/system/user/index.vue
... ... @@ -19,7 +19,6 @@ import {
19 19 UploadRawFile
20 20 } from 'element-plus'
21 21 import { handleTree } from '@/utils/tree'
22   -import { DICT_TYPE } from '@/utils/dict'
23 22 import { useI18n } from '@/hooks/web/useI18n'
24 23 import { useTable } from '@/hooks/web/useTable'
25 24 import { FormExpose } from '@/components/Form'
... ... @@ -457,12 +456,6 @@ onMounted(async () =&gt; {
457 456 </template>
458 457 </el-tag>
459 458 </template>
460   - <template #status="{ row }">
461   - <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
462   - </template>
463   - <template #loginDate="{ row }">
464   - <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
465   - </template>
466 459 </Descriptions>
467 460 <!-- 操作按钮 -->
468 461 <template #footer>
... ... @@ -478,7 +471,7 @@ onMounted(async () =&gt; {
478 471 </template>
479 472 </XModal>
480 473 <!-- 分配用户角色 -->
481   - <XModal v-model="roleDialogVisible" title="分配角色" maxHeight="450px">
  474 + <XModal v-model="roleDialogVisible" title="分配角色">
482 475 <el-form :model="userRole" label-width="80px">
483 476 <el-form-item label="用户名称">
484 477 <el-input v-model="userRole.username" :disabled="true" />
... ... @@ -507,12 +500,7 @@ onMounted(async () =&gt; {
507 500 </template>
508 501 </XModal>
509 502 <!-- 导入 -->
510   - <XModal
511   - v-model="importDialogVisible"
512   - :title="importDialogTitle"
513   - :destroy-on-close="true"
514   - maxHeight="350px"
515   - >
  503 + <XModal v-model="importDialogVisible" :title="importDialogTitle">
516 504 <el-form class="drawer-multiColumn-form" label-width="150px">
517 505 <el-form-item label="模板下载 :">
518 506 <el-button type="primary" @click="handleImportTemp">
... ...