You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
34 KiB

{"version":3,"file":"js/801.259d5b91.js","mappings":"sKAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,UAAU,CAACA,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACF,EAAG,MAAM,CAACE,YAAY,SAAS,CAACF,EAAG,WAAW,CAACG,MAAM,CAAC,MAAQ,SAAS,KAAO,UAAU,OAAS,GAAG,UAAW,MAAU,GAAGH,EAAG,MAAM,CAACE,YAAY,OAAO,CAACF,EAAG,YAAY,CAACG,MAAM,CAAC,KAAO,UAAU,KAAO,QAAQ,MAAQ,GAAG,KAAO,gBAAgBC,GAAG,CAAC,MAAQ,SAASC,GAAQT,EAAIU,sBAAuB,KAAQ,CAACV,EAAIW,GAAG,WAAW,GAAGP,EAAG,MAAM,CAACE,YAAY,SAAS,CAACF,EAAG,WAAW,CAACQ,YAAY,CAAC,MAAQ,QAAQL,MAAM,CAAC,KAAOP,EAAIa,KAAKC,QAC7iB,SAAUC,GAAQ,OAAQf,EAAIgB,YAC5BD,EAAKE,SAASC,cAAcC,SAASnB,EAAIgB,WAAWE,kBACtD,IAAM,GAAG,KAAO,GAAG,QAAS,EAAK,QAAS,EAAK,yBAAwB,EAAK,aAAa,iBAAiB,CAACd,EAAG,kBAAkB,CAACG,MAAM,CAAC,MAAQ,OAAO,MAAQ,UAAUa,YAAYpB,EAAIqB,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,SAASC,GAAO,MAAO,CAACxB,EAAIW,GAAG,IAAIX,EAAIyB,GAAGD,EAAME,IAAIT,UAAY,OAAO,YAAYb,EAAG,kBAAkB,CAACG,MAAM,CAAC,MAAQ,KAAK,MAAQ,SAAS,MAAQ,OAAOa,YAAYpB,EAAIqB,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,SA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9B,SAAAA,CACA,CAAA4B,UAAAA,EAAAC,QAAAA,SAAAC,QAAAA,UAKAX,MAAAA,EAAAA,IAGAe,QAAAA,CAEA,gBACA,MAAA9C,KAAAA,SAAA,uBACA,aAIAyB,sBACA,yCAIAQ,UAEA,8CAEA,MAMA,mCACA,qDAEA,YADA,uCAKA,oCACA,mDACA,gCAEA,yCACA,eACA,sCAlBA,oCAoBA,8BAIA,wBACA,MAAAjC,KAAAA,SAAA,0BACA,yBACA,iCAIAoC,aAEA,iDAEA,GAKA,sDACA,mCAGA,2CACA,eACA,mCAVA,qCAYA,iCAIA,0BACA,6BACA,eACA,kCAIAW,OACA,qDACA,SACA,YACA,yBACAC,EAAAA,KAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EACA,0BAMAC,qBAAAA,GAEA,UACA,OACA,OACA,OAEA,SAGA,GAFA,KAEA,IAsBA,OApBA,wBACA,cACAC,GAAAA,EAAAA,MACAC,EAAAA,EAAAA,aAIAA,EAAAA,SAAAA,IACA,cACAD,EAAAA,EAAAA,IAAAA,EAAAA,MACAE,EAAAA,EAAAA,aAIAA,EAAAA,SAAAA,IACA,cACAF,EAAAA,EAAAA,IAAAA,EAAAA,UAIA,IAGAG,UACA,iBC3dgQ,I,UCO5PC,GAAY,OACd,EACAtE,EACAqD,GACA,EACA,KACA,KACA,MAIF,EAAeiB,EAAiB","sources":["webpack://eatwhat-admin/./src/views/User.vue?c50b","webpack://eatwhat-admin/src/views/User.vue","webpack://eatwhat-admin/./src/views/User.vue?f4e4","webpack://eatwhat-admin/./src/views/User.vue"],"sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',[_c('div',{staticClass:\"user\"},[_c('div',{staticClass:\"title\"},[_c('el-alert',{attrs:{\"title\":\"用户管理界面\",\"type\":\"success\",\"center\":\"\",\"closable\":false}})],1),_c('div',{staticClass:\"btn\"},[_c('el-button',{attrs:{\"type\":\"primary\",\"size\":\"small\",\"round\":\"\",\"icon\":\"el-icon-plus\"},on:{\"click\":function($event){_vm.addUserDialogVisible = true}}},[_vm._v(\"添加用户\")])],1),_c('div',{staticClass:\"table\"},[_c('el-table',{staticStyle:{\"width\":\"100%\"},attrs:{\"data\":_vm.user.filter(\n function (data) { return !_vm.userSearch ||\n data.userName.toLowerCase().includes(_vm.userSearch.toLowerCase()); }\n ),\"fit\":\"\",\"lazy\":\"\",\"stripe\":true,\"border\":true,\"highlight-current-row\":true,\"empty-text\":\"🥶正在努力加载中...\"}},[_c('el-table-column',{attrs:{\"label\":\"用户昵称\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\" \"+_vm._s(scope.row.userName || \"神秘人\")+\" \")]}}])}),_c('el-table-column',{attrs:{\"label\":\"性别\",\"align\":\"center\",\"width\":\"100\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\" \"+_vm._s(scope.row.userGend || \"隐私\")+\" \")]}}])}),_c('el-table-column',{attrs:{\"label\":\"手机账号\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\" \"+_vm._s(scope.row.userNumb || \"未知\")+\" \")]}}])}),_c('el-table-column',{attrs:{\"label\":\"喜好\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\" \"+_vm._s(scope.row.userLike || \"未知\")+\" \")]}}])}),_c('el-table-column',{attrs:{\"label\":\"住址\",\"align\":\"center\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_vm._v(\" \"+_vm._s(scope.row.userAdd || \"未知\")+\" \")]}}])}),_c('el-table-column',{attrs:{\"align\":\"center\"},scopedSlots:_vm._u([{key:\"header\",fn:function(scope){return [_c('el-input',{attrs:{\"size\":\"mini\",\"placeholder\":\"输入用户名称搜索\"},model:{value:(_vm.userSearch),callback:function ($$v) {_vm.userSearch=$$v},expression:\"userSearch\"}})]}},{key:\"default\",fn:function(scope){return [_c('el-button',{attrs:{\"type\":\"primary\",\"size\":\"mini\",\"plain\":\"\"},on:{\"click\":function($event){return _vm.showUpdateUser(scope.row.userId)}}},[_vm._v(\"编辑\")]),_c('el-popconfirm',{staticStyle:{\"margin-left\":\"5px\"},attrs:{\"title\":\"确定删除该用户?此操作不可逆\"},on:{\"confirm\":function($event){return _vm.deleteUser(scope.row.userId)}}},[_c('el-button',{attrs:{\"slot\":\"reference\",\"type\":\"danger\",\"size\":\"mini\",\"plain\":\"\"},slot:\"reference\"},[_vm._v(\"删除\")])],1)]}}])})],1)],1)]),_c('el-dialog',{attrs:{\"title\":\"添加用户\",\"visible\":_vm.addUserDialogVisible,\"width\":\"45%\",\"center\":true},on:{\"update:visible\":function($event){_vm.addUserDialogVisible=$event},\"close\":_vm.addUserDialogClosed}},[_c('el-form',{ref:\"addUserFormRef\",attrs:{\"model\":_vm.addUserForm,\"label-width\":\"80px\",\"size\":\"small\",\"rules\":_vm.addUserFormRules}},[_c('el-form-item',{attrs:{\"label\":\"用户昵称\",\"prop\":\"userName\"}},[_c('el-input',{attrs:{\"prefix-icon\":\"el-icon-user-solid\",\"autocomplete\":\"off\",\"maxlength\":\"8\",\"clearable\":true},model:{value:(_vm.addUserForm.userName),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userName\", $$v)},expression:\"addUserForm.userName\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户性别\",\"prop\":\"userGend\"}},[_c('el-radio-group',{model:{value:(_vm.addUserForm.userGend),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userGend\", $$v)},expression:\"addUserForm.userGend\"}},[_c('el-radio',{attrs:{\"label\":\"男\"}},[_vm._v(\"男\")]),_c('el-radio',{attrs:{\"label\":\"女\"}},[_vm._v(\"女\")])],1)],1),_c('el-form-item',{attrs:{\"label\":\"用户电话\",\"prop\":\"userNumb\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-phone\",\"clearable\":true,\"maxlength\":\"11\"},model:{value:(_vm.addUserForm.userNumb),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userNumb\", _vm._n($$v))},expression:\"addUserForm.userNumb\"}})],1),_c('el-form-item',{attrs:{\"label\":\"登陆密码\",\"prop\":\"userPwd\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-lock\",\"clearable\":true,\"minlength\":\"6\",\"maxlength\":\"13\",\"show-password\":\"\"},model:{value:(_vm.addUserForm.userPwd),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userPwd\", $$v)},expression:\"addUserForm.userPwd\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户喜好\",\"prop\":\"userLike\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-sugar\",\"clearable\":true},model:{value:(_vm.addUserForm.userLike),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userLike\", $$v)},expression:\"addUserForm.userLike\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户住址\",\"prop\":\"userAdd\"}},[_c('el-cascader',{staticStyle:{\"width\":\"100%\"},attrs:{\"options\":_vm.citys,\"filterable\":\"\",\"clearable\":\"\",\"props\":{ expandTrigger: 'hover' }},model:{value:(_vm.addUserForm.userAdd),callback:function ($$v) {_vm.$set(_vm.addUserForm, \"userAdd\", $$v)},expression:\"addUserForm.userAdd\"}})],1)],1),_c('div',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"round\":\"\",\"plain\":\"\",\"size\":\"small\",\"type\":\"info\"},on:{\"click\":function($event){_vm.addUserDialogVisible = false}}},[_vm._v(\"取 消\")]),_c('el-button',{attrs:{\"type\":\"primary\",\"round\":\"\",\"plain\":\"\",\"size\":\"small\"},on:{\"click\":_vm.addUser}},[_vm._v(\"确 定\")])],1)],1),_c('el-dialog',{attrs:{\"title\":\"更新用户信息\",\"visible\":_vm.updateUserDialogVisible,\"width\":\"45%\",\"center\":true},on:{\"update:visible\":function($event){_vm.updateUserDialogVisible=$event}}},[_c('el-form',{ref:\"updateUserFormRef\",attrs:{\"model\":_vm.updateUserForm,\"label-width\":\"80px\",\"size\":\"small\",\"rules\":_vm.addUserFormRules}},[_c('el-form-item',{attrs:{\"label\":\"用户昵称\",\"prop\":\"userName\"}},[_c('el-input',{attrs:{\"prefix-icon\":\"el-icon-user-solid\",\"autocomplete\":\"off\",\"maxlength\":\"8\",\"clearable\":true},model:{value:(_vm.updateUserForm.userName),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userName\", $$v)},expression:\"updateUserForm.userName\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户性别\",\"prop\":\"userGend\"}},[_c('el-radio-group',{model:{value:(_vm.updateUserForm.userGend),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userGend\", $$v)},expression:\"updateUserForm.userGend\"}},[_c('el-radio',{attrs:{\"label\":\"男\"}},[_vm._v(\"男\")]),_c('el-radio',{attrs:{\"label\":\"女\"}},[_vm._v(\"女\")])],1)],1),_c('el-form-item',{attrs:{\"label\":\"用户电话\",\"prop\":\"userNumb\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-phone\",\"clearable\":true,\"maxlength\":\"11\"},model:{value:(_vm.updateUserForm.userNumb),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userNumb\", _vm._n($$v))},expression:\"updateUserForm.userNumb\"}})],1),_c('el-form-item',{attrs:{\"label\":\"登陆密码\",\"prop\":\"userPwd\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-lock\",\"clearable\":true,\"minlength\":\"6\",\"maxlength\":\"13\",\"show-password\":\"\"},model:{value:(_vm.updateUserForm.userPwd),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userPwd\", $$v)},expression:\"updateUserForm.userPwd\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户喜好\",\"prop\":\"userLike\"}},[_c('el-input',{attrs:{\"autocomplete\":\"off\",\"prefix-icon\":\"el-icon-sugar\",\"clearable\":true},model:{value:(_vm.updateUserForm.userLike),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userLike\", $$v)},expression:\"updateUserForm.userLike\"}})],1),_c('el-form-item',{attrs:{\"label\":\"用户住址\",\"prop\":\"userAdd\"}},[_c('el-cascader',{staticStyle:{\"width\":\"100%\"},attrs:{\"options\":_vm.citys,\"filterable\":\"\",\"clearable\":\"\",\"props\":{ expandTrigger: 'hover' }},model:{value:(_vm.updateUserForm.userAdd),callback:function ($$v) {_vm.$set(_vm.updateUserForm, \"userAdd\", $$v)},expression:\"updateUserForm.userAdd\"}})],1)],1),_c('div',{staticClass:\"dialog-footer\",attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{attrs:{\"round\":\"\",\"plain\":\"\",\"size\":\"small\",\"type\":\"info\"},on:{\"click\":function($event){_vm.updateUserDialogVisible = false}}},[_vm._v(\"取 消\")]),_c('el-button',{attrs:{\"type\":\"primary\",\"round\":\"\",\"plain\":\"\",\"size\":\"small\"},on:{\"click\":_vm.updateUser}},[_vm._v(\"确 定\")])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <el-card>\r\n <div class=\"user\">\r\n <div class=\"title\">\r\n <el-alert\r\n title=\"用户管理界面\"\r\n type=\"success\"\r\n center\r\n :closable=\"false\"\r\n ></el-alert>\r\n </div>\r\n <div class=\"btn\">\r\n <el-button\r\n type=\"primary\"\r\n size=\"small\"\r\n round\r\n icon=\"el-icon-plus\"\r\n @click=\"addUserDialogVisible = true\"\r\n >添加用户</el-button\r\n >\r\n </div>\r\n <div class=\"table\">\r\n <el-table\r\n :data=\"\r\n user.filter(\r\n (data) =>\r\n !userSearch ||\r\n data.userName.toLowerCase().includes(userSearch.toLowerCase())\r\n )\r\n \"\r\n style=\"width: 100%\"\r\n fit\r\n lazy\r\n :stripe=\"true\"\r\n :border=\"true\"\r\n :highlight-current-row=\"true\"\r\n empty-text=\"🥶正在努力加载中...\"\r\n >\r\n <el-table-column label=\"用户昵称\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.userName || \"神秘人\" }}\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"性别\" align=\"center\" width=\"100\">\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.userGend || \"隐私\" }}\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"手机账号\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.userNumb || \"未知\" }}\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"喜好\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.userLike || \"未知\" }}\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column label=\"住址\" align=\"center\">\r\n <template slot-scope=\"scope\">\r\n {{ scope.row.userAdd || \"未知\" }}\r\n </template>\r\n </el-table-column>\r\n\r\n <el-table-column align=\"center\">\r\n <template slot=\"header\" slot-scope=\"scope\">\r\n <el-input\r\n v-model=\"userSearch\"\r\n size=\"mini\"\r\n placeholder=\"输入用户名称搜索\"\r\n />\r\n </template>\r\n <template slot-scope=\"scope\">\r\n <el-button\r\n type=\"primary\"\r\n size=\"mini\"\r\n plain\r\n @click=\"showUpdateUser(scope.row.userId)\"\r\n >编辑</el-button\r\n >\r\n <el-popconfirm\r\n title=\"确定删除该用户?此操作不可逆\"\r\n style=\"margin-left: 5px\"\r\n @confirm=\"deleteUser(scope.row.userId)\"\r\n >\r\n <el-button slot=\"reference\" type=\"danger\" size=\"mini\" plain\r\n >删除</el-button\r\n >\r\n </el-popconfirm>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n </div>\r\n </div>\r\n\r\n <!-- 添加新用户的dialog -->\r\n <el-dialog\r\n title=\"添加用户\"\r\n :visible.sync=\"addUserDialogVisible\"\r\n width=\"45%\"\r\n :center=\"true\"\r\n @close=\"addUserDialogClosed\"\r\n >\r\n <el-form\r\n :model=\"addUserForm\"\r\n label-width=\"80px\"\r\n size=\"small\"\r\n ref=\"addUserFormRef\"\r\n :rules=\"addUserFormRules\"\r\n >\r\n <el-form-item label=\"用户昵称\" prop=\"userName\">\r\n <el-input\r\n prefix-icon=\"el-icon-user-solid\"\r\n v-model=\"addUserForm.userName\"\r\n autocomplete=\"off\"\r\n maxlength=\"8\"\r\n :clearable=\"true\"\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户性别\" prop=\"userGend\">\r\n <el-radio-group v-model=\"addUserForm.userGend\">\r\n <el-radio label=\"男\">男</el-radio>\r\n <el-radio label=\"女\">女</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户电话\" prop=\"userNumb\">\r\n <el-input\r\n v-model.number=\"addUserForm.userNumb\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-phone\"\r\n :clearable=\"true\"\r\n maxlength=\"11\"\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"登陆密码\" prop=\"userPwd\">\r\n <el-input\r\n v-model=\"addUserForm.userPwd\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-lock\"\r\n :clearable=\"true\"\r\n minlength=\"6\"\r\n maxlength=\"13\"\r\n show-password\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户喜好\" prop=\"userLike\">\r\n <el-input\r\n v-model=\"addUserForm.userLike\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-sugar\"\r\n :clearable=\"true\"\r\n ></el-input>\r\n </el-form-item>\r\n <el-form-item label=\"用户住址\" prop=\"userAdd\">\r\n <el-cascader\r\n style=\"width: 100%\"\r\n v-model=\"addUserForm.userAdd\"\r\n :options=\"citys\"\r\n filterable\r\n clearable\r\n :props=\"{ expandTrigger: 'hover' }\"\r\n ></el-cascader>\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button\r\n @click=\"addUserDialogVisible = false\"\r\n round\r\n plain\r\n size=\"small\"\r\n type=\"info\"\r\n >取 消</el-button\r\n >\r\n <el-button type=\"primary\" @click=\"addUser\" round plain size=\"small\"\r\n >确 定</el-button\r\n >\r\n </div>\r\n </el-dialog>\r\n\r\n <!-- 更新用户的dialog -->\r\n <el-dialog\r\n title=\"更新用户信息\"\r\n :visible.sync=\"updateUserDialogVisible\"\r\n width=\"45%\"\r\n :center=\"true\"\r\n >\r\n <el-form\r\n :model=\"updateUserForm\"\r\n label-width=\"80px\"\r\n size=\"small\"\r\n ref=\"updateUserFormRef\"\r\n :rules=\"addUserFormRules\"\r\n >\r\n <el-form-item label=\"用户昵称\" prop=\"userName\">\r\n <el-input\r\n prefix-icon=\"el-icon-user-solid\"\r\n v-model=\"updateUserForm.userName\"\r\n autocomplete=\"off\"\r\n maxlength=\"8\"\r\n :clearable=\"true\"\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户性别\" prop=\"userGend\">\r\n <el-radio-group v-model=\"updateUserForm.userGend\">\r\n <el-radio label=\"男\">男</el-radio>\r\n <el-radio label=\"女\">女</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户电话\" prop=\"userNumb\">\r\n <el-input\r\n v-model.number=\"updateUserForm.userNumb\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-phone\"\r\n :clearable=\"true\"\r\n maxlength=\"11\"\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"登陆密码\" prop=\"userPwd\">\r\n <el-input\r\n v-model=\"updateUserForm.userPwd\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-lock\"\r\n :clearable=\"true\"\r\n minlength=\"6\"\r\n maxlength=\"13\"\r\n show-password\r\n ></el-input>\r\n </el-form-item>\r\n\r\n <el-form-item label=\"用户喜好\" prop=\"userLike\">\r\n <el-input\r\n v-model=\"updateUserForm.userLike\"\r\n autocomplete=\"off\"\r\n prefix-icon=\"el-icon-sugar\"\r\n :clearable=\"true\"\r\n ></el-input>\r\n </el-form-item>\r\n <el-form-item label=\"用户住址\" prop=\"userAdd\">\r\n <el-cascader\r\n style=\"width: 100%\"\r\n v-model=\"updateUserForm.userAdd\"\r\n :options=\"citys\"\r\n filterable\r\n clearable\r\n :props=\"{ expandTrigger: 'hover' }\"\r\n ></el-cascader>\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button\r\n @click=\"updateUserDialogVisible = false\"\r\n round\r\n plain\r\n size=\"small\"\r\n type=\"info\"\r\n >取 消</el-button\r\n >\r\n <el-button type=\"primary\" @click=\"updateUser\" round plain size=\"small\"\r\n >确 定</el-button\r\n >\r\n </div>\r\n </el-dialog>\r\n </el-card>\r\n</template>\r\n\r\n<script>\r\nimport citys from \"../js/citys\";\r\nexport default {\r\n name: \"User\",\r\n data() {\r\n return {\r\n user: [],\r\n userSearch: \"\",\r\n //添加新用户的dialog可见性\r\n addUserDialogVisible: false,\r\n //更新用户信息的dialog可见性\r\n updateUserDialogVisible: false,\r\n //添加新用户的对象\r\n addUserForm: {\r\n userId: \"\",\r\n userPwd: \"123456\",\r\n userName: \"神秘人\",\r\n userNumb: \"\",\r\n userLike: \"\",\r\n userAdd: \"\",\r\n userGend: \"男\",\r\n },\r\n\r\n //更新新用户时的对象\r\n updateUserForm: {\r\n userId: \"\",\r\n userPwd: \"\",\r\n userName: \"\",\r\n userNumb: \"\",\r\n userLike: \"\",\r\n userAdd: \"\",\r\n userGend: \"\",\r\n },\r\n\r\n //添加用户表单验证规则\r\n addUserFormRules: {\r\n userName: [\r\n { required: true, message: \"请输入用户昵称\", trigger: \"blur\" },\r\n {\r\n min: 1,\r\n max: 8,\r\n message: \"长度在 1 到 8 个字符\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n userPwd: [\r\n { required: true, message: \"请输入用户登录密码\", trigger: \"blur\" },\r\n {\r\n min: 6,\r\n max: 13,\r\n message: \"长度在 6 到 13 个字符\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n userNumb: [\r\n { required: true, message: \"请输入电话号码\", trigger: \"blur\" },\r\n {\r\n pattern:\r\n /^((13[0-9])|(14[5-9])|(15([0-3]|[5-9]))|(16[6-7])|(17[1-8])|(18[0-9])|(19[1|3])|(19[5|6])|(19[8|9]))\\d{8}$/,\r\n message: \"手机号码格式不符合\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n userLike: [],\r\n userAdd: [{ required: true, message: \"住址不可为空\", trigger: \"blur\" }],\r\n userGend: [\r\n { required: true, message: \"性别不可为空\", trigger: \"blur\" },\r\n ],\r\n },\r\n\r\n //城市地址级联选择器数据\r\n citys,\r\n };\r\n },\r\n methods: {\r\n //获取用户数据\r\n async getUser() {\r\n const { data: userRes } = await this.$http.get(\"user\");\r\n this.user = userRes;\r\n },\r\n\r\n //添加用户的dialog对话框关闭时触发\r\n addUserDialogClosed() {\r\n this.$refs.addUserFormRef.resetFields();\r\n },\r\n\r\n //添加新用户方法\r\n addUser() {\r\n //表单验证开始\r\n this.$refs.addUserFormRef.validate(async (valid) => {\r\n //表单验证失败\r\n if (!valid) {\r\n this.$message.error(\"添加新用户验证失败\");\r\n return;\r\n }\r\n //表单验证通过\r\n //首先检验该用户是否已经存在(电话号码)\r\n for (let i = 0; i < this.user.length; i++) {\r\n if (this.user[i].userNumb === this.addUserForm.userNumb) {\r\n this.$message.warning(\"该用户已存在,请勿重复添加\");\r\n return;\r\n }\r\n }\r\n //该用户不存在\r\n this.addUserForm.userId = this.guid();\r\n this.addUserForm.userAdd = this.getLocationTransform(\r\n this.addUserForm.userAdd\r\n );\r\n await this.$http.post(\"user\", this.addUserForm);\r\n this.getUser();\r\n this.$message.success(\"添加新用户成功\");\r\n });\r\n this.addUserDialogVisible = false;\r\n },\r\n\r\n //点击编辑按钮\r\n async showUpdateUser(userId) {\r\n const { data: userRes } = await this.$http.get(\"user/\" + userId);\r\n this.updateUserForm = userRes[0];\r\n this.updateUserDialogVisible = true;\r\n },\r\n\r\n //点击确定发起更新请求\r\n updateUser() {\r\n //表单验证开始\r\n this.$refs.updateUserFormRef.validate(async (valid) => {\r\n //表单验证失败\r\n if (!valid) {\r\n this.$message.error(\"更新用户信息验证失败\");\r\n return;\r\n }\r\n //表单验证通过\r\n this.updateUserForm.userAdd = this.getLocationTransform(\r\n this.updateUserForm.userAdd\r\n );\r\n //发起请求\r\n await this.$http.put(\"user\", this.updateUserForm);\r\n this.getUser();\r\n this.$message.success(\"更新用户信息成功\");\r\n });\r\n this.updateUserDialogVisible = false;\r\n },\r\n\r\n //删除用户方法\r\n async deleteUser(userId) {\r\n await this.$http.delete(\"user/\" + userId);\r\n this.getUser();\r\n this.$message.success(\"删除用户成功!\");\r\n },\r\n\r\n //获取唯一id的方法\r\n guid() {\r\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(\r\n /[xy]/g,\r\n function (c) {\r\n var r = (Math.random() * 16) | 0,\r\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n }\r\n );\r\n },\r\n\r\n //将用户的城市编号转化为中文显示\r\n getLocationTransform(cityArr) {\r\n //将所需要的城市编码信息列出来\r\n const location = cityArr;\r\n const locationProvince = location[0];\r\n const locationCity = location[1];\r\n const locationArea = location[2];\r\n //创建数组保存查询到的数组,减少查询次数\r\n var provinceArr = [];\r\n var cityArr = [];\r\n //最后用于存放城市中文字符的字符串\r\n var tansformLocation = \"\";\r\n //第一次得到省和市级数组\r\n this.citys.forEach((item) => {\r\n if (item.value === locationProvince) {\r\n tansformLocation = tansformLocation + item.label;\r\n provinceArr = item.children;\r\n }\r\n });\r\n //第二次得到市和区域级数组\r\n provinceArr.forEach((item) => {\r\n if (item.value === locationCity) {\r\n tansformLocation = tansformLocation + \"/\" + item.label;\r\n cityArr = item.children;\r\n }\r\n });\r\n //第三次得到完整省市区字符串\r\n cityArr.forEach((item) => {\r\n if (item.value === locationArea) {\r\n tansformLocation = tansformLocation + \"/\" + item.label;\r\n }\r\n });\r\n //返回该字符串\r\n return tansformLocation;\r\n },\r\n },\r\n created() {\r\n this.getUser();\r\n },\r\n};\r\n</script>\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40[0].rules[0].use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./User.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40[0].rules[0].use[1]!../../node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./User.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./User.vue?vue&type=template&id=5b262236&\"\nimport script from \"./User.vue?vue&type=script&lang=js&\"\nexport * from \"./User.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","on","$event","addUserDialogVisible","_v","staticStyle","user","filter","data","userSearch","userName","toLowerCase","includes","scopedSlots","_u","key","fn","scope","_s","row","userGend","userNumb","userLike","userAdd","model","value","callback","$$v","expression","showUpdateUser","userId","deleteUser","slot","addUserDialogClosed","ref","addUserForm","addUserFormRules","$set","_n","citys","expandTrigger","addUser","updateUserDialogVisible","updateUserForm","updateUser","staticRenderFns","name","userPwd","required","message","trigger","min","max","pattern","methods","guid","v","getLocationTransform","tansformLocation","provinceArr","cityArr","created","component"],"sourceRoot":""}