yigeren911 před 2 roky
rodič
revize
1e0eeef556

+ 5 - 0
.idea/.gitignore

@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 58 - 0
.idea/codeStyles/Project.xml

@@ -0,0 +1,58 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <HTMLCodeStyleSettings>
+      <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
+      <option name="HTML_ENFORCE_QUOTES" value="true" />
+    </HTMLCodeStyleSettings>
+    <JSCodeStyleSettings version="0">
+      <option name="FORCE_SEMICOLON_STYLE" value="true" />
+      <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
+      <option name="FORCE_QUOTE_STYlE" value="true" />
+      <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
+      <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
+      <option name="SPACES_WITHIN_IMPORTS" value="true" />
+    </JSCodeStyleSettings>
+    <TypeScriptCodeStyleSettings version="0">
+      <option name="FORCE_SEMICOLON_STYLE" value="true" />
+      <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
+      <option name="FORCE_QUOTE_STYlE" value="true" />
+      <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
+      <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
+      <option name="SPACES_WITHIN_IMPORTS" value="true" />
+    </TypeScriptCodeStyleSettings>
+    <VueCodeStyleSettings>
+      <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
+      <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
+    </VueCodeStyleSettings>
+    <codeStyleSettings language="HTML">
+      <option name="SOFT_MARGINS" value="80" />
+      <indentOptions>
+        <option name="INDENT_SIZE" value="2" />
+        <option name="CONTINUATION_INDENT_SIZE" value="2" />
+        <option name="TAB_SIZE" value="2" />
+      </indentOptions>
+    </codeStyleSettings>
+    <codeStyleSettings language="JavaScript">
+      <option name="SOFT_MARGINS" value="80" />
+      <indentOptions>
+        <option name="INDENT_SIZE" value="2" />
+        <option name="CONTINUATION_INDENT_SIZE" value="2" />
+        <option name="TAB_SIZE" value="2" />
+      </indentOptions>
+    </codeStyleSettings>
+    <codeStyleSettings language="TypeScript">
+      <option name="SOFT_MARGINS" value="80" />
+      <indentOptions>
+        <option name="INDENT_SIZE" value="2" />
+        <option name="CONTINUATION_INDENT_SIZE" value="2" />
+        <option name="TAB_SIZE" value="2" />
+      </indentOptions>
+    </codeStyleSettings>
+    <codeStyleSettings language="Vue">
+      <option name="SOFT_MARGINS" value="80" />
+      <indentOptions>
+        <option name="CONTINUATION_INDENT_SIZE" value="2" />
+      </indentOptions>
+    </codeStyleSettings>
+  </code_scheme>
+</component>

+ 5 - 0
.idea/codeStyles/codeStyleConfig.xml

@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+  <state>
+    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+  </state>
+</component>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/parking.iml" filepath="$PROJECT_DIR$/.idea/parking.iml" />
+    </modules>
+  </component>
+</project>

+ 12 - 0
.idea/parking.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 1 - 0
src/api/controllerUrls.ts

@@ -64,3 +64,4 @@ export const building = "/community/building/"; //楼宇管理
 export const map = "/map/"; //地图管理
 export const parking = "/parking/"; //车位管理
 
+export const buildingTree = "/common/tree";//楼宇位置树

+ 3 - 1
src/components/pictureUpload/multiple.vue

@@ -1,7 +1,7 @@
 <template>
     <div v-for="(item ,index) in previewUrl" style="position:relative;">
         <!-- <img v-if="previewUrl?.length>0" :src="item" class="box" style="cursor: pointer" @click="clickImg(item)"/> -->
-        <el-image :preview-teleported="true" :preview-src-list="previewUrl" :initial-index="index"
+        <el-image ref="imageRef" :preview-teleported="true" :preview-src-list="previewUrl" :initial-index="index"
                   :src="item" class="box"/>
         <el-icon
             style="position: absolute;top: 10px;right: 7px;color: red;cursor: pointer" @click="del(index)">
@@ -47,6 +47,8 @@ const props = defineProps({
     }
 })
 
