修正文件管理两个bug:不显示“上传人”的问题、图片无法预览问题

This commit is contained in:
dataprince 2023-12-11 09:06:26 +08:00
parent 6aa2755864
commit 01c1f4ea3f
4 changed files with 8 additions and 426 deletions

View File

@ -4,14 +4,14 @@
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Ruoyi-Flex V4.1.8</h1>
<h4 align="center">Ruoyi-Flex是基于JDK21、Spring Boot V3.2.X+平台 前后端分离的Java快速开发框架</h4>
## 项目介绍
## 1、项目介绍
flex-elementplus-ui是Ruoyi-Flex的原来前端UI部分flex-ui 采用Vue3、Element-Plus、vite、Pinia等技术构建。
## 后端项目
## 2、后端项目
Ruoyi-Flex实行前后端分离仓库本项目是前端部分java后端项目是Ruoyi-Flex后端项目地址: [Ruoyi-Flex](https://gitee.com/dataprince/ruoyi-flex)
## 安装教程
## 3、安装教程
### 开发
@ -38,7 +38,7 @@ npm run build:stage
#### 构建生产环境
npm run build:prod
## Ruoyi-Flex交流群
## 4、Ruoyi-Flex交流群
本软件完全开源作者很忙如果您在使用过程中遇到问题请付点小费扫码支付199元后申请加入QQ群或者微信群寻求帮助
<table>
@ -52,7 +52,7 @@ npm run build:prod
</tr>
</table>
## 开源协议
## 5、开源协议
**为什么推荐使用本项目?**
@ -62,7 +62,7 @@ npm run build:prod
如果这个项目让您有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。
## 演示图
## 6、演示图
<table>
<tr>
@ -87,7 +87,7 @@ npm run build:prod
</tr>
</table>
## 参与贡献
## 7、参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支

View File

@ -1,249 +0,0 @@
<!-- 联想输入框+选择 -->
<template>
<div>
<el-autocomplete
v-model="targetName"
:fetch-suggestions="querySearchAsync"
:placeholder="placeholder"
:trigger-on-focus="false"
:disabled="disabled"
:size="size?'small':'default'"
:clearable="clearable"
@select="handleSelect">
<template #append>
<el-button @click="showSelect">
<el-icon>
<search/>
</el-icon>
</el-button>
</template>
<!-- 自定义下拉选项数据格式-->
<template #default="{ item }" v-if="type === 'employee' || type === 'customer'">
<span>{{ item.name }}</span> - <span>{{ item.value }}</span>
</template>
</el-autocomplete>
<!-- <el-input v-model="targetId" style="display: none" />-->
<!-- <employee-select v-if="employeeSelectVisible" ref="employeeSelectRef" @employeeSelect="employeeSelectHandle"/>-->
<customer-select v-if="customerSelectVisible" ref="customerSelectRef" @customerSelect="customerSelectHandle"/>
</div>
</template>
<script setup>
// import EmployeeSelect from '@/components/employee-select'
// import {getEmployee,listEmployee} from '@/api/employee/employee'
import CustomerSelect from '@/components/CustomerSelect'
import {listCadre} from '@/api/check/cadre'
const props = defineProps({
//
param: {
type: String,
required: true
},
//
index: {
type: Number,
default: 0,
required: false
},
//
type: {
type: String,
default: 'customer',
required: true
},
//
disabled: {
type: Boolean,
default: false,
required: false
},
//
filterWhere: {
type: String,
default: '',
required: false
},
//
filterObject: {
type: Object,
default: () => ({}),
required: false
},
// employeeId
targetIdProp: {
type: String,
default: ''
},
// employeeName
targetNameProp: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '关键字联想',
required: false
},
size: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
}
})
const { proxy } = getCurrentInstance();
//const employeeSelectVisible = ref(false)
const customerSelectVisible = ref(true)
const timeout = ref('')
//employeeIdemployeeName
const targetId = ref('')
const targetName = ref('')
const resultAllList = ref([])
const emits = defineEmits(['commonAutoCompleteSelect']);
watch(()=>props.targetIdProp, (val, oldVal) => {
if (val === null || val === undefined || val === '') {
return false
} else {
targetId.value = val
}
if (props.type === 'employee' && props.targetIdProp && !props.targetNameProp) {
getEmployeeName(val)
}
}, {immediate: true, deep: true});
watch(()=>props.targetNameProp, (val, oldVal) => {
if (!val) {
targetName.value = ''
} else {
targetName.value = props.targetNameProp
}
}, {immediate: true, deep: true});
watch(targetName, (newQuestion, oldQuestion) => {
if (newQuestion === '' || newQuestion === undefined) {
targetId.value = ''
emits('commonAutoCompleteSelect', props.param, '', '')
}
})
function init() {
nextTick(() => {
targetName.value = ''
})
}
function showSelect() {
if(props.disabled){
return
}
if (props.type === 'customer') {
showCustomerSelect()
}
}
//
function showEmployeeSelect() {
employeeSelectVisible.value = true
nextTick(() => {
proxy.$refs.employeeSelectRef.init()
})
}
function employeeSelectHandle(id, name, row) {
targetId.value = id
targetName.value = name
emits('commonAutoCompleteSelect', props.param, id, name, row, props.index)
}
//employeeIdemployeeName
function getEmployeeName(val) {
if (val === undefined || val === null || val === 'null') {
return false
} else {
getEmployee(targetId.value).then(res => {
if (res.code === 200) {
targetName.value = res.data?res.data.employeeName:''
}
})
proxy.$emit('commonAutoCompleteSelect', props.param, targetId.value, targetName.value)
}
}
//
function showCustomerSelect() {
customerSelectVisible.value = true
nextTick(() => {
// proxy.$refs.customerSelectRef.dataForm.value.customerId = props.filterWhere
proxy.$refs.customerSelectRef.init()
})
}
function customerSelectHandle(id, name, row) {
targetId.value = id
targetName.value = name
emits('commonAutoCompleteSelect', props.param, id, name, row, props.index)
}
// ------------------
function querySearchAsync(queryValue, cb) {
if (props.type === 'customer'
|| props.type === 'employee'
) {
searchAssociate(queryValue, cb)
}
}
// KeyUp()
function searchAssociate(queryValue, cb) {
if (queryValue === '' || queryValue === undefined) return
if (props.type === 'customer') {
listCadre({customerName: queryValue}).then((res) => {
resultAllList.value = loadQueryData(res)
cb(resultAllList.value)
})
}
}
//({id,name,value})
function loadQueryData(res) {
let serier = []
if (res.rows) {
for (let i = 0, l = res.rows.length; i < l; i++) {
let tempList = {
'id': res.rows[i].id
}
if (props.type === 'customer') {
tempList.name = res.rows[i].customerName
tempList.value = res.rows[i].customerName
}
serier.push(tempList)
}
if (res.rows.length === 0) {
serier.push({'value': '无查询数据'})
}
}
return serier
}
//
function handleSelect(item) {
emits('commonAutoCompleteSelect', props.param, item.id, item.value, item, props.index)
}
</script>
<style lang="scss">
</style>

