Hwt 2 سال پیش
والد
کامیت
3b987e349b
3فایلهای تغییر یافته به همراه121 افزوده شده و 96 حذف شده
  1. 116 91
      smart/src/components/common/alertModal.vue
  2. 2 2
      smart/src/views/accessRecord/index.vue
  3. 3 3
      smart/src/views/onSiteVehicles/index.vue

+ 116 - 91
smart/src/components/common/alertModal.vue

@@ -1,115 +1,140 @@
 <!--
  * @Author: wf
  * @Date: 2021-08-12 16:12:17
- * @LastEditors: wfmodal.customClass
- * @LastEditTime: 2021-08-13 09:15:25
+ * @LastEditors: D4THYL3
+ * @LastEditTime: 2022-09-14 10:22:11
  * @Description: element-ui Dialog弹窗封装
 -->
 <template>
-    <!-- <transition name="el-zoom-in-center"> -->
-    <el-dialog
-        v-if="modal.show"
-        :visible.sync="modal.show"
-        class="alert-modal"
-        :width="modal.width"
-        :fullscreen="modal.fullscreen"
-        :custom-class="modal.customClass || 'alert-el-modal'"
-        :class="{ 'is-modal': !modal.fullscreen, newpop: modal.class }"
-        :append-to-body="true"
-        :lock-scroll="true"
-        @closed="close"
-        ref="alertModal"
-        top="0"
-        :close-on-click-modal="false"
-        :close-on-press-escape="false"
+  <!-- <transition name="el-zoom-in-center"> -->
+  <el-dialog
+    v-if="modal.show"
+    :visible.sync="modal.show"
+    class="alert-modal"
+    :width="modal.width"
+    :fullscreen="modal.fullscreen"
+    :custom-class="modal.customClass || 'alert-el-modal'"
+    :class="{ 'is-modal': !modal.fullscreen, newpop: modal.class }"
+    :append-to-body="true"
+    :lock-scroll="true"
+    @closed="close"
+    ref="alertModal"
+    top="0"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+  >
+    <div slot="title">
+      <div class="title_row">
+        <strong class="title">{{ modal.title }}</strong>
+        {{ modal.star }}
+        <span v-if="modal.hideStar"></span>
+        <span v-else-if="modal.title && !modal.notip"> (<span class="color-danger">*为必填项</span>) </span>
+        <!-- <i class="close" @click="close"></i> -->
+      </div>
+    </div>
+    <!-- :style="`height:${modal.showFooter ? 'calc(100% - 50px)' : 'calc(100% - 54px)'}`" -->
+    <!-- <div class="body_content"> -->
+    <div
+      class="content"
+      v-scroll
     >
