|
@@ -23,6 +23,7 @@ import {
|
|
|
getEditRecords,
|
|
|
updateDesignerFamilyInfo,
|
|
|
} from '../../../../core/libs/agent-requests'
|
|
|
+import { addUnit } from 'wot-design-uni/components/common/util'
|
|
|
import { messages } from '../../../../core/libs/messages'
|
|
|
import { omit } from 'radash'
|
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
@@ -59,8 +60,10 @@ const eventsQuery = computed(() => ({ type: '3' }))
|
|
|
const recordQuery = computed(() => ({ pageNo: 1, pageSize: 10 }))
|
|
|
const actionSheetStatus = ref(false)
|
|
|
const schema = ref<DataFormSchema>()
|
|
|
+const fileList = ref<any[]>([])
|
|
|
const formData = ref({
|
|
|
focus: '',
|
|
|
+ awardsFileUrl: '',
|
|
|
})
|
|
|
const formDataFoucs = ref<{
|
|
|
focus: string
|
|
@@ -133,8 +136,21 @@ const handleAddFamilyInfo = async (item: DesignerFamilyInfo) => {
|
|
|
schema.value = familySchema
|
|
|
actionSheetStatus.value = true
|
|
|
}
|
|
|
+const action = ref(`${import.meta.env.VITE_SERVER_BASEURL}/app-api/infra/file/upload`)
|
|
|
+const handleUploadChange = ({ fileList }) => {
|
|
|
+ formData.value.awardsFileUrl = fileList
|
|
|
+ .map((item: any) => {
|
|
|
+ if (item.response) {
|
|
|
+ return JSON.parse(item.response).data
|
|
|
+ } else {
|
|
|
+ return item.url
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .join(',')
|
|
|
+}
|
|
|
const handleAddAward = async () => {
|
|
|
submitType.value = 'award'
|
|
|
+ fileList.value = []
|
|
|
schema.value = {
|
|
|
awardsName: {
|
|
|
type: 'TextField',
|
|
@@ -159,10 +175,11 @@ const handleAddAward = async () => {
|
|
|
type: 'date',
|
|
|
},
|
|
|
},
|
|
|
- awardsFileUrl: {
|
|
|
- type: 'ImageUploader',
|
|
|
- label: messages.objects.designerAward.awardsFileUrl,
|
|
|
- },
|
|
|
+ // awardsFileUrl: {
|
|
|
+ // type: 'ImageUploader',
|
|
|
+ // label: messages.objects.designerAward.awardsFileUrl,
|
|
|
+ // callback: handleUploadChange,
|
|
|
+ // },
|
|
|
}
|
|
|
actionSheetStatus.value = true
|
|
|
}
|
|
@@ -512,34 +529,7 @@ onShow(async () => {
|
|
|
</wd-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- :mock-list="[-->
|
|
|
- <!-- { awardsName: '123', awardsRank: '123' },-->
|
|
|
- <!-- {-->
|
|
|
- <!-- awardsName: '筑巢奖',-->
|
|
|
- <!-- },-->
|
|
|
- <!-- ]"-->
|
|
|
<ListHelperEvo ref="awardsListRef" :request="getAwards" :query="{ userId: id }">
|
|
|
- <!-- <template #default="{ item, isLast }">-->
|
|
|
- <!-- <div class="flex flex-col gap-4 py-4">-->
|
|
|
- <!-- <SectionHeading-->
|
|
|
- <!-- title="奖项名称"-->
|
|
|
- <!-- size="base"-->
|
|
|
- <!-- :end-text="item.awardsName"-->
|
|
|
- <!-- ></SectionHeading>-->
|
|
|
- <!-- <SectionHeading-->
|
|
|
- <!-- title="奖项日期"-->
|
|
|
- <!-- :end-text="item.awardsTime && dayjs(item.awardsTime).format('YYYY-MM-DD')"-->
|
|
|
- <!-- ></SectionHeading>-->
|
|
|
- <!-- <SectionHeading title="奖项名次" :end-text="item.awardsRank"></SectionHeading>-->
|
|
|
- <!-- <SectionHeading-->
|
|
|
- <!-- title="奖项照片"-->
|
|
|
- <!-- end-arrow-->
|
|
|
- <!-- :path="`/pages/agent/designer/archives/award/photos/index?urls=${item.awardsFileUrl ?? ''}`"-->
|
|
|
- <!-- ></SectionHeading>-->
|
|
|
- <!-- <wd-button type="text" @click="handleDeleteAward(item)">删除</wd-button>-->
|
|
|
- <!-- <div v-if="!isLast" class="w-full h-1 bg-[#dadada]"></div>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </template>-->
|
|
|
<template #list="{ list }">
|
|
|
<template v-for="(item, i) in list" :key="i">
|
|
|
<div class="flex flex-col gap-4 py-4">
|
|
@@ -679,6 +669,22 @@ onShow(async () => {
|
|
|
<wd-action-sheet v-model="actionSheetStatus">
|
|
|
<div class="p-4">
|
|
|
<DataForm :schema="schema" :direction="'horizontal'" v-model="formData"></DataForm>
|
|
|
+ <template v-if="submitType = 'award'">
|
|
|
+ <div
|
|
|
+ class="grid mb-4 items-start"
|
|
|
+ :style="{ 'grid-template-columns': `${addUnit(64)} auto` }"
|
|
|
+ >
|
|
|
+ <label class="text-sm font-normal leading-relaxed text-black/60 h-10 flex items-center">
|
|
|
+ 附件
|
|
|
+ </label>
|
|
|
+ <wd-upload
|
|
|
+ :file-list="fileList"
|
|
|
+ image-mode="aspectFill"
|
|
|
+ :action="action"
|
|
|
+ @change="handleUploadChange"
|
|
|
+ ></wd-upload>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<wd-button :round="false" block @click="handleSubmit">提交</wd-button>
|
|
|
</div>
|
|
|
</wd-action-sheet>
|