Browse Source

Project Init

yigeren911 1 year ago
parent
commit
c91eb9e102

+ 4 - 12
src/components/pictureUpload/multiple.vue

@@ -51,19 +51,11 @@ const props = defineProps({
 });
 
 onMounted(() => {
-  if (props.modelValue?.length > 0) {
-    fileUrl.value = JSON.parse(props.modelValue ? props.modelValue : "[]");
-  } else {
-    fileUrl.value = [];
-  }
+  fileUrl.value = props.modelValue?.length > 0 ? JSON.parse(props.modelValue) : [];
 });
 
 watch(() => props.modelValue, () => {
-  if (props.modelValue?.length > 0) {
-    fileUrl.value = JSON.parse(props.modelValue ? props.modelValue : "[]");
-  } else {
-    fileUrl.value = [];
-  }
+  fileUrl.value = props.modelValue?.length > 0 ? JSON.parse(props.modelValue) : [];
 });
 
 
@@ -77,7 +69,7 @@ let previewUrl = computed(() => {
   let res = [];
   for (let i of fileUrl.value) {
     const baseUrl = import.meta.env.VITE_AXIOS_BASE_URL;
-    res.push(baseUrl + "/uploadFile/" + i);
+    res.push(baseUrl + "/uploadFile/" + i.url);
   }
   return res;
 });
@@ -91,7 +83,7 @@ function upload(file: any) {
   let fd = new FormData();
   fd.append("file", file.file);
   fileUpload(fd).then(res => {
-    fileUrl.value.push(res.data.fileUrl);
+    fileUrl.value.push({ url: res.data.fileUrl });
     emit("update:modelValue", JSON.stringify(fileUrl.value));
 
   });

+ 7 - 13
src/views/backend/enterprise/project/parking/index.vue

@@ -61,12 +61,12 @@
               <el-tag v-if="row.isHire == 1" style="margin: 0 5px;">出租</el-tag>
             </template>
           </el-table-column>
-          <el-table-column label="销售金额" width="100">
+          <el-table-column label="销售金额">
             <template #default="{ row }">
               <span v-if="row.isSale == 1" style="margin: 0 5px;">{{ row.salePrice }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="出售状态" width="100">
+          <el-table-column label="出售状态">
             <template #default="{ row }">
               <el-tag v-if="row.isSale == 1" :type="row.saleStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">
                 {{ row.saleStatus
@@ -74,12 +74,12 @@
               </el-tag>
             </template>
           </el-table-column>
-          <el-table-column label="租金" width="100">
+          <el-table-column label="租金">
             <template #default="{ row }">
               <span v-if="row.isHire == 1" style="margin: 0 5px;">{{ row.hirePrice }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="出租状态" width="100">
+          <el-table-column label="出租状态">
             <template #default="{ row }">
               <el-tag v-if="row.isHire == 1" :type="row.hireStatus == 1 ? 'info' : 'success'" style="margin: 0 5px;">
                 {{ row.hireStatus
@@ -87,7 +87,7 @@
               </el-tag>
             </template>
           </el-table-column>
-          <el-table-column label="是否标记" width="100">
+          <el-table-column label="是否标记">
             <template #default="{ row }">
               <el-tag :type="row.mapId == 0 ? 'danger' : 'success'" style="margin: 0 5px;">{{ row.mapId
               == 0 ? "未标记" : "已标记" }}
@@ -121,8 +121,8 @@
                        :background="true"
                        layout="sizes, prev, pager, next, jumper"
                        :total="total"
-                       @size-change="handleSizeChange"
-                       @current-change="handleCurrentChange"
+                       @size-change="getData()"
+                       @current-change="getData()"
         />
       </div>
     </div>
@@ -277,12 +277,6 @@ function getData() {
   });
 }
 
-const handleSizeChange = (val: number) => {
-  getData();
-};
-const handleCurrentChange = (val: number) => {
-  getData();
-};
 
 function openDialog(type: string, data: any = {}) {
   editDialogRef.value.open(type, data, districtId, communityId, buildingId);