-        <div slot="title">
-            <div class="title_row">
-                <strong class="title">{{ modal.title }}</strong>
-                {{ modal.star }}
-                <span v-if="modal.hideStar"></span>
-                <span v-else-if="modal.title && !modal.notip"> (<span class="color-danger">*为必填项</span>) </span>
-                <!-- <i class="close" @click="close"></i> -->
-            </div>
-        </div>
-        <!-- :style="`height:${modal.showFooter ? 'calc(100% - 50px)' : 'calc(100% - 54px)'}`" -->
-        <!-- <div class="body_content"> -->
-        <div class="content" v-scroll>
-            <component :id="modal.id" :is="modal.component" :params="modal.props" :ref="modal.id" @close="close"></component>
-        </div>
-        <!-- </div> -->
-        <span slot="footer" class="dialog-footer" v-if="!modal.fullscreen || modal.showFooter">
-            <el-button @click="alertReset(modal.id)" class="reset" v-if="modal.showResetButton">重置</el-button>
-            <el-button @click="close" class="reset" v-if="!modal.showCancelButton">{{ modal.cancelButtonText || '取消' }}</el-button>
-            <el-button type="primary" v-if="!modal.showConfirmButton" @click="submit(modal.id)">{{
+      <component
+        :id="modal.id"
+        :is="modal.component"
+        :params="modal.props"
+        :ref="modal.id"
+        @close="close"
+      ></component>
+    </div>
+    <!-- </div> -->
+    <span
+      slot="footer"
+      class="dialog-footer"
+      v-if="!modal.fullscreen || modal.showFooter"
+    >
+      <el-button
+        @click="alertReset(modal.id)"
+        class="reset"
+        v-if="modal.showResetButton"
+      >重置</el-button>
+      <el-button
+        @click="close"
+        class="reset"
+        v-if="!modal.showCancelButton"
+      >{{ modal.cancelButtonText || '取消' }}</el-button>
+      <el-button
+        type="primary"
+        v-if="!modal.showConfirmButton"
+        @click="submit(modal.id)"
+      >{{
                 modal.confirmButtonText || '保存'
             }}</el-button>
-        </span>
-    </el-dialog>
-    <!-- </transition> -->
+    </span>
+  </el-dialog>
+  <!-- </transition> -->
 </template>
 
 <script>
 const preventBrowserBack = () => {
-    history.pushState(null, null, document.URL);
+  history.pushState(null, null, document.URL);
 };
 /* 
   使用vuex this.$store.dispatch("openModal", {})打开弹窗,具体参数去store查看
 */
 export default {
-    name: 'alert-modal',
-    props: {
-        params: {
-            type: Object,
-            default() {
-                return {};
-            }
-        }
-    },
-    data() {
-        return {
-            // modal:{}
-        };
-    },
-    computed: {
-        modal() {
-            // const xx = this.$store.getters['getPopups'];
-            let obj = this.params;
-            if (obj && obj.height) {
-                this.$nextTick(() => {
-                    if (this.$refs.alertModal && this.$refs.alertModal.$el && this.$refs.alertModal.$el.childNodes) {
-                        this.$refs.alertModal.$el.childNodes[0].style.height = obj.height;
-                    }
-                });
-            }
-            if (obj.show) {
-                history.pushState(null, null, document.URL);
-                window.addEventListener('popstate', preventBrowserBack, false);
-            } else {
-                window.removeEventListener('popstate', preventBrowserBack);
-            }
-            return obj;
-        }
+  name: 'alert-modal',
+  props: {
+    params: {
+      type: Object,
+      default () {
+        return {};
+      }
+    }
+  },
+  data () {
+    return {
+      // modal:{}
+    };
+  },
+  computed: {
+    modal () {
+      // const xx = this.$store.getters['getPopups'];
+      let obj = this.params;
+      if (obj && obj.height) {
+        this.$nextTick(() => {
+          if (this.$refs.alertModal && this.$refs.alertModal.$el && this.$refs.alertModal.$el.childNodes) {
+            this.$refs.alertModal.$el.childNodes[0].style.height = obj.height;
+          }
+        });
+      }
+      if (obj.show) {
+        history.pushState(null, null, document.URL);
+        window.addEventListener('popstate', preventBrowserBack, false);
+      } else {
+        window.removeEventListener('popstate', preventBrowserBack);
+      }
+      return obj;
+    }
+  },
+  watch: {},
+  methods: {
+    close () {
+      this.$store.dispatch('delPopup', this.modal.id);
     },
-    watch: {},
-    methods: {
-        close() {
-            this.$store.dispatch('delPopup', this.modal.id);
-        },
-        // 弹窗重置,执行弹出组件的reset方法
-        alertReset(id) {
-            const component = this.$refs[id];
-            component.reset && component.reset();
-        },
-        submit(id) {
-            const component = this.$refs[id];
-            component.submit && component.submit();
-        }
+    // 弹窗重置,执行弹出组件的reset方法
+    alertReset (id) {
+      const component = this.$refs[id];
+      component.reset && component.reset();
     },
-    created() {
-        // debugger
-        // this.modal=this.params;
+    submit (id) {
+      const component = this.$refs[id];
+      component.submit && component.submit();
     }
+  },
+  created () {
+    // debugger
+    // this.modal=this.params;
+  }
 };
 </script>
 

+ 2 - 2
smart/src/views/accessRecord/index.vue

@@ -122,7 +122,7 @@ export default {
       if (this.parkName.length == 0) {
         this.$message.error('请选择停车场');
       } else {
-        this.mixins_dataUrl = '/sc-community-web/parkingCar/findOutInInfo';
+        this.mixins_dataUrl = '/sc-community/parkingCar/findOutInInfo';
         this.mixins_query = { plateNo: this.mixins_query.plateNo, parkId: this.mixins_query.parkId, parkName: this.parkName, startTime: this.mixins_query.startTime, endTime: this.mixins_query.endTime };
         this.mixins_search();
       }
@@ -151,7 +151,7 @@ export default {
     },
     // 获取停车场名称
     nameParking () {
-      this.$http.post('/sc-community-web/parkingCar/findParkInfo', { pageNum: this.mixins_pageset.pageIndex, pageSize: this.mixins_pageset.pageSize }).then(({ data, status, msg }) => {
+      this.$http.post('/sc-community/parkingCar/findParkInfo', { pageNum: this.mixins_pageset.pageIndex, pageSize: this.mixins_pageset.pageSize }).then(({ data, status, msg }) => {
         console.log(data.list);
         for (let i = 0; i < data.list.length; i++) {
           this.nameParkingLot.push({

+ 3 - 3
smart/src/views/onSiteVehicles/index.vue

@@ -142,13 +142,13 @@ export default {
           title: '车辆通行记录详情'
         });
       }).then(() => {
-        debugger
+
         this.mixins_search();
       });
     },
     // 获取停车场名称
     nameParking () {
-      this.$http.post('/sc-community-web/parkingCar/findParkInfo', { pageNum: this.mixins_page.pageNum, pageSize: this.mixins_page.pageSize }).then(({ data, status, msg }) => {
+      this.$http.post('/sc-community/parkingCar/findParkInfo', { pageNum: this.mixins_page.pageNum, pageSize: this.mixins_page.pageSize }).then(({ data, status, msg }) => {
         console.log(data.list);
         for (let i = 0; i < data.list.length; i++) {
           this.nameParkingLot.push({
@@ -181,7 +181,7 @@ export default {
       if (this.nameParkingLotName.length == 0) {
         this.$message.error('请选择停车场');
       } else {
-        this.mixins_dataUrl = '/sc-community-web/parkingCar/queryPresenceVehicles';
+        this.mixins_dataUrl = '/sc-community/parkingCar/queryPresenceVehicles';
         this.mixins_query = { plateNo: this.mixins_query.plateNo, parkId: this.mixins_query.parkId, pageNum: this.mixins_pageset.pageIndex, pageSize: this.mixins_pageset.pageSize, parkName: this.nameParkingLotName };
         // console.log('mixins_list', this.mixins_query);
         this.mixins_search();