Skip to content
网游世界
网游世界

吾生有涯,而知无涯。

  • 首页
  • PHP
    • ThinkPHP
    • FastAdmin
    • webman
  • JavaScript
    • jQuery
    • AdminLTE
  • Free Pascal
  • Java
    • JeeSite
    • 若依
    • ruoyi-vue-pro
  • 其它
    • 操作系统
    • 树莓派
    • 前端
    • Null
  • 关于
网游世界

吾生有涯,而知无涯。

ruoyi-vue-pro 增加详情页面

3Vshej, 2024年6月9日 周日2024年6月9日 周日

默认情况下,没有详情页,这时候需要自己动手加一个,这里基于 Descriptions 组件。

零、/yudao-ui/yudao-ui-admin-vue3/src/components/UploadFile/src/UploadFile.vue 调整

<el-button link type="danger" @click="handleRemove(row.file)"> 删除</el-button>

改为,即当禁用时,不允许删除

<el-button v-if="!disabled" link type="danger" @click="handleRemove(row.file)"> 删除</el-button>

一、复制 EmployeeDimissionDetail.vue 、EmployeeDimissionDetail.ts 到指定要增加详情的目录。

EmployeeHealthCheckDetail.zip

二、列表页调整:

<!-- 详情操作按钮 -->
<el-button link type="primary" @click="openDetail(scope.row)"> 详情 </el-button>


<!-- 引入弹窗组件-->
<!-- 详情弹窗 -->
<EmployeeDimissionDetail ref="detailRef" />

/**  引入弹窗表单 */
import EmployeeDimissionDetail from './EmployeeDimissionDetail.vue'


/** 详情操作 */
const detailRef = ref()
const openDetail = (row: EmployeeDimissionRepVO) => {
    detailRef.value.open(row)
}

三、EmployeeTrainingEventDetail.vue 页修改地方:

1、import { allSchemas } from ‘./EmployeeTrainingEventDetail.ts’
2、defineOptions({ name: ‘EmployeeTrainingEventDetail’ })
3、await EmployeeManagementChangesRepApi.getEmployeeManagementChangesRep(info.id)

四、EmployeeTrainingEventDetail.ts 文件根据 EmployeeTrainingEventRepForm.vue 文件配置参数

五、EmployeeTrainingEventRepForm.vue 根据 EmployeeTrainingEventDetail.ts 对需要转换的字段处理(如,人员名称等)

六、其他

1、预览附件功能:

<!-- 单图或单附件 -->
        <Descriptions :data="data" :schema="allSchemas.detailSchema">
            <template #attachments="{ row }">
                <div v-if="row.attachments">
                    <el-image
                        v-if="row.attachments.includes('jpeg')"
                        class="h-80px w-80px"
                        lazy
                        :src="row.attachments"
                        :preview-src-list="[row.attachments]"
                        preview-teleported
                        fit="cover"
                    />
                    <el-link
                        v-else-if="row.attachments.includes('pdf')"
                        type="primary"
                        :href="row.attachments"
                        :underline="false"
                        target="_blank"
                        >预览</el-link
                    >
                    <el-link
                        v-else
                        type="primary"
                        download
                        :href="row.attachments"
                        :underline="false"
                        target="_blank"
                        >下载</el-link
                    >
                </div>
            </template>
        </Descriptions>

<!-- 多附件 -->
        <Descriptions :data="data" :schema="allSchemas.detailSchema">
            <template #file="{ row }">
                <UploadFile
                    disabled
                    v-model="row.file"
                />
            </template>
        </Descriptions>

<!-- 多字段多附件 -->
        <Descriptions :data="data" :schema="allSchemas.detailSchema">
            <template #level1File="{ row }">
                <UploadFile disabled v-model="row.level1File" />
            </template>
            <template #level2File="{ row }">
                <UploadFile disabled v-model="row.level2File" />
            </template>
            <template #level3File="{ row }">
                <UploadFile disabled v-model="row.level3File" />
            </template>
        </Descriptions>

 

2、自定义属性:

{
    label: '签订方式',
    field: 'signatureType',
    dictType: DICT_TYPE.SIGNATURE_TYPE,
    table: {
        width: 120
    },
    isSearch: false
},

    {
    label: '面试时间',
    field: 'interviewTime',
    formatter: dateFormatter,
    detail: {
        dateFormat: 'YYYY-MM-DD HH:mm:ss'
    },
    table: {
        width: 120
    }
},

相关:
CRUD 组件、useCrudSchemas

相关文章:

  1. JeeSite 列表中增加日期范围筛选 在开发中,需要进行日期范围筛选,那么可以按以下方法来进行。...
  2. JeeSite 导出数据 默认情况下,JeeSite 会自动生成导出代码,但有时候忘记了。这里介绍如何手动添加导出功能。...
  3. JeeSite 通过模板添加列表状态筛选 在 JeeSite 流程表单中,列表中可以通过流程状态来筛选不同状态的流程(审批)信息。...
  4. JeeSite 列表添加横向滚动条 在开发中,如何列表字段太多时,有些列会显示不全,这时候想展示全怎么办? 推荐使用第二种方法。...
Java ruoyi-vue-pro RuoYi-Vue-Pro 框架列表页前端表单

文章导航

Previous post
Next post

近期文章

  • Android Studio Gradle 配置国内镜像
  • 为什么重新发明轮子
  • ruoyi-vue-pro 匿名访问
  • VUE 中接收 code 异常
  • 关于 AI

归档

  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 8 月
  • 2024 年 7 月
  • 2024 年 6 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 12 月
除非特殊说明,本站作品采用知识共享署名 4.0 国际许可协议进行许可。
豫公网安备 41010402002622号 豫ICP备2020029609号-3
©2025 3Vshej