浏览代码

修复bug

凉纪 2 年之前
父节点
当前提交
cf379f024d

+ 21 - 3
src/components/SearchSelectCell/index.vue

@@ -63,18 +63,36 @@ export default {
       label:'',
     }
   },
+  // watch:{
+  //   value:{
+  //     handler(val){
+  //       console.log(val,'val')
+  //       let arr = [];
+  //       val.forEach(v=>{
+  //         this.columns.forEach(item=>{
+  //           if(v === item[this.prop.value]){
+  //             arr.push(item[this.prop.label]);
+  //           }
+  //         })
+  //       })
+  //       this.label = arr.toString();
+  //       console.log(this.label,'label')
+  //     },
+  //     //immediate:true,
+  //   }
+  // },
   computed:{
     columns(){
       return this.dataList;
     },
     selected(){
-      let val;
+      let val = [];
       this.columns.forEach(v=> {
-        if (v[this.prop.value] === this.value) {
+        if (v[this.prop.value] == this.value) {
           val.push(v[this.prop.label]);
-          this.label = val.toString();
         }
       });
+      this.label = val.toString();
       return val;
     },
   },

+ 9 - 9
src/components/TopBar.vue

@@ -68,7 +68,7 @@ export default {
       active: this.defaultActive,
       rolesList: [],
       color: '#ecf9ff',
-      background: '#4ea2f8'
+      background: 'rgba(78,162,248,0.63)'
     }
   },
   computed: {
@@ -91,20 +91,20 @@ export default {
       let alarmLevel = this.list[index].alarmLevel;
       switch (alarmLevel){
         case '蓝色':
-          this.background = '#4ea2f8';
-          this.color = '#fff';
+          this.background = 'rgba(78,162,248,0.62)';
+          //this.color = '#fff';
           break;
         case '黄色':
-          this.background = '#eee367';
-          this.color = '#fff';
+          this.background = 'rgba(238,227,103,0.63)';
+          //this.color = '#fff';
           break;
         case '橙色':
-          this.background = '#f6b568';
-          this.color = '#fff';
+          this.background = 'rgba(246,181,104,0.62)';
+          //this.color = '#fff';
           break;
         case '红色':
-          this.background = '#ef464a';
-          this.color = '#fff';
+          this.background = 'rgba(239,70,74,0.65)';
+          //this.color = '#fff';
       }
     },
     clickOutLogin() {

+ 217 - 0
src/components/Yselectcell/index.vue

@@ -0,0 +1,217 @@
+<template>
+  <div class="date-cell">
+    <van-cell v-if="disabled" :required="required" :title="title" :label="nameListStr"/>
+    <van-cell v-else  :required="required" :title="title" :label="nameListStr" is-link  @click="clickItem"/>
+
+    <van-popup
+      class="search-data-popup"
+      round lazy-render
+      v-model="showPicker"
+      position="bottom"
+      @click-overlay="clickOverlay"
+      :close-on-click-overlay="closeOnClickOverlay">
+      <div class="header-line">
+        <div class="cancel" @click="onSearchCancel">取消</div>
+        <div class="title">{{ title }}</div>
+        <div class="sure" @click="onSearchConfirm">确定</div>
+      </div>
+
+      <van-search v-if="showSearch" placeholder="输入搜索内容" v-model="searchValue" @input="inputSearchValue" />
+
+      <div v-if="itemList?.length >0"  class="lists">
+        <van-checkbox-group v-model="selected">
+          <van-cell-group>
+            <van-cell
+              v-for="(item, index) in itemList"
+              clickable
+              :key="item.id"
+              :title="item.name">
+              <template #right-icon>
+                <van-checkbox :name="item.id" ref="checkboxes"/>
+              </template>
+            </van-cell>
+          </van-cell-group>
+        </van-checkbox-group>
+      </div>
+      <div v-else class="lists">
+        <van-empty description="无数据" />
+      </div>
+    </van-popup>
+  </div>
+</template>
+
+<script>
+export default {
+  props:{
+    //禁用
+    disabled:{
+      type: [Boolean,String],
+      default: false,
+    },
+    //双向绑定的数据
+    value:{
+      type:Array,
+      default: ()=>[],
+    },
+    required:{
+      type: [Boolean,String],
+      default: false,
+    },
+    //标题
+    title:{
+      type: String,
+      default: null,
+    },
+    //父组件给的列表数据
+    dataList:{
+      type: Array,
+      default: ()=>[],
+    },
+    closeOnClickOverlay:{
+      type:Boolean,
+      default:true
+    },
+    showSearch:{
+      type:Boolean,
+      default:true
+    },
+    //自定义字段
+    prop:{
+      type: Object,
+      default: ()=>(
+        {
+          label:'label',
+          value:'value'
+        }
+      ),
+    }
+  },
+  data(){
+    return{
+      showPicker:false,
+      selected:[],
+      label:'',
+      searchValue: "", //搜索框内容
+      itemList:[],
+    }
+  },
+  watch:{
+    value:{
+      handler(val){
+        console.log(val,'val256')
+        if(!val) {
+          this.selected = [];
+        }else{
+          this.selected = this.value;
+        }
+      },
+      immediate:true,
+    },
+    dataList:{
+      handler(val){
+        console.log(val,'dataList')
+        this.itemList = JSON.parse(JSON.stringify(this.dataList));
+      },
+      immediate:true,
+    }
+  },
+  computed: {
+    nameListStr() {
+      const list = this.dataList.filter(item => this.selected.includes(item.id));
+      return list.map(item => item.name)?.join(',')
+    },
+  },
+  methods:{
+    clickOverlay(){
+      this.selected = this.value;
+      this.showPicker = false;
+    },
+    /** 有bug*/
+    click(v,i){
+      console.log(this.$refs.checkboxes,i,'4546456')
+      this.$refs.checkboxes[i].toggle();
+    },
+    inputSearchValue(query) {
+      //搜索框值发生改变
+      setTimeout(() => {
+        this.itemList= this.dataList.filter(item => {
+          return item.name.indexOf(query) > -1;
+        });
+      }, 200);
+    },
+    onSearchCancel() {
+      this.selected = this.value;
+      this.$emit("cancel");
+      this.showPicker = false;
+    },
+    onSearchConfirm() {
+      console.log(this.selected,'selected')
+      this.$emit("change", this.selected);
+      this.showPicker = false;
+    },
+    clickItem(){
+      this.showPicker = true;
+    },
+  },
+  model:{
+    prop: 'value',
+    event: 'change',
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.van-cell__label{
+  margin: 0;
+}
+.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>

+ 0 - 3
src/components/orgTree/index.vue

@@ -80,9 +80,6 @@ export default {
   }
 }
 </script>
-<style>
-
-</style>
 <style lang="scss">
 .orgTree {
   font-size: 28px;

+ 92 - 50
src/components/scroll/scroll.vue

@@ -8,12 +8,12 @@
       </div>
 
       <!-- 内容区域 -->
-      <div class="content">
+      <div class="list-content">
         <slot></slot>
       </div>
 
       <!-- 上拉加载更多区域 -->
-      <div v-if="pullupUp" class="load-more-wrapper" v-show="showLoadMoreText">
+      <div v-if="showLoadMoreText" class="load-more-wrapper">
         <div class="load-more-indicator">
           {{ loadMoreText }}
         </div>
@@ -24,17 +24,28 @@
 
 <script>
 import BScroll from 'better-scroll';
-
 export default {
   props: {
+    //开启下拉刷新
     pullupDown: {
       type: Boolean,
       default: true,
     },
+    //开启上拉加载更多
     pullup: {
       type: Boolean,
       default: true,
     },
+    //下拉刷新回调函数
+    pullupDownFn: {
+      type: Function,
+      default: () => {},
+    },
+    //上拉加载更多回调函数
+    pullupFn: {
+      type: Function,
+      default: () => {},
+    },
   },
   data() {
     return {
@@ -44,7 +55,7 @@ export default {
       showLoadMoreText: false, // 是否显示加载更多
       refreshText: '下拉刷新', // 刷新文本
       loadMoreText: '加载更多', // 加载更多文本
-      pullupUp: true,
+      pullupUp: true, // 是否可以上拉加载更多
     };
   },
   mounted() {
@@ -52,12 +63,28 @@ export default {
     this.initScroll();
   },
   watch: {
-    pullup(val) {
-      console.log('状态改变',val)
-      this.pullupUp = val
-    }
+    pullup: {
+      handler(val) {
+        console.log('状态改变',val)
+        this.pullupUp = val
+      },
+      immediate: true
+    },
   },
   methods: {
+    /** 刷新滚动容器高度,使用时最好在nextTick函数中调用*/
+    refresh() {
+      // this.$nextTick(()=>{
+      //   console.log('刷新滚动容器')
+      //   this.bs.finishPullUp(); //  加载更多完成
+      //   this.bs.refresh(); // 重新计算高度
+      // })
+      setTimeout(() => {
+        console.log('刷新滚动容器')
+        this.bs.finishPullUp(); //  加载更多完成
+        this.bs.refresh();
+      },500)
+    },
     // 初始化 better-scroll
     initScroll() {
       this.bs = new BScroll(this.$refs.scrollWrapper, {
@@ -71,50 +98,63 @@ export default {
         },
       });
 
-
-        // 监听下拉刷新事件
-        this.bs.on('pullingDown', (pos) => {
-          if(this.pullupDown) {
-            this.isRefreshing = true;
-            //this.refreshText = '正在刷新';
-            this.$emit('refresh');
-            // 这里可以执行刷新操作,例如发送请求获取数据
-            // 刷新完成后,调用 this.refreshFinish() 结束刷新
-            setTimeout(() => {
-              this.refreshFinish();
-            }, 300);
-          }else {
-            setTimeout(() => {
-              this.refreshFinish();
-            }, 300);
-          }
-        });
-        console.log(this.pullupUp,'pullingUp1')
-        // 监听上拉加载事件
-        this.bs.on('pullingUp', () => {
-          console.log(this.pullupUp,'pullingUp2')
-          if(this.pullupUp) {
-            this.showLoadMoreText = true;
-            this.loadMoreText = '正在加载...';
-            this.$emit('loadMore');
-            // 这里可以执行加载更多操作,例如发送请求获取数据
-            // 加载完成后,调用 this.loadMoreFinish() 结束加载更多
-            setTimeout(() => {
-              this.loadMoreFinish();
-            }, 500);
-          }else {
-            setTimeout(() => {
-              this.loadMoreFinish();
-            }, 500);
-          }
-        });
+      // 监听下拉刷新事件
+      this.bs.on('pullingDown', this.pullingDownHandler);
+      // 监听上拉加载事件
+      this.bs.on('pullingUp', this.pullingUpHandier);
       // better-scroll 初始化完成后,刷新 scroll
-      this.bs.refresh();
+      this.$nextTick(()=>{
+        this.bs.refresh();
+      })
+    },
+    // 下拉刷新
+    async pullingDownHandler(){
+      console.log('下拉刷新')
+      if(this.pullupDown) {
+        this.isRefreshing = true;
+        //this.refreshText = '正在刷新';
+        this.$emit('refresh');
+        // 这里可以执行刷新操作,例如发送请求获取数据
+        await this.downFn();
+        // 刷新完成后,调用 this.refreshFinish() 结束刷新
+        setTimeout(() => {
+          this.refreshFinish();
+        }, 500);
+      }else {
+        setTimeout(() => {
+          this.refreshFinish();
+        }, 300);
+      }
+    },
+    // 上拉加载
+    async pullingUpHandier(){
+      console.log(this.pullupUp,'pullingUp2')
+      if(this.pullupUp) {
+        this.showLoadMoreText = true;
+        this.loadMoreText = '正在加载...';
+        this.$emit('loadMore');
+        await this.upFn();
+        this.loadMoreText = '加载更多';
+        this.showLoadMoreText = false;
+        // 加载完成后,调用 this.loadMoreFinish() 结束加载更多
+      }else {
+        setTimeout(() => {
+          this.loadMoreFinish();
+        }, 300);
+      }
+    },
+
+    async downFn(){
+      await this.pullupDownFn();
+    },
+
+     async upFn(){
+      await this.pullupFn();
     },
 
     // 结束下拉刷新
     refreshFinish() {
-      this.isRefreshing = false;
+      console.log('更新容器高度');
       this.refreshText = '下拉刷新';
       this.bs.finishPullDown(); //  刷新完成
       this.bs.refresh(); // 重新计算高度
@@ -122,11 +162,14 @@ export default {
 
     // 结束上拉加载更多
     loadMoreFinish() {
-      this.showLoadMoreText = false;
       this.loadMoreText = '加载更多';
-      this.bs.finishPullUp(); //  加载更多完成
+      this.showLoadMoreText = false;
     },
   },
+  destroyed() {
+    // 销毁 better-scroll
+    this.bs.destroy();
+  },
 };
 </script>
 
@@ -166,5 +209,4 @@ export default {
 }
 
 
-
 </style>

+ 1 - 2
src/components/selectCell/index.vue

@@ -58,7 +58,7 @@ export default {
   data(){
     return{
       showPicker:false,
-      label:'',
+      label:'',
     }
   },
   computed:{
@@ -83,7 +83,6 @@ export default {
     pickerConfirm(val){
       this.label = val[this.prop.label];
       this.showPicker = false;
-      console.log(this.selected,'234')
       this.$emit('change',val[this.prop.value])
     },
     clickItem(){

+ 4 - 1
src/filters/filter.js

@@ -5,7 +5,10 @@ import dayjs from "dayjs";
  *yyyy-MM-dd hh:mm:ss
  */
 export function formatDate(date, format) {
-  if(!format) format = 'YYYY-MM-DD HH:mm:ss'
+  if(!date) return '';
+  if(!format) format = 'YYYY-MM-DD HH:mm:ss';
+  if(format === 'DATE') format = 'YYYY-MM-DD';
+  if(format === 'TIME') format = 'HH:mm:ss';
   return dayjs(date).format(format);
 }
 

+ 6 - 0
src/router/router.config.js

@@ -250,6 +250,12 @@ export let routers = [
         component: () => import('@/views/menu/resumption/detail.vue'),
         meta: { title: '履职', keepAlive: false ,hideTabBar:true}
       },
+      {
+        path: '/safetyBook',
+        name: 'safetyBook',
+        component: () => import('@/views/menu/safetyBook/index.vue'),
+        meta: { title: '安全责任书', keepAlive: false ,hideTabBar:false}
+      },
     ],
   },
 ]

+ 21 - 16
src/views/home/menu.vue

@@ -3,18 +3,21 @@
     <top-bar></top-bar>
 
     <div class="menu-list">
-      <div class="menu-list-item" v-for="(v, i) in menuList" :key="i">
-        <p @click="onclick">{{ v.meta.title }}</p>
-        <van-grid border :column-num="3">
-          <van-grid-item
-            v-for="(item, index) in v.children"
-            :key="index"
-            :icon="item.meta.icon"
-            :text="item.meta.title"
-            :to="item.path"
-          />
-        </van-grid>
-      </div>
+      <Scroll ref="Scroll" :pullupDown="false" :pullup="false">
+        <van-empty v-if="!menuList.length" description="暂无数据" />
+        <div v-else class="menu-list-item" v-for="(v, i) in menuList" :key="i">
+          <p @click="onclick">{{ v.meta.title }}</p>
+          <van-grid border :column-num="3">
+            <van-grid-item
+              v-for="(item, index) in v.children"
+              :key="index"
+              :icon="item.meta.icon"
+              :text="item.meta.title"
+              :to="item.path"
+            />
+          </van-grid>
+        </div>
+      </Scroll>
     </div>
 
 
@@ -28,11 +31,12 @@
 
 <script>
 import TopBar from '@/components/TopBar'
+import Scroll from '@/components/scroll/scroll'
 import { mapGetters } from 'vuex'
 import { getMenu, getTheAreaWeather } from '@/api/public'
 export default {
   name: 'menus',
-  components: { TopBar },
+  components: { TopBar,Scroll },
   data() {
     return {
       menuList: [],
@@ -50,7 +54,8 @@ export default {
   methods: {
     getMenuList() {
       getMenu().then(res => {
-        this.menuList = res.data
+        this.menuList = res.data;
+        this.$refs.Scroll.refresh();
       })
     },
     clickHandler(item) {
@@ -104,13 +109,13 @@ export default {
   background-color: rgba(237, 252, 255, 1);
 }
 .menu-list {
-  padding: 30px 0;
+  padding: 30px 0 0 0;
   height: calc(100vh - 400px);
   overflow: auto;
 }
 .menu-list-item {
   background-color: #fff;
-  border-radius: 10px;
+  -border-radius: 10px;
   box-shadow: 0 10px 20px #eee;
   margin: 20px;
   > p {

+ 11 - 8
src/views/menu/message/index.vue

@@ -7,16 +7,14 @@
       <van-tab title="消息" name="3"></van-tab>
     </van-tabs>
     <div class="card-list">
-<!--      <van-empty description="暂无数据" v-if="!dataList || dataList.length === 0" />-->
       <Scroll
+        ref="Scroll"
         @refresh="refreshData"
         @loadMore="getDataList"
-        :pullup="pullup"
-        class="wrapper"
-        ref="wrapper">
+        :pullup="pullup">
         <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)">
+        <van-cell-group class="list-item" v-else v-for="(v,i) in dataList" :key="i">
+          <van-cell  :title="v.title" :label="v.content" @click="clickItem(v)">
             <template #right-icon>
               <i  class="point-icon" :class="{'active':v.isRead}" />
             </template>
@@ -124,8 +122,8 @@ export default {
       this.getDataList();
     },
     getDataList(){
+      console.log(11111)
       if( this.dataList.length !== 0 && this.dataList?.length >= this.total) {
-        console.log(456,'456')
         this.pullup = false;
         this.$toast('已加载完毕');
         return;
@@ -149,6 +147,7 @@ export default {
             this.dataList = [...this.dataList,...res.rows] ;
             this.pullup = true;
             this.query.pageNum++;
+            this.$refs.Scroll.refresh();
           }
         })
         return;
@@ -168,6 +167,7 @@ export default {
           this.dataList = [...this.dataList,...res.rows] ;
           this.pullup = true;
           this.query.pageNum++;
+          this.$refs.Scroll.refresh();
         }
       })
     }
@@ -192,12 +192,15 @@ export default {
 
 }
 .card-list{
-  padding: 20px ;
+  padding: 20px;
   height: calc(100vh - 190px);
   overflow:  auto;
 }
 .list-item{
   margin-bottom: 20px;
+  &:last-child{
+    margin-bottom: 0;
+  }
 }
 .cell-label{
   width: 100%;

+ 21 - 0
src/views/menu/safetyBook/api.js

@@ -0,0 +1,21 @@
+import request from "@/utils/request";
+import day from 'dayjs'
+//获取消息列表
+export function dataList(params) {
+  return request({
+    url: "/core/center/messageList",
+    method: "get",
+    params,
+  });
+}
+//获取计划列表
+export function msgList(data){
+  return request({
+    url: "/core/notification/appList",
+    method: "post",
+    data
+  });
+}
+
+
+

+ 122 - 0
src/views/menu/safetyBook/index.vue

@@ -0,0 +1,122 @@
+<template>
+  <div class="safetyBook">
+    <NavBar />
+    <div class="page-container">
+      <div class="search-box">
+        <org-tree v-model="query.OrgId" placeholder="选择检查机构" @change="refreshData"></org-tree>
+      </div>
+      <div class="scroll-box">
+        <Scroll
+          ref="Scroll"
+          :pullupDownFn="refreshData"
+          :pullupFn="getDataList"
+          :pullup="pullup">
+          <van-empty v-if="!dataList.length" description="暂无数据" />
+          <div class="list-item" v-else v-for="(v,i) in dataList" :key="i">
+            <van-panel :title="v.title" :status="`${i}`" @click="clickItem(v)">
+              <van-cell class="item-cell" :title="v.title" :value="v.publishTime">
+              </van-cell>
+              <van-cell class="item-cell" :title="v.title" :value="v.publishTime" >
+              </van-cell>
+              <van-cell class="item-cell" :title="v.title" :value="v.publishTime" >
+              </van-cell>
+            </van-panel>
+          </div>
+        </Scroll>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/components/NavBar'
+import OrgTree from '@/components/orgTree'
+import Scroll from '@/components/scroll/scroll'
+import {dataList} from './api'
+import {formatDate} from "@/filters/filter";
+import {msgList} from "@/views/menu/message/api";
+export default {
+  name: "safetyBook",
+  components: {
+    NavBar,
+    OrgTree,
+    Scroll
+  },
+  data(){
+    return {
+      pullup:true,
+      query:{
+        OrgId:null,
+        pageNum:1,
+        pageSize:10,
+      },
+      total:0,
+      dataList:[]
+    }
+  },
+  mounted(){
+    this.getDataList();
+  },
+  methods:{
+    refreshData(){
+      this.pullup = true;
+      this.query.pageNum = 1;
+      this.total = 0;
+      this.dataList = [];
+      this.getDataList();
+    },
+    getDataList(){
+      if( this.dataList.length !== 0 && this.dataList?.length >= this.total) {
+        this.pullup = false;
+        this.$toast('已加载完毕');
+        return;
+      }
+      let data = {};
+      dataList(this.query).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] ;
+          this.pullup = true;
+          this.query.pageNum++;
+          this.$refs.Scroll.refresh();
+        }
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+.safetyBook{
+  .list-item{
+    .van-cell-group__title{
+      background-color: #fff;
+      color: #333;
+    }
+    .van-cell__title{
+      color: #969799;
+    }
+  }
+}
+</style>
+<style lang="scss" scoped>
+.safetyBook{
+
+}
+.scroll-box{
+  padding: 20px;
+  width: 100%;
+  height:calc(100vh - 284px);
+  overflow: auto;
+}
+.list-item{
+  margin-bottom:20px;
+  &:last-child{
+    margin-bottom: 0;
+  }
+}
+</style>

+ 66 - 27
src/views/menu/securityCheckRegister/index.vue

@@ -10,7 +10,7 @@
 <!--              <div class="org-label">检查机构</div>-->
 <!--            </van-col>-->
             <van-col span="24">
-              <org-tree v-model="query.checkOrgId" placeholder="选择检查机构" @change="refreshData"></org-tree>
+              <org-tree v-model="query.checkOrgId" placeholder="选择检查机构" @change="changeOrgId"></org-tree>
             </van-col>
           </van-row>
         </div>
@@ -27,7 +27,12 @@
       </div>
 
       <div class="van-hairline--bottom">
-        <search-select-cell title="检查角色" v-model="query.roldIds" :dataList="rolesList" :prop="prop" @change="refreshData"/>
+        <search-select-cell
+          title="检查角色"
+          v-model="query.roldIds"
+          :dataList="rolesList"
+          :prop="prop"
+          @change="refreshData"/>
       </div>
       <div class="van-hairline--bottom">
         <date-cell title="检查日期"  v-model="query.taskTime" date-type="date" @change="refreshData"/>
@@ -36,17 +41,15 @@
 
       <div class="card-list">
         <Scroll
-          @pulldown="refreshData"
-          @pullup="getDataList"
-          :data='dataList'
-          :pullup="pullup"
-          class="wrapper"
-          ref="wrapper">
+          ref="Scroll"
+          @refresh="refreshData"
+          @loadMore="getDataList"
+          :pullup="pullup">
           <van-empty description="暂无数据" v-if="!dataList || dataList.length === 0" />
           <div  v-else class="list-item">
-            <van-panel v-for="(v,i) in dataList" :title="v.taskName" :desc="`${formatDate(v.planStartTime,'YYYY-MM-DD')}~${formatDate(v.planEndTime,'YYYY-MM-DD')}`" >
+            <van-panel v-for="(v,i) in dataList" :title="v.taskName" :desc="rangDate(formatDate(v.planStartTime,'DATE'),formatDate(v.planEndTime,'DATE'))" >
 
-              <van-collapse v-model="active" :key="v.planId">
+              <van-collapse v-model="active" :key="v.planId" @change="collapseChange">
                 <van-collapse-item :name="v.planId" >
                   <template #title>
                     <div class="collapse-title">
@@ -77,7 +80,7 @@ import OrgTree from '@/components/orgTree'
 import KList from '@/components/list'
 import DateCell from '@/components/dateCell'
 import SelectCell from '@/components/selectCell'
-import SearchSelectCell from '@/components/SearchSelectCell'
+import SearchSelectCell from '@/components/Yselectcell'
 import Scroll from '@/components/scroll/scroll'
 import {dataList,registerRole} from './api'
 import {mapGetters} from "vuex";
@@ -103,7 +106,10 @@ export default {
         beCheckedOrgId:null,
         roldIds:[],
         state:'1',
+        pageNum:1,
+        pageSize:10,
       },
+      total:0,
       rolesList:[],
       prop:{
         label:'name',
@@ -120,25 +126,35 @@ export default {
   },
   mounted() {
     this.initData();
+    this.query.checkOrgId = this.orgId;
+    this.getRoleList();
   },
   computed:{
     ...mapGetters(['orgId','dictionary']),
   },
-  watch:{
-    'query.checkOrgId':{
-      handler(v){
-        this.getRoleList();
-      }
-    }
-  },
   methods: {
     formatDate,
+    changeOrgId(){
+      console.log(123,'2131')
+      this.query.roldIds = [];
+      this.getRoleList();
+      this.refreshData();
+    },
+    collapseChange(){
+      console.log('collapseChange')
+      this.$nextTick(()=>{
+        this.$refs.Scroll.refresh();
+      })
+    },
     changeList(item,type){
       this.$set(item,'active',type);
+      //this.$refs.Scroll.refresh();
     },
     refreshData(){
+      console.log('sadad')
+      this.pullup = true;
       this.query.pageNum = 1;
-      this.pullup = false;
+      this.total = 0;
       this.dataList = [];
       this.getDataList();
     },
@@ -153,20 +169,43 @@ export default {
       })
     },
     getDataList(){
+      if( this.dataList.length !== 0 && this.dataList?.length >= this.total) {
+        this.pullup = false;
+        this.$toast('已加载完毕');
+        return;
+      }
       let data = {
         ...this.query
       }
       if(!this.query.checkOrgId) return this.$toast('请选择机构');
       dataList(data).then(res=>{
-        this.dataList = res.rows.map(v=>{
-          v.active = 1
-          return v
-        });
-        this.active = res.rows.map(v=>{
-          return v.planId
-        })
+        if(res.total === '0'){
+          this.pullup = false;
+          this.$toast('已加载完毕');
+          return
+        }
+        this.total = res.total;
+        if(this.dataList.length < res.total) {
+          //this.dataFn(res.row);
+          this.dataList = [...this.dataList,...res.rows];
+          this.$nextTick(()=>{
+            this.$refs.Scroll.loadMoreFinish()
+            //this.$refs.Scroll.refresh();
+          })
+          this.pullup = true;
+          this.query.pageNum++;
+        }
       })
-    }
+    },
+    dataFn(arr){
+      this.dataList = arr.map(v=>{
+        v.active = 1
+        return v
+      });
+      this.active = arr.map(v=>{
+        return v.planId
+      })
+    },
   }
 }
 </script>

+ 8 - 1
vue.config.js

@@ -110,13 +110,20 @@ module.exports = defineConfig({
       },
       '/dev': {
         target: "http://10.87.10.55:8080",
-        // target: "http://47.92.229.224:9002",
         // ws:true,
         changOrigin:true,
         pathRewrite:{
           '^/dev':'/'
         }
       },
+      '/test': {
+        target: "http://47.92.229.224:9002",
+        // ws:true,
+        changOrigin:true,
+        pathRewrite:{
+          '^/test':'/'
+        }
+      },
       '/chao': {
         target: "http://10.87.10.34:8080",
         // ws:true,