chunk-ca959234.831c2ecb.js 7.1 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ca959234"],{"2eed":function(e,t,i){},"8cdf":function(e,t,i){"use strict";var n=i("2eed"),a=i.n(n);a.a},e382:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v("\n 新增\n ")])],1),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"Id",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("span",[e._v(e._s(n.id))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"手机号"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[n.edit?[i("el-input",{staticClass:"edit-input",model:{value:n.username,callback:function(t){e.$set(n,"username",t)},expression:"row.username"}})]:i("span",[e._v(e._s(n.username))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"姓 名"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[n.edit?[i("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:n.nickname,callback:function(t){e.$set(n,"nickname",t)},expression:"row.nickname"}})]:i("span",[e._v(e._s(n.nickname))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"身份证"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[n.edit?[i("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:n.cardId,callback:function(t){e.$set(n,"cardId",t)},expression:"row.cardId"}})]:i("span",[e._v(e._s(n.cardId))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"最后学习时间"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[i("span",[e._v(e._s(n.lastTickAt))])]}}])}),e._v(" "),i("el-table-column",{attrs:{align:"center","min-width":"150px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row,a=t.$index;return[n.edit?i("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(t){return e.confirmEdit(n)}}},[e._v("\n 提交\n ")]):e._e(),e._v(" "),n.edit?i("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(t){return e.cancelEdit(n)}}},[e._v("\n 取消\n ")]):e._e(),e._v(" "),n.edit?e._e():i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(t){return e.initEdit(n,a)}}},[e._v("\n 编辑\n ")]),e._v(" "),n.edit?e._e():i("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-edit"},on:{click:function(t){return e.gotoDetail(n.id)}}},[e._v("\n 查看记录\n ")])]}}])})],1),e._v(" "),i("el-dialog",{attrs:{title:"create"==e.dialogStatus?"新增":"修改",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"70px"}},[i("el-form-item",{attrs:{label:"姓 名",prop:"title"}},[i("el-input",{model:{value:e.temp.nickname,callback:function(t){e.$set(e.temp,"nickname",t)},expression:"temp.nickname"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"手机号",prop:"title"}},[i("el-input",{model:{value:e.temp.username,callback:function(t){e.$set(e.temp,"username",t)},expression:"temp.username"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"身份证",prop:"title"}},[i("el-input",{model:{value:e.temp.cardId,callback:function(t){e.$set(e.temp,"cardId",t)},expression:"temp.cardId"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"密码",prop:"title"}},[i("el-input",{model:{value:e.temp.password,callback:function(t){e.$set(e.temp,"password",t)},expression:"temp.password"}})],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.createData()}}},[e._v("\n 确认\n ")])],1)],1)],1)},a=[],s=(i("96cf"),i("3b8d")),r=i("8237"),l=i.n(r),o=i("c24f"),c=i("ed08"),u={name:"InlineEditTable",data:function(){return{list:[],listLoading:!0,dialogFormVisible:!1,dialogStatus:"",rules:{username:[{required:!0,message:"必填",trigger:"blur"}],nickname:[{required:!0,message:"必填",trigger:"blur"}],cardId:[{required:!0,message:"必填",trigger:"blur"}]},temp:{},brow:{}}},created:function(){this.getList()},methods:{getList:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,i,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.listLoading=!0,e.next=3,Object(o["b"])();case 3:t=e.sent,t.code,i=t.list,t.total,i||(this.listLoading=!1),this.list=i.map((function(e){return n.$set(e,"edit",!1),e.lastTickAt=e.lastTickAt&&Object(c["h"])(e.lastTickAt)||"还未开始学习",e})),this.listLoading=!1;case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),cancelEdit:function(e){e=Object.assign(e,this.brow),console.log("rbrow",e),e.edit=!1},confirmEdit:function(e){var t=this,i=e.id,n=e.username,a=e.nickname,s=e.cardId;Object(o["f"])({id:i,username:n,nickname:a,cardId:s}).then((function(i){e.edit=!1,t.$message({message:"数据更新成功",type:"success"})}))},handleDelete:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t,i){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.edit=!1,e.next=3,doNode({do:"del",id:t.id});case 3:n=e.sent,200==n.code&&(this.$notify({title:"Success",message:"删除成功",type:"success",duration:2e3}),this.list.splice(i,1));case 5:case"end":return e.stop()}}),e,this)})));function t(t,i){return e.apply(this,arguments)}return t}(),handleJump:function(e,t){console.log(t,e),this.$router.push({path:"/monitor-server/index",query:{node:e.node}})},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},resetTemp:function(){this.temp={id:0,username:"",cardId:"",nickname:"",password:"123456"}},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){var i=Object.assign({},e.temp);i.password=l()(i.password),Object(o["f"])(i).then((function(t){i.edit=!1,e.dialogStatus="",e.dialogFormVisible=!1,e.list.push(i),e.$message({message:"新增账户成功",type:"success"})}))}))},initEdit:function(e,t){this.brow=Object.assign({},e),e.edit=!e.edit},gotoDetail:function(e){this.$router.push({path:"/user_info",query:{id:e}})}}},d=u,m=(i("8cdf"),i("2877")),p=Object(m["a"])(d,n,a,!1,null,"64cfdd74",null);t["default"]=p.exports}}]);