xingyu4j 2 years ago
parent
commit
eed6a9a689

+ 2 - 2
yudao-ui-admin-vue3/src/views/system/errorCode/index.vue

@@ -110,18 +110,18 @@ const handleCreate = () => {
 
 
 // 修改操作
 // 修改操作
 const handleUpdate = async (rowId: number) => {
 const handleUpdate = async (rowId: number) => {
+  setDialogTile('update')
   // 设置数据
   // 设置数据
   const res = await ErrorCodeApi.getErrorCodeApi(rowId)
   const res = await ErrorCodeApi.getErrorCodeApi(rowId)
   unref(formRef)?.setValues(res)
   unref(formRef)?.setValues(res)
-  setDialogTile('update')
 }
 }
 
 
 // 详情操作
 // 详情操作
 const handleDetail = async (rowId: number) => {
 const handleDetail = async (rowId: number) => {
+  setDialogTile('detail')
   // 设置数据
   // 设置数据
   const res = await ErrorCodeApi.getErrorCodeApi(rowId)
   const res = await ErrorCodeApi.getErrorCodeApi(rowId)
   detailRef.value = res
   detailRef.value = res
-  setDialogTile('detail')
 }
 }
 
 
 // 删除操作
 // 删除操作

+ 2 - 2
yudao-ui-admin-vue3/src/views/system/notice/index.vue

@@ -109,18 +109,18 @@ const handleCreate = () => {
 
 
 // 修改操作
 // 修改操作
 const handleUpdate = async (rowId: number) => {
 const handleUpdate = async (rowId: number) => {
+  setDialogTile('update')
   // 设置数据
   // 设置数据
   const res = await NoticeApi.getNoticeApi(rowId)
   const res = await NoticeApi.getNoticeApi(rowId)
   unref(formRef)?.setValues(res)
   unref(formRef)?.setValues(res)
-  setDialogTile('update')
 }
 }
 
 
 // 详情操作
 // 详情操作
 const handleDetail = async (rowId: number) => {
 const handleDetail = async (rowId: number) => {
+  setDialogTile('detail')
   // 设置数据
   // 设置数据
   const res = await NoticeApi.getNoticeApi(rowId)
   const res = await NoticeApi.getNoticeApi(rowId)
   detailRef.value = res
   detailRef.value = res
-  setDialogTile('detail')
 }
 }
 
 
 // 删除操作
 // 删除操作

+ 1 - 1
yudao-ui-admin-vue3/src/views/system/notice/notice.data.ts

@@ -34,7 +34,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
       isSearch: true
       isSearch: true
     },
     },
     {
     {
-      title: '公告内容', // TODO 星语:详情时,公告展示有办法是 html 么?
+      title: '公告内容',
       field: 'content',
       field: 'content',
       table: {
       table: {
         type: 'html'
         type: 'html'

+ 16 - 6
yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts

@@ -49,21 +49,31 @@ const crudSchemas = reactive<VxeCrudSchema>({
     },
     },
     {
     {
       title: '访问令牌的有效期',
       title: '访问令牌的有效期',
-      field: 'accessTokenValiditySeconds', // TODO 星语:展示时,要有 xxx 秒
+      field: 'accessTokenValiditySeconds',
       form: {
       form: {
         component: 'InputNumber'
         component: 'InputNumber'
+      },
+      table: {
+        slots: {
+          default: 'accessTokenValiditySeconds_default'
+        }
       }
       }
     },
     },
     {
     {
       title: '刷新令牌的有效期',
       title: '刷新令牌的有效期',
-      field: 'refreshTokenValiditySeconds', // TODO 星语:展示时,要有 xxx 秒
+      field: 'refreshTokenValiditySeconds',
       form: {
       form: {
         component: 'InputNumber'
         component: 'InputNumber'
+      },
+      table: {
+        slots: {
+          default: 'refreshTokenValiditySeconds_default'
+        }
       }
       }
     },
     },
     {
     {
       title: '授权类型',
       title: '授权类型',
-      field: 'authorizedGrantTypes', // TODO 星语:详情展示时,应该类似 table 也是多个 tag
+      field: 'authorizedGrantTypes',
       table: {
       table: {
         width: 300,
         width: 300,
         slots: {
         slots: {
@@ -74,17 +84,17 @@ const crudSchemas = reactive<VxeCrudSchema>({
     {
     {
       title: '授权范围',
       title: '授权范围',
       field: 'scopes', // TODO @星语:带输入的 SELECT
       field: 'scopes', // TODO @星语:带输入的 SELECT
-      isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
+      isTable: false
     },
     },
     {
     {
       title: '自动授权范围',
       title: '自动授权范围',
       field: 'autoApproveScopes', // TODO @星语:带输入的 SELECT
       field: 'autoApproveScopes', // TODO @星语:带输入的 SELECT
-      isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
+      isTable: false
     },
     },
     {
     {
       title: '可重定向的 URI 地址',
       title: '可重定向的 URI 地址',
       field: 'redirectUris', // TODO @星语:带输入的 SELECT
       field: 'redirectUris', // TODO @星语:带输入的 SELECT
-      isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
+      isTable: false
     },
     },
     {
     {
       title: '权限',
       title: '权限',

+ 56 - 3
yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue

@@ -12,6 +12,12 @@
           @click="handleCreate()"
           @click="handleCreate()"
         />
         />
       </template>
       </template>
+      <template #accessTokenValiditySeconds_default="{ row }">
+        {{ row.accessTokenValiditySeconds + '秒' }}
+      </template>
+      <template #refreshTokenValiditySeconds_default="{ row }">
+        {{ row.refreshTokenValiditySeconds + '秒' }}
+      </template>
       <template #authorizedGrantTypes_default="{ row }">
       <template #authorizedGrantTypes_default="{ row }">
         <el-tag
         <el-tag
           :disable-transitions="true"
           :disable-transitions="true"
@@ -61,7 +67,54 @@
       v-if="actionType === 'detail'"
       v-if="actionType === 'detail'"
       :schema="allSchemas.detailSchema"
       :schema="allSchemas.detailSchema"
       :data="detailRef"
       :data="detailRef"
-    />
+    >
+      <template #accessTokenValiditySeconds="{ row }">
+        {{ row.accessTokenValiditySeconds + '秒' }}
+      </template>
+      <template #refreshTokenValiditySeconds="{ row }">
+        {{ row.refreshTokenValiditySeconds + '秒' }}
+      </template>
+      <template #authorizedGrantTypes="{ row }">
+        <el-tag
+          :disable-transitions="true"
+          :key="index"
+          v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
+          :index="index"
+        >
+          {{ authorizedGrantType }}
+        </el-tag>
+      </template>
+      <template #scopes="{ row }">
+        <el-tag
+          :disable-transitions="true"
+          :key="index"
+          v-for="(scopes, index) in row.scopes"
+          :index="index"
+        >
+          {{ scopes }}
+        </el-tag>
+      </template>
+      <template #autoApproveScopes="{ row }">
+        <el-tag
+          :disable-transitions="true"
+          :key="index"
+          v-for="(autoApproveScopes, index) in row.autoApproveScopes"
+          :index="index"
+        >
+          {{ autoApproveScopes }}
+        </el-tag>
+      </template>
+      <template #redirectUris="{ row }">
+        <el-tag
+          :disable-transitions="true"
+          :key="index"
+          v-for="(redirectUris, index) in row.redirectUris"
+          :index="index"
+        >
+          {{ redirectUris }}
+        </el-tag>
+      </template>
+    </Descriptions>
     <template #footer>
     <template #footer>
       <!-- 按钮:保存 -->
       <!-- 按钮:保存 -->
       <XButton
       <XButton
@@ -121,17 +174,17 @@ const handleCreate = () => {
 
 
 // 修改操作
 // 修改操作
 const handleUpdate = async (rowId: number) => {
 const handleUpdate = async (rowId: number) => {
+  setDialogTile('update')
   // 设置数据
   // 设置数据
   const res = await ClientApi.getOAuth2ClientApi(rowId)
   const res = await ClientApi.getOAuth2ClientApi(rowId)
   unref(formRef)?.setValues(res)
   unref(formRef)?.setValues(res)
-  setDialogTile('update')
 }
 }
 
 
 // 详情操作
 // 详情操作
 const handleDetail = async (rowId: number) => {
 const handleDetail = async (rowId: number) => {
+  setDialogTile('detail')
   const res = await ClientApi.getOAuth2ClientApi(rowId)
   const res = await ClientApi.getOAuth2ClientApi(rowId)
   detailRef.value = res
   detailRef.value = res
-  setDialogTile('detail')
 }
 }
 
 
 // 删除操作
 // 删除操作

+ 2 - 2
yudao-ui-admin-vue3/src/views/system/role/index.vue

@@ -202,18 +202,18 @@ const handleCreate = () => {
 
 
 // 修改操作
 // 修改操作
 const handleUpdate = async (rowId: number) => {
 const handleUpdate = async (rowId: number) => {
+  setDialogTile('update')
   // 设置数据
   // 设置数据
   const res = await RoleApi.getRoleApi(rowId)
   const res = await RoleApi.getRoleApi(rowId)
   unref(formRef)?.setValues(res)
   unref(formRef)?.setValues(res)
-  setDialogTile('update')
 }
 }
 
 
 // 详情操作
 // 详情操作
 const handleDetail = async (rowId: number) => {
 const handleDetail = async (rowId: number) => {
+  setDialogTile('detail')
   // 设置数据
   // 设置数据
   const res = await RoleApi.getRoleApi(rowId)
   const res = await RoleApi.getRoleApi(rowId)
   detailRef.value = res
   detailRef.value = res
-  setDialogTile('detail')
 }
 }
 
 
 // 删除操作
 // 删除操作

+ 2 - 2
yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue

@@ -113,17 +113,17 @@ const handleCreate = () => {
 
 
 // 修改操作
 // 修改操作
 const handleUpdate = async (rowId: number) => {
 const handleUpdate = async (rowId: number) => {
+  setDialogTile('update')
   // 设置数据
   // 设置数据
   const res = await SmsChannelApi.getSmsChannelApi(rowId)
   const res = await SmsChannelApi.getSmsChannelApi(rowId)
   unref(formRef)?.setValues(res)
   unref(formRef)?.setValues(res)
-  setDialogTile('update')
 }
 }
 
 
 // 详情操作
 // 详情操作
 const handleDetail = async (rowId: number) => {
 const handleDetail = async (rowId: number) => {
+  setDialogTile('detail')
   const res = await SmsChannelApi.getSmsChannelApi(rowId)
   const res = await SmsChannelApi.getSmsChannelApi(rowId)
   detailData.value = res
   detailData.value = res
-  setDialogTile('detail')
 }
 }
 
 
 // 删除操作
 // 删除操作