{"version":3,"sources":["webpack:///./src/views/ap/user/Index.vue?e946","webpack:///./src/controllers/ap/user/Index.ts","webpack:///./src/controllers/ap/user/Index.ts?e061","webpack:///./src/views/ap/user/Index.vue"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","_v","_s","$data","textHash","attrs","_l","item","index","key","on","$event","preventDefault","redirectToEditPage","confirmDelete","staticRenderFns","data","created","getTextHashByPage","get","window","location","href","yes","confirm","id","deleteForm","delete","errNo","ApUserIndexController","components","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,iBAAiB,CAACH,EAAG,KAAK,CAACF,EAAIM,GAAGN,EAAIO,GAAGP,EAAIQ,MAAMC,SAAS,QAAQ,YAAYP,EAAG,cAAc,CAACQ,MAAM,CAAC,GAAK,oBAAoB,CAACR,EAAG,SAAS,CAACF,EAAIM,GAAG,WAAWN,EAAIW,GAAIX,EAAQ,MAAE,SAASY,EAAKC,GAAO,OAAOX,EAAG,MAAM,CAACY,IAAID,GAAO,CAACX,EAAG,IAAI,CAACF,EAAIM,GAAGN,EAAIO,GAAGK,MAASV,EAAG,SAAS,CAACa,GAAG,CAAC,MAAQ,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBjB,EAAIkB,mBAAmBL,MAAU,CAACb,EAAIM,GAAG,UAAUJ,EAAG,SAAS,CAACa,GAAG,CAAC,MAAQ,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBjB,EAAImB,cAAcN,MAAU,CAACb,EAAIM,GAAG,kBAAiB,IAEjnBc,EAAkB,G,gDCOtB,yE,OAEU,EAAAC,KAAe,G,EAoCzB,OAtCmD,oBAIpC,YAAAC,QAAb,W,0HAEoB,OADlBrB,KAAKO,MAAMC,SAAW,OAAYc,kBAAkB,QACpD,EAAAtB,KAAKO,MAAa,GAAM,OAAUgB,O,cAAlC,EAAWH,KAAO,S,YAGZ,YAAAH,mBAAR,SAA2BL,GACzBY,OAAOC,SAASC,KAAO,oBAAsBd,GAGvC,YAAAM,cAAR,SAAsBN,GACpB,IAAMe,EAAMC,QAAQ,qBAAuB5B,KAAKO,MAAMa,KAAKR,GAAOiB,GAAK,KACnEF,GACF3B,KAAK8B,WAAWlB,IAIN,YAAAkB,WAAd,SAAyBlB,G,0HACT,SAAM,OAAUmB,OAAO/B,KAAKO,MAAMa,KAAKR,GAAOiB,K,cAAtDG,EAAQ,SACA,IAAVA,IACFR,OAAOC,SAASC,KAAO,e,YAvBRO,EAAqB,gBAHzC,eAAiC,CAChCC,WAAY,MAEOD,GAsCrB,EAtCA,CAAmD,QAA9B,ICTqR,I,YCOtSE,EAAY,eACd,EACArC,EACAqB,GACA,EACA,KACA,KACA,MAIa,aAAAgB,E","file":"js/chunk-2d0b692c.ff4f1937.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"ap_user_index\"},[_c('h3',[_vm._v(_vm._s(_vm.$data.textHash[\"user\"][\"user\"]))]),_c('router-link',{attrs:{\"to\":\"/admin/user/add\"}},[_c('button',[_vm._v(\"add\")])]),_vm._l((_vm.data),function(item,index){return _c('div',{key:index},[_c('p',[_vm._v(_vm._s(item))]),_c('button',{on:{\"click\":function($event){$event.preventDefault();return _vm.redirectToEditPage(index)}}},[_vm._v(\"edit\")]),_c('button',{on:{\"click\":function($event){$event.preventDefault();return _vm.confirmDelete(index)}}},[_vm._v(\"delete\")])])})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Component, Vue } from \"vue-property-decorator\";\r\n\r\nimport { LangManager } from \"@/lang\";\r\nimport { UserModel } from \"@/models\";\r\n// import { pb } from \"@/network/pb/proto\";\r\n\r\n@Component({\r\n components: {}\r\n})\r\nexport default class ApUserIndexController extends Vue {\r\n private textHash!: { [page: string]: { [key: string]: string } };\r\n private data: object = {};\r\n\r\n public async created() {\r\n this.$data.textHash = LangManager.getTextHashByPage(\"user\");\r\n this.$data.data = await UserModel.get();\r\n }\r\n\r\n private redirectToEditPage(index: number) {\r\n window.location.href = \"/admin/user/edit/\" + index;\r\n }\r\n\r\n private confirmDelete(index: number) {\r\n const yes = confirm(\"confirm delete id \" + this.$data.data[index].id + \"?\");\r\n if (yes) {\r\n this.deleteForm(index);\r\n }\r\n }\r\n\r\n private async deleteForm(index: number) {\r\n const errNo = await UserModel.delete(this.$data.data[index].id);\r\n if (errNo === 1) {\r\n window.location.href = \"/admin/user\";\r\n }\r\n }\r\n\r\n // private async pbTest() {\r\n // const test = pb.User.create({\r\n // id: 1,\r\n // account: \"pb\",\r\n // password: \"pbpb\",\r\n // name: \"pb\",\r\n // role: \"pb\"\r\n // });\r\n // const testEncode = pb.User.encode(test).finish();\r\n // await UserModel.addByPB(testEncode);\r\n // }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--14-2!../../../../node_modules/eslint-loader/index.js??ref--13-0!./Index.ts?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/ts-loader/index.js??ref--14-2!../../../../node_modules/eslint-loader/index.js??ref--13-0!./Index.ts?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Index.vue?vue&type=template&id=95e8358e&\"\nimport script from \"@/controllers/ap/user/Index?vue&type=script&lang=ts&\"\nexport * from \"@/controllers/ap/user/Index?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/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"],"sourceRoot":""}