This commit is contained in:
lcw
2026-01-23 15:43:22 +08:00
parent 47a7081963
commit 5b62d707ff
76 changed files with 3333 additions and 880 deletions

View File

@ -9,7 +9,7 @@
:action="actionUrl"
:list-type="props.showBtn ? '' : 'picture-card'"
:file-list="fileList"
show-file-list
:show-file-list="showFileList"
:before-remove="beforeRemove"
:on-exceed="handleExceed"
:on-success="handlerSuccess"
@ -82,6 +82,10 @@ const props = defineProps({
isAll: {
type: Boolean,
default: true //所有类型都可以用这个接口接口返回的是id
},
showFileList: {
type: Boolean,
default: true
}
});
const emits = defineEmits(["update:modelValue"]);
@ -102,9 +106,10 @@ watch(() => props.modelValue,(val) => {
// 确保file.url始终是字符串URL
const fileUrl = props.isAll ? `/mosty-api/mosty-base/minio/image/download/` + el.id : el.url;
return {
...el,
url: String(fileUrl || ''),
name: el.name || '',
id: el
};
} else {
return {
@ -113,6 +118,8 @@ watch(() => props.modelValue,(val) => {
};
}
});
console.log(fileList.value, "fileList.value");
},{ immediate: true,deep:true });
const actionUrl = computed(() => {
@ -173,8 +180,16 @@ const handlerSuccess = (res, file) => {
let arr = []
if(props.isImg){
arr = fileList.value.map((el) => el.id)
}else{
arr = fileList.value.map((el) => ({ id:el.id, name:el.name}))
} else {
console.log(fileList,"测试");
arr = fileList.value.map((el) => {
console.log(el,'xunhuan');
return {
id: el.id, name: el.name
}
})
console.log(arr,"测试2222");
}
emits("update:modelValue", arr);
};

View File

@ -8,9 +8,8 @@
:stripe="getConfiger.stripe" :height="tableHeight" v-loading="tableConfiger.loading" :lazy="getConfiger.lazy"
:load="load" :tree-props="treePros" style="width: 100%" :header-cell-class-name="() => 'HeadBgColor'"
:highlight-current-row="getConfiger.showSelectType === 'radio'"
@row-click="handleRowClick"
@cell-click="handleCellClick"
:row-style="(row, index) => getRowStyle(row, index)"
:row-class-name="(row, index) => getRowClassName(row, index)">
@ -98,7 +97,7 @@ const props = defineProps({
}
});
// 可选的时候选择的数据
const emit = defineEmits(["chooseData","handleRowClick"]);
const emit = defineEmits(["chooseData","handleRowClick","handleCellClick"]);
const multipleTableRef = ref();
const currentRow = ref();
let getConfiger = reactive({
@ -160,7 +159,6 @@ const load = (date, treeNode, resolve) => {
const getRowStyle = (row, index) => {
// 基础行高样式
const baseStyle = { height: getConfiger.rowHeight === 'auto' ? getConfiger.rowHeight : getConfiger.rowHeight + 'px' };
// 如果有自定义行样式函数,合并样式
if (props.rowStyle) {
const customStyle = props.rowStyle(row, index);
@ -200,6 +198,9 @@ function setDefaultChoose() {
const handleRowClick = (row) => {
emit("handleRowClick", row);
}
const handleCellClick = (row,column,event,cell) => {
emit("handleCellClick", {row,column,event,cell});
}
</script>
<style lang="scss"></style>

View File

@ -1,11 +1,11 @@
<template>
<div class="pageTitle" :style="`margin-bottom: ${marginBottom}px;background-color: ${backgroundColor}`">
<div class="pageTitle" :style="`margin-bottom: ${marginBottom}px;margin-top: ${marginTop}px;background-color: ${backgroundColor};height: ${height}px;`">
<div class="title">
<ul class="flex" v-if="Array.isArray(title)">
<li :class=" idx == active ? 'hedBtn':''" @click="handleBtn(it,idx)" class="pointer ml10 mr10" v-for="(it,idx) in title" :key="it">{{ it }}</li>
</ul>
<div class="font" v-else>{{ title }}</div>
<div class="ml30">
<div :style="`margin-left: ${ malginLeft==0?30:malginLeft}px`">
<slot name="left"></slot>
</div>
</div>
@ -28,15 +28,28 @@ defineProps({
marginBottom: {
type: Number,
default: 0
},
malginLeft: {
type: Number,
default: 0
},
active: {
type: Number,
default: 0
},
marginTop: {
type: Number,
default: 0
},
backgroundColor: {
type: String,
default: "rgb(255, 255, 255, 0)"
},
height: {
type: Number,
default: 52
}
});
const emit = defineEmits(["update:active","change"]);
@ -47,7 +60,7 @@ const handleBtn = (it, idx) => {
};
</script>
<style lang = "scss" scoped>
.pageTitle {
width: 100%;
@ -55,7 +68,7 @@ const handleBtn = (it, idx) => {
display: flex;
justify-content: space-between;
align-items: center;
min-height: 52px;
min-height: 30px;
.title {
display: flex;
margin: auto 0;
@ -71,4 +84,4 @@ const handleBtn = (it, idx) => {
color: #0072ff;
}
}
</style>
</style>

View File

@ -169,7 +169,7 @@ const props = defineProps({
},
marginBottom: {
type: Number,
default: 15
default: 0
},
backgroundColor: {
type: String,