style: detailRef => detailData

This commit is contained in:
xingyu 2022-12-06 23:46:13 +08:00
parent 731e49d7b6
commit 860049d238
17 changed files with 48 additions and 49 deletions

View File

@ -73,12 +73,12 @@ const submitForm = async () => {
} }
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = async (row: FormVO) => { const handleDetail = async (row: FormVO) => {
// //
detailRef.value = row detailData.value = row
setDialogTile('detail') setDialogTile('detail')
} }
@ -148,7 +148,7 @@ getList()
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
/> />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>

View File

@ -90,12 +90,12 @@ const getUserNickName = (userId: number) => {
return '未知(' + userId + ')' return '未知(' + userId + ')'
} }
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = async (row: UserGroupVO) => { const handleDetail = async (row: UserGroupVO) => {
// //
detailRef.value = row detailData.value = row
setDialogTile('detail') setDialogTile('detail')
} }
@ -194,7 +194,7 @@ onMounted(async () => {
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
> >
<template #memberUserIds="{ row }"> <template #memberUserIds="{ row }">
<span v-for="userId in row.memberUserIds" :key="userId"> <span v-for="userId in row.memberUserIds" :key="userId">

View File

@ -92,12 +92,12 @@ const handleChangeState = async (row: ModelVO) => {
.catch(() => {}) .catch(() => {})
} }
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = async (row: ModelVO) => { const handleDetail = async (row: ModelVO) => {
// //
detailRef.value = row detailData.value = row
setDialogTile('detail') setDialogTile('detail')
} }
@ -198,7 +198,7 @@ getList()
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
/> />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>

View File

@ -38,12 +38,12 @@ const handleCancel = (row: ProcessInstanceVO) => {
} }
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = async (row: ProcessInstanceVO) => { const handleDetail = async (row: ProcessInstanceVO) => {
// //
detailRef.value = row detailData.value = row
dialogVisible.value = true dialogVisible.value = true
} }
@ -105,7 +105,7 @@ getList()
<XModal v-model="dialogVisible" :title="t('action.detail')"> <XModal v-model="dialogVisible" :title="t('action.detail')">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>

View File