+const imageRef = ref()
+
 onMounted(() => {
     if (props.fileUrl?.length>0) {
         previewUrl.value = JSON.parse(props.fileUrl)

+ 202 - 200
src/views/backend/dashboard.vue

@@ -148,200 +148,7 @@
     </div>
 </template>
 
-<style scoped lang="scss">
-.welcome {
-    transition: all 0.3s ease;
-    background: #e1eaf9;
-    border-radius: 6px;
-    display: flex;
-    align-items: center;
-    padding: 15px 20px !important;
-    box-shadow: 0 0 30px 0 rgba(82, 63, 105, 0.05);
-    .welcome-img {
-        height: 100px;
-        margin-right: 10px;
-        user-select: none;
-    }
-    .welcome-title {
-        font-size: 1.5rem;
-        line-height: 30px;
-        color: var(--color-primary-sub-0);
-    }
-    .welcome-note {
-        padding-top: 6px;
-        font-size: 15px;
-        color: var(--color-text-primary);
-    }
-}
-.working {
-    height: 130px;
-    display: flex;
-    justify-content: center;
-    flex-wrap: wrap;
-    height: 100%;
-    position: relative;
-    &:hover {
-        .working-coffee {
-            -webkit-transform: translateY(-4px) scale(1.02);
-            -moz-transform: translateY(-4px) scale(1.02);
-            -ms-transform: translateY(-4px) scale(1.02);
-            -o-transform: translateY(-4px) scale(1.02);
-            transform: translateY(-4px) scale(1.02);
-            z-index: 999;
-        }
-    }
-    .working-coffee {
-        transition: all 0.3s ease;
-        width: 80px;
-    }
-    .working-text {
-        display: block;
-        width: 100%;
-        font-size: 15px;
-        text-align: center;
-        color: var(--color-text-primary);
-    }
-    .working-opt {
-        position: absolute;
-        top: -40px;
-        right: 10px;
-        background-color: rgba($color: #000000, $alpha: 0.3);
-        padding: 10px 20px;
-        border-radius: 20px;
-        color: #fff;
-        transition: all 0.3s ease;
-        cursor: pointer;
-        opacity: 0;
-        z-index: 999;
-        &:active {
-            background-color: rgba($color: #000000, $alpha: 0.6);
-        }
-    }
-    &:hover {
-        .working-opt {
-            opacity: 1;
-            top: 0px;
-        }
-        .working-done {
-            opacity: 1;
-            top: 50px;
-        }
-    }
-}
-.small-panel-box {
-    margin-top: 20px;
-}
-.small-panel {
-    background-color: #e9edf2;
-    border-radius: var(--el-border-radius-base);
-    transition: all 0.3s ease;
-    padding: 25px;
-    margin-bottom: 20px;
-    .small-panel-title {
-        color: #92969a;
-        font-size: 15px;
-    }
-    .small-panel-content {
-        display: flex;
-        align-items: flex-end;
-        margin-top: 20px;
-        color: #2c3f5d;
-        .content-left {
-            font-size: 24px;
-            .icon {
-                margin-right: 10px;
-            }
-            span {
-                display: inline-block;
-                font-size: 28px;
-            }
-        }
-        .content-right {
-            font-size: 18px;
-            margin-left: auto;
-        }
-        .color-success {
-            color: var(--color-success);
-        }
-        .color-warning {
-            color: var(--color-warning);
-        }
-        .color-danger {
-            color: var(--color-danger);
-        }
-        .color-info {
-            color: var(--color-info);
-        }
-    }
-}
-.growth-chart {
-    margin-bottom: 20px;
-}
-
-.suspension:hover {
-    -webkit-transform: translateY(-4px) scale(1.02);
-    -moz-transform: translateY(-4px) scale(1.02);
-    -ms-transform: translateY(-4px) scale(1.02);
-    -o-transform: translateY(-4px) scale(1.02);
-    transform: translateY(-4px) scale(1.02);
-    -webkit-box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
-    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
-    z-index: 999;
-    border-radius: 6px;
-}
-.user-growth-chart,
-.file-growth-chart {
-    height: 260px;
-}
-.new-user-growth {
-    height: 300px;
-}
-
-.user-source-chart,
-.user-surname-chart {
-    height: 400px;
-}
-.new-user-item {
-    display: flex;
-    align-items: center;
-    padding: 20px;
-    margin: 10px 15px;
-    box-shadow: 0 0 30px 0 rgba(82, 63, 105, 0.05);
-    background-color: #fff;
-    .new-user-avatar {
-        height: 48px;
-        width: 48px;
-        border-radius: 50%;
-    }
-    .new-user-base {
-        margin-left: 10px;
-        color: #2c3f5d;
-        .new-user-name {
-            font-size: 15px;
-        }
-        .new-user-time {
-            font-size: 13px;
-        }
-    }
-    .new-user-arrow {
-        margin-left: auto;
-    }
-}
-.new-user-card :deep(.el-card__body) {
-    padding: 0;
-}
 
-@media screen and (max-width: 425px) {
-    .welcome-img {
-        display: none;
-    }
-}
-@media screen and (max-width: 1200px) {
-    .lg-mb-20 {
-        margin-bottom: 20px;
-    }
-}
-</style>
 
 <script setup lang="ts">
 import { onMounted, onUnmounted, reactive, nextTick, onActivated, watch, onBeforeMount } from 'vue'
@@ -795,13 +602,13 @@ onActivated(() => {
 })
 
 onMounted(() => {
-    startWork()
-    initCountUp()
-    greetingsFun()
-    initUserGrowthChart()
-    initFileGrowthChart()
-    initUserSourceChart()
-    initUserSurnameChart()
+    // startWork()
+    // initCountUp()
+    // greetingsFun()
+    // initUserGrowthChart()
+    // initFileGrowthChart()
+    // initUserSourceChart()
+    // initUserSurnameChart()
     window.addEventListener('resize', echartsResize)
 })
 
@@ -830,3 +637,198 @@ export default defineComponent({
     name: 'dashboard',
 })
 </script>
+
+<style scoped lang="scss">
+.welcome {
+  transition: all 0.3s ease;
+  background: #e1eaf9;
+  border-radius: 6px;
+  display: flex;
+  align-items: center;
+  padding: 15px 20px !important;
+  box-shadow: 0 0 30px 0 rgba(82, 63, 105, 0.05);
+  .welcome-img {
+    height: 100px;
+    margin-right: 10px;
+    user-select: none;
+  }
+  .welcome-title {
+    font-size: 1.5rem;
+    line-height: 30px;
+    color: var(--color-primary-sub-0);
+  }
+  .welcome-note {
+    padding-top: 6px;
+    font-size: 15px;
+    color: var(--color-text-primary);
+  }
+}
+.working {
+  height: 130px;
+  display: flex;
+  justify-content: center;
+  flex-wrap: wrap;
+  height: 100%;
+  position: relative;
+  &:hover {
+    .working-coffee {
+      -webkit-transform: translateY(-4px) scale(1.02);
+      -moz-transform: translateY(-4px) scale(1.02);
+      -ms-transform: translateY(-4px) scale(1.02);
+      -o-transform: translateY(-4px) scale(1.02);
+      transform: translateY(-4px) scale(1.02);
+      z-index: 999;
+    }
+  }
+  .working-coffee {
+    transition: all 0.3s ease;
+    width: 80px;
+  }
+  .working-text {
+    display: block;
+    width: 100%;
+    font-size: 15px;
+    text-align: center;
+    color: var(--color-text-primary);
+  }
+  .working-opt {
+    position: absolute;
+    top: -40px;
+    right: 10px;
+    background-color: rgba($color: #000000, $alpha: 0.3);
+    padding: 10px 20px;
+    border-radius: 20px;
+    color: #fff;
+    transition: all 0.3s ease;
+    cursor: pointer;
+    opacity: 0;
+    z-index: 999;
+    &:active {
+      background-color: rgba($color: #000000, $alpha: 0.6);
+    }
+  }
+  &:hover {
+    .working-opt {
+      opacity: 1;
+      top: 0px;
+    }
+    .working-done {
+      opacity: 1;
+      top: 50px;
+    }
+  }
+}
+.small-panel-box {
+  margin-top: 20px;
+}
+.small-panel {
+  background-color: #e9edf2;
+  border-radius: var(--el-border-radius-base);
+  transition: all 0.3s ease;
+  padding: 25px;
+  margin-bottom: 20px;
+  .small-panel-title {
+    color: #92969a;
+    font-size: 15px;
+  }
+  .small-panel-content {
+    display: flex;
+    align-items: flex-end;
+    margin-top: 20px;
+    color: #2c3f5d;
+    .content-left {
+      font-size: 24px;
+      .icon {
+        margin-right: 10px;
+      }
+      span {
+        display: inline-block;
+        font-size: 28px;
+      }
+    }
+    .content-right {
+      font-size: 18px;
+      margin-left: auto;
+    }
+    .color-success {
+      color: var(--color-success);
+    }
+    .color-warning {
+      color: var(--color-warning);
+    }
+    .color-danger {
+      color: var(--color-danger);
+    }
+    .color-info {
+      color: var(--color-info);
+    }
+  }
+}
+.growth-chart {
+  margin-bottom: 20px;
+}
+
+.suspension:hover {
+  -webkit-transform: translateY(-4px) scale(1.02);
+  -moz-transform: translateY(-4px) scale(1.02);
+  -ms-transform: translateY(-4px) scale(1.02);
+  -o-transform: translateY(-4px) scale(1.02);
+  transform: translateY(-4px) scale(1.02);
+  -webkit-box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
+  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
+  z-index: 999;
+  border-radius: 6px;
+}
+.user-growth-chart,
+.file-growth-chart {
+  height: 260px;
+}
+.new-user-growth {
+  height: 300px;
+}
+
+.user-source-chart,
+.user-surname-chart {
+  height: 400px;
+}
+.new-user-item {
+  display: flex;
+  align-items: center;
+  padding: 20px;
+  margin: 10px 15px;
+  box-shadow: 0 0 30px 0 rgba(82, 63, 105, 0.05);
+  background-color: #fff;
+  .new-user-avatar {
+    height: 48px;
+    width: 48px;
+    border-radius: 50%;
+  }
+  .new-user-base {
+    margin-left: 10px;
+    color: #2c3f5d;
+    .new-user-name {
+      font-size: 15px;
+    }
+    .new-user-time {
+      font-size: 13px;
+    }
+  }
+  .new-user-arrow {
+    margin-left: auto;
+  }
+}
+.new-user-card :deep(.el-card__body) {
+  padding: 0;
+}
+
+@media screen and (max-width: 425px) {
+  .welcome-img {
+    display: none;
+  }
+}
+@media screen and (max-width: 1200px) {
+  .lg-mb-20 {
+    margin-bottom: 20px;
+  }
+}
+</style>

+ 1 - 1
src/views/backend/enterprise/project/community/index.vue

@@ -40,7 +40,7 @@ const baTable = new baTableClass(
         column: [
             { type: "selection", align: "center", operator: false },
             { label: "小区名称", prop: "communityName", align: "left", operator: "LIKE" },
-            { label: "所在区", prop: "districtName", align: "center", operator: false },
+            { label: "所在区县", prop: "districtName", align: "center", operator: false },
             { label: "现有车位", prop: "carportCount", align: "center",width:"100", operator: false },
             { label: "剩余车位", prop: "carportReminderCount", align: "center",width:"100", operator: false },
             { label: "现有车库", prop: "garageCount", align: "center",width:"100", operator: false },

+ 4 - 3
src/views/backend/enterprise/project/map/index.vue

@@ -39,9 +39,9 @@ const baTable = new baTableClass(
         dblClickNotEditColumn: [undefined, 'status'],
         column: [
             {type: 'selection', align: 'center', operator: false},
-            {label: '所在区', prop: 'districtName', align: 'left', operator: 'LIKE'},
+            {label: '所在区县', prop: 'districtName', align: 'left', operator: 'LIKE'},
             {label: '小区名称', prop: 'communityName', align: 'left', operator: 'LIKE'},
-            {label: '关联楼号', prop: 'buildingName', align: 'center', operator: false},
+            {label: '关联楼号', prop: 'buildingName', align: 'left', operator: false},
             {label: '创建人', prop: 'creatorName', align: 'center', width: '120', operator: false},
             {label: '创建时间', prop: 'createTime', align: 'center', width: '160', operator: false},
             {
@@ -62,7 +62,8 @@ const baTable = new baTableClass(
         requestEdit: () => {
             if (baTable.form.items && !baTable.form.items.icon) baTable.form.items.icon = 'el-icon-Minus'
         },
-    }
+    },
+
 )
 
 provide('baTable', baTable)

+ 25 - 11
src/views/backend/enterprise/project/map/popupForm.vue

@@ -16,22 +16,24 @@
                  label-position="right" :label-width="'100px'" :rules="rules"
                  v-if="!baTable.form.loading">
           <el-form-item label="所在区(县)">
-            <el-select v-model="districtId" placeholder="请选择" @change="selectDstrict">
+            <el-select v-model="districtId" placeholder="请选择" style="width: 100%" @change="selectDstrict">
               <el-option v-for="item in districtList" :label="item.districtName" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item prop="id" label="所在小区">
-            <el-select v-model="baTable.form.items!.id" placeholder="请选择" @change="selectCommunity">
+          <el-form-item prop="communityId" label="所在小区">
+            <el-select v-model="baTable.form.items!.communityId" placeholder="请选择" style="width: 100%"
+                       @change="selectCommunity">
               <el-option v-for="item in communityList" :label="item.communityName" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item prop="ids" label="相关楼号">
-            <el-select v-model="baTable.form.items!.ids" placeholder="请选择" style="width: 100%" clearable multiple>
+          <el-form-item prop="buildingIds" label="相关楼号">
+            <el-select v-model="baTable.form.items!.buildingIds" placeholder="请选择" style="width: 100%" clearable
+                       multiple>
               <el-option v-for="item in buildingList" :label="item.buildingNumber" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item prop="url" label="上传地图">
-            <pictureUpload v-model:fileUrl="baTable.form.items!.url"></pictureUpload>
+          <el-form-item prop="mapUrl" label="上传地图">
+            <pictureUpload v-model:fileUrl="baTable.form.items!.mapUrl"></pictureUpload>
           </el-form-item>
         </el-form>
       </div>
@@ -48,7 +50,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, inject, onMounted } from "vue";
+import { ref, reactive, inject, onMounted, watch } from "vue";
 
 import type baTableClass from "/@/utils/baTable";
 import type { ElForm, FormItemRule } from "element-plus";
@@ -62,22 +64,24 @@ const formRef = ref<InstanceType<typeof ElForm>>();
 const baTable = inject("baTable") as baTableClass;
 
 
+
+
 const rules: Partial<Record<string, FormItemRule[]>> = reactive({
-  id: [
+  communityId: [
     {
       required: true,
       message: "请选择",
       trigger: "blur"
     }
   ],
-  ids: [
+  buildingIds: [
     {
       required: true,
       message: "请选择",
       trigger: "blur"
     }
   ],
-  url: [
+  mapUrl: [
     {
       required: true,
       message: "请上传",
@@ -90,6 +94,14 @@ onMounted(() => {
   getInitData();
 });
 
+watch(() => baTable.form.operate ? true : false, (nValue, oValue) => {
+  console.log(nValue);
+  if(nValue){
+    console.log(baTable.form.items);
+  }
+
+});
+
 //区县列表
 let districtList = ref([]);
 let districtId = ref("");
@@ -104,6 +116,7 @@ function getInitData() {
 
 //小区列表
 let communityList = ref([]);
+
 //选择区县,获取小区列表
 function selectDstrict(event: any) {
   request.index(community_list, {
@@ -117,6 +130,7 @@ function selectDstrict(event: any) {
 
 //楼号列表
 let buildingList = ref([]);
+
 //选择小区,获取楼号列表
 function selectCommunity(event: any) {
   request.index(building_list, {

+ 208 - 15
src/views/backend/enterprise/project/parking/editDialog.vue

@@ -1,34 +1,227 @@
 <template>
-  <el-dialog v-model="showDialog">
-    <el-row :gutter="10">
-      <el-col :span="12"></el-col>
-      <el-col :span="12"></el-col>
-    </el-row>
+  <el-dialog title="车位登记" v-model="showDialog" width="800px" @close="closeDialog">
+    <el-form ref="formRef" :model="formData" label-position="right" :label-width="'100px'" :rules="formRules"
+      label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="车位类型" prop="parkingType">
+            <el-radio-group v-model="formData.parkingType">
+              <el-radio-button :label="0" border>车位</el-radio-button>
+              <el-radio-button :label="1" border>车库</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="车位编号" prop="parkingNumber">
+            <el-input v-model="formData.parkingNumber"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="车位面积" prop="area">
+            <el-input v-model="formData.area"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="联系电话" prop="contactNumber">
+            <el-input v-model="formData.contactNumber"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否特价" prop="isSpecial">
+            <el-radio-group v-model="formData.isSpecial">
+              <el-radio-button :label="0" border>否</el-radio-button>
+              <el-radio-button :label="1" border>是</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否置顶" prop="isTop">
+            <el-radio-group v-model="formData.isTop">
+              <el-radio-button :label="0" border>否</el-radio-button>
+              <el-radio-button :label="1" border>是</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-divider />
+        <el-col :span="24">
+          <el-form-item label="是否出售" prop="isSale">
+            <el-radio-group v-model="formData.isSale">
+              <el-radio-button :label="0" border>否</el-radio-button>
+              <el-radio-button :label="1" border>是</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="售价" prop="salePrice" v-if="formData.isSale == 1">
+            <el-input v-model="formData.salePrice"></el-input>
+          </el-form-item>
+        </el-col>
+        <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-select>
+          </el-form-item>
+        </el-col>
+        <el-divider />
+        <el-col :span="24">
+          <el-form-item label="是否出租" prop="isHire">
+            <el-radio-group v-model="formData.isHire">
+              <el-radio-button :label="0" border>否</el-radio-button>
+              <el-radio-button :label="1" border>是</el-radio-button>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="租金" prop="hirePrice" v-if="formData.isHire == 1">
+            <el-input v-model="formData.hirePrice"></el-input>
+          </el-form-item>
+        </el-col>
+        <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-select>
+          </el-form-item>
+        </el-col>
+
+
+
+
+
+
+      </el-row>
+
+
+
+
+    </el-form>
+
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="showDialog = false">取消</el-button>
+        <el-button type="primary" @click="submit">
+          提交
+        </el-button>
+      </div>
+    </template>
   </el-dialog>
 </template>
 
 <script setup>
-import { ref } from "vue";
+import { reactive, ref } from "vue";
+import request from "/@/api/request";
+import { parking } from "/@/api/controllerUrls";
+import { ElMessage } from 'element-plus'
+
+let showDialog = ref(false);
 
-let showDialog = ref(false)
-let mapData = ref({})
+let formRef = ref()
+
+let type = ref('add')
+
+let emit = defineEmits(['close'])
 
 defineExpose({
   open
-})
+});
+
+function open(type1, data, districtId, communityId, buildingId) {
+  type.value = type1
+  if (type1 == "add") {
+    formRef.value?.resetFields()
+    formData.districtId = districtId
+    formData.communityId = communityId
+    formData.buildingId = buildingId
+  } else {
+    for (let key in formData) {
+      formData[key] = data[key]
+    }
+    formData.id = data.id
+  }
+
+  showDialog.value = true;
+}
+
+let formData = reactive({
+  districtId: '',
+  communityId: '',
+  buildingId: '',
+  parkingType: 0,
+  parkingNumber: "",
+  area: "",
+  parkingUrl: "",//车位展示图片
+  isSpecial: 0,//是否特价车位
+  isTop: 0,//是否置顶
+  isHire: 0,//是否出租
+  hirePrice: 0,//租金
+  hireStatus: 0,//出租状态
+  isSale: 0,//是否出售
+  salePrice: 0,//售价
+  saleStatus: 0,//出售状态
+  contactNumber: "",//联系电话
 
-function open(value){
+});
+
+let formRules = {
+  parkingNumber: [
+    { required: true, message: '不能为空' }
+  ],
+  area: [
+    { required: true, message: '不能为空' },
+    // { type: 'number', message: '必须为数字' }
+  ],
+  contactNumber: [
+    { required: true, message: '不能为空' },
+    // { type: 'number', message: '必须为数字' }
+  ],
+  hirePrice: [
+    { required: true, message: '不能为空' },
+    // { type: 'number', message: '必须为数字' }
+  ],
+  salePrice: [
+    { required: true, message: '不能为空' },
+    // { type: 'number', message: '必须为数字' }
+  ],
+};
+
+
+
+function getInitData() {
 
-  showDialog.value = true
 }
 
-function getInitData(){
+function submit() {
+  formRef.value.validate((valid) => {
+    if (valid) {
+      if(formData.isHire==0&&formData.isSale==0) {
+        ElMessage({type:'warning',message:'请选择售卖类型',grouping:true})
+        return
+      }
+      if (type.value == 'add') {
+        request.add(parking, formData).then((res) => {
+          if (res.code == 1) {
+            showDialog.value = false
+          }
+        });
+      } else {
+        request.edit(parking, formData).then((res) => {
+          if (res.code == 1) {
+            showDialog.value = false
+          }
+        });
+      }
+    }
+  })
+}
 
+function closeDialog(){
+  emit('close');
 }
 
 
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

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

@@ -1,78 +1,202 @@
 <template>
   <div class="default-main ">
-    <el-alert class="ba-table-alert" v-if="baTable.table.remark" :title="baTable.table.remark" type="info"
-              show-icon />
-    <el-row>
-      <el-col :span="24">
-
-        <!-- 表格顶部菜单 -->
-        <TableHeader :buttons="['refresh', 'add', 'edit', 'delete', 'comSearch']"
-                     quick-search-placeholder="通过标题模糊搜索"
-                     @action="baTable.onTableHeaderAction" />
-        <!-- 表格 -->
-        <!-- 要使用`el-table`组件原有的属性,直接加在Table标签上即可 -->
-        <Table @action="baTable.onTableAction" />
-      </el-col>
-    </el-row>
-
-    <!-- 表单 -->
-    <PopupForm ref="formRef" />
+    <div style="display: flex;align-items: center">
+      <span>区县:</span>
+      <el-select v-model="districtId" placeholder="请选择区县" style="width: 150px;margin-right: 10px" @change="selectDstrict"
+        :clearable="true">
+        <el-option v-for="item in districtList" :label="item.districtName" :value="item.id"></el-option>
+      </el-select>
+      <span>小区:</span>
+      <el-select v-model="communityId" placeholder="请选择小区" style="width: 150px;margin-right: 10px"
+        @change="selectCommunity" :clearable="true">
+        <el-option v-for="item in communityList" :label="item.communityName" :value="item.id"></el-option>
+      </el-select>
+      <span>楼号:</span>
+      <el-select v-model="buildingId" placeholder="请选择楼号" style="width: 150px;margin-right: 10px" @change="selectBuilding"
+        :clearable="true">
+        <el-option v-for="item in buildingList" :label="item.buildingNumber" :value="item.id"></el-option>
+      </el-select>
+      <el-button v-if="auth('add')" type="primary" :disabled="buildingId == ''"
+        @click="openDialog('add')">登记车位</el-button>
+      <el-button v-if="auth('map')" type="primary" :disabled="buildingId == ''"
+        @click="">车位绑定</el-button>
+    </div>
+
+    <el-table :data="parkingData" style="margin-top: 10px" border>
+      <el-table-column prop="parkingNumber" label="车位编号"></el-table-column>
+      <el-table-column prop="parkingType" label="车位类型">
+        <template #default="{ row }">
+          <span>{{ row.parkingType == 1 ? '车库' : '车位' }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="area" label="车位面积"></el-table-column>
+      <el-table-column label="售卖类型">
+        <template #default="{ row }">
+          <el-tag v-if="row.isSale == 1" style="margin: 0 5px;">售卖</el-tag>
+          <el-tag v-if="row.isHire == 1" style="margin: 0 5px;">出租</el-tag>
+        </template>
+      </el-table-column>
+      <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="出售状态">
+        <template #default="{ row }">
+          <el-tag v-if="row.isSale == 1" :type="row.saleStatus == 1 ? 'info' : ''" style="margin: 0 5px;">{{ row.saleStatus
+            == 1 ? '已售' : '待售' }}</el-tag>
+        </template>
+      </el-table-column>
+      <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="出租状态">
+        <template #default="{ row }">
+          <el-tag v-if="row.isHire == 1" :type="row.hireStatus == 1 ? 'info' : ''" style="margin: 0 5px;">{{ row.hireStatus
+            == 1 ? '已租' : '待租' }}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" width="150" header-align="center">
+        <template #default="{ row }">
+          <div style="display: flex;justify-content: center;">
+            <el-button v-if="auth('edit')" class="table-operate" size="small" type="warning" @click="openDialog('edit', row)">
+              <icon name="el-icon-edit"></icon>
+            </el-button>
+            <el-popconfirm width="220" confirm-button-text="确定" cancel-button-text="取消" title="是否确定删除?"
+              @confirm="deleteRow(row)">
+              <template #reference>
+                <el-button v-if="auth('del')"  class="table-operate" type="danger" size="small">
+                  <icon name="el-icon-delete"></icon>
+                </el-button>
+              </template>
+            </el-popconfirm>
+
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <editDialog ref="editDialogRef" @close="getData"></editDialog>
+    <parkingMap ref="parkingMapRef"></parkingMap>  
 
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, provide } from "vue";
-import { parking } from "/@/api/controllerUrls";
-import Table from "/@/components/table/index.vue";
-import TableHeader from "/@/components/table/header/index.vue";
-import { defaultOptButtons } from "/@/components/table";
-import { baTableApi } from "/@/api/common";
-import baTableClass from "/@/utils/baTable";
-
-
-const tableRef = ref();
-const baTable = new baTableClass(
-  new baTableApi(parking),
-  {
-    dblClickNotEditColumn: [undefined, "status"],
-    column: [
-      { label: "小区名称", prop: "communityName", align: "left", operator: "LIKE" },
-      { label: "楼号", prop: "buildingNumber", align: "center", operator: false },
-      { label: "现有车位", prop: "carportCount", align: "center", width: "100", operator: false },
-      { label: "剩余车位", prop: "carportReminderCount", align: "center", width: "100", operator: false },
-      { label: "现有车库", prop: "garageCount", align: "center", width: "100", operator: false },
-      { label: "剩余车库", prop: "garageReminderCount", align: "center", width: "100", operator: false },
-      { label: "创建人", prop: "creatorName", align: "center", width: "120", operator: false },
-      { label: "创建时间", prop: "createTime", align: "center", width: "160", operator: false },
-      {
-        label: "操作",
-        align: "center",
-        width: "160",
-        render: "buttons",
-        buttons: defaultOptButtons(),
-        operator: false
-      }
-    ]
-  },
-  {
-    defaultItems: {}
-  },
-  {
-    // 获得编辑数据后
-    requestEdit: () => {
-      if (baTable.form.items && !baTable.form.items.icon) baTable.form.items.icon = "el-icon-Minus";
-    }
-  }
-);
 
-provide("baTable", baTable);
+import { auth } from "/@/utils/common";
+import request from "/@/api/request";
+import { building_list, community_list, district_list, parking } from "/@/api/controllerUrls";
+import { onMounted, ref } from "vue";
+import editDialog from "./editDialog.vue"
+import parkingMap from "./parkingMap.vue"
+
 
 onMounted(() => {
-  baTable.mount();
-  baTable.getIndex();
-});
+  getDistrictList()
+  getData()
+})
+
+let districtId = ref('')
+
+let editDialogRef = ref()
+
+//区县列表
+let districtList = ref([])
+function getDistrictList() {
+  request.index(district_list, {}, "").then((res: any) => {
+    if (res.code == 1) {
+      districtList.value = res.data;
+    }
+  });
+}
+
+let communityId = ref('')
+
+//小区列表
+let communityList = ref([]);
+
+//选择区县,获取小区列表
+function selectDstrict(event: any) {
+  request.index(community_list, {
+    districtIds: event
+  }, "").then((res: any) => {
+    if (res.code == 1) {
+      communityList.value = res.data;
+      communityId.value = ''
+      buildingId.value = ''
+      getData()
+    }
+  });
+}
+
+
+let buildingId = ref('')
+//楼号列表
+let buildingList = ref([]);
+
+//选择小区,获取楼号列表
+function selectCommunity(event: any) {
+  request.index(building_list, {
+    communityIds: event
+  }, "").then((res: any) => {
+    if (res.code == 1) {
+      buildingList.value = res.data;
+      buildingId.value = ''
+      getData()
+    }
+  });
+}
+
+
+let parkingData = ref([])
+
+function selectBuilding(event: any) {
+  getData()
+}
+
+
+function getData() {
+  request.index(parking, {
+    districtId: districtId.value,
+    communityId: communityId.value,
+    buildingId: buildingId.value
+  }).then((res: any) => {
+    if (res.code == 1) {
+      parkingData.value = res.data.list;
+    }
+  });
+}
+
+function openDialog(type: string, data: any = {}) {
+  editDialogRef.value.open(type, data, districtId, communityId, buildingId)
+}
+
+
+function deleteRow(row: any) {
+  request.delete(parking, {
+    id: row.id
+  }).then((res: any) => {
+    if (res.code == 1) {
+      getData()
+    }
+  });
+}
+
+
 </script>
 
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.table-operate {
+  padding: 4px 5px;
+  height: auto;
+}
+
+.table-operate .icon {
+  font-size: 14px !important;
+  color: #ffffff !important;
+}
+</style>