首页 > 其他分享 >app列表页(无筛选 有搜索)

app列表页(无筛选 有搜索)

时间:2023-05-06 11:56:57浏览次数:26  
标签:index app 列表 item result background position 筛选 page

<template>
  <div class="wh main bxs">
    <div class="header bxs w">
      <van-row>
        <van-col @click="backFn" span="8" class="f18 corm pl10"
          ><van-icon name="arrow-left" class="corm" />返回</van-col
        >
        <van-col span="8" class="tc f20">用户管理</van-col>
        <van-col span="8" class="tr f16 pr10 corm">
          <span @click="addFn">新增</span>
        </van-col>
      </van-row>
    </div>
    <div class="wh bxs content">
      <div class="contentSea bxs w">
        <van-search
          v-model="bizTitle"
          placeholder="输入用户名/登录账号/身份证号搜索"
          @search="onSearch"
        />
      </div>
      <!-- main.js 引入注册 -->
      <scroller
        :on-infinite="infinite"
        :noDataText="noDataText"
        class="bxs p10 h"
        ref="myscroller"
      >
        <div class="contentList bxs w ptnew">
          <van-swipe-cell v-for="(item, i) of tableData" :key="i">
            <div class="w p10 list bxs mb10" @click="detailFn(item)">
              <div class="list-item">
                <div class="f16 titleInfo flex">
                  <span class="text_1">{{ item.nickName }}</span>
                </div>
                <div class="f12 mt5">
                  {{ item.userName }}
                </div>
                <div class="list-item-lf bxs p10 bgcm">
                  <div class="wh flexca">
                    <van-icon name="manager" size="25" />
                  </div>
                </div>
                <div class="list-item-rt bxs p10 bgf f12">
                  <div class="h flexca" style="color: #2e7cf9">
                    <span>
                      <i class="iconfont icon-ticket_renlianshibie"> </i>
                      信息登记</span
                    >
                    <span class="ml10 f13"
                      ><van-icon name="more-o" class="f16" /> 操作</span
                    >
                  </div>
                </div>
              </div>
            </div>
            <template #right>
              <van-button
                square
                style="margin-left: 1px"
                type="info"
                text="删除"
                class="delete-button"
                @click="deleteFn(item)"
              />
            </template>
          </van-swipe-cell>
        </div>
      </scroller>
    </div>
  </div>
</template>
<script>
import {
  getUserQueryList,
  delByUserIds,
} from "@/api/mine_userManage";
import {
  getDictTypeList,
} from "@/api/sys";
// 状态关联关键词*
export default {
  data () {
    return {
      bizTitle: "",//搜索参数
      tableData: [],//列表初始化数据
      page: {
        index: 0,
        size: 10,
        total: null,
      },

    };
  },
  created () {
    this.employeeId = JSON.parse(localStorage.getItem("employeeId"));
    this.departmentId = localStorage.getItem("departmentId");
  },
  // 页面销毁生命周期方法
  beforeDestroy () {
    this.$toast.clear();
  },
  methods: {
    // 删除
    async deleteFn (item) {
      const res = await delByUserIds(item.userId);
      if (res.code == 200) {
        this.$toast.success("刪除成功");
        this.page.index = 0;
        this.tableData = [];
        this.getData();
      }
    },
    // 详情跳转
    detailFn (item) {
      this.$router
        .push({
          name: "userManageDetail",
          params: {
            userId: item.userId,
            item: item,
          },
        })
        .then((res) => {
          console.log(res);
        })
        .catch((error) => {
          console.log(error);
        }); //把error 抛出来;
    },
    // 新增
    addFn () {
      this.$router
        .push({ name: "userMessAdd" })
        .then((res) => {
          console.log(res);
        })
        .catch((error) => {
          console.log(error);
        }); //把error 抛出来;
    },
    // 搜索
    onSearch () {
      this.page = {
        index: 0,
        size: 10,
        total: null,
      };
      console.log(this.page);
      this.$refs.myscroller.finishInfinite(false);
      this.tableData = [];
    },
    infinite (done) {
      setTimeout(() => {
        this.page.index++;
        this.getData(done);
      }, 500);
    },
    // 初始化数据
    async getData (done) {
      let datVal = {
        keyword: this.bizTitle,
        ...this.formSearch,
        pageNum: this.page.index,
        pageSize: this.page.size,
      };
      console.log(this.page.index, "index");
      const result = await getUserQueryList(datVal);
      if (this.$refs.myscroller) {
        this.$refs.myscroller.finishInfinite(true);
      }
      if (result.data.length < 10) {
        this.noDataText = this.noDataTextEnd;
      }
      if (result.data && result.data.length > 0) {
        if (typeof done == "function") {
          done();
        }
        this.tableData = this.tableData.concat(result.data);
        console.log(this.tableData, result.data);
        if (result.pageNum) {
          this.page.index = result.pageNum;
        }
        this.page.total = result.total;
      }
    },
    backFn () {
      this.$router.back();
    },



  },
};
</script>
<style lang="scss" scoped>
.contentList.ptnew {
  padding-top: 105px;
}
.search_condition {
  position: absolute;
  top: 15px;
  right: 15px;
  display: inline-block;
  padding: 3px 8px;
  background-color: #fff;
  border-radius: 5px;
  z-index: 999;
}

