1 line
4.1 KiB
JavaScript
1 line
4.1 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5c1f1857"],{"20b8":function(t,e,a){"use strict";a("b3c4")},"97df":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:"divBox"},[a("div",{staticClass:"selCard"},[a("el-form",{ref:"searchForm",attrs:{model:t.tableFrom,size:"small","label-width":"65px",inline:""}},[a("el-form-item",{attrs:{label:"昵称:",prop:"nickname"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入昵称",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.nickname,callback:function(e){t.$set(t.tableFrom,"nickname",e)},expression:"tableFrom.nickname"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"用户名:",prop:"username"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入用户名",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.username,callback:function(e){t.$set(t.tableFrom,"username",e)},expression:"tableFrom.username"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.getList(1)}}},[t._v("搜索")]),t._v(" "),a("el-button",{attrs:{size:"small"},on:{click:function(e){return t.searchReset()}}},[t._v("重置")])],1)],1)],1),t._v(" "),a("el-card",{staticClass:"mt14"},[a("div",{staticClass:"mb20"},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.onAdd}},[t._v("\n 添加助手\n ")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small"}},[a("el-table-column",{attrs:{prop:"assistant_id",label:"ID","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{prop:"username",label:"用户名","min-width":"200"}}),t._v(" "),a("el-table-column",{attrs:{prop:"nickname",label:"昵称","min-width":"200"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.assistant_id)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.assistant_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)],1)},i=[],s=a("83d6"),l=a("b7be"),r={name:"AssistantList",data:function(){return{roterPre:s["roterPre"],listLoading:!0,tableData:{data:[],total:0},tableFrom:{page:1,limit:20,username:"",nickname:""},loading:!1}},watch:{},mounted:function(){this.getList("")},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},getList:function(t){var e=this;this.listLoading=!0,this.tableFrom.page=t||this.tableFrom.page,Object(l["sb"])(this.tableFrom).then((function(t){e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},onAdd:function(){var t=this;this.$modalForm(Object(l["tb"])()).then((function(){return t.getList("")}))},onEdit:function(t){var e=this;this.$modalForm(Object(l["vb"])(t)).then((function(){return e.getList("")}))},handleDelete:function(t,e){var a=this;this.$modalSure("删除该助手").then((function(){Object(l["ub"])(t).then((function(t){var e=t.message;a.$message.success(e),a.getList("")})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},o=r,c=(a("20b8"),a("2877")),u=Object(c["a"])(o,n,i
|