1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-716f2609"],{"3df8f":function(t,e,a){"use strict";a("dbbb")},4191:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"search-list-form"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.searchForm}},[a("el-form-item",{attrs:{label:"姓名"}},[a("el-input",{attrs:{placeholder:"请输入姓名"},model:{value:t.searchForm.name,callback:function(e){t.$set(t.searchForm,"name",e)},expression:"searchForm.name"}})],1),a("el-form-item",{attrs:{label:"状态"}},[a("el-select",{attrs:{placeholder:"请选择状态"},model:{value:t.searchForm.status,callback:function(e){t.$set(t.searchForm,"status",e)},expression:"searchForm.status"}},[a("el-option",{attrs:{label:"全部",value:""}}),a("el-option",{attrs:{label:"启用",value:"1"}}),a("el-option",{attrs:{label:"禁用",value:"0"}})],1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSearch}},[t._v("查询")]),a("el-button",{attrs:{type:"primary"},on:{click:t.resetSearch}},[t._v("重置")])],1)],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-row-class-name":"headerBg","empty-text":"暂无用户信息"}},[a("el-table-column",{attrs:{prop:"name",label:"姓名"}}),a("el-table-column",{attrs:{prop:"nikeName",label:"昵称"}}),a("el-table-column",{attrs:{prop:"phone",label:"手机号"}}),a("el-table-column",{attrs:{prop:"level",label:"用户等级"}}),a("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s("1"===e.row.status?"启用":"禁用")+" ")]}}])}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.handleEdit(e.$index,e.row)}}},[t._v("编辑")]),a("el-button",{attrs:{type:"danger"},on:{click:function(a){return t.handleDel(e.$index,e.row)}}},[t._v("删除")])]}}])})],1),a("div",{staticClass:"pagination-container"},[a("el-pagination",{attrs:{"current-page":t.pagination.currentPage,"page-sizes":[10,20,50,100],"page-size":t.pagination.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.pagination.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),a("el-dialog",{attrs:{title:"编辑信息",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{attrs:{model:t.editForm}},[a("el-form-item",{attrs:{label:"姓名","label-width":t.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:t.editForm.name,callback:function(e){t.$set(t.editForm,"name",e)},expression:"editForm.name"}})],1),a("el-form-item",{attrs:{label:"年龄","label-width":t.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:t.editForm.age,callback:function(e){t.$set(t.editForm,"age",e)},expression:"editForm.age"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitEdit}},[t._v("确 定")])],1)],1)],1)},i=[],o=a("c7eb"),r=a("5530"),l=a("1da1"),s=(a("ac1f"),a("841c"),a("b775"));function c(t){return Object(s["a"])({url:"/wechat/getInfoList",method:"post",data:t})}function u(t){return Object(s["a"])({url:"/wechat/deleteUserInfo",method:"post",data:t})}a("323e");var d={data:function(){return{searchForm:{name:"",status:""},tableData:[],dialogFormVisible:!1,editForm:{name:"",age:""},formLabelWidth:"120px",editIndex:-1,pagination:{currentPage:1,pageSize:10,total:0}}},mounted:function(){this.search()},methods:{fetchData:function(){var t=this;return Object(l["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$api.getUsers(Object(r["a"])({page:t.pagination.currentPage,pageSize:t.pagination.pageSize},t.searchForm));case 3:a=e.sent,t.tableData=a.data,t.pagination.total=a.total,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$message.error("获取数据失败");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))()},handleSizeChange:function(t){this.pagination.pageSize=t,this.fetchData()},handleCurrentChange:function(t){this.pagination.currentPage=t,this.fetchData()},onSearch:function(){console.log("搜索条件:",this.searchForm)},resetSearch:function(){this.searchForm={name:"",status:""}},handleEdit:function(t,e){},handleToggleStatus:function(t,e){this.tableData[t].status="1"===e.status?"0":"1"},submitEdit:function(){this.editIndex>-1&&(this.tableData[this.editIndex]=Object(r["a"])(Object(r["a"])({},this.editForm),{},{status:this.tableData[this.editIndex].status}),this.dialogFormVisible=!1)},handleDel:function(t){var e=this,a={id:t.id};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){u(a).then((function(t){e.search()}))})).catch((function(){}))},search:function(){var t=this;c().then((function(e){200===e.status&&(t.tableData=e.data.dataList,t.pagination.currentPage=e.data.page,t.pagination.pageSize=e.data.pageSize,t.pagination.total=e.data.totalRecord)}))}}},m=d,p=(a("3df8f"),a("2877")),h=Object(p["a"])(m,n,i,!1,null,"6ee5f348",null);e["default"]=h.exports},dbbb:function(t,e,a){}}]);
|