This commit is contained in:
2025-02-14 09:18:01 +08:00
36 changed files with 2486 additions and 318 deletions

View File

@@ -163,7 +163,9 @@
:preview-src-list="scope.row[col.prop]"
:initial-index="index"
:preview-teleported="true"
:style="`width: ${col.imageWidth ?? 40}px; height: ${col.imageHeight ?? 40}px`"
:style="`width: ${col.imageWidth ?? 40}px; height: ${
col.imageHeight ?? 40
}px`"
/>
</template>
</template>
@@ -923,8 +925,10 @@ function fetchPageData(formData: IObject = {}, isRestart = false) {
if (props.contentConfig.parseData) {
data = props.contentConfig.parseData(data);
}
pagination.total = data.total;
pageData.value = data.list;
pagination.total = !props.contentConfig.resultListKey ? data.length : data.totalRow * 1;
pageData.value = props.contentConfig.resultListKey
? data[props.contentConfig.resultListKey]
: data;
} else {
pageData.value = data;
}

View File

@@ -21,9 +21,16 @@
</span>
</template>
<!-- Input 输入框 -->
{{ item.type }}
<template v-if="item.type === 'input' || item.type === undefined">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
</template>
<!-- textarea 输入框 -->
<template v-else-if="item.type === 'textarea' || item.type === undefined">
<el-input v-model="formData[item.prop]" type="textarea" v-bind="item.attrs" />
</template>
<!-- Select 选择器 -->
<template v-else-if="item.type === 'select'">
<el-select v-model="formData[item.prop]" v-bind="item.attrs">
@@ -131,7 +138,7 @@ prepareFuncs.forEach((func) => func());
// 获取表单数据
function getFormData(key?: string) {
return key === undefined ? formData : (formData[key] ?? undefined);
return key === undefined ? formData : formData[key] ?? undefined;
}
// 设置表单值

View File

@@ -39,6 +39,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' || item.type === undefined">
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
</template>
<!-- Select 选择器 -->
<template v-else-if="item.type === 'select'">
<el-select v-model="formData[item.prop]" v-bind="item.attrs">
@@ -288,7 +292,7 @@ prepareFuncs.forEach((func) => func());
// 获取表单数据
function getFormData(key?: string) {
return key === undefined ? formData : (formData[key] ?? undefined);
return key === undefined ? formData : formData[key] ?? undefined;
}
// 设置表单值

View File

@@ -55,6 +55,7 @@ export interface ISearchConfig {
}
export interface IContentConfig<T = any> {
resultListKey?: string;
// 页面名称(参与组成权限标识,如sys:user:xxx)
pageName: string;
// table组件属性
@@ -218,6 +219,7 @@ export type IFormItems<T = any> = Array<{
// 组件类型(如input,select,radio,custom等默认input)
type?:
| "input"
| "textarea"
| "select"
| "radio"
| "switch"

View File

@@ -26,7 +26,7 @@
<script setup lang="ts">
import { UploadRawFile, UploadRequestOptions } from "element-plus";
import FileAPI, { FileInfo } from "@/api/file";
import CommonApi, { FileInfo, uploadResponse } from "@/api/account/common";
const props = defineProps({
/**
@@ -130,7 +130,7 @@ function handleUpload(options: UploadRequestOptions) {
formData.append(key, props.data[key]);
});
FileAPI.upload(formData)
CommonApi.upload(formData)
.then((data) => {
resolve(data);
})
@@ -152,9 +152,9 @@ function handleDelete() {
*
* @param fileInfo 上传成功后的文件信息
*/
const onSuccess = (fileInfo: FileInfo) => {
const onSuccess = (fileInfo: string) => {
ElMessage.success("上传成功");
modelValue.value = fileInfo.url;
modelValue.value = fileInfo;
};
/**