This commit is contained in:
2025-02-14 15:49:41 +08:00
23 changed files with 958 additions and 342 deletions

View File

@@ -28,7 +28,7 @@
</template>
<!-- textarea 输入框 -->
<template v-else-if="item.type === 'textarea' || item.type === undefined">
<template v-else-if="item.type === 'textarea'">
<el-input v-model="formData[item.prop]" type="textarea" v-bind="item.attrs" />
</template>
<!-- Select 选择器 -->

View File

@@ -24,8 +24,8 @@
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
</template>
<!-- textarea 输入框 -->
<template v-if="item.type === 'textarea' || item.type === undefined">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
<template v-if="item.type === 'textarea'">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" type="textarea" />
</template>
<!-- Select 选择器 -->
<template v-else-if="item.type === 'select'">
@@ -123,6 +123,10 @@
<template v-if="item.type === 'input' || item.type === undefined">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
</template>
<!-- textarea 输入框 -->
<template v-if="item.type === 'textarea'">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" type="textarea" />
</template>
<!-- Select 选择器 -->
<template v-else-if="item.type === 'select'">
<el-select v-model="formData[item.prop]" v-bind="item.attrs">

View File

@@ -5,7 +5,7 @@
shadow="never"
class="mb-[10px]"
>
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form ref="queryFormRef" :model="queryParams" :inline="inline">
<template v-for="(item, index) in formItems" :key="item.prop">
<el-form-item
v-show="isExpand ? true : index < showNumber"
@@ -36,6 +36,14 @@
@keyup.enter="handleQuery"
/>
</template>
<!-- radio-button radio按钮组 -->
<template v-if="item.type === 'radio-button'">
<el-radio-group v-model="queryParams[item.prop]" v-bind="item.attrs">
<template v-for="option in item.options" :key="option.value">
<el-radio-button :label="option.label" :value="option.value" />
</template>
</el-radio-group>
</template>
<!-- InputTag 标签输入框 -->
<template v-if="item.type === 'input-tag'">
<div class="flex-center">
@@ -131,6 +139,10 @@ const emit = defineEmits<{
}>();
const queryFormRef = ref<FormInstance>();
//form表单展示形式
const inline = ref<boolean>(
props.searchConfig.inline === undefined ? true : !!props.searchConfig.inline
);
// 是否显示
const visible = ref(true);
// 响应式的formItems

View File

@@ -29,10 +29,11 @@ export interface IOperatData {
export interface ISearchConfig {
// 页面名称(参与组成权限标识,如sys:user:xxx)
pageName: string;
inline?: Boolean;
// 表单项
formItems: Array<{
// 组件类型(如input,select等)
type?: "input" | "select" | "tree-select" | "date-picker" | "input-tag";
type?: "input" | "select" | "tree-select" | "date-picker" | "input-tag" | "radio-button";
// 标签文本
label: string;
// 标签提示

View File

@@ -49,7 +49,7 @@ import {
UploadRequestOptions,
} from "element-plus";
import FileAPI, { FileInfo } from "@/api/file";
import CommonApi, { FileInfo, uploadResponse } from "@/api/account/common";
const props = defineProps({
/**
@@ -165,7 +165,7 @@ function handleUpload(options: UploadRequestOptions) {
formData.append(key, props.data[key]);
});
FileAPI.upload(formData)
CommonApi.upload(formData)
.then((data) => {
resolve(data);
})
@@ -187,9 +187,9 @@ const handleProgress = (event: UploadProgressEvent) => {
/**
* 上传成功
*/
const handleSuccess = (fileInfo: FileInfo) => {
const handleSuccess = (fileInfo: string) => {
ElMessage.success("上传成功");
modelValue.value = [...modelValue.value, fileInfo.url];
modelValue.value = [...modelValue.value, fileInfo];
};
const handleError = (error: any) => {
@@ -200,19 +200,19 @@ const handleError = (error: any) => {
* 删除文件
*/
function handleRemove(fileUrl: string) {
FileAPI.delete(fileUrl).then(() => {
modelValue.value = modelValue.value.filter((url) => url !== fileUrl);
});
// CommonApi.delete(fileUrl).then(() => {
modelValue.value = modelValue.value.filter((url) => url !== fileUrl);
// });
}
/**
* 下载文件
*/
function handleDownload(file: UploadUserFile) {
const { url, name } = file;
if (url) {
FileAPI.download(url, name);
}
// const { url, name } = file;
// if (url) {
// CommonApi.download(url, name);
// }
}
</script>
<style lang="scss" scoped>