<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="用户id" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
       <el-form-item label="手机号" prop="mobilePhone">
        <el-input
          v-model="queryParams.mobilePhone"
          placeholder="请输入用户手机号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="账户类型" prop="role">
        <el-input
          v-model="queryParams.role"
          placeholder="请输入账户类型"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户姓名" prop="username">
        <el-input
          v-model="queryParams.username"
          placeholder="请输入用户姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户地址" prop="address">
        <el-input
          v-model="queryParams.address"
          placeholder="请输入用户地址"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="地区" prop="area">
        <el-input
          v-model="queryParams.area"
          placeholder="请输入地区"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input
          v-model="queryParams.password"
          placeholder="请输入密码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户手机号" prop="mobilePhone">
        <el-input
          v-model="queryParams.mobilePhone"
          placeholder="请输入用户手机号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户头像" prop="userAvatar">
        <el-input
          v-model="queryParams.userAvatar"
          placeholder="请输入用户头像"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户二维码" prop="qrCode">
        <el-input
          v-model="queryParams.qrCode"
          placeholder="请输入用户二维码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户排位赛级别" prop="userGrade">
        <el-input
          v-model="queryParams.userGrade"
          placeholder="请输入用户排位赛级别"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="昵称" prop="realName">
        <el-input
          v-model="queryParams.realName"
          placeholder="请输入昵称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="上一次登录时间" prop="loginTime">
        <el-date-picker clearable size="small"
          v-model="queryParams.loginTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择上一次登录时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="注册时间" prop="registerTime">
        <el-date-picker clearable size="small"
          v-model="queryParams.registerTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择注册时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="点赞数" prop="likeNum">
        <el-input
          v-model="queryParams.likeNum"
          placeholder="请输入点赞数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="粉丝数" prop="fansNum">
        <el-input
          v-model="queryParams.fansNum"
          placeholder="请输入粉丝数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="关注数" prop="attenNum">
        <el-input
          v-model="queryParams.attenNum"
          placeholder="请输入关注数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总公里数" prop="totalDistance">
        <el-input
          v-model="queryParams.totalDistance"
          placeholder="请输入总公里数"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="马拉松场次" prop="timesMarathon">
        <el-input
          v-model="queryParams.timesMarathon"
          placeholder="请输入马拉松场次"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="排位赛场次" prop="timesQualifier">
        <el-input
          v-model="queryParams.timesQualifier"
          placeholder="请输入排位赛场次"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否删除(默认值0)" prop="isDelete">
        <el-input
          v-model="queryParams.isDelete"
          placeholder="请输入是否删除(默认值0)"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户账号状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择用户账号状态" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item>
      <el-form-item label="体重" prop="weight">
        <el-input
          v-model="queryParams.weight"
          placeholder="请输入体重"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身高" prop="height">
        <el-input
          v-model="queryParams.height"
          placeholder="请输入身高"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="积分" prop="userPoint">
        <el-input
          v-model="queryParams.userPoint"
          placeholder="请输入积分"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="余额" prop="userMoney">
        <el-input
          v-model="queryParams.userMoney"
          placeholder="请输入余额"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="登录方式(1=手机号登录，2=快捷登录，3=第三方登录)" prop="loginType">
        <el-select v-model="queryParams.loginType" placeholder="请选择登录方式(1=手机号登录，2=快捷登录，3=第三方登录)" clearable size="small">
          <el-option label="请选择字典生成" value="" />
        </el-select>
      </el-form-item> -->
      <!-- <el-form-item label="性别：0=保密，1=男，2=女" prop="gender">
        <el-input
          v-model="queryParams.gender"
          placeholder="请输入性别：0=保密，1=男，2=女"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="会员生日" prop="birthday">
        <el-input
          v-model="queryParams.birthday"
          placeholder="请输入会员生日"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="appid" prop="appId">
        <el-input
          v-model="queryParams.appId"
          placeholder="请输入appid"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="排位赛积分" prop="qualifyingPoints">
        <el-input
          v-model="queryParams.qualifyingPoints"
          placeholder="请输入排位赛积分"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="悦动id" prop="yuedongId">
        <el-input
          v-model="queryParams.yuedongId"
          placeholder="请输入悦动id"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:LzydUser:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:LzydUser:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:LzydUser:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:LzydUser:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row> -->

    <el-table v-loading="loading" :data="LzydUserList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="id" />
      <el-table-column label="悦动id" align="center" prop="yuedongId" width="200" />
      <el-table-column label="用户id" align="center" prop="userId" width="200" />
      <el-table-column label="账户类型" align="center" prop="role" />
      <el-table-column label="用户姓名" align="center" prop="username" />
      <el-table-column label="用户地址" align="center" prop="address" />
      <el-table-column label="地区" align="center" prop="area" width="200px" />
      <el-table-column label="密码" align="center" prop="password" />
      <el-table-column label="用户手机号" align="center" prop="mobilePhone" width="200" />
      <el-table-column label="发布者头像" align="center" width="100">
        <template slot-scope="scope" >
          <img style="width:100%;height:100%" :src="scope.row.userAvatar" alt="" />
        </template>
      </el-table-column>
      <el-table-column label="用户二维码" align="center" prop="qrCode" />
      <el-table-column label="用户排位赛级别" align="center" prop="userGrade" />
      <el-table-column label="昵称" align="center" prop="realName" />
      <el-table-column label="上一次登录时间" align="center" prop="loginTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.loginTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="注册时间" align="center" prop="registerTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="点赞数" align="center" prop="likeNum" />
      <el-table-column label="粉丝数" align="center" prop="fansNum" />
      <el-table-column label="关注数" align="center" prop="attenNum" />
      <el-table-column label="总公里数" align="center" prop="totalDistance" />
      <el-table-column label="马拉松场次" align="center" prop="timesMarathon" />
      <el-table-column label="排位赛场次" align="center" prop="timesQualifier" />
      <el-table-column label="是否删除(默认值0)" align="center" prop="isDelete" />
      <el-table-column label="用户账号状态" align="center" prop="status" />
      <el-table-column label="体重" align="center" prop="weight" />
      <el-table-column label="身高" align="center" prop="height" />
      <el-table-column label="积分" align="center" prop="userPoint" />
      <el-table-column label="余额" align="center" prop="userMoney" />
      <el-table-column label="登录方式" align="center" prop="loginType" />
      <!-- (1=手机号登录，2=快捷登录，3=第三方登录) -->
      <el-table-column label="性别" align="center" prop="gender" />
      <!-- ：0=保密，1=男，2=女 -->
      <el-table-column label="会员生日" align="center" prop="birthday" />
      <!-- <el-table-column label="appid" align="center" prop="appId" /> -->
      <el-table-column label="排位赛积分" align="center" prop="qualifyingPoints" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:LzydUser:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:LzydUser:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改用户列表对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户id" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户id" />
        </el-form-item>
        <el-form-item label="账户类型" prop="role">
          <el-input v-model="form.role" placeholder="请输入账户类型" />
        </el-form-item>
        <el-form-item label="用户姓名" prop="username">
          <el-input v-model="form.username" placeholder="请输入用户姓名" />
        </el-form-item>
        <el-form-item label="用户地址" prop="address">
          <el-input v-model="form.address" placeholder="请输入用户地址" />
        </el-form-item>
        <el-form-item label="地区" prop="area">
          <el-input v-model="form.area" placeholder="请输入地区" />
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="form.password" placeholder="请输入密码" />
        </el-form-item>
        <el-form-item label="用户手机号" prop="mobilePhone">
          <el-input v-model="form.mobilePhone" placeholder="请输入用户手机号" />
        </el-form-item>
        <el-form-item label="用户头像" prop="userAvatar">
          <el-input v-model="form.userAvatar" placeholder="请输入用户头像" />
        </el-form-item>
        <el-form-item label="用户二维码" prop="qrCode">
          <el-input v-model="form.qrCode" placeholder="请输入用户二维码" />
        </el-form-item>
        <el-form-item label="用户排位赛级别" prop="userGrade">
          <el-input v-model="form.userGrade" placeholder="请输入用户排位赛级别" />
        </el-form-item>
        <el-form-item label="昵称" prop="realName">
          <el-input v-model="form.realName" placeholder="请输入昵称" />
        </el-form-item>
        <el-form-item label="上一次登录时间" prop="loginTime">
          <el-date-picker clearable size="small"
            v-model="form.loginTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择上一次登录时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="注册时间" prop="registerTime">
          <el-date-picker clearable size="small"
            v-model="form.registerTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择注册时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="点赞数" prop="likeNum">
          <el-input v-model="form.likeNum" placeholder="请输入点赞数" />
        </el-form-item>
        <el-form-item label="粉丝数" prop="fansNum">
          <el-input v-model="form.fansNum" placeholder="请输入粉丝数" />
        </el-form-item>
        <el-form-item label="关注数" prop="attenNum">
          <el-input v-model="form.attenNum" placeholder="请输入关注数" />
        </el-form-item>
        <el-form-item label="总公里数" prop="totalDistance">
          <el-input v-model="form.totalDistance" placeholder="请输入总公里数" />
        </el-form-item>
        <el-form-item label="马拉松场次" prop="timesMarathon">
          <el-input v-model="form.timesMarathon" placeholder="请输入马拉松场次" />
        </el-form-item>
        <el-form-item label="排位赛场次" prop="timesQualifier">
          <el-input v-model="form.timesQualifier" placeholder="请输入排位赛场次" />
        </el-form-item>
        <el-form-item label="是否删除(默认值0)" prop="isDelete">
          <el-input v-model="form.isDelete" placeholder="请输入是否删除(默认值0)" />
        </el-form-item>
        <el-form-item label="用户账号状态">
          <el-radio-group v-model="form.status">
            <el-radio label="1">请选择字典生成</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="体重" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入体重" />
        </el-form-item>
        <el-form-item label="身高" prop="height">
          <el-input v-model="form.height" placeholder="请输入身高" />
        </el-form-item>
        <el-form-item label="积分" prop="userPoint">
          <el-input v-model="form.userPoint" placeholder="请输入积分" />
        </el-form-item>
        <el-form-item label="余额" prop="userMoney">
          <el-input v-model="form.userMoney" placeholder="请输入余额" />
        </el-form-item>
        <el-form-item label="登录方式(1=手机号登录，2=快捷登录，3=第三方登录)" prop="loginType">
          <el-select v-model="form.loginType" placeholder="请选择登录方式(1=手机号登录，2=快捷登录，3=第三方登录)">
            <el-option label="请选择字典生成" value="" />
          </el-select>
        </el-form-item>
        <el-form-item label="性别：0=保密，1=男，2=女" prop="gender">
          <el-input v-model="form.gender" placeholder="请输入性别：0=保密，1=男，2=女" />
        </el-form-item>
        <el-form-item label="会员生日" prop="birthday">
          <el-input v-model="form.birthday" placeholder="请输入会员生日" />
        </el-form-item>
        <el-form-item label="appid" prop="appId">
          <el-input v-model="form.appId" placeholder="请输入appid" />
        </el-form-item>
        <el-form-item label="排位赛积分" prop="qualifyingPoints">
          <el-input v-model="form.qualifyingPoints" placeholder="请输入排位赛积分" />
        </el-form-item>
        <el-form-item label="悦动id" prop="yuedongId">
          <el-input v-model="form.yuedongId" placeholder="请输入悦动id" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listLzydUser, getLzydUser, delLzydUser, addLzydUser, updateLzydUser, exportLzydUser } from "@/api/system/LzydUser";

