update:项目封面图

This commit is contained in:
2026-04-02 15:28:18 +08:00
parent dc049ee62b
commit f624cc4eef
4 changed files with 23 additions and 9 deletions

View File

@@ -145,6 +145,7 @@
:attrs="attrs"
v-model="formData[item.searchKey || item.key]"
:multiple="attrs.multiple"
:limit="attrs.limit"
:disabled="attrs.disabled || (item.disabled && showDisabled)"
@change="(val: any) => changeFun(item.key, val)"
/>

View File

@@ -52,19 +52,20 @@ interface Props {
modelValue: any;
multiple?: boolean;
disabled?: boolean;
limit?: any;
viewMode?: string;
limitUpload?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
modelValue: '',
multiple: false,
disabled: false,
limit: null,
viewMode: 'card', // card卡片模式 text文本模式 inline内联模式
limitUpload: false,
});
const imgList = ref<any>([]);
const limitNum = ref(0);
watch(
() => props.modelValue,
(val: any) => {
@@ -77,9 +78,20 @@ watch(
{ deep: true, immediate: true }
);
watch(
() => imgList.value,
(val: any) => {
limitNum.value = val.length;
}
);
const uploading = ref(false);
const percentage = ref(0);
const beforeUploadFun = (file: any) => {
if (props.limit && limitNum.value >= Number(props.limit)) {
return false;
}
limitNum.value++;
uploading.value = true;
const params = {
avatar: file,
@@ -92,12 +104,7 @@ const beforeUploadFun = (file: any) => {
.then((res: any) => {
if (res.code === 200) {
const avatarId = res.data.avatarId;
if (props.limitUpload) {
imgList.value = [avatarId];
} else {
imgList.value.push(avatarId);
}
imgList.value.push(avatarId);
updateFun(avatarId);
ElMessage.success('上传成功');
}

View File

@@ -19,7 +19,11 @@
nodeCode: { disabled: projectInfo.projectSource === 'EP' },
projectId: { disabled: projectInfo.projectSource === 'EP' },
nodeSubType: !!props.projectId ? {} : { defaultSelects: [0] },
detailImgUrl: {
limit: 1,
},
}"
:hideKeys="hideKeys"
@load="loadFun"
@change="formChangeFun"
v-model:data="editRowInfo"
@@ -57,6 +61,7 @@ import { PROJECT_EXE_STATUS_CODE } from '@/utils/enum/project';
import { getMemberListIds } from '@/utils/task';
import dayjs from 'dayjs';
import EpProjectSelect from './epProjectSelect.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
const props = defineProps<{
modelValue: boolean;
@@ -68,6 +73,7 @@ const tableFormRef = ref();
const loadingInterface = ref(false);
const epProjectId = ref<number | null>(null);
const hideKeys = ref<any>(enableConfigByTenant([TENANT_ENUM.BASE]) ? [] : ['detailImgUrl']);
const dialogVisible = computed(() => {
return props.modelValue;

View File

@@ -48,7 +48,7 @@
</template>
<script setup lang="ts">
import { ref, nextTick, watch, onMounted, reactive } from 'vue';
import { ref, nextTick, watch, reactive } from 'vue';
import TableForm from '@/components/common/table/tableForm.vue';
import appNameBg from './appNameBg.vue';
import html2canvas from 'html2canvas';