From c1498006d64ac53630980aaa2aaf424300e9815c Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期一, 05 八月 2024 10:24:34 +0800
Subject: [PATCH] fix: 获取URL

---
 src/views/dmx/model/components/addModel.vue |  214 +++++++++++++++++++++++++++--------------------------
 1 files changed, 109 insertions(+), 105 deletions(-)

diff --git a/src/views/dmx/model/components/addModel.vue b/src/views/dmx/model/components/addModel.vue
index eeab066..35c9ce5 100644
--- a/src/views/dmx/model/components/addModel.vue
+++ b/src/views/dmx/model/components/addModel.vue
@@ -1,18 +1,26 @@
-
 <template>
   <a-button type="primary" @click="handleClick" style="margin-left: 10px">
     <template #icon>
       <icon-plus />
     </template>
   </a-button>
-  <a-modal v-model:visible="visible" title="娣诲姞妯″紡"
-           @before-open="handleOpened"
-           @cancel="handleCancel"
-           :footer="false"
-           title-align="start"
-           width="600px"
+  <a-modal
+    v-model:visible="visible"
+    title="娣诲姞妯″紡"
+    @before-open="handleOpened"
+    @cancel="handleCancel"
+    :footer="false"
+    title-align="start"
+    width="600px"
   >
-    <a-form ref="formRef" :rules="rules" :model="form" @submit="handleSubmit" :style="{width:'90%',margin:'0 auto'}" layout="vertical" >
+    <a-form
+      ref="formRef"
+      :rules="rules"
+      :model="form"
+      @submit="handleSubmit"
+      :style="{ width: '90%', margin: '0 auto' }"
+      layout="vertical"
+    >
       <a-form-item field="name" label="妯″瀷绫诲瀷">
         <a-select v-model="form.section" placeholder="璇烽�夋嫨">
           <a-option value="section one">Section One</a-option>
@@ -21,7 +29,7 @@
         </a-select>
       </a-form-item>
       <a-form-item field="name" label="妯″瀷鍚嶇О">
-        <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"/>
+        <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�" />
       </a-form-item>
       <a-form-item field="section" label="妯″瀷鍥剧墖">
         <a-space direction="vertical" :style="{ width: '100%' }">
@@ -35,8 +43,10 @@
             <template #upload-button>
               <div
                 :class="`arco-upload-list-item${
-            file && file.status === 'error' ? ' arco-upload-list-item-error' : ''
-          }`"
+                  file && file.status === 'error'
+                    ? ' arco-upload-list-item-error'
+                    : ''
+                }`"
               >
                 <div
                   class="arco-upload-list-picture custom-upload-avatar"
@@ -52,11 +62,11 @@
                     type="circle"
                     size="mini"
                     :style="{
-                position: 'absolute',
-                left: '50%',
-                top: '50%',
-                transform: 'translateX(-50%) translateY(-50%)',
-              }"
+                      position: 'absolute',
+                      left: '50%',
+                      top: '50%',
+                      transform: 'translateX(-50%) translateY(-50%)',
+                    }"
                   />
                 </div>
                 <div class="arco-upload-picture-card" v-else>
@@ -71,16 +81,18 @@
         </a-space>
       </a-form-item>
       <a-form-item field="name" label="鍩虹Url">
-        <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"/>
+        <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�" />
       </a-form-item>
       <a-form-item field="raptor" label="鏄惁鏀寔 Vision">
         <a-switch v-model="form.raptor" />
       </a-form-item>
 
       <a-form-item>
-        <div style="width: 100%;text-align: right">
+        <div style="width: 100%; text-align: right">
           <a-button @click="visible = false">鍙栨秷</a-button>
-          <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button>
+          <a-button style="margin-left: 10px" type="primary" html-type="submit"
+            >纭畾</a-button
+          >
         </div>
       </a-form-item>
     </a-form>
@@ -88,100 +100,92 @@
 </template>
 
 <script lang="ts" setup>
-import { onMounted ,onBeforeMount, reactive, ref } from "vue";
+  import { onMounted, onBeforeMount, reactive, ref } from 'vue';
 
-const visible = ref(false);
-const loading = ref(false);
-const form = reactive({
-  size: "medium",
-  name: "",
-  age: undefined,
-  section: "0",
-  province: "haidian",
-  options: [],
-  date: "",
-  time: "",
-  radio: "radio one",
-  slider: 5,
-  score: 5,
-  switch: false,
-  multiSelect: ["section one"],
-  treeSelect: "",
-  raptor: false,
-  prompt: '璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n' +
-    '      {cluster_content}\n' +
-    '浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��',
-});
-const formRef = ref(null);
-
-const rules = {
-  name: [
-    {
-      required: true,
-      message:'鍚嶇О涓嶅厑璁镐负绌�',
-    },
-  ],
-}
-
-
-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('璇锋眰鏁版嵁');
-
-      }
-    })
-};
-const handleCancel = () => {
-  visible.value = false;
-}
-
-const handleOpened =(el) => {
-  Object.assign(form,{
-    name: '',// 鐢ㄦ埛鍚�
-    nameJoin: '',// 鏄电О
-    post: '',// 宀椾綅
-    txt: '',// 澶囨敞
+  const visible = ref(false);
+  const loading = ref(false);
+  const form = reactive({
+    size: 'medium',
+    name: '',
+    age: undefined,
+    section: '0',
+    province: 'haidian',
+    options: [],
+    date: '',
+    time: '',
+    radio: 'radio one',
+    slider: 5,
+    score: 5,
+    switch: false,
+    multiSelect: ['section one'],
+    treeSelect: '',
+    raptor: false,
+    prompt:
+      '璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n' +
+      '      {cluster_content}\n' +
+      '浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��',
   });
-  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(()=>{
+  const handleSubmit = ({ values, errors }) => {
+    console.log('values:', values, '\nerrors:', errors);
+  };
 
-})
-onMounted(()=>{
+  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>
 
 <script lang="ts">
-export default {
-  name: 'add',
-  methods: {
-
-  }
-};
-</script>
\ No newline at end of file
+  export default {
+    name: 'add',
+    methods: {},
+  };
+</script>

--
Gitblit v1.8.0