export default {
  name: "LzydUser",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 用户列表表格数据
      LzydUserList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        role: null,
        username: null,
        address: null,
        area: null,
        password: null,
        mobilePhone: null,
        userAvatar: null,
        qrCode: null,
        userGrade: null,
        realName: null,
        loginTime: null,
        registerTime: null,
        likeNum: null,
        fansNum: null,
        attenNum: null,
        totalDistance: null,
        timesMarathon: null,
        timesQualifier: null,
        isDelete: null,
        status: null,
        weight: null,
        height: null,
        userPoint: null,
        userMoney: null,
        loginType: null,
        gender: null,
        birthday: null,
        appId: null,
        qualifyingPoints: null,
        yuedongId: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        userId: [
          { required: true, message: "用户id不能为空", trigger: "blur" }
        ],
        role: [
          { required: true, message: "账户类型不能为空", trigger: "blur" }
        ],
        username: [
          { required: true, message: "用户姓名不能为空", trigger: "blur" }
        ],
        address: [
          { required: true, message: "用户地址不能为空", trigger: "blur" }
        ],
        area: [
          { required: true, message: "地区不能为空", trigger: "blur" }
        ],
        password: [
          { required: true, message: "密码不能为空", trigger: "blur" }
        ],
        mobilePhone: [
          { required: true, message: "用户手机号不能为空", trigger: "blur" }
        ],
        userAvatar: [
          { required: true, message: "用户头像不能为空", trigger: "blur" }
        ],
        qrCode: [
          { required: true, message: "用户二维码不能为空", trigger: "blur" }
        ],
        userGrade: [
          { required: true, message: "用户排位赛级别不能为空", trigger: "blur" }
        ],
        realName: [
          { required: true, message: "昵称不能为空", trigger: "blur" }
        ],
        loginTime: [
          { required: true, message: "上一次登录时间不能为空", trigger: "blur" }
        ],
        registerTime: [
          { required: true, message: "注册时间不能为空", trigger: "blur" }
        ],
        likeNum: [
          { required: true, message: "点赞数不能为空", trigger: "blur" }
        ],
        fansNum: [
          { required: true, message: "粉丝数不能为空", trigger: "blur" }
        ],
        attenNum: [
          { required: true, message: "关注数不能为空", trigger: "blur" }
        ],
        totalDistance: [
          { required: true, message: "总公里数不能为空", trigger: "blur" }
        ],
        timesMarathon: [
          { required: true, message: "马拉松场次不能为空", trigger: "blur" }
        ],
        timesQualifier: [
          { required: true, message: "排位赛场次不能为空", trigger: "blur" }
        ],
        createTime: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        updateTime: [
          { required: true, message: "更新时间不能为空", trigger: "blur" }
        ],
        isDelete: [
          { required: true, message: "是否删除(默认值0)不能为空", trigger: "blur" }
        ],
        status: [
          { required: true, message: "用户账号状态不能为空", trigger: "blur" }
        ],
        weight: [
          { required: true, message: "体重不能为空", trigger: "blur" }
        ],
        height: [
          { required: true, message: "身高不能为空", trigger: "blur" }
        ],
        userPoint: [
          { required: true, message: "积分不能为空", trigger: "blur" }
        ],
        userMoney: [
          { required: true, message: "余额不能为空", trigger: "blur" }
        ],
        loginType: [
          { required: true, message: "登录方式(1=手机号登录，2=快捷登录，3=第三方登录)不能为空", trigger: "change" }
        ],
        gender: [
          { required: true, message: "性别：0=保密，1=男，2=女不能为空", trigger: "blur" }
        ],
        birthday: [
          { required: true, message: "会员生日不能为空", trigger: "blur" }
        ],
        appId: [
          { required: true, message: "appid不能为空", trigger: "blur" }
        ],
        qualifyingPoints: [
          { required: true, message: "排位赛积分不能为空", trigger: "blur" }
        ],
        yuedongId: [
          { required: true, message: "悦动id不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询用户列表列表 */
    getList() {
      this.loading = true;
      listLzydUser(this.queryParams).then(response => {
        this.LzydUserList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        userId: null,
        role: null,
        username: null,
        address: null,
        area: null,
        password: null,
        mobilePhone: null,
        userAvatar: null,
        qrCode: null,
        userGrade: null,
        realName: null,
        loginTime: null,
        registerTime: null,
        likeNum: null,
        fansNum: null,
        attenNum: null,
        totalDistance: null,
        timesMarathon: null,
        timesQualifier: null,
        createTime: null,
        updateTime: null,
        isDelete: null,
        status: 0,
        weight: null,
        height: null,
        userPoint: null,
        userMoney: null,
        loginType: null,
        gender: null,
        birthday: null,
        appId: null,
        qualifyingPoints: null,
        yuedongId: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加用户列表";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getLzydUser(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改用户列表";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateLzydUser(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addLzydUser(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除用户列表编号为"' + ids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delLzydUser(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有用户列表数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportLzydUser(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
