|  |  |  | 
|---|
|  |  |  | const visible = ref(false); | 
|---|
|  |  |  | const loading = ref(false); | 
|---|
|  |  |  | const form = reactive({ | 
|---|
|  |  |  | size: 'medium', | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | size: "medium", | 
|---|
|  |  |  | name: "", | 
|---|
|  |  |  | age: undefined, | 
|---|
|  |  |  | section: '0', | 
|---|
|  |  |  | province: 'haidian', | 
|---|
|  |  |  | section: "0", | 
|---|
|  |  |  | province: "haidian", | 
|---|
|  |  |  | options: [], | 
|---|
|  |  |  | date: '', | 
|---|
|  |  |  | time: '', | 
|---|
|  |  |  | radio: 'radio one', | 
|---|
|  |  |  | date: "", | 
|---|
|  |  |  | time: "", | 
|---|
|  |  |  | radio: "radio one", | 
|---|
|  |  |  | slider: 5, | 
|---|
|  |  |  | score: 5, | 
|---|
|  |  |  | switch: false, | 
|---|
|  |  |  | multiSelect: ['section one'], | 
|---|
|  |  |  | treeSelect: '', | 
|---|
|  |  |  | multiSelect: ["section one"], | 
|---|
|  |  |  | treeSelect: "", | 
|---|
|  |  |  | raptor: false, | 
|---|
|  |  |  | prompt: | 
|---|
|  |  |  | '请总结以下段落。 小心数字,不要编造。 段落如下:\n' + | 
|---|
|  |  |  | prompt: '请总结以下段落。 小心数字,不要编造。 段落如下:\n' + | 
|---|
|  |  |  | '      {cluster_content}\n' + | 
|---|
|  |  |  | '以上就是你需要总结的内容。', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | name: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | required: true, | 
|---|
|  |  |  | message: '名称不允许为空', | 
|---|
|  |  |  | message:'名称不允许为空', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleSubmit = ({ values, errors }) => { | 
|---|
|  |  |  | console.log('values:', values, '\nerrors:', errors); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleSubmit = ({values, errors}) => { | 
|---|
|  |  |  | console.log('values:', values, '\nerrors:', errors) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleClick = () => { | 
|---|
|  |  |  | visible.value = true; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const handleBeforeOk = (done) => { | 
|---|
|  |  |  | formRef.value.validate().then((res) => { | 
|---|
|  |  |  | console.log('form:', form); | 
|---|
|  |  |  | if (!form.name) { | 
|---|
|  |  |  | done(false); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | console.log('请求数据'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | formRef.value.validate().then(res => { | 
|---|
|  |  |  | console.log('form:', form) | 
|---|
|  |  |  | if (!form.name) { | 
|---|
|  |  |  | done(false) | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | console.log('请求数据'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const handleCancel = () => { | 
|---|
|  |  |  | visible.value = false; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleOpened = (el) => { | 
|---|
|  |  |  | Object.assign(form, { | 
|---|
|  |  |  | name: '', // 用户名 | 
|---|
|  |  |  | nameJoin: '', // 昵称 | 
|---|
|  |  |  | post: '', // 岗位 | 
|---|
|  |  |  | txt: '', // 备注 | 
|---|
|  |  |  | const handleOpened =(el) => { | 
|---|
|  |  |  | Object.assign(form,{ | 
|---|
|  |  |  | name: '',// 用户名 | 
|---|
|  |  |  | nameJoin: '',// 昵称 | 
|---|
|  |  |  | post: '',// 岗位 | 
|---|
|  |  |  | txt: '',// 备注 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | formRef.value.resetFields(); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const formRef = ref(null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const file = ref(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onChange = (_, currentFile) => { | 
|---|
|  |  |  | file.value = { | 
|---|
|  |  |  | ...currentFile, | 
|---|
|  |  |  | // url: URL.createObjectURL(currentFile.file), | 
|---|
|  |  |  | const rules = { | 
|---|
|  |  |  | name: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | required: true, | 
|---|
|  |  |  | message: '名称不允许为空', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const onProgress = (currentFile) => { | 
|---|
|  |  |  | file.value = currentFile; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | onBeforeMount(() => {}); | 
|---|
|  |  |  | onMounted(() => {}); | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | const handleSubmit = ({ values, errors }) => { | 
|---|
|  |  |  | console.log('values:', values, '\nerrors:', errors); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script lang="ts"> | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'add', | 
|---|
|  |  |  | methods: {}, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const handleClick = () => { | 
|---|
|  |  |  | visible.value = true; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const handleBeforeOk = (done) => { | 
|---|
|  |  |  | formRef.value.validate().then((res) => { | 
|---|
|  |  |  | console.log('form:', form); | 
|---|
|  |  |  | if (!form.name) { | 
|---|
|  |  |  | done(false); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | console.log('请求数据'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const handleCancel = () => { | 
|---|
|  |  |  | visible.value = false; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const handleOpened = (el) => { | 
|---|
|  |  |  | Object.assign(form, { | 
|---|
|  |  |  | name: '', // 用户名 | 
|---|
|  |  |  | nameJoin: '', // 昵称 | 
|---|
|  |  |  | post: '', // 岗位 | 
|---|
|  |  |  | txt: '', // 备注 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | formRef.value.resetFields(); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const file = ref(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onChange = (_, currentFile) => { | 
|---|
|  |  |  | file.value = { | 
|---|
|  |  |  | ...currentFile, | 
|---|
|  |  |  | // url: URL.createObjectURL(currentFile.file), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | const onProgress = (currentFile) => { | 
|---|
|  |  |  | file.value = currentFile; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | onBeforeMount(() => {}); | 
|---|
|  |  |  | onMounted(() => {}); | 
|---|
|  |  |  | </script> | 
|---|