@ -21,7 +21,7 @@
</ContentWrap> </ContentWrap>
<XModal v-model="dialogVisible" :title="dialogTitle"> <XModal v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> <Descriptions :schema="allSchemas.detailSchema" :data="detailData">
<template #duration="{ row }"> <template #duration="{ row }">
<span>{{ row.duration + 'ms' }}</span> <span>{{ row.duration + 'ms' }}</span>
</template> </template>
@ -52,14 +52,14 @@ const { gridOptions } = useVxeGrid<ApiAccessLogApi.ApiAccessLogVO>({
getListApi: ApiAccessLogApi.getApiAccessLogPageApi getListApi: ApiAccessLogApi.getApiAccessLogPageApi
}) })
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
// //
const handleDetail = (row: ApiAccessLogApi.ApiAccessLogVO) => { const handleDetail = (row: ApiAccessLogApi.ApiAccessLogVO) => {
// //
detailRef.value = row detailData.value = row
dialogTitle.value = t('action.detail') dialogTitle.value = t('action.detail')
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -44,7 +44,7 @@
</ContentWrap> </ContentWrap>
<XModal v-model="dialogVisible" :title="dialogTitle"> <XModal v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
<XButton :title="t('dialog.close')" @click="dialogVisible = false" /> <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
@ -71,14 +71,14 @@ const { gridOptions, getList, exportList } = useVxeGrid<ApiErrorLogApi.ApiErrorL
exportListApi: ApiErrorLogApi.exportApiErrorLogApi exportListApi: ApiErrorLogApi.exportApiErrorLogApi
}) })
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') // const dialogTitle = ref('') //
// //
const handleDetail = (row: ApiErrorLogApi.ApiErrorLogVO) => { const handleDetail = (row: ApiErrorLogApi.ApiErrorLogVO) => {
// //
detailRef.value = row detailData.value = row
dialogTitle.value = t('action.detail') dialogTitle.value = t('action.detail')
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -8,7 +8,6 @@
node-key="id" node-key="id"
:data="preview.fileTree" :data="preview.fileTree"
:expand-on-click-node="false" :expand-on-click-node="false"
default-expanded-keys="[0]"
highlight-current highlight-current
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />

View File

@ -33,7 +33,7 @@
</ContentWrap> </ContentWrap>
<XModal v-model="dialogVisible" :title="dialogTitle"> <XModal v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> <Descriptions :schema="allSchemas.detailSchema" :data="detailData">
<template #retryInterval="{ row }"> <template #retryInterval="{ row }">
<span>{{ row.retryInterval + '毫秒' }} </span> <span>{{ row.retryInterval + '毫秒' }} </span>
</template> </template>
@ -69,13 +69,13 @@ const dialogVisible = ref(false) // 是否显示弹出层
const dialogTitle = ref('') // const dialogTitle = ref('') //
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = async (row: JobLogApi.JobLogVO) => { const handleDetail = async (row: JobLogApi.JobLogVO) => {
// //
const res = JobLogApi.getJobLogApi(row.id) const res = JobLogApi.getJobLogApi(row.id)
detailRef.value = res detailData.value = res
dialogTitle.value = t('action.detail') dialogTitle.value = t('action.detail')
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -101,7 +101,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
> >
<template #retryInterval="{ row }"> <template #retryInterval="{ row }">
<span>{{ row.retryInterval + '毫秒' }} </span> <span>{{ row.retryInterval + '毫秒' }} </span>
@ -161,7 +161,7 @@ const actionType = ref('') // 操作按钮的类型
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('edit') // const dialogTitle = ref('edit') //
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref const detailData = ref() // Ref
const nextTimes = ref([]) const nextTimes = ref([])
const shortcuts = ref([ const shortcuts = ref([
{ {
@ -198,7 +198,7 @@ const handleUpdate = async (rowId: number) => {
const handleDetail = async (rowId: number) => { const handleDetail = async (rowId: number) => {
// //
const res = await JobApi.getJobApi(rowId) const res = await JobApi.getJobApi(rowId)
detailRef.value = res detailData.value = res
// //
const jobNextTime = await JobApi.getJobNextTimesApi(rowId) const jobNextTime = await JobApi.getJobNextTimesApi(rowId)
nextTimes.value = jobNextTime nextTimes.value = jobNextTime

View File

@ -50,7 +50,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
/> />
<template #footer> <template #footer>
<!-- 按钮保存 --> <!-- 按钮保存 -->
@ -93,7 +93,7 @@ const dialogTitle = ref('edit') // 弹出层标题
const actionType = ref('') // const actionType = ref('') //
const actionLoading = ref(false) // Loading const actionLoading = ref(false) // Loading
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const setDialogTile = (type: string) => { const setDialogTile = (type: string) => {
@ -120,7 +120,7 @@ const handleDetail = async (rowId: number) => {
setDialogTile('detail') setDialogTile('detail')
// //
const res = await ErrorCodeApi.getErrorCodeApi(rowId) const res = await ErrorCodeApi.getErrorCodeApi(rowId)
detailRef.value = res detailData.value = res
} }
// //

View File

@ -20,7 +20,7 @@
<!-- 弹窗 --> <!-- 弹窗 -->
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle"> <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
<!-- 表单详情 --> <!-- 表单详情 -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
<template #footer> <template #footer>
<!-- 按钮关闭 --> <!-- 按钮关闭 -->
<XButton :title="t('dialog.close')" @click="dialogVisible = false" /> <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
@ -47,13 +47,13 @@ const { gridOptions, exportList } = useVxeGrid<LoginLogVO>({
}) })
// //
const detailRef = ref() // Ref const detailData = ref() // Ref
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref(t('action.detail')) // const dialogTitle = ref(t('action.detail')) //
// //
const handleDetail = async (row: LoginLogVO) => { const handleDetail = async (row: LoginLogVO) => {
// //
detailRef.value = row detailData.value = row
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -50,7 +50,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
> >
<template #content="{ row }"> <template #content="{ row }">
<Editor :model-value="row.content" read-only="true" /> <Editor :model-value="row.content" read-only="true" />
@ -98,7 +98,7 @@ const dialogTitle = ref('edit') // 弹出层标题
const actionType = ref('') // const actionType = ref('') //
const actionLoading = ref(false) // Loading const actionLoading = ref(false) // Loading
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const setDialogTile = (type: string) => { const setDialogTile = (type: string) => {
@ -125,7 +125,7 @@ const handleDetail = async (rowId: number) => {
setDialogTile('detail') setDialogTile('detail')
// //
const res = await NoticeApi.getNoticeApi(rowId) const res = await NoticeApi.getNoticeApi(rowId)
detailRef.value = res detailData.value = res
} }
// //

View File

@ -17,7 +17,7 @@
</ContentWrap> </ContentWrap>
<XModal v-model="dialogVisible" :title="dialogTitle"> <XModal v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" /> <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
<XButton :title="t('dialog.close')" @click="dialogVisible = false" /> <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
@ -45,13 +45,13 @@ const { gridOptions, getList } = useVxeGrid<TokenApi.OAuth2TokenVO>({
}) })
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref(t('action.detail')) // const dialogTitle = ref(t('action.detail')) //
// //
const handleDetail = async (row: TokenApi.OAuth2TokenVO) => { const handleDetail = async (row: TokenApi.OAuth2TokenVO) => {
// //
detailRef.value = row detailData.value = row
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -27,7 +27,7 @@
<!-- 弹窗 --> <!-- 弹窗 -->
<XModal id="postModel" v-model="dialogVisible" :title="t('action.detail')"> <XModal id="postModel" v-model="dialogVisible" :title="t('action.detail')">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> <Descriptions :schema="allSchemas.detailSchema" :data="detailData">
<template #resultCode="{ row }"> <template #resultCode="{ row }">
<span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span> <span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
</template> </template>
@ -63,11 +63,11 @@ const { gridOptions, exportList } = useVxeGrid<OperateLogApi.OperateLogVO>({
// //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const actionLoading = ref(false) // Loading const actionLoading = ref(false) // Loading
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const handleDetail = (row: OperateLogApi.OperateLogVO) => { const handleDetail = (row: OperateLogApi.OperateLogVO) => {
// //
detailRef.value = row detailData.value = row
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -64,7 +64,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
/> />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
@ -189,7 +189,7 @@ const actionType = ref('') // 操作按钮的类型
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('edit') // const dialogTitle = ref('edit') //
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref const detailData = ref() // Ref
// //
const setDialogTile = (type: string) => { const setDialogTile = (type: string) => {
@ -216,7 +216,7 @@ const handleDetail = async (rowId: number) => {
setDialogTile('detail') setDialogTile('detail')
// //
const res = await RoleApi.getRoleApi(rowId) const res = await RoleApi.getRoleApi(rowId)
detailRef.value = res detailData.value = res
} }
// //

View File

@ -22,7 +22,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
/> />
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
@ -53,10 +53,10 @@ const dialogVisible = ref(false) // 是否显示弹出层
const dialogTitle = ref('edit') // const dialogTitle = ref('edit') //
const actionType = ref('') // const actionType = ref('') //
// ========== ========== // ========== ==========
const detailRef = ref() // Ref const detailData = ref() // Ref
const handleDetail = (row: SmsLoglApi.SmsLogVO) => { const handleDetail = (row: SmsLoglApi.SmsLogVO) => {
// //
detailRef.value = row detailData.value = row
dialogVisible.value = true dialogVisible.value = true
} }

View File

@ -63,7 +63,7 @@
<Descriptions <Descriptions
v-if="actionType === 'detail'" v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema" :schema="allSchemas.detailSchema"
:data="detailRef" :data="detailData"
> >
<template #packageId="{ row }"> <template #packageId="{ row }">
<el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag> <el-tag v-if="row.packageId === 0" type="danger">系统租户</el-tag>
@ -112,7 +112,7 @@ const actionType = ref('') // 操作按钮的类型
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('edit') // const dialogTitle = ref('edit') //
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref const detailData = ref() // Ref
const getPackageName = (packageId: number) => { const getPackageName = (packageId: number) => {
for (let item of tenantPackageOption) { for (let item of tenantPackageOption) {
if (item.value === packageId) { if (item.value === packageId) {
@ -147,7 +147,7 @@ const handleUpdate = async (rowId: number) => {
const handleDetail = async (rowId: number) => { const handleDetail = async (rowId: number) => {
// //
const res = await TenantApi.getTenantApi(rowId) const res = await TenantApi.getTenantApi(rowId)
detailRef.value = res detailData.value = res
setDialogTile('detail') setDialogTile('detail')
} }