|  | @@ -19,6 +19,8 @@ import { useRouter } from '../../../core/utils/router'
 | 
	
		
			
				|  |  |  import BottomAppBar from '@/components/bottom-app-bar.vue'
 | 
	
		
			
				|  |  |  import { toast } from '../../../core/utils/common'
 | 
	
		
			
				|  |  |  import { messages } from '../../../core/libs/messages'
 | 
	
		
			
				|  |  | +import { DataFormSchema } from '../../../components/data-form'
 | 
	
		
			
				|  |  | +import { ComponentExposed } from 'vue-component-type-helpers'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  const router = useRouter()
 | 
	
		
			
				|  |  |  const userStore = useUserStore()
 | 
	
	
		
			
				|  | @@ -28,12 +30,55 @@ const circleType = ref<CircleType>()
 | 
	
		
			
				|  |  |  const content = ref('')
 | 
	
		
			
				|  |  |  const fileList = ref([])
 | 
	
		
			
				|  |  |  const action = ref(`${import.meta.env.VITE_SERVER_BASEURL}/app-api/infra/file/upload`)
 | 
	
		
			
				|  |  | -const schema = ref({
 | 
	
		
			
				|  |  | -  spaceType: { label: '空间类型', type: 'Select', props: { columns: [] } },
 | 
	
		
			
				|  |  | -  designStyle: { label: '设计风格', type: 'Select', props: { columns: [] } },
 | 
	
		
			
				|  |  | -  spaceAddr: { label: '空间位置', type: 'TextField' },
 | 
	
		
			
				|  |  | -  customerDemand: { label: '客户需求', type: 'TextField' },
 | 
	
		
			
				|  |  | +const dataFormRef = ref<ComponentExposed<typeof DataForm>>()
 | 
	
		
			
				|  |  | +const schema = ref<DataFormSchema>({
 | 
	
		
			
				|  |  | +  spaceType: {
 | 
	
		
			
				|  |  | +    label: '空间类型:',
 | 
	
		
			
				|  |  | +    type: 'Select',
 | 
	
		
			
				|  |  | +    required: true,
 | 
	
		
			
				|  |  | +    labelWidth: 80,
 | 
	
		
			
				|  |  | +    props: {
 | 
	
		
			
				|  |  | +      columns: [],
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  designStyle: {
 | 
	
		
			
				|  |  | +    label: '设计风格:',
 | 
	
		
			
				|  |  | +    type: 'Select',
 | 
	
		
			
				|  |  | +    required: true,
 | 
	
		
			
				|  |  | +    labelWidth: 80,
 | 
	
		
			
				|  |  | +    props: { columns: [] },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  // spaceAddr: { label: '空间位置', type: 'TextField' },
 | 
	
		
			
				|  |  | +  spaceExtent: {
 | 
	
		
			
				|  |  | +    label: '空间面积:',
 | 
	
		
			
				|  |  | +    type: 'TextField',
 | 
	
		
			
				|  |  | +    required: true,
 | 
	
		
			
				|  |  | +    labelWidth: 80,
 | 
	
		
			
				|  |  | +    props: { placeholder: '请输入空间面积' },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  caseName: {
 | 
	
		
			
				|  |  | +    label: '案例名称:',
 | 
	
		
			
				|  |  | +    type: 'TextField',
 | 
	
		
			
				|  |  | +    required: true,
 | 
	
		
			
				|  |  | +    labelWidth: 80,
 | 
	
		
			
				|  |  | +    props: { placeholder: '请输入案例名称' },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  circleDesc: {
 | 
	
		
			
				|  |  | +    label: '案例描述:',
 | 
	
		
			
				|  |  | +    type: 'Textarea',
 | 
	
		
			
				|  |  | +    required: true,
 | 
	
		
			
				|  |  | +    labelWidth: 80,
 | 
	
		
			
				|  |  | +    props: { placeholder: '请输入案例描述' },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  // customerDemand: { label: '客户需求', type: 'TextField' },
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  | +const rules = {
 | 
	
		
			
				|  |  | +  spaceType: [{ required: true, message: '请选择空间类型' }],
 | 
	
		
			
				|  |  | +  designStyle: [{ required: true, message: '请选择设计风格' }],
 | 
	
		
			
				|  |  | +  spaceExtent: [{ required: true, message: '请填写空间面积' }],
 | 
	
		
			
				|  |  | +  caseName: [{ required: true, message: '请填写案例名称' }],
 | 
	
		
			
				|  |  | +  circleDesc: [{ required: true, message: '请填写案例描述' }],
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  const formData = ref({})
 | 
	
		
			
				|  |  |  const formInited = ref(false)
 | 
	
		
			
				|  |  |  const tagName = ref('')
 | 
	
	
		
			
				|  | @@ -43,11 +88,16 @@ const handleChange = ({ fileList: files }) => {
 | 
	
		
			
				|  |  |    console.log(fileList.value)
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  const handleSubmit = async () => {
 | 
	
		
			
				|  |  | -  publishing.value = true
 | 
	
		
			
				|  |  | +  const { valid, errors } = await dataFormRef.value.validate()
 | 
	
		
			
				|  |  | +  console.log(valid, errors)
 | 
	
		
			
				|  |  | +  if (!valid) {
 | 
	
		
			
				|  |  | +    return false
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |    if (!fileList.value.length) {
 | 
	
		
			
				|  |  |      toast(messages.moment.imageNotExist)
 | 
	
		
			
				|  |  |      return false
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  publishing.value = true
 | 
	
		
			
				|  |  |    const { code, msg } = await createCircle({
 | 
	
		
			
				|  |  |      stylistId: userInfo.value.userId,
 | 
	
		
			
				|  |  |      stylistName: userInfo.value.nickname,
 | 
	
	
		
			
				|  | @@ -99,7 +149,13 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  |    <div class="flex-grow bg-white p-3.5 flex flex-col">
 | 
	
		
			
				|  |  |      <template v-if="circleType === CircleType.case && formInited">
 | 
	
		
			
				|  |  | -      <DataForm v-model="formData" :schema="schema" direction="horizontal"></DataForm>
 | 
	
		
			
				|  |  | +      <DataForm
 | 
	
		
			
				|  |  | +        ref="dataFormRef"
 | 
	
		
			
				|  |  | +        v-model="formData"
 | 
	
		
			
				|  |  | +        :schema="schema"
 | 
	
		
			
				|  |  | +        :rules="rules"
 | 
	
		
			
				|  |  | +        direction="horizontal"
 | 
	
		
			
				|  |  | +      ></DataForm>
 | 
	
		
			
				|  |  |      </template>
 | 
	
		
			
				|  |  |      <template v-if="circleType === CircleType.moment">
 | 
	
		
			
				|  |  |        <wd-textarea v-model="content" placeholder="分享你此刻的想法" />
 | 
	
	
		
			
				|  | @@ -114,6 +170,12 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
 | 
	
		
			
				|  |  |          <div class="w-7 h-7 relative flex-col justify-start items-start flex"></div>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </div> -->
 | 
	
		
			
				|  |  | +    <div v-if="circleType === '2'" class="flex items-center">
 | 
	
		
			
				|  |  | +      <span class="text-[#ef4343] text-base font-normal font-['PingFang_SC'] leading-normal">
 | 
	
		
			
				|  |  | +        *
 | 
	
		
			
				|  |  | +      </span>
 | 
	
		
			
				|  |  | +      <SectionHeading title="实景图:" size="base" custom-class="my-5"></SectionHeading>
 | 
	
		
			
				|  |  | +    </div>
 | 
	
		
			
				|  |  |      <wd-upload
 | 
	
		
			
				|  |  |        :file-list="fileList"
 | 
	
		
			
				|  |  |        image-mode="aspectFill"
 |