|
|
|
@ -9,31 +9,24 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script lang="ts"> |
|
|
|
import { defineComponent, h } from 'vue'; |
|
|
|
import { defineComponent } from 'vue'; |
|
|
|
import { BasicUpload } from '/@/components/Upload'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
|
|
|
|
|
|
|
import { uploadApi } from '/@/api/sys/upload'; |
|
|
|
// import { Alert } from 'ant-design-vue'; |
|
|
|
|
|
|
|
const schemas: FormSchema[] = [ |
|
|
|
{ |
|
|
|
field: 'field1', |
|
|
|
component: 'Input', |
|
|
|
component: 'Upload', |
|
|
|
label: '字段1', |
|
|
|
colProps: { |
|
|
|
span: 8, |
|
|
|
}, |
|
|
|
rules: [{ required: true, type: 'array', message: '请选择上传文件' }], |
|
|
|
render: ({ model, field }) => { |
|
|
|
return h(BasicUpload, { |
|
|
|
value: model[field], |
|
|
|
api: uploadApi, |
|
|
|
onChange: (val: string[]) => { |
|
|
|
model[field] = val; |
|
|
|
}, |
|
|
|
}); |
|
|
|
rules: [{ required: true, message: '请选择上传文件' }], |
|
|
|
componentProps: { |
|
|
|
api: uploadApi, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
|