Browse Source

Project Init

yigeren911 1 year ago
parent
commit
76573cdb7a

+ 6 - 4
src/views/backend/enterprise/project/parking/editDialog.vue

@@ -71,8 +71,9 @@
             <el-col :span="12">
               <el-form-item label="出售状态" prop="saleStatus" v-if="formData.isSale == 1">
                 <el-select v-model="formData.saleStatus">
-                  <el-option :value="0" label="否"></el-option>
-                  <el-option :value="1" label="是"></el-option>
+                  <el-option :value="0" label="待售"></el-option>
+                  <el-option :value="1" label="已售"></el-option>
+                  <el-option :value="2" label="预订"></el-option>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -93,8 +94,9 @@
             <el-col :span="12">
               <el-form-item label="出租状态" prop="hireStatus" v-if="formData.isHire == 1">
                 <el-select v-model="formData.hireStatus">
-                  <el-option :value="0" label="否"></el-option>
-                  <el-option :value="1" label="是"></el-option>
+                  <el-option :value="0" label="待租"></el-option>
+                  <el-option :value="1" label="已租"></el-option>
+                  <el-option :value="2" label="预订"></el-option>
                 </el-select>
               </el-form-item>
             </el-col>

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

@@ -68,9 +68,9 @@
           </el-table-column>
           <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
-              == 1 ? "已售" : "待售" }}
+              <el-tag v-if="row.isSale == 1" :type="row.saleStatus == 1||row.saleStatus == 2 ? 'info' : 'success'"
+                      style="margin: 0 5px;">
+                {{ ["待售", "已售", "预售"][row.saleStatus] }}
               </el-tag>
             </template>
           </el-table-column>
@@ -81,9 +81,9 @@
           </el-table-column>
           <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
-              == 1 ? "已租" : "待租" }}
+              <el-tag v-if="row.isHire == 1" :type="row.hireStatus == 1||row.hireStatus == 2 ? 'info' : 'success'"
+                      style="margin: 0 5px;">
+                {{ ["待租", "已租", "预租"][row.hireStatus] }}
               </el-tag>
             </template>
           </el-table-column>

+ 17 - 17
src/views/backend/enterprise/project/parking/mapSetting.vue

