问星数据dist打包,线上使用; 源码在bigData仓库

32.25e34f3f32dce589f44a.js 11KB

1
  1. webpackJsonp([32],{"3Tpn":function(e,t,i){e.exports=i.p+"static/img/permission_img.fd02ee0.png"},jQhY:function(e,t){},qpG7:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={name:"UserAdminstration",data:function(){return{role_list:[],externalUser:[],isEdit:!1,role_id:4,page:1,total:0,pageInfoSize:0,usersList:[],loading:!1,name:"",phone:"",real_name:"",role2_id:"",isAddEdit:1,user_id:"",search_phone:"",note:"",role_expired_at:"",pickerOptions:{disabledDate:function(e){return e.getTime()<Date.now()},shortcuts:[{text:"永久",onClick:function(e){e.$emit("pick","")}},{text:"15天后",onClick:function(e){var t=new Date;t.setTime(t.getTime()+1296e6),e.$emit("pick",t)}},{text:"30天后",onClick:function(e){var t=new Date;t.setTime(t.getTime()+2592e6),e.$emit("pick",t)}}]}}},created:function(){this.users_list(1),this.getRoleList(1)},methods:{getRoleList:function(e){var t=this;this.page=e;var i={page:this.page};this.role_name_search&&(i.keyword=this.role_name_search),this.$axios.get(this.URL.BASEURL+this.URL.rolesList,{params:i}).then(function(e){(e=e.data)&&0==e.errno?(t.role_list=e.rst.data,e.rst.data.forEach(function(e,t){4!=e.id&&21!=e.id&&22!=e.id&&23!=e.id||_this.externalUser.push(e)})):t.$message({message:e.err,type:"warning"})}).catch(function(e){})},goBack:function(){this.isEdit=!1,this.role2_id="",this.real_name="",this.role_expired_at="",this.phone="",this.name="",this.user_id=""},handleCurrentChange:function(e){this.users_list(e)},users_list:function(e){this.page=e;var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.users_list,{params:{page:e,role_id:this.role_id,phone:this.search_phone}}).then(function(e){e=e.data;t.loading=!1,0==e.errno&&e?(t.usersList=e.rst.data,t.total=e.rst.pageInfo.total,t.pageInfoSize=e.rst.pageInfo.size):t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},users_addUser:function(){if(this.name){if(!/^1[3456789]\d{9}$/.test(this.phone))return this.$message({message:"手机号格式不正确,请重新输入",type:"warning"}),!1;if(this.role2_id)if(2!=this.isAddEdit){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.users_addUser,{name:this.name,phone:this.phone,real_name:this.real_name,role_expired_at:this.role_expired_at,role_id:this.role2_id,note:this.note}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?(e.$message({message:"添加成功",type:"success"}),e.isAddEdit=1,e.isEdit=!1,e.role2_id="",e.real_name="",e.role_expired_at="",e.phone="",e.name="",e.user_id="",e.users_list(1)):e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})}else this.editUser();else this.$message({message:"请选择用户角色",type:"warning"})}else this.$message({message:"请输入用户名",type:"warning"})},editUserEvent:function(e){var t=e.name,i=e.phone,s=e.real_name,a=e.role_id,n=e.user_id,r=e.note,o=e.role_expired_at;this.name=t,this.phone=i,this.real_name=s,this.role_expired_at=o,this.role2_id=a,this.user_id=n,this.note=r,this.isAddEdit=2,this.isEdit=!0},editUser:function(){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.editUser,{name:this.name,phone:this.phone,real_name:this.real_name,role_expired_at:this.role_expired_at,role_id:this.role2_id,id:this.user_id,note:this.note}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?(e.$message({message:"编辑成功",type:"success"}),e.isAddEdit=1,e.isEdit=!1,e.role2_id="",e.real_name="",e.role_expired_at="",e.phone="",e.name="",e.user_id="",e.users_list(1)):e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})},users_role:function(){var e=this;this.$axios.get(this.URL.BASEURL+this.URL.users_role,{params:{}}).then(function(t){0==(t=t.data).errno&&t?(e.role_list=t.rst.data,t.rst.data.forEach(function(t,i){4!=t.id&&21!=t.id&&22!=t.id&&23!=t.id||e.externalUser.push(t)})):e.$message({message:t.err,type:"warning"})}).catch(function(e){})},users_delUser:function(e){var t=this;this.$confirm("此操作将删除该用户, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.loading=!0,t.$axios.post(t.URL.BASEURL+t.URL.users_delUser,{id:e}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?(t.$message({type:"success",message:"删除成功!"}),t.users_list(1)):t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})}).catch(function(){})}},watch:{role_id:function(){this.users_list(1)}}},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"permission_big_div",attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.isEdit,expression:"!isEdit"}],staticClass:"content"},[s("div",{staticClass:"topOperation clear"},[s("el-button",{staticClass:"operation add",attrs:{type:"primary",size:"small"},on:{click:function(t){e.isEdit=!0,e.isAddEdit=1}}},[e._v("+ 新增用户")]),e._v(" "),s("el-input",{staticClass:"operation search",attrs:{size:"small",placeholder:"用户手机号"},on:{clear:function(t){return e.users_list(1)}},nativeOn:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.users_list(1)}},model:{value:e.search_phone,callback:function(t){e.search_phone="string"==typeof t?t.trim():t},expression:"search_phone"}},[s("i",{staticClass:"el-input__icon el-icon-search",staticStyle:{cursor:"pointer"},attrs:{slot:"suffix"},on:{click:function(t){return e.users_list(1)}},slot:"suffix"})])],1),e._v(" "),s("div",{staticClass:"role operation"},[s("div",{staticClass:"permission_div"},[s("el-radio-group",{attrs:{size:"small"},model:{value:e.role_id,callback:function(t){e.role_id="string"==typeof t?t.trim():t},expression:"role_id"}},e._l(e.externalUser,function(t){return s("el-radio",{key:t.id,attrs:{label:t.id,size:"small"}},[e._v("\n "+e._s(t.name)+"\n ")])}),1)],1)]),e._v(" "),s("table",{staticClass:"table"},[e._m(0),e._v(" "),e._l(e.usersList,function(t){return s("tr",{key:t.id},[s("td",[e._v(e._s(t.id))]),e._v(" "),s("td",[e._v(e._s(t.name))]),e._v(" "),s("td",[e._v(e._s(t.phone))]),e._v(" "),s("td",[e._v(e._s(t.real_name))]),e._v(" "),s("td",[e._v(e._s(t.role?t.role.name:""))]),e._v(" "),s("td",[e._v(e._s(t.role_expired_at))]),e._v(" "),s("td",[e._v(e._s(t.create_time))]),e._v(" "),s("td",[s("el-tooltip",{attrs:{effect:"dark",content:t.note,placement:"top"}},[s("p",{class:["note_div","Firefox"==e.$localSelfStore.getLocal("browserOs")?"describeOs":""]},[e._v(e._s(t.note))])])],1),e._v(" "),s("td",{staticStyle:{width:"200px"}},[s("button",{staticClass:"edit",on:{click:function(i){return e.editUserEvent({name:t.name,phone:t.phone,real_name:t.real_name,role_id:t.role_id,user_id:t.id,note:t.note,role_expired_at:t.role_expired_at})}}},[e._v("编辑")]),e._v(" "),s("button",{staticClass:"delete",on:{click:function(i){return e.users_delUser(t.id)}}},[e._v("删除")])])])})],2),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],staticClass:"bottom pagingBottom"},[s("span",{directives:[{name:"show",rawName:"v-show",value:e.total,expression:"total"}],staticClass:"total"},[e._v("共"+e._s(e.total)+"条结果")]),e._v(" "),s("el-pagination",{attrs:{background:"","current-page":e.page,"page-size":e.pageInfoSize,layout:"prev, pager, next ",total:e.total},on:{"current-change":e.handleCurrentChange}})],1)]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isEdit,expression:"isEdit"}],staticClass:"newlyAddedEdit"},[s("img",{staticClass:"permission_img",attrs:{src:i("3Tpn")}}),e._v(" "),s("div",{staticClass:"addEdit"},[s("div",[s("label",{staticClass:"label_div"},[e._v("用户名:")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.name,expression:"name",modifiers:{trim:!0}}],attrs:{placeholder:"请输入用户名"},domProps:{value:e.name},on:{input:function(t){t.target.composing||(e.name=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),s("div",[s("label",{staticClass:"label_div"},[e._v("用户手机号:")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.phone,expression:"phone",modifiers:{trim:!0}}],attrs:{placeholder:"请输入用户手机号"},domProps:{value:e.phone},on:{input:function(t){t.target.composing||(e.phone=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),s("div",[s("label",{staticClass:"label_div"},[e._v("姓名:")]),e._v(" "),s("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.real_name,expression:"real_name",modifiers:{trim:!0}}],attrs:{placeholder:"请输入真实姓名"},domProps:{value:e.real_name},on:{input:function(t){t.target.composing||(e.real_name=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),s("div",[s("label",{staticClass:"label_div"},[e._v("备注:")]),e._v(" "),s("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:e.note,expression:"note",modifiers:{trim:!0}}],attrs:{placeholder:"请输入备注信息"},domProps:{value:e.note},on:{input:function(t){t.target.composing||(e.note=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),s("div",[s("label",{staticClass:"label_div"},[e._v("角色:")]),e._v(" "),s("el-radio-group",{staticStyle:{display:"inline-block",width:"50%","vertical-align":"top",margin:"0px"},attrs:{size:"small"},model:{value:e.role2_id,callback:function(t){e.role2_id="string"==typeof t?t.trim():t},expression:"role2_id"}},e._l(e.role_list,function(t){return s("el-radio",{key:t.id,attrs:{label:t.id,size:"small"}},[e._v("\n "+e._s(t.name)+"\n ")])}),1)],1),e._v(" "),s("div",[s("label",{staticClass:"label_div"},[e._v("过期时间:")]),e._v(" "),s("div",{staticClass:"roleExpiredTime"},[e._v(e._s(e.role_expired_at?e.role_expired_at:"永久")+"\n "),s("i",{staticClass:"el-icon-arrow-down icon"}),e._v(" "),s("el-date-picker",{staticStyle:{width:"100%",height:"100%",position:"absolute",top:"0",left:"0",opacity:"0"},attrs:{size:"mini",align:"right",type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期","picker-options":e.pickerOptions},model:{value:e.role_expired_at,callback:function(t){e.role_expired_at=t},expression:"role_expired_at"}})],1)]),e._v(" "),s("div",{staticClass:"newlyAddedEdit_button"},[s("button",{staticClass:"back",on:{click:e.goBack}},[e._v("返回")]),e._v(" "),s("button",{staticClass:"submit",on:{click:e.users_addUser}},[e._v("提交")])])])])])},staticRenderFns:[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("tr",[i("th",[e._v("用户ID")]),i("th",[e._v("用户名")]),i("th",[e._v("用户手机号")]),i("th",[e._v("姓名")]),i("th",[e._v("角色")]),i("th",[e._v("过期时间")]),i("th",[e._v("创建时间")]),i("th",[e._v("备注")]),i("th",[e._v("操作")])])}]};var n=i("C7Lr")(s,a,!1,function(e){i("jQhY")},"data-v-b088a04c",null);t.default=n.exports}});