| 1 |
- {"remainingRequest":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/thread-loader/dist/cjs.js!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/babel-loader/lib/index.js!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js??ref--0-0!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/view/userRun/userList.vue?vue&type=script&lang=js&","dependencies":[{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/view/userRun/userList.vue","mtime":1618306924000},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/thread-loader/dist/cjs.js","mtime":1665684003955},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/babel-loader/lib/index.js","mtime":1665684010704},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js","mtime":1665684006084}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport axios from '@/libs/api.request';\nexport default {\n name: 'voice',\n\n data() {\n return {\n showAddUser: false,\n showEditUser: false,\n distributionRole: false,\n showAreaModal: false,\n roleList: [],\n curRoleId: '',\n curUserId: '',\n province: '',\n // 省\n city: '',\n // 市\n district: 0,\n // 区 (如果代理区域为地级市,默认为0 )\n provinceList: [],\n // 省列表\n cityList: [],\n // 市列表\n districtList: [],\n // 区列表\n formAdd: {\n account_no: '',\n // 账号\n password: '',\n // 密码\n name: ''\n },\n fromEdit: {\n id: '',\n mobiles: '',\n name: '',\n password: ''\n },\n ruleValidate: {\n account_no: [{\n required: true,\n message: '请输入手机号',\n trigger: 'blur'\n }],\n name: [{\n required: true,\n message: '请输入姓名',\n trigger: 'blur'\n }],\n password: [{\n required: true,\n message: '请输入密码',\n trigger: 'blur'\n }]\n },\n ruleValidateEdit: {\n mobiles: [{\n required: true,\n message: '请输入手机号',\n trigger: 'blur',\n pattern: /.+/\n }],\n name: [{\n required: true,\n message: '请输入姓名',\n trigger: 'blur'\n }],\n password: [{\n required: true,\n message: '请输入密码',\n trigger: 'blur'\n }]\n },\n showVideoModal: false,\n queryDataPage: 1,\n total: 0,\n residueNum: '',\n // 密码\n showResidueNum: false,\n residueId: '',\n // 当前点击的用户id\n // 查询条件\n queryData: {\n title: '',\n name: '',\n phone: '',\n pagenum: 15\n },\n columns: [{\n title: 'ID',\n key: 'id'\n }, {\n title: '姓名',\n key: 'real_name'\n }, {\n title: '手机号',\n key: 'mobile'\n }, {\n title: '所属用户组',\n key: 'is_super',\n render: (h, params) => {\n if (params.row.is_super !== undefined) {\n return h('span', params.row.roles[0].name);\n }\n }\n }, {\n title: '操作',\n minWidth: 200,\n key: 'action',\n align: 'center',\n render: (h, params) => {\n let btnArr = [];\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'primary'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n let that = this;\n that.distributionRole = true;\n that.curUserId = params.row.id;\n\n if (params.row.roles.length !== 0) {\n that.curRoleId = params.row.roles[0].id;\n } else {\n that.curRoleId = '';\n }\n }\n },\n directives: [{\n name: 'opcode',\n value: 'modelhasroles create'\n }]\n }, '分配角色'));\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'primary'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n this.showEditUser = true;\n this.fromEdit.id = params.row.id;\n this.fromEdit.mobiles = params.row.mobile;\n this.fromEdit.name = params.row.real_name;\n this.fromEdit.password = params.row.password; // axios\n // .request({\n // url: '/admins/adver/show',\n // data: {\n // id: params.row.id\n // },\n // method: 'POST'\n // })\n // .then(res => {\n // if (res.data.code === 'success') {\n // this.showVideoModal = true\n // this.posterTitle = res.data.data.title\n // this.posterImg = res.data.data.image\n // this.posterContent = res.data.data.content\n // } else {\n // that.$Message.error(res.data.message)\n // }\n // })\n }\n },\n directives: [{\n name: 'opcode',\n value: 'systemuser edit'\n }]\n }, '修改资料'));\n\n if (params.row.is_super !== 1) {\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'primary'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n let that = this;\n this.showAreaModal = true;\n this.residueId = params.row.id;\n this.getProvince({\n manageProvince: params.row.manageProvince,\n manageCity: params.row.manageCity,\n manageDistrict: params.row.manageDistrict\n });\n }\n } // directives: [\n // {\n // name: 'opcode',\n // value: 'admins/modifyPassword'\n // }\n // ]\n\n }, '分配区域'));\n }\n\n if (params.row.status === 1) {\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'warning'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n this.$Modal.confirm({\n title: '确定冻结该账户?',\n content: '',\n loading: true,\n onOk: () => {\n var that = this;\n axios.request({\n url: '/admins/user/edit',\n data: {\n id: params.row.id,\n status: 2\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n that.$Modal.remove();\n that.$Message.success(res.data.message, 'middle');\n\n if (that.isSearch) {\n that.cateadd(this.queryDataPage);\n } else {\n that.taskList();\n }\n } else {\n that.$Message.error(res.data.message);\n }\n });\n }\n });\n }\n },\n directives: [{\n name: 'opcode',\n value: 'systemuser edit'\n }]\n }, '冻结账户'));\n } else {\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'success'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n this.$Modal.confirm({\n title: '确定启用该账户?',\n content: '',\n loading: true,\n onOk: () => {\n var that = this;\n axios.request({\n url: '/admins/user/edit',\n data: {\n id: params.row.id,\n status: 1\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n that.$Modal.remove();\n that.$Message.success(res.data.message, 'middle');\n\n if (that.isSearch) {\n that.cateadd(this.queryDataPage);\n } else {\n that.taskList();\n }\n } else {\n that.$Message.error(res.data.message);\n }\n });\n }\n });\n }\n },\n directives: [{\n name: 'opcode',\n value: 'systemuser edit'\n }]\n }, '启用账户'));\n }\n\n btnArr.push(h('Button', {\n props: {\n size: 'small',\n type: 'error'\n },\n style: {\n marginTop: '5px',\n marginBottom: '5px',\n marginRight: '5px'\n },\n on: {\n click: () => {\n this.showResidueNum = true;\n this.residueId = params.row.id;\n }\n },\n directives: [{\n name: 'opcode',\n value: 'admins/modifyPassword'\n }]\n }, '重置密码'));\n return h('div', btnArr);\n }\n }],\n tableData: [],\n isSearch: false\n };\n },\n\n created() {\n this.taskList();\n this.getRoleList();\n },\n\n methods: {\n // 分页\n levelchangepage(res) {\n this.queryDataPage = res;\n\n if (this.isSearch) {\n this.cateadd(this.queryDataPage);\n } else {\n this.taskList();\n }\n },\n\n // 点击查询\n cateadd(page) {\n var listData = {\n page: page,\n perPage: this.queryData.pagenum,\n real_name: this.queryData.name,\n mobile: this.queryData.phone\n }; // 清除对象中的空属性\n\n listData = this.clearNullData(listData); // listData = clearNullData(listData)\n\n axios.request({\n method: 'post',\n url: '/admins/system/user',\n data: listData\n }).then(res => {\n if (res.data.code === 'success') {\n this.$refs['pages'].currentPage = page;\n this.tableData = res.data.data.data;\n this.total = res.data.data.total;\n this.isSearch = true;\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 获取列表信息\n taskList() {\n axios.request({\n method: 'post',\n url: '/admins/system/user',\n data: {\n page: this.queryDataPage,\n perPage: this.queryData.pagenum\n }\n }).then(res => {\n if (res.data.code === 'success') {\n this.tableData = res.data.data.data;\n this.total = res.data.data.total;\n this.isSearch = false;\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 重置密码\n cateaddok() {\n var that = this;\n axios.request({\n url: '/admins/modifyPassword',\n data: {\n id: that.residueId,\n new_pass: that.residueNum,\n comfirm_pass: that.residueNum\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n that.$Modal.remove();\n that.$Message.success(res.data.message, 'middle');\n\n if (that.isSearch) {\n that.cateadd(this.queryDataPage);\n } else {\n that.taskList();\n }\n\n that.residueNum = '';\n } else {\n that.$Message.error(res.data.message);\n }\n });\n },\n\n // 添加用户\n addUser(name) {\n this.$refs[name].validate(valid => {\n if (valid) {\n axios.request({\n url: '/admins/system/user/add',\n data: {\n mobile: this.formAdd.account_no,\n real_name: this.formAdd.name,\n password: this.formAdd.password\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n this.showAddUser = false;\n this.$Modal.remove();\n this.$Message.success(res.data.message, 'middle');\n this.taskList();\n this.formAdd.account_no = '';\n this.formAdd.name = '';\n this.formAdd.password = '';\n } else {\n this.$Message.error(res.data.message);\n }\n });\n }\n });\n },\n\n // 获取用户组数据\n getRoleList() {\n axios.request({\n method: 'post',\n url: '/admins/system/roles'\n }).then(res => {\n if (res.data.code === 'success') {\n this.roleList = res.data.data;\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 编辑用户\n editUser(fromName) {\n this.$refs[fromName].validate(valid => {\n if (valid) {\n axios.request({\n url: '/admins/user/edit',\n data: {\n id: this.fromEdit.id,\n mobile: this.fromEdit.mobiles.toString(),\n real_name: this.fromEdit.name,\n password: this.fromEdit.password\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n this.showEditUser = false;\n this.$Modal.remove();\n this.$Message.success(res.data.message, 'middle');\n\n if (this.isSearch) {\n this.cateadd(this.queryDataPage);\n } else {\n this.taskList();\n }\n\n this.fromEdit.id = '';\n this.fromEdit.name = '';\n this.fromEdit.password = '';\n this.fromEdit.mobiles = '';\n } else {\n this.$Message.error(res.data.message);\n }\n });\n }\n });\n },\n\n // 分配角色\n changeRole() {\n var that = this;\n axios.request({\n url: '/admins/system/modelhasroles/create',\n data: {\n suid: that.curUserId,\n roleid: that.curRoleId\n },\n method: 'POST'\n }).then(res => {\n if (res.data.code === 'success') {\n that.distributionRole = false;\n that.curRoleId = '';\n that.$Modal.remove();\n that.$Message.success('设置成功', 'middle');\n\n if (that.isSearch) {\n that.cateadd(this.queryDataPage);\n } else {\n that.taskList();\n }\n } else {\n that.$Message.error(res.data.message);\n }\n });\n },\n\n // 省\n getProvince(obj) {\n axios.request({\n method: 'GET',\n url: '/admins/openarea/0'\n }).then(res => {\n if (res.data.code === 'success') {\n this.province = res.data.data.list[0].id;\n this.provinceList = res.data.data.list;\n\n if (obj && obj.manageProvince) {\n this.province = obj.manageProvince;\n }\n\n this.getCity(obj);\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 市\n getCity(obj) {\n axios.request({\n method: 'GET',\n url: '/admins/openarea/' + this.province\n }).then(res => {\n if (res.data.code === 'success') {\n this.city = res.data.data.list[0].id;\n this.cityList = res.data.data.list;\n\n if (obj && obj.manageCity) {\n this.city = obj.manageCity;\n }\n\n this.getDistrict(obj);\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 区\n getDistrict(obj) {\n axios.request({\n method: 'GET',\n url: '/admins/openarea/' + this.city\n }).then(res => {\n if (res.data.code === 'success') {\n this.districtList = res.data.data.list; // this.district = res.data.data.list[0].id\n\n if (obj && obj.manageDistrict) {\n this.district = obj.manageDistrict;\n } else {\n this.district = '0';\n }\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n addArea() {\n axios.request({\n method: 'POST',\n url: '/admins/addAdminarea',\n data: {\n admin_id: this.residueId,\n province: this.province,\n city: this.city,\n district: this.district\n }\n }).then(res => {\n if (res.data.code === 'success') {\n this.$Message.success(res.data.message, 'middle');\n this.showAreaModal = false;\n this.taskList();\n } else {\n this.$Message.error(res.data.message, 'middle');\n }\n });\n },\n\n // 清空\n handleReset(name) {\n this.showAddUser = false;\n this.showEditUser = false;\n this.$refs[name].resetFields();\n }\n\n }\n};",null]}
|