Prechádzať zdrojové kódy

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_app into V0.0.2

coys 2 rokov pred
rodič
commit
4c276a3950

+ 57 - 48
src/components/SearchSelectCell/SelectPicker.vue

@@ -5,7 +5,7 @@
       <div class="title">{{ title }}</div>
       <div class="sure" @click="onSearchConfirm">确定</div>
     </div>
-    <van-search v-if="showSearch" placeholder="输入您想搜索内容" v-model="searchValue" @input="inputSearchValue" />
+    <van-search v-if="showSearch" placeholder="输入搜索内容" v-model="searchValue" @input="inputSearchValue" />
 <!--    <div class="tip">已选{{temp_datas.length}}条</div>-->
     <div v-if="itemList?.length >0"  class="lists">
       <div  class="line" v-for="(item, index) in itemList" :key="item[valueKey]">
@@ -22,7 +22,7 @@
       </div>
     </div>
     <div v-else class="lists">
-      <van-empty description="无数据" />
+      <van-empty description="无数据" />
     </div>
   </van-popup>
 </template>
@@ -96,7 +96,11 @@ export default {
       this.$set(this.columns[i],'checked',!this.columns[i].checked);
     },
     inputSearchValue(query) {
-      if(query == ''){return this.itemList = this.options }
+      console.log(query,'query')
+      if(!query){
+        this.itemList = this.options
+        return
+      }
       //搜索框值发生改变
       setTimeout(() => {
         this.itemList= this.temp_datas.filter(item => {
@@ -117,50 +121,55 @@ export default {
   },
 }
 </script>
-<style scoped>
-.search-data-popup .tip {
-  color: #666;
-  padding-bottom: 5px;
-}
-.search-data-popup .header-line {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  height: 90px;
-}
-.search-data-popup .header-line .cancel {
-  padding: 0 30px;
-  font-size: 28px;
-  color: #969799;
-}
-.search-data-popup .header-line .title {
-  font-weight: 500;
-  font-size: 30px;
-  color: #343434;
-}
-.search-data-popup .header-line .sure {
-  padding: 0 30px;
-  font-size: 28px;
-  color: #1989fa;
-}
-.search-data-popup .lists {
-  display: flex;
-  flex-direction: column;
-  padding: 10px 12px 20px 12px;
-  min-height: 300px;
-  max-height: 700px;
-  overflow: auto;
-}
-.search-data-popup .lists .line {
-  line-height: 40px;
-  font-size: 16px;
-  color: #000;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.search-data-popup .lists .line img {
-  width: 20px;
-  height: 20px;
+<style lang="scss" scoped>
+.search-data-popup{
+  .header-line {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 90px;
+  }
+  .header-line .cancel {
+    padding: 0 30px;
+    font-size: 28px;
+    color: #969799;
+  }
+   .header-line .title {
+    font-weight: 500;
+    font-size: 30px;
+    color: #343434;
+  }
+   .header-line .sure {
+    padding: 0 30px;
+    font-size: 28px;
+    color: #1989fa;
+  }
+   .lists {
+    display: flex;
+    flex-direction: column;
+    padding: 10px 12px 20px 12px;
+    min-height: 300px;
+    max-height: 700px;
+    overflow: auto;
+  }
+   .lists .line {
+    line-height: 40px;
+    font-size: 16px;
+    color: #000;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+   .lists .line img {
+    width: 20px;
+    height: 20px;
+  }
+  .tip {
+    color: #666;
+    padding-bottom: 5px;
+  }
+  .van-empty{
+    padding: 0;
+  }
 }
 </style>

+ 79 - 15
src/components/TopBar.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="top-bar-box">
     <div class="top-bar">
       <div class="top-box">
         <span>移动安全保卫管理平台</span>
@@ -14,19 +14,36 @@
         <van-icon name="arrow" size="20" />
       </div>
     </div>
+    <div v-if="showNotice" class="notice-box">
+      <div>
+        <van-notice-bar  v-if="list.length>0" left-icon="volume-o" mode="closeable"  :color="color" :background="background">
+          <van-swipe
+            @change="onChange"
+            vertical
+            class="notice-swipe"
+            :autoplay="8000"
+            :show-indicators="false">
+            <van-swipe-item v-for="item in list" :key="item.id" @click="clickHandler(item)" >
+              {{item.alarmTitle}}
+            </van-swipe-item>
+          </van-swipe>
+        </van-notice-bar>
+      </div>
+    </div>
 
-    <!-- 天气预警 -->
-    <van-swipe v-if="list.length > 0" style="height: 50px" vertical autoplay="2000">
-      <van-swipe-item v-for="item in list" :key="item.id" @click="clickHandler(item)">
-        <div class="color" :style="{ color: item.bgc, backgroundColor: '#fff' }">
-          <van-icon name="warn-o" /> {{ item.alarmTitle }}
-        </div>
-      </van-swipe-item>
 
-      <template #indicator>
-        <div class="custom-indicator"></div>
-      </template>
-    </van-swipe>
+<!--    &lt;!&ndash; 天气预警 &ndash;&gt;-->
+<!--    <van-swipe v-if="list.length > 0" style="height: 50px" vertical autoplay="2000">-->
+<!--      <van-swipe-item v-for="item in list" :key="item.id" @click="clickHandler(item)">-->
+<!--        <div class="color" :style="{ color: item.bgc, backgroundColor: '#fff' }">-->
+<!--          <van-icon name="warn-o" /> {{ item.alarmTitle }}-->
+<!--        </div>-->
+<!--      </van-swipe-item>-->
+
+<!--      <template #indicator>-->
+<!--        <div class="custom-indicator"></div>-->
+<!--      </template>-->
+<!--    </van-swipe>-->
   </div>
 </template>
 <script>
@@ -37,13 +54,21 @@ export default {
   components: {
     [Icon.name]: Icon
   },
+  props:{
+    showNotice:{
+      type:Boolean,
+      default:true
+    },
+  },
   data() {
     return {
       list: [],
       show: false,
       info: '',
       active: this.defaultActive,
-      rolesList: []
+      rolesList: [],
+      color: '#ecf9ff',
+      background: '#4ea2f8'
     }
   },
   computed: {
@@ -57,11 +82,31 @@ export default {
         this.getTheWeather()
       }
     }, 100);
-    
+
 
     // this.rolesList=JSON.parse(window.sessionStorage.getItem('SET_USER_ROLELIST'))||[]
   },
   methods: {
+    onChange(index){
+      let alarmLevel = this.list[index].alarmLevel;
+      switch (alarmLevel){
+        case '蓝色':
+          this.background = '#4ea2f8';
+          this.color = '#fff';
+          break;
+        case '黄色':
+          this.background = '#eee367';
+          this.color = '#fff';
+          break;
+        case '橙色':
+          this.background = '#f6b568';
+          this.color = '#fff';
+          break;
+        case '红色':
+          this.background = '#ef464a';
+          this.color = '#fff';
+      }
+    },
     clickOutLogin() {
       logout().then(res => {
         sessionStorage.clear()
@@ -70,6 +115,7 @@ export default {
       })
     },
     clickHandler(item) {
+      console.log(item,'1111111')
       this.info = item.alarmContent
       this.show = true
     },
@@ -98,8 +144,20 @@ export default {
   }
 }
 </script>
-
+<style lang="scss">
+.van-notice-bar{
+  line-height:60px;
+  height: 60px;
+}
+.notice-swipe {
+  height: 30px;
+  line-height: 30px;
+}
+</style>
 <style scoped lang="scss">
+.top-bar-box{
+  position: relative;
+}
 .top-bar {
   height: 300px;
   width: 100%;
@@ -120,6 +178,12 @@ export default {
     font-size: 40px;
   }
 }
+.notice-box{
+  width: 100%;
+  position: absolute;
+  bottom: -80;
+  z-index: 1000;
+}
 .bottom-box {
   padding-top: 50px;
   > div {

+ 1 - 1
src/components/nfcPopup/more.vue

@@ -26,7 +26,7 @@
           </div>
         </div>
       </div>
-      <input v-show="false" ref="upload" type='file' accept="image/*" @change="fileChange"/>
+      <input v-show="false" ref="upload"  type='file' accept="image/*" capture="camera" @change="fileChange"/>
     </van-popup>
   </div>
 </template>

+ 2 - 0
src/views/home/menu.vue

@@ -16,6 +16,8 @@
         </van-grid>
       </div>
     </div>
+
+
     <van-dialog v-model="show" title="标题" confirmButtonText="关闭">
       <p class="text">
         {{ info }}

+ 20 - 5
src/views/menu/message/index.vue

@@ -14,7 +14,8 @@
         :pullup="pullup"
         class="wrapper"
         ref="wrapper">
-        <van-cell-group  v-for="(v,i) in dataList">
+        <van-empty v-if="!dataList.length" description="暂无数据" />
+        <van-cell-group v-else v-for="(v,i) in dataList">
           <van-cell class="list-item" :title="v.title" :label="v.content" @click="clickItem(v)">
             <template #right-icon>
               <i  class="point-icon" :class="{'active':v.isRead}" />
@@ -83,7 +84,7 @@ export default {
       query:{
         type:1,
         pageNum:1,
-        pageSize:1,
+        pageSize:10,
       },
       pullup:true,
       message:null,
@@ -123,7 +124,7 @@ export default {
       this.getDataList();
     },
     getDataList(){
-      if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
+      if( this.dataList.length !== 0 && this.dataList?.length >= this.total) {
         console.log(456,'456')
         this.pullup = false;
         this.$toast('已加载完毕');
@@ -138,10 +139,14 @@ export default {
           tagRoleIds:this.roleList.map(v=>{return v.roleId}),
         }
         msgList(data).then(res=>{
+          if(res.total === '0'){
+            this.pullup = false;
+            this.$toast('已加载完毕');
+            return
+          }
           this.total = res.total;
           if(this.dataList.length < res.total) {
             this.dataList = [...this.dataList,...res.rows] ;
-            console.log(123,'123')
             this.pullup = true;
             this.query.pageNum++;
           }
@@ -153,7 +158,17 @@ export default {
         userId:this.id,
       }
       dataList(data).then(res=>{
-        this.dataList = res.rows;
+        if(res.total === '0'){
+          this.pullup = false;
+          this.$toast('已加载完毕');
+          return
+        }
+        this.total = res.total;
+        if(this.dataList.length < res.total) {
+          this.dataList = [...this.dataList,...res.rows] ;
+          this.pullup = true;
+          this.query.pageNum++;
+        }
       })
     }
   }