View File

@ -1,169 +0,0 @@
<!-- 客户选择组件 -->
<template>
<el-dialog width="1010px"
v-model="dialogVisible"
:fullscreen="isFullScreen"
append-to-body>
<el-form :inline="true" :model="queryParams" class="demo-form-inline" @submit.prevent>
<el-form-item label="客户姓名">
<el-input v-model="queryParams.cadreName" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" border stripe @row-click="rowClick" highlight-current-row v-loading="dataListLoading">
<el-table-column label="编号" align="center" prop="cadreId" v-show="false"/>
<el-table-column label="姓名" align="center" prop="cadreName" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
<el-table-column label="性别" align="center" prop="cadreGender">
<template #default="scope">
<dict-tag :options="sys_user_gender" :value="scope.row.cadreGender"/>
</template>
</el-table-column>
<el-table-column label="纪检岗位" align="center" prop="cadreCheckpost">
<template #default="scope">
<dict-tag :options="sys_yes_no" :value="scope.row.cadreCheckpost"/>
</template>
</el-table-column>
<el-table-column label="是否在职" align="center" prop="cadreOnjob">
<template #default="scope">
<dict-tag :options="sys_yes_no" :value="scope.row.cadreOnjob"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<template #footer>
<div class="dialog-footer">
</div>
</template>
<!--注释代码 全屏-->
<template v-slot:title>
<div>
<span class="el-dialog__title">选择客户</span>
<el-tag v-if="id" ref="employeeTag" type="success">{{ name }}</el-tag>
<button type="button" @click="isFullScreen = !isFullScreen" aria-label="Close" class="el-dialog__headerbtn"
style="right: 40px">
<i class="el-dialog__close iconfont icon-sky-quanping3"></i>
</button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { listCadre } from "@/api/check/cadre";
import {reactive, ref, toRefs, nextTick, getCurrentInstance} from "vue"
const {proxy} = getCurrentInstance()
const { sys_yes_no, sys_user_gender } = proxy.useDict('sys_yes_no', 'sys_user_gender');
const dataListLoading = ref(false)
const dataList = ref([])
// const pageIndex = ref(1)
// const pageSize = ref(10)
//
const total = ref(0);
const dialogVisible = ref(false)
const isFullScreen = ref(false)
const id = ref('')
const name = ref('')
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
cadreName: null
}
})
const {queryParams} = toRefs(data)
const emit = defineEmits(["customerSelect"])
defineExpose({init})
function initData() {
id.value = ''
name.value = ''
queryParams.value.cadreName = ''
}
function init() {
dialogVisible.value = true
nextTick(() => {
isFullScreen.value = false
initData()
getDataList()
})
}
//
function getDataList() {
dataListLoading.value = true
listCadre(queryParams.value).then(response => {
if (response && response.code === 200) {
dataList.value = response.rows;
total.value = response.total;
} else {
dataList.value = []
total.value = 0
}
dataListLoading.value = false
});
// listCadre({
// pageNum: 1,
// pageSize: 10,
// cadreName: queryParams.value.cadreName
// }).then(response => {
// if (response && response.code === 200) {
// dataList.value = response.data.records
// totalPage.value = response.data.total
// } else {
// dataList.value = []
// totalPage.value = 0
// }
// dataListLoading.value = false
// })
}
//
function sizeChangeHandle(val) {
pageSize.value = val
pageIndex.value = 1
getDataList()
}
//
function currentChangeHandle(val) {
pageIndex.value = val
getDataList()
}
function rowClick(row, event, column) {
name.value = row.cadreName
id.value = row.cadreId
dialogVisible.value = false
emit('customerSelect', id.value, name.value, row)
}
</script>
<style lang="scss">
.el-dialog__body {
padding: 10px 20px;
color: #606266;
font-size: 14px;
}
.el-pagination {
margin-top: 10px;
text-align: right;
}
</style>

View File

@ -189,7 +189,7 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => {
loading.value = true;
const res = await getConfigKey("sys.oss.previewListResource");
previewListResource.value = res?.data === undefined ? true : res.data === 'true';
previewListResource.value = res?.data === undefined ? true : res.data === "true";
const response = await listOss(proxy?.addDateRange(queryParams.value, dateRangeCreateTime.value, "CreateTime"));
ossList.value = response.rows;
total.value = response.total;