secgateway/libs/files/lighttpd/webpages/static/js/10.d74615f0cb3da619063c.1.4...

492 lines
15 KiB
Plaintext

webpackJsonp([10],{
/***/ "4MyM":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
// EXTERNAL MODULE: ./src/components/Title.vue + 2 modules
var Title = __webpack_require__("/+Ed");
// EXTERNAL MODULE: ./src/components/Pagination.vue + 2 modules
var Pagination = __webpack_require__("cMGX");
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/pages/user/AddUser.vue
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var AddUser = ({
name: 'AddUser',
props: ['available', 'areaList', 'URL', 'contextPath'],
data: function data() {
var that = this;
var validateUsername = function validateUsername(rule, value, callback) {
var cellphone = /^1\d{10}$/;
if (value) {
if (!cellphone.test(value)) {
callback(new Error('格式不正确'));
} else {
callback();
}
} else {
callback();
}
};
var validateUsernameBack = function validateUsernameBack(rule, value, callback) {
if (that.returnCode == 4013) {
callback(new Error('用户名已存在'));
} else {
callback();
}
};
return {
form: {
username: '',
areaInfo: ''
},
returnCode: '0',
rules: {
username: [{ required: true, message: '用户名不能为空', trigger: ['blur', 'change'] }, { validator: validateUsername, trigger: ['blur', 'change'] }, { validator: validateUsernameBack, trigger: ['blur', 'change'] }],
areaInfo: [{ required: true, message: '请选择区域', trigger: ['blur', 'change'] }]
}
};
},
computed: {
areaCode: function areaCode() {
var that = this;
if (that.form.areaInfo) {
return that.form.areaInfo[that.form.areaInfo.length - 1];
} else {
return '';
}
}
},
mounted: function mounted() {},
methods: {
submitForm: function submitForm(formName) {
var that = this;
that.$refs[formName].validate(function (valid) {
if (valid) {
var formData = that.$qs.stringify({
phone: that.form.username,
areaCode: that.areaCode
});
that.$axios({
method: 'post',
url: that.contextPath + that.URL.addUser,
data: formData,
loader: true
}).then(function (res) {
var returnCode = Number(res.data.resultCode);
if (returnCode === 0) {
//添加成功
that.closeDialog();
that.$parent.getUserList();
} else if (returnCode === 4013) {
//手机号码已存在
that.returnCode = returnCode;
that.$refs.addUserForm && that.$refs.addUserForm.validateField('username');
} else {
that.$alert(res.data.message, '提示', {
customClass: 'wafConfirm',
confirmButtonText: '我知道了',
type: 'warning'
});
}
}).catch(function (e) {
e && that.$message.error(e.message);
});
} else {
console.log('error submit!!');
return false;
}
});
},
closeDialog: function closeDialog() {
var that = this;
that.$emit('update:available', false);
}
}
});
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-31ad24ac","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/pages/user/AddUser.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{attrs:{"title":"添加管理员","visible":_vm.available,"close-on-click-modal":false,"close-on-press-escape":false,"custom-class":'operaUserDialog',"center":""},on:{"close":_vm.closeDialog}},[_c('div',{staticClass:"addUserFormArea"},[_c('el-form',{ref:"addUserForm",attrs:{"rules":_vm.rules,"model":_vm.form,"label-width":"90px","size":"small"}},[_c('el-form-item',{attrs:{"label":"用户名","prop":"username"}},[_c('el-input',{attrs:{"placeholder":"请输入"},model:{value:(_vm.form.username),callback:function ($$v) {_vm.$set(_vm.form, "username", $$v)},expression:"form.username"}})],1),_vm._v(" "),_c('el-form-item',{attrs:{"label":"区域","prop":"areaInfo"}},[_c('el-cascader',{attrs:{"expand-trigger":"hover","options":_vm.areaList},model:{value:(_vm.form.areaInfo),callback:function ($$v) {_vm.$set(_vm.form, "areaInfo", $$v)},expression:"form.areaInfo"}})],1)],1)],1),_vm._v(" "),_c('template',{slot:"footer"},[_c('el-button',{on:{"click":_vm.closeDialog}},[_vm._v("取消")]),_vm._v(" "),_c('el-button',{attrs:{"type":"primary"},on:{"click":function($event){return _vm.submitForm('addUserForm')}}},[_vm._v("确定")])],1)],2)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var user_AddUser = (esExports);
// CONCATENATED MODULE: ./src/pages/user/AddUser.vue
function injectStyle (ssrContext) {
__webpack_require__("oRY/")
}
var normalizeComponent = __webpack_require__("VU/8")
/* script */
/* template */
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
AddUser,
user_AddUser,
__vue_template_functional__,
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
/* harmony default export */ var pages_user_AddUser = (Component.exports);
// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm.js
var vuex_esm = __webpack_require__("NYxO");
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/pages/user/User.vue
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var User = ({
name: 'User',
props: {
type: {
type: String,
required: true,
validator: function validator(value) {
return ['admin', 'common'].indexOf(value) !== -1;
}
}
},
components: {
Title: Title["a" /* default */],
Pagination: Pagination["a" /* default */],
AddUser: pages_user_AddUser
},
data: function data() {
return {
moduleTitle: '用户管理',
total: 0,
currentPage: 1,
pageSize: 10,
tableData: [],
areaList: [],
searchParams: {
username: ''
},
URL: {
getAreaList: '/rest/allArea',
getUserList: '/admin/userlist',
addUser: '/admin/addUser',
deleteUser: '/admin/delete'
},
availableAddUser: false
// showList: false,
// listTypes: ['admin','common']
};
},
computed: {
adminList: function adminList() {
var that = this;
return that.type === 'admin';
},
contextPath: function contextPath() {
return this.$store.state.urlHost;
},
adminTHeight: function adminTHeight() {
var that = this;
return that.adminList ? this.$store.state.adminTHeight : this.$store.state.adminTHeight + 44;
},
pageTitle: function pageTitle() {
var that = this;
return that.adminList ? '管理员列表' : '用户列表';
},
tableKey: function tableKey() {
return this.type;
}
},
watch: {
type: function type(val) {
//用户列表类型改变时重置组件数据
var that = this;
that.resetData();
that.getUserList();
}
},
beforeMount: function beforeMount() {
var that = this;
// that.showList = that.listTypes.indexOf(that.type) >= 0;
},
mounted: function mounted() {
var that = this;
that.getRelyData();
that.getUserList();
},
methods: {
resetData: function resetData() {
var that = this;
that.searchParams.username = '';
that.currentPage = 1;
that.pageSize = 10;
that.tableData = [];
that.availableAddUser = false;
},
getRelyData: function getRelyData() {
var that = this;
var getAreaList = function getAreaList() {
return that.$axios({
method: 'post',
url: that.contextPath + that.URL.getAreaList,
needInterceptors: true,
showError: true,
loader: true
});
};
that.$axios.all([getAreaList()]).then(that.$axios.spread(function (areaResult) {
that.areaList = areaResult.options || [];
}));
},
getUserList: function getUserList(currentPage, pageSize) {
var that = this;
that.$axios({
method: 'post',
url: that.contextPath + that.URL.getUserList,
needInterceptors: true,
showError: true,
loader: false,
data: that.$qs.stringify({
type: that.adminList ? 1 : 0,
phone: that.searchParams.username.trim(),
currentPage: (currentPage || that.currentPage || 1) - 1,
pageSize: pageSize || that.pageSize || 10
})
}).then(function (result) {
that.total = result.totalItems;
that.tableData = result.data || [];
}).catch(function (e) {});
},
sizeChange: function sizeChange(val) {
var that = this;
that.currentPage = 1;
that.pageSize = val;
that.getUserList(that.currentPage, val);
},
currentChange: function currentChange(val) {
var that = this;
that.currentPage = val;
that.getUserList(val, that.pageSize);
},
addUser: function addUser() {
var that = this;
that.availableAddUser = true;
},
deleteUser: function deleteUser(data) {
var that = this;
that.$confirm('您确定要删除该用户吗?', '提示', {
customClass: 'wafConfirm',
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
that.$axios({
method: 'post',
url: that.contextPath + that.URL.deleteUser + '/' + data.id,
needInterceptors: true,
loader: true
}).then(function () {
that.getUserList();
}).catch(function (e) {
var message = '';
if (e && e.code == '4208') {
message = '无法删除<div class="confimTip">该账户下还存在网站未删除,请先删除再执行此步骤</div>';
} else {
message = e && e.message;
}
that.$alert(message, '提示', {
dangerouslyUseHTMLString: true,
customClass: 'wafConfirm',
confirmButtonText: '我知道了',
type: 'error'
});
});
}).catch(function () {
return false;
});
}
}
});
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-6e58684b","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/pages/user/User.vue
var User_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('Title',{attrs:{"pTitle":_vm.moduleTitle,"title":_vm.pageTitle}}),_vm._v(" "),_c('div',{staticClass:"con-content"},[_c('div',{staticClass:"table-area"},[_c('div',{staticClass:"table-area-handle"},[_c('el-input',{staticClass:"search-text-btn",attrs:{"size":"small","placeholder":"请输入用户名"},on:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.currentChange(1)}},model:{value:(_vm.searchParams.username),callback:function ($$v) {_vm.$set(_vm.searchParams, "username", $$v)},expression:"searchParams.username"}}),_vm._v(" "),_c('el-button',{attrs:{"type":"primary","size":"mini"},on:{"click":function($event){return _vm.currentChange(1)}}},[_vm._v(" 搜索")])],1),_vm._v(" "),(_vm.adminList)?_c('div',{staticClass:"table-area-handle"},[_c('el-button',{staticClass:"el-icon-circle-plus-outline",attrs:{"type":"primary","size":"mini"},on:{"click":_vm.addUser}},[_vm._v(" 添加")])],1):_vm._e(),_vm._v(" "),_c('el-table',{key:_vm.tableKey,ref:"adminTable",staticClass:"contable",staticStyle:{"width":"100%"},attrs:{"border":"","height":_vm.adminTHeight,"data":_vm.tableData,"tooltip-effect":"dark"}},[_c('el-table-column',{attrs:{"type":"index","label":"编号","width":"50"}}),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"phone","label":"用户名","min-width":"180"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('div',{staticClass:"rowBreak",attrs:{"title":scope.row.phone}},[_vm._v("\n "+_vm._s(scope.row.phone)+"\n ")])]}}])}),_vm._v(" "),(_vm.adminList)?_c('el-table-column',{attrs:{"prop":"areaName","label":"区域","min-width":"120"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('div',[_vm._v("\n "+_vm._s(scope.row.areaName ? scope.row.areaName : '-')+"\n ")])]}}],null,false,3973848473)}):_vm._e(),_vm._v(" "),_c('el-table-column',{attrs:{"prop":"createTime","label":"创建时间","min-width":"180"}}),_vm._v(" "),(_vm.adminList)?_c('el-table-column',{staticClass:"el-breadcrumb",attrs:{"label":"操作","min-width":"180"},scopedSlots:_vm._u([{key:"default",fn:function(scope){return [_c('div',{},[_c('a',{staticClass:"operaBtn",on:{"click":function($event){return _vm.deleteUser(scope.row)}}},[_vm._v("删除")])])]}}],null,false,1089570070)}):_vm._e()],1)],1),_vm._v(" "),_c('Pagination',{attrs:{"total":_vm.total,"pageSize":_vm.pageSize,"currentPage":_vm.currentPage},on:{"sizeChange":_vm.sizeChange,"currentChange":_vm.currentChange}})],1),_vm._v(" "),(_vm.availableAddUser)?_c('AddUser',{attrs:{"available":_vm.availableAddUser,"areaList":_vm.areaList,"URL":_vm.URL,"contextPath":_vm.contextPath},on:{"update:available":function($event){_vm.availableAddUser=$event}}}):_vm._e()],1)}
var User_staticRenderFns = []
var User_esExports = { render: User_render, staticRenderFns: User_staticRenderFns }
/* harmony default export */ var user_User = (User_esExports);
// CONCATENATED MODULE: ./src/pages/user/User.vue
function User_injectStyle (ssrContext) {
__webpack_require__("r1OL")
}
var User_normalizeComponent = __webpack_require__("VU/8")
/* script */
/* template */
/* template functional */
var User___vue_template_functional__ = false
/* styles */
var User___vue_styles__ = User_injectStyle
/* scopeId */
var User___vue_scopeId__ = "data-v-6e58684b"
/* moduleIdentifier (server only) */
var User___vue_module_identifier__ = null
var User_Component = User_normalizeComponent(
User,
user_User,
User___vue_template_functional__,
User___vue_styles__,
User___vue_scopeId__,
User___vue_module_identifier__
)
/* harmony default export */ var pages_user_User = __webpack_exports__["default"] = (User_Component.exports);
/***/ }),
/***/ "oRY/":
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ "r1OL":
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ })
});