.main {
  position: relative;
  .header {
    height: 50px;
    line-height: 50px;
    position: fixed;
    background: #fff;
    top: 0;
    left: 0;
    z-index: 100;
  }
  .content {
    background: #f5f8f8;
    padding-top: 105px;
    .contentSea {
      position: fixed;
      top: 50px;
      left: 0;
      background: #fff;
      z-index: 100;
    }
    .contentList {
      .list {
        background: #fff;
        position: relative;
        border-radius: 4px;
        .list-item {
          width: 100%;
          box-sizing: border-box;
          position: relative;
          padding-left: 50px;
        }
        .list-item-lf {
          position: absolute;
          left: 0;
          top: 0;
          width: 40px;
          height: 40px;
          border-radius: 50%;
        }
        .list-item-rt {
          position: absolute;
          right: 0;
          top: 0;
        }
        // div:nth-child(1) {
        //   width: 80%;
        // }
        // .flotDiv {
        //   position: absolute;
        //   top: 10px;
        //   right: 0;
        //   background: #cc0000;
        //   color: #fff;
        // }
      }
    }
  }
}
.delete-button {
  height: 100%;
}
.filter-btm-btn {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #fff;
  box-sizing: border-box;
  padding-top: 10px;
  .btn {
    display: inline-block;
    width: 40%;
    height: 40px;
    line-height: 40px;
    background-color: #8a8a8a;
    color: #fff;
    text-align: center;
  }
  .btn_l {
    border-radius: 20px 0 0 20px;
  }
  .btn_r {
    border-radius: 0 20px 20px 0;
    background-color: #2e7cf9;
  }
}
</style>

 

标签:index,app,列表,item,result,background,position,筛选,page
From: https://www.cnblogs.com/dianzan/p/17376809.html

相关文章

  • 在Winform分页控件中集成保存用户列表显示字段及宽度调整设置
    在Winform的分页控件里面,我们提供了很多丰富的功能,如常规分页,中文转义、导出Excel、导出PDF等,基于DevExpress的样式的分页控件,我们在其上面做了不少封装,以便更好的使用,其中就包括集成保存用户列表显示字段及宽度调整设置。本篇随笔介绍这个实现的过程,通过在当前程序中序列化方式存......
  • 使用nacos配置,启动服务时一直报 Error starting ApplicationContext. To display the
    报错日志如下:ErrorstartingApplicationContext.Todisplaytheconditionsreportre-runyourapplicationwith'debug'enabled.-2023-05-0509:46:02.328[TID:N/A]ERROR8236---[main]o.s.b.d.LoggingFailureAnalysisReporter:***********......
  • (原创第一篇,踩坑无数得来的,对Ai自动化测试框架很有帮助)appium自动化测试时遇到不能使用
     现在开发的前端界面使用vue或者更牛逼技术,导致使用appium或者uiautomator2做自动化测试时不能识别到元素,无法使用传统的id,name或者xpath,这时我们需要使用坐标点击文本框。有获取坐标方法,下期写一篇文章,可以在评论区提醒瑞克。fromappiumimportwebdriverimporttimeimport......
  • python 创建虚拟环境以及数据迁移和.Django创建app
    一.python创建虚拟环境1.1首先要确认在那个位置创建虚拟环境创建命令virtualenv虚拟环境名称二.python数据迁移1.生成迁移文件pythonmanage.pymakemigrations2.同步到数据库中pythonmanage.pymigrate三.Django创建apppythonmanage.pystartappAPP名称......
  • uniapp使用scss定义全局css
    1.新建scss文件,定义各种全局css样式$orange:#ee5313!default;//主题色:橙色$darkOrange:#d43a11;//深橙色$color:#333;$gray:#999;//灰色$lightGray:#bbb;//浅灰$grayBg:#f3f3f3!important;//body灰色背景$white:#fff;//白色$blue:#1a......
  • MASA MinimalAPI源码解析:为什么我们只写了一个app.MapGet,却生成了三个接口
    源码解析:为什么我们只写了一个app.MapGet,却生成了三个接口1.ServiceBase1.AutoMapRoute源码如下:AutoMapRoute自动创建map路由,MinimalAPI会根据service中的方法,创建对应的api接口。比如上文的一个方法:publicasyncTask<WeatherForecast[]>PostWeather(){re......
  • flask--app.add_url_rule()函数 和 类视图详解
    flask--app.add_url_rule()函数和类视图详解app.add_url_rule()函数在flask中,我们知道给一个函数添加url的时候,只需要使用装饰器@app.route('')装饰对应的函数就可以了。为什么这个装饰器就可以给函数视图添加url规则呢?查看app.route()源码发现,这个装饰器在里面调用的另外一......
  • 如何配置Apple推送证书 push证书
     很多开发者使用hbuilder打包应该都有遇到这个问题,“profile文件不支持推通知功能,但manifest.json中选择了Push(消息推送)模块,请重新生成profile文件”。想要使用Apple的推送功能就需要配置push证书,然后使用快捷工具appuploader工具制作证书,最后使用hbuilder打包就可以了。......
  • post请求application/x-www-form-urlencoded
    importorg.springframework.http.HttpHeaders;importorg.springframework.http.MediaType;importorg.springframework.web.client.RestTemplateimportorg.springframework.util.MultiValueMap;importorg.springframework.util.LinkedMultiValueMap;importorg.springfra......
  • 【SpringBoot】【二】 SpringApplicationRunListeners 监听器执行过程详解
    1 前言我们看到SpringBoot启动的时候,会在每个时机执行监听器,这节我们就来看看,加载监听器的过程我们就不说了哈,上节说过了哈,本节我们主要看:(1)SpringApplicationRunListeners的创建过程(2)监听器的执行时机有哪些(3)监听器的执行过程三个方面来看哈。2 使用在看之前,我们先......