From 3c38598df86e697268b14865e68159d6ba989285 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期四, 11 四月 2024 15:32:04 +0800
Subject: [PATCH] docs: 首次加载白屏添加loading

---
 src/components/page/whiteList/index.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/components/page/whiteList/index.vue b/src/components/page/whiteList/index.vue
index 3299801..2153b46 100644
--- a/src/components/page/whiteList/index.vue
+++ b/src/components/page/whiteList/index.vue
@@ -12,7 +12,7 @@
             </el-form>
         </div>
 
-        <el-table :data="pageData.rows" v-loading="pageData.isLoading" border style="width:100%;border:1px solid #bcbec2;">
+        <el-table :height="tableHeight" :data="pageData.rows" v-loading="pageData.isLoading" border style="width:100%;border:1px solid #bcbec2;">
             <el-table-column type="index" width="50" label="搴忓彿" align="center"> </el-table-column>
             <el-table-column prop="carNo" label="杞︾墝鍙�" align="center" width="150"></el-table-column>
             <el-table-column prop="type" label="绫诲瀷" align="center" width="100">
@@ -50,8 +50,8 @@
                 <el-form-item label="鏈堢エ缁撴潫鏃ユ湡" prop="endTime" v-if="flag2">
                     <el-date-picker placeholder="閫夋嫨鏃堕棿" v-model="formData.endTime"></el-date-picker>
                 </el-form-item>
-                <el-form-item label="鍋滆溅鍦�" prop="parkId" v-if="flag2">
-                    <el-select v-model="formData.parkId">
+                <el-form-item label="鍋滆溅鍦�" prop="parkIds" v-if="flag2">
+                    <el-select v-model="ids" multiple clearable>
                         <el-option v-for="item in table1" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
@@ -80,17 +80,21 @@
                     type: 0,
                     endTime: '',
                     startTime: '',
-                    parkId:null
+                    parkIds: null,
+                    name: '',
                 },
-                urlPath:this.$systemconfig.basePath + '/whiteList/',
+                ids:[],
+                urlPath:this.$systemconfig.basePath + '/ffzf/whiteList/',
                 table1:[],
+              tableHeight:500,
             }
         },
         mounted() {
             this.loadData();
-            this.$byutil.postData(this, this.$systemconfig.basePath+'/park/findAll', this.formData, res => {
-                this.table1 = res.obj;
+            this.$byutil.postData(this, this.$systemconfig.basePath+'/ffzf/park/findAll', this.formData, res => {
+                this.table1 = res.data;
             })
+          this.tableHeight = window.innerHeight - 260
         },
         methods: {
             selectChange(value){
@@ -103,10 +107,11 @@
             onSave(){
                 this.$refs['formData'].validate((valid) => {
                     if (valid) {
+                      this.formData.parkIds = this.ids.join(",")
                         this.$byutil.postData(this, this.urlPath+'save', this.formData, res => {
                             this.$refs['formData'].resetFields();
                             this.flag=false;
-                            this.$message({message: res.message, type: 'success'});
+                            this.$message({message:'淇濆瓨鎴愬姛', type: 'success'});
                             this.loadData();
                         })
                     } else {
@@ -115,7 +120,7 @@
                 });
             },
             loadData() {
-                this.$byutil.loadPageData(this, this.urlPath+'findPage', this.searchForm);
+                this.$byutil.loadPageData(this, this.urlPath+'findPageNew', this.searchForm);
             },
             onSearch() {
                 this.pageData = this.$byutil.defaultPageData();
@@ -123,25 +128,31 @@
             },
             onAdd() {
                 this.flag=true;
+                this.flag2=false;
                 this.$refs['formData'].resetFields();
                 this.formData = {
                     carNo: '',
                     type: 0,
                     endTime: '',
                     startTime: '',
-                    parkId:null
+                    parkIds: null
                 }
             },
             onEdit(row) {
                 this.flag=true;
+                this.ids = []
                 this.formData  = row;
                 if(row.type==1){
-                    this.flag2=true;
+                  this.ids = this.formData.parkIds.split(",")
+                  this.ids = this.ids.map(function(data){
+                    return +data;
+                  });
+                  this.flag2=true;
                 }
             },
             onDelete(row) {
                 this.$byutil.deleteData(this,this.urlPath+"delete",{id:row.id}, res => {
-                    this.$message({message: res.message, type: 'success'});
+                    this.$message({message: '鍒犻櫎鎴愬姛', type: 'success'});
                     this.loadData();
                 })
             },
@@ -159,4 +170,4 @@
 
 <style scoped>
 
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1