@@ -82,7 +82,7 @@ let width = ref(0);
 let mapStyle = computed(() => {
   const baseUrl = import.meta.env.VITE_AXIOS_BASE_URL;
   return {
-    backgroundImage: `url(${baseUrl + "/uploadFile/" + props.imgUrl})`,
+    backgroundImage: `url(${ props.imgUrl})`,
     width: width.value + "px",
     height: height.value + "px",
     left: dragOption.x1 + "px",
@@ -111,7 +111,7 @@ function setImgSize(url) {
     width.value = m.clientWidth;
     height.value = m.clientWidth * (img.naturalHeight / img.naturalWidth);
   };
-  img.src = import.meta.env.VITE_AXIOS_BASE_URL + "/uploadFile/" + url;
+  img.src =  url;
 }
 
 watch(() => props.imgUrl, (newValue) => {
@@ -192,22 +192,22 @@ let formRules = reactive({
   id: [{ required: true, message: "不能为空", trigger: "blur" }]
 });
 
-let statusList = [
-  { label: "可售", backGround: "#0bc933", color: "#000000" },
-  { label: "已售", backGround: "#fd0002", color: "#ffffff" },
-  { label: "待租", backGround: "#fde801", color: "#000000" },
-  { label: "已租", backGround: "#006efd", color: "#ffffff" }
-];
 
 function setMarkStyle(row) {
-  if (row.saleStatus == 1) {
-    return { label: "已售", backGround: "#fd0002", color: "#ffffff" };
-  } else if (row.isSale == 1) {
-    return { label: "待售", backGround: "#0bc933", color: "#000000" };
-  } else if (row.isHire == 1) {
-    return { label: "已租", backGround: "#006efd", color: "#ffffff" };
-  } else {
-    return { label: "待租", backGround: "#fde801", color: "#000000" };
+  if (row.isSale === 1 && row.saleStatus === 0 && row.isHire === 1 && row.hireStatus == 0) {
+    return { label: "租售", backGround: "#fd0002", color: "#ffffff" };
+  } else if (row.isSale === 1 && row.saleStatus === 0) {
+    return { label: "待售", backGround: "#0bc933", color: "#ffffff" };
+  } else if (row.isSale === 1 && row.saleStatus == 1) {
+    return { label: "已售", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isSale === 1 && row.saleStatus == 2) {
+    return { label: "预售", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isHire === 1 && row.hireStatus == 0) {
+    return { label: "待租", backGround: "#006efd", color: "#ffffff" };
+  } else if (row.isHire === 1 && row.hireStatus == 1) {
+    return { label: "已租", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isHire === 1 && row.hireStatus == 2) {
+    return { label: "预租", backGround: "#fdda01", color: "#8a8a8a" };
   }
 
 }
@@ -334,7 +334,7 @@ function wheel(event) {
   justify-content: center;
   align-items: center;
   color: #ffffff;
-  white-space:nowrap;
+  white-space: nowrap;
   user-select: none;
   position: absolute;
   cursor: pointer;

+ 16 - 17
src/views/backend/enterprise/project/parking/parkingView.vue

@@ -63,7 +63,7 @@ let width = ref(0);
 let mapStyle = computed(() => {
   const baseUrl = import.meta.env.VITE_AXIOS_BASE_URL;
   return {
-    backgroundImage: `url(${baseUrl + "/uploadFile/" + props.imgUrl})`,
+    backgroundImage: `url(${ props.imgUrl})`,
     width: width.value + "px",
     height: height.value + "px",
     left: dragOption.x1 + "px",
@@ -91,7 +91,7 @@ function setImgSize(url) {
     width.value = m.clientWidth;
     height.value = m.clientWidth * (img.naturalHeight / img.naturalWidth);
   };
-  img.src = import.meta.env.VITE_AXIOS_BASE_URL + "/uploadFile/" + url;
+  img.src = url;
 }
 
 
@@ -144,22 +144,21 @@ function getItemStyle(item) {
   };
 }
 
-let statusList = [
-  { label: "可售", backGround: "#0bc933", color: "#000000" },
-  { label: "已售", backGround: "#fd0002", color: "#ffffff" },
-  { label: "待租", backGround: "#fde801", color: "#000000" },
-  { label: "已租", backGround: "#006efd", color: "#ffffff" }
-];
-
 function setMarkStyle(row) {
-  if (row.saleStatus == 1) {
-    return { label: "已售", backGround: "#fd0002", color: "#ffffff" };
-  } else if (row.isSale == 1) {
-    return { label: "待售", backGround: "#0bc933", color: "#000000" };
-  } else if (row.isHire == 1) {
-    return { label: "已租", backGround: "#006efd", color: "#ffffff" };
-  } else {
-    return { label: "待租", backGround: "#fde801", color: "#000000" };
+  if (row.isSale === 1 && row.saleStatus === 0 && row.isHire === 1 && row.hireStatus == 0) {
+    return { label: "租售", backGround: "#fd0002", color: "#ffffff" };
+  } else if (row.isSale === 1 && row.saleStatus === 0) {
+    return { label: "待售", backGround: "#0bc933", color: "#ffffff" };
+  } else if (row.isSale === 1 && row.saleStatus == 1) {
+    return { label: "已售", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isSale === 1 && row.saleStatus == 2) {
+    return { label: "预售", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isHire === 1 && row.hireStatus == 0) {
+    return { label: "待租", backGround: "#006efd", color: "#ffffff" };
+  } else if (row.isHire === 1 && row.hireStatus == 1) {
+    return { label: "已租", backGround: "#fdda01", color: "#8a8a8a" };
+  } else if (row.isHire === 1 && row.hireStatus == 2) {
+    return { label: "预租", backGround: "#fdda01", color: "#8a8a8a" };
   }
 
 }

+ 1 - 1
tsconfig.json

@@ -13,7 +13,7 @@
         "lib": ["esnext", "dom"],
         "baseUrl": "./",
         "paths": {
-            "/@/*": ["src/*"]
+            "/@/*": ["src/*"] 
         },
         "types": ["element-plus/global"]
     },