12 |
- (function(){var e={191:function(e,t,a){"use strict";a.d(t,{i:function(){return s}});var o=a(4642);const s={baseUrl:`${o.baseApi}onlinePost`,ajaxstart:{functionName:"select_user_type1",r_type:null,page:null,num:null},userstate:{functionName:"update_user_state"},ajax_admin:{functionName:"update_user_admin"},ajax_school:{functionName:"select_school_name",u_name:"",u_org:""},ajax_org:{functionName:"select_organization"},ajax_school_name:{functionName:"select_school_name"},ajax_add_school:{functionName:"insert_school"},ajax_add_org:{functionName:"insert_org"},ajax_confirm:{functionName:"updata_user_o_s"},moveUser:{functionName:"account_update_user"},allRecords:{functionName:"select_requestuser",page:1,num:10}}},3080:function(e){e.exports={env:"production",title:"cocorobo",baseUrl:"https://www.xxx.com/",baseApi:"https://pbl.cocorobo.cn/api/pbl/",APPID:"xxx",APPSECRET:"xxx",$cdn:"https://imgs.solui.cn"}},4642:function(e,t,a){const o=a(3080);e.exports=o},8277:function(e,t,a){"use strict";var o=a(6848),s=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("router-view")],1)},n=[],i=a(1656),r={},l=(0,i.A)(r,s,n,!1,null,null,null),c=l.exports,u=a(6178),d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"body"},[t("div",{staticClass:"top"},[t("div",{staticClass:"title"},[e._v("CocoClass后台管理")]),t("div",{staticClass:"person"},[t("div",{staticClass:"person_name"},[e._v(e._s(e.userinfo?e.userinfo.username:""))]),t("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"text"},on:{click:e.handleLogout}},[e._v("退出")])],1)]),t("div",{staticClass:"container"},[t("div",{staticClass:"left"},[t("ul",[t("router-link",{staticClass:"menu_left",attrs:{to:"/user-list"}},[t("i",{staticClass:"el-icon-s-custom"}),e._v("账号列表 ")]),t("router-link",{staticClass:"menu_left",attrs:{to:"/user-examine"}},[t("i",{staticClass:"el-icon-edit"}),e._v("账号审核 ")])],1)]),t("div",{staticClass:"table-container"},[t("router-view")],1)])])},p=[],h=(a(4114),a(3518)),m=a(4373),_=a(9122),f=a.n(_);m.A.defaults.timeout=6e5,m.A.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8",m.A.defaults.baseURL={NODE_ENV:"production",VUE_APP_ENV:"production",BASE_URL:"/"}.NODE_HOST,m.A.defaults.withCredentials=!0,console.log({NODE_ENV:"production",VUE_APP_ENV:"production",BASE_URL:"/"});const g=m.A.CancelToken;let b;function v(e){return JSON.stringify(e)}function y(e,t,a){return new Promise(((o,s)=>{m.A.post(e,t,a?{cancelToken:a.token}:"").then((e=>{o(e)}),(e=>{s(e)})).catch((e=>{s(e)}))}))}function x(e,t,a){return new Promise(((o,s)=>{m.A.put(e,t,a?{cancelToken:a.token}:"").then((e=>{o(e)}),(e=>{s(e)})).catch((e=>{s(e)}))}))}function w(e,t,a){return new Promise(((o,s)=>{let n=a?a.token:"";m.A.get(e,{params:t,cancelToken:n}).then((e=>{o(e)}),(e=>{s(e)})).catch((e=>{s(e)}))}))}m.A.interceptors.request.use((e=>{if("https://gpt.cocorobo.cn/search_image"===e.url||"https://gpt.cocorobo.cn/chat"===e.url||"https://gpt4.cocorobo.cn/create_free_assistants"===e.url||"https://gpt4.cocorobo.cn/assistants_completion_response"===e.url)e.data=v(e.data);else if(-1!==e.url.indexOf("https://gpt4.cocorobo.cn/")||-1!==e.url.indexOf("https://claude3.cocorobo.cn/")||-1!==e.url.indexOf("https://llm.cocorobo.cn/"))e.headers={"Content-Type":"application/json"};else if(e.data&&"1"===e.data[0].post&&"post"===e.method)e.data="mode="+Object.values(e.data[0]).join(",");else if("post"===e.method){const t={};for(const a in e.data[0])Object.hasOwnProperty.call(e.data[0],a)&&(t[a]=encodeURIComponent(e.data[0][a]));e.data=f().stringify([t])}else{const t={};for(const a in e.data)Object.hasOwnProperty.call(e.data,a)&&(t[a]=encodeURIComponent(e.data[a]));e.data=t}return e}),(e=>Promise.reject(e))),m.A.interceptors.response.use((e=>{if(!e.data.success){let t=e.data.token;localStorage.setItem("access_token",t)}return e}),(e=>(m.A.isCancel(e)?console.log("请求已取消",e.message):"401"==e.response.data.status&&(void 0).$router.push("/login"),Promise.reject(e))));var C={get:w,post:y,put:x,setCancelSource:()=>(b=g.source(),b)},S=a(4642);function k(){return C.get("//beta.api.cocorobo.cn/api/getcookieuserid")}function j(e){return C.post("//beta.api.cocorobo.cn/api/logout",e)}function T(e){return C.get(`${S.baseApi}/selectUser`,e)}function N(e){return C.post(`${S.baseApi}/batchRegistrationUser`,[e])}var A={name:"HomeView",computed:{...(0,h.L8)(["userinfo"])},methods:{...(0,h.i0)({logout:"user/logout"}),async handleLogout(){this.$confirm("确定退出吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((async()=>{j().then((async()=>{this.$message({message:"退出成功",type:"success"}),await this.logout(),this.$router.push("/login")})).catch((e=>{console.error(e)}))})).catch((()=>{}))}},mounted(){}},E=A,O=(0,i.A)(E,d,p,!1,null,"0dd62c46",null),P=O.exports,$=function(){var e=this,t=e._self._c;return t("div",{staticClass:"list_container"},[e._m(0),t("el-dialog",{staticClass:"table",attrs:{title:"移动选择",visible:e.isOrgFormVisible,"before-close":e.close_table,width:"920px"},on:{"update:visible":function(t){e.isOrgFormVisible=t}}},[t("div",{staticClass:"input-container"},[t("div",{staticClass:"input_box"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchQuery,expression:"searchQuery"}],staticClass:"table_find",attrs:{type:"text",placeholder:"搜索学校"},domProps:{value:e.searchQuery},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.ajax_school_name(e.searchQuery,e.school.type)},input:function(t){t.target.composing||(e.searchQuery=t.target.value)}}}),t("i",{staticClass:"el-icon-search",on:{click:function(t){return e.ajax_school_name(e.searchQuery,e.school.type)}}})]),t("el-select",{staticClass:"custom-select",staticStyle:{"margin-left":"10px"},attrs:{placeholder:"请选择组织",clearable:""},on:{change:e.ajax_org_check},model:{value:e.school.OrgId,callback:function(t){e.$set(e.school,"OrgId",t)},expression:"school.OrgId"}},e._l(e.organizations,(function(a,o){return t("el-option",{key:o,attrs:{label:a.name,value:a.id}},[e._v(" "+e._s(a.name)+" ")])})),1)],1),t("div",{staticClass:"table_down"},[e.cn_org?t("div",[t("div",{staticClass:"checkbox-container"},e._l(e.cn_school,(function(a,o){return t("div",{key:o,staticClass:"checkbox_comment"},[t("div",{staticClass:"checkbox-left"},[t("label",{staticClass:"checkbox-label"},[t("a",[e._v(e._s(a.name))])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedSchool,expression:"selectedSchool"}],staticClass:"checkbox_input_org",attrs:{type:"radio",name:"school_selection"},domProps:{value:a.name,checked:e._q(e.selectedSchool,a.name)},on:{change:function(t){e.selectedSchool=a.name}}})])])})),0)]):e._e()]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.isOrgFormVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.add_school_dialog=!0}}},[e._v("新增学校")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.add_org_dialog=!0}}},[e._v("新增组织")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_confirm}},[e._v("确认移动")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增账户",visible:e.isTableUseVisible,"before-close":e.close_table,width:"700px"},on:{"update:visible":function(t){e.isTableUseVisible=t}}},[t("div",{staticClass:"el-dialog__body"},[t("form",{staticClass:"el-form",attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学生姓名")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",{attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"add_input el-input el-input--suffix",attrs:{"data-v-3a331e10":""}},[t("input",{staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入学生姓名"}})])])])]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学生姓名")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",{attrs:{"data-v-3a331e10":""}},[t("div",{staticClass:"add_input el-input el-input--suffix",attrs:{"data-v-3a331e10":""}},[t("input",{staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入学生姓名"}})])])])]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("选择组织")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择组织"},model:{value:e.school.type,callback:function(t){e.$set(e.school,"type",t)},expression:"school.type"}},[t("el-option",{attrs:{value:1}},[e._v("组织1")]),t("el-option",{attrs:{value:2}},[e._v("组织2")])],1)],1)]),t("div",{staticClass:"el-form-item",attrs:{"data-v-3a331e10":""}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("选择学校")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择"},model:{value:e.school.type,callback:function(t){e.$set(e.school,"type",t)},expression:"school.type"}},[t("el-option",{attrs:{value:1}},[e._v("学校1")]),t("el-option",{attrs:{value:2}},[e._v("学校2")])],1)],1)])])]),t("div",{staticClass:"el-dialog__footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.isTableUseVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"}},[e._v("确认")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增学校",visible:e.add_school_dialog,"before-close":e.close_add_school,width:"700px"},on:{"update:visible":function(t){e.add_school_dialog=t}}},[t("div",{staticClass:"el_dialog_school_content"},[t("form",{staticClass:"el-form"},[t("div",{staticClass:"el-form-item",staticStyle:{"margin-top":"15px"}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学校名称")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.sch_name,expression:"sch_name"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"学校名称"},domProps:{value:e.sch_name},on:{input:function(t){t.target.composing||(e.sch_name=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("地区")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.region,expression:"region"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入地区"},domProps:{value:e.region},on:{input:function(t){t.target.composing||(e.region=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("学校编码")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.schoolCode,expression:"schoolCode"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入编码"},domProps:{value:e.schoolCode},on:{input:function(t){t.target.composing||(e.schoolCode=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("上级组织")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"100px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("el-form",{ref:"form",staticStyle:{float:"left","margin-left":"20px",width:"200px",height:"30px","margin-top":"-65px"},attrs:{model:e.school}},[t("el-select",{staticClass:"custom-select",attrs:{placeholder:"请选择组织"},model:{value:e.school.parentOrgId,callback:function(t){e.$set(e.school,"parentOrgId",t)},expression:"school.parentOrgId"}},e._l(e.organizations,(function(a,o){return t("el-option",{key:o,attrs:{label:a.name,value:a.id}},[e._v(" "+e._s(a.name)+" ")])})),1)],1)],1)])])])])]),t("div",{staticClass:"el-dialog__footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.add_school_dialog=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_add_school}},[e._v("确认")])],1)]),t("el-dialog",{staticClass:"table",attrs:{title:"新增组织",visible:e.add_org_dialog,"before-close":e.close_add_org,width:"700px"},on:{"update:visible":function(t){e.add_org_dialog=t}}},[t("div",{staticClass:"el_dialog_org_content"},[t("form",{staticClass:"el-form"},[t("div",{staticClass:"el-form-item",staticStyle:{"margin-top":"15px"}},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("组织名称")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.orgName,expression:"orgName"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"组织名称"},domProps:{value:e.orgName},on:{input:function(t){t.target.composing||(e.orgName=t.target.value)}}})])])])]),t("div",{staticClass:"el-form-item"},[t("label",{staticClass:"el-form-item__label",staticStyle:{width:"100px"}},[e._v("随机码")]),t("div",{staticClass:"el-form-item__content",staticStyle:{"margin-left":"5px"}},[t("span",[t("div",{staticClass:"add_input el-input el-input--suffix"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.randomCode,expression:"randomCode"}],staticClass:"el-input__inner",attrs:{type:"text",autocomplete:"off",placeholder:"请输入随机码"},domProps:{value:e.randomCode},on:{input:function(t){t.target.composing||(e.randomCode=t.target.value)}}})])])])])])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.add_org_dialog=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.ajax_add_org}},[e._v("确认")])],1)]),t("div",{staticClass:"content"},[t("div",{staticClass:"button_top"},[t("a",{style:{color:e.open?"black":"rgb(179, 179, 179)"},on:{click:e.showopen}},[e._v("启用中("+e._s(e.tableData.length)+")")]),t("a",{style:{color:e.stop?"black":"rgb(179, 179, 179)"},on:{click:e.showstop}},[e._v("已停用("+e._s(e.tableData_stop.length)+")")])]),e.open_content?t("div",[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.paginatedData,border:"",stripe:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_name",label:"组织名称","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_number",label:"学校名称","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"姓名","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"account",label:"账户","min-width":"32","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",label:"身份","min-width":"32","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("div",[e._v(e._s(e.roleType(a)))])]}}],null,!1,3854193392)}),t("el-table-column",{attrs:{"show-overflow-toolti":"",label:"操作","min-width":"35","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax__open_stop(a.userid)}}},[e._v("停用")]),t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.run(a.userid)}}},[e._v("移动")]),1===a.type?t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax_admin(a.userid,a.role,a.type)}}},[e._v(" "+e._s(1===a.role?"已设置管理员":"设置管理员")+" ")]):e._e()]}}],null,!1,1327522867)})],1),e.up_page?t("div",{staticClass:"Pagetion"},[t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,total:e.tableData.length,layout:"total, prev, pager, next, jumper"},on:{"current-change":e.handlePageChange}})],1):e._e()],1):e._e(),e.stop_content?t("div",[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.down_paginatedData,border:"","header-align":"center",align:"center",stripe:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_name",label:"组织名称","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"company_number",label:"学校名称","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",label:"姓名","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"account",label:"账户","min-width":"35","header-align":"center",align:"center"}}),t("el-table-column",{attrs:{label:"操作","min-width":"25","header-align":"center",align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("el-button",{attrs:{link:"",type:"text",size:"small"},on:{click:function(t){return e.ajax__open_stop(a.userid)}}},[e._v("启用")])]}}],null,!1,3088615389)})],1),e.down_page?t("div",{staticClass:"Pagetion"},[t("el-pagination",{attrs:{"current-page":e.down_currentPage,"page-size":e.down_pageSize,total:e.tableData_stop.length,layout:"total, prev, pager, next, jumper"},on:{"current-change":e.down_handlePageChange}})],1):e._e()],1):e._e()])],1)},D=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"title_examine"},[t("div",{staticClass:"pub_title"},[e._v("账号列表")]),t("div",{staticStyle:{"margin-left":"auto"}})])}],U=(a(8992),a(2577),a(1454),a(191)),I={name:"HelloWorld",components:{},data(){return{dropdownVisible:!1,checked:!0,showCompany:!1,isOrgFormVisible:!1,isTableUseVisible:!1,add_org_dialog:!1,orgName:"",u_create:"",randomCode:"",uLogin:"1",radio:"1",sch_name:"",region:"",schoolType:"1",schoolCode:"",loginPermission:"1",add_school_dialog:!1,isCompanyDropdownVisible:!1,companyListVisibility:[!1,!1,!1],open_content:!0,add_button:!0,stop_content:!1,open:!0,stop:!1,selectedSchool:"",currentPage:1,pageSize:10,down_currentPage:1,down_pageSize:10,up_page:!0,down_page:!1,company_name:0,tableData:[],tableData_stop:[],form:{name:"",account:"",organization:"",school:""},cn_org:!0,hk_org:!1,com_org:!1,organizations:[],cn_school:[],searchQuery:"",dialogVisible:!0,school:{OrgId:null},ajaxParams:null,check_user_id:""}},computed:{paginatedData(){const e=(this.currentPage-1)*this.pageSize,t=this.currentPage*this.pageSize;return this.tableData.slice(e,t)},down_paginatedData(){const e=(this.down_currentPage-1)*this.down_pageSize,t=this.down_currentPage*this.down_pageSize;return this.tableData_stop.slice(e,t)},roleType(){return function(e){return 2==e.type?"学生":1==e.type?1==e.role?"管理员":"老师":void 0}}},watch:{currentPage(e,t){e!==t&&this.ajax_user_open(e)},down_currentPage(e,t){e!==t&&this.ajax_user_stop(e)}},methods:{run(e){this.check_user_id=e,this.isOrgFormVisible=!0},close_table(){this.isOrgFormVisible=!1,this.isTableUseVisible=!1},nextStep(){this.isTableUseVisible=!0},form_clost(){this.isTableUseVisible=!1},close_add_org(){this.add_org_dialog=!1},close_add_school(){this.add_school_dialog=!1},showopen(){this.open_content=!0,this.add_button=!0,this.stop_content=!1,this.open=!0,this.stop=!1,this.up_page=!0,this.down_page=!1},showstop(){this.open_content=!1,this.add_button=!1,this.stop_content=!0,this.open=!1,this.stop=!0,this.up_page=!1,this.down_page=!0},handlePageChange(e){this.currentPage=e},down_handlePageChange(e){this.down_currentPage=e},cn_orgization(){this.cn_org=!0,this.hk_org=!1,this.com_org=!1},hk_orgization(){this.cn_org=!1,this.hk_org=!0,this.com_org=!1},com_orgization(){this.cn_org=!1,this.hk_org=!1,this.com_org=!0},headerCellStyle(){return{backgroundColor:"#f1f1f1"}},ajax_user_open(){let e=[{functionName:U.i.ajaxstart.functionName,r_type:1,page:this.currentPage,num:this.pageSize}];this.$ajax.post(U.i.baseUrl,e).then((e=>{const t=e.data[0].map((e=>({company_name:e.org_name||"暂无",company_number:e.school_name||"暂无",name:e.user_name||"暂无",account:e.account_name||"暂无",userid:e.user_id,role:e.admin_role||0,school:e.s_id,type:e.usertype})));this.tableData=Array(this.pageSize*(this.currentPage-1)).fill(null).concat(t);const a=e.data[0][0].total_count;this.tableData.length=a})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_user_stop(){let e=[{functionName:U.i.ajaxstart.functionName,r_type:0,page:this.down_currentPage,num:this.down_pageSize}];this.$ajax.post(U.i.baseUrl,e).then((e=>{const t=e.data[0].map((e=>({company_name:e.org_name||"暂无",company_number:e.school_name||"暂无",name:e.user_name||"暂无",account:e.account_name||"暂无",userid:e.user_id})));this.tableData_stop=Array(this.down_pageSize*(this.down_currentPage-1)).fill(null).concat(t);const a=e.data[0][0].total_count;this.tableData_stop.length=a})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax__open_stop(e){const t=this.open_content,a=t?"停用该条数据":"启用该条数据",o=t?"停用成功!":"启用成功!",s=t?"已取消停用":"已取消启用";let n=[{functionName:U.i.userstate.functionName,u_id:e}];this.$confirm(`此操作将会${a}, 是否继续?`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$ajax.post(U.i.baseUrl,n).then((()=>{this.$message({type:"success",message:o}),this.ajax_user_stop(),this.ajax_user_open()})).catch((e=>{this.$message.error("处理失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:s})}))},ajax_admin(e,t){let a=1===t?"此操作将会取消此用户的管理员状态,是否继续?":"此操作将会设置该用户为管理员,是否继续?";this.$confirm(a,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{let t=[{functionName:U.i.ajax_admin.functionName,u_id:e}];this.$ajax.post(U.i.baseUrl,t).then((e=>{this.tableData=e.data[0].map((e=>({company_name:e.name||"暂无",company_number:e.id||"暂无",name:e.username||"暂无",account:e.account||"暂无",role:e.role,userid:e.userid}))),this.ajax_user_stop(),this.ajax_user_open(),this.$message({type:"success",message:"已成功执行!"})})).catch((e=>{console.error("请求失败:",e),this.$message({type:"error",message:"操作失败,请稍后再试"})}))})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))},ajax_school(){const e=[U.i.ajax_school];this.$ajax.post(U.i.baseUrl,e).then((e=>{e.data&&Array.isArray(e.data[0])&&(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_org(){const e=[U.i.ajax_org];this.$ajax.post(U.i.baseUrl,e).then((e=>{e.data&&Array.isArray(e.data[0])&&(this.organizations=e.data[0].map((e=>({name:e.name,id:e.id}))))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_school_name(e){const t=this.school.OrgId||"";if(!e)return void this.$message.warning("请输入搜索内容");let a=[{functionName:U.i.ajax_school_name.functionName,u_name:e,u_org:t}];this.$ajax.post(U.i.baseUrl,a).then((e=>{e.data&&Array.isArray(e.data[0])&&e.data[0].length>0?(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))),this.$message.success("成功查询到了学校")):this.$message.warning("没有找到匹配的学校"),this.$nextTick((()=>{this.searchQuery="",this.selectedSchool="",this.searchQuery=""}))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_org_check(){const e=this.school.OrgId||"";let t=[{functionName:U.i.ajax_school_name.functionName,u_name:"",u_org:e}];this.$ajax.post(U.i.baseUrl,t).then((e=>{e.data&&Array.isArray(e.data[0])&&e.data[0].length>0?(this.cn_school=e.data[0].map((e=>({name:e.name,id:e.id}))),this.$message.success("成功查询到了学校")):this.$message.warning("没有找到匹配的学校"),this.$nextTick((()=>{this.searchQuery="",this.selectedSchool=""}))})).catch((e=>{this.$message.error("查询失败"),console.error("请求失败,错误信息:",e)}))},ajax_add_school(){if(!this.sch_name||""===this.sch_name.trim())return void this.$message.error("学校名称不能为空!");let e=[{functionName:U.i.ajax_add_school.functionName,u_name:this.sch_name,u_org:this.school.parentOrgId||"",u_dest:this.region||"",u_type:this.schoolType||"",u_code:this.schoolCode||"",u_isLogin:"1"===this.loginPermission?1:2}];this.$ajax.post(U.i.baseUrl,e).then((()=>{this.$message({type:"success",message:"已成功执行!"}),this.ajax_school(),this.add_school_dialog=!1,this.sch_name="",this.school.parentOrgId="",this.region="",this.schoolType="1",this.schoolCode="",this.loginPermission="1"})).catch((e=>{this.$message.error("插入失败"),console.error("请求失败,错误信息:",e)}))},ajax_add_org(){let e=this.orgName,t=this.randomCode||"",a=this.radio;if(!e)return void this.$message.error("组织名称不能为空");let o=[{functionName:U.i.ajax_add_org.functionName,u_name:e,u_create:"0",u_code:t,u_login:a}];this.$ajax.post(U.i.baseUrl,o).then((()=>{this.$message({type:"success",message:"已成功执行!"}),this.ajax_org(),this.add_org_dialog=!1,this.orgName="",this.randomCode="",this.uLogin="1"})).catch((e=>{this.$message.error("插入失败"),console.error("请求失败,错误信息:",e)}))},ajax_confirm(){const e=this.school.OrgId||"",t=this.cn_school.find((e=>e.name===this.selectedSchool));if(!t||!t.id)return void this.$message({type:"warning",message:"请选择你要移动的学校!"});let a=[{functionName:U.i.ajax_confirm.functionName,u_id:this.check_user_id,o_id:e||"",s_id:t.id}];this.$ajax.post(U.i.baseUrl,a).then((()=>{this.$message({type:"success",message:"移动成功!"}),this.isOrgFormVisible=!1,this.ajax_user_open(),this.school.OrgId="",this.selectedSchool=null,this.ajax_school()})).catch((e=>{this.$message.error("移动失败"),console.error("请求失败,错误信息:",e)}))}},mounted(){this.ajax_user_stop(),this.ajax_user_open(),this.ajax_org(),this.ajax_school()}},z=I,R=(0,i.A)(z,$,D,!1,null,"4f8380d8",null),V=R.exports,L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table_container"},[e._m(0),t("div",{staticClass:"table_content"},[t("div",{staticClass:"button_top"},[t("div",{staticClass:"examine_title"},[t("a",{style:{color:0==e.type?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:function(t){return e.showData(0)}}},[e._v("待审核("+e._s(e.tableData)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:1==e.type?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:function(t){return e.showData(1)}}},[e._v("已通过("+e._s(e.approvedData)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:2==e.type?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:function(t){return e.showData(2)}}},[e._v("已拒绝("+e._s(e.RefusedData)+")")])]),t("div",{staticClass:"examine_title"},[t("a",{style:{color:3==e.type?"black":"rgb(179, 179, 179)",fontWeight:"bold"},on:{click:function(t){return e.showData(3)}}},[e._v("全部记录("+e._s(e.AllData)+")")])])]),t("div",{staticClass:"content"},[t("div",{staticClass:"tableBox"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.currentTableData,stripe:"",border:"","header-cell-style":e.headerCellStyle}},[t("el-table-column",{attrs:{label:"组织名称","min-width":"45","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.orgName?t.row.orgName:"-"))]}}])}),t("el-table-column",{attrs:{label:"学校名字","min-width":"45","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.schoolName?t.row.schoolName:"-"))]}}])}),t("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"contact_info",label:"电话/邮箱","min-width":"45"}}),t("el-table-column",{attrs:{prop:"name",label:"姓名","min-width":"45","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"username",label:"账号","min-width":"45","show-overflow-tooltip":"","label-class-name":"address-column"}}),t("el-table-column",{attrs:{prop:"time",label:"提交时间","min-width":"45"}}),t("el-table-column",{attrs:{label:"状态","min-width":"45"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.getStatusText(t.row.type)))]}}])}),t("el-table-column",{attrs:{prop:"remarks",label:"备注","min-width":"45"}}),0==e.type?t("el-table-column",{attrs:{label:"操作",width:"150px"},scopedSlots:e._u([{key:"default",fn:function({row:a}){return[t("button",{staticStyle:{color:"#308fff",background:"none",border:"none",cursor:"pointer","margin-left":"25px"},on:{click:function(t){return e.ajax_move_user(1,a)}}},[e._v(" 通过 ")]),t("button",{staticStyle:{color:"#ff2570",background:"none",border:"none",cursor:"pointer","margin-left":"35px"},on:{click:function(t){return e.ajax_move_user(2,a)}}},[e._v(" 拒绝 ")])]}}],null,!1,3629706527)}):e._e()],1)],1),t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,total:e.total,layout:"total,prev, pager, next, jumper"},on:{"current-change":e.handlePageChange}})],1)])])},B=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"title_examine"},[t("div",{staticClass:"pub_title"},[e._v("账号审核")])])}],F={name:"IndexTable",components:{},data(){return{checked:!0,selectedOptions:[],showCompany:!1,selectedOrg:"CN",checkboxStates:Array(10).fill(!1),selectedSchools:Array(16).fill(""),button:Array(10).fill(!1),currentPage:1,currentApprovedPage:1,currentRefusedPage:1,currentAllPage:1,total:0,pageSize:10,pageSizeOptions:[10,25,50],currentTableData:[],Pending_request:!0,type:0,tableData:0,approvedData:0,RefusedData:0,AllData:0}},computed:{...(0,h.L8)(["userid"])},methods:{getStatusText(e){const t={0:"待审核",1:"已通过",2:"已拒绝"};return t[e]||"未知状态"},getButtonType(e){const t={0:"primary",1:"success",2:"danger"};return t[e]||"default"},headerCellStyle(){return{backgroundColor:"#f1f1f1"}},handlePageChange(e){U.i.allRecords.page=e,this.$forceUpdate(),this.ajaxAll()},showData(e){this.type=e,this.ajaxAll()},ajaxAll(){console.log("获取所有记录");const e=[{functionName:U.i.allRecords.functionName,r_type:3==this.type?"":this.type,page:U.i.allRecords.page,r_num:U.i.allRecords.num}];this.currentTableData=[],this.$ajax.post(U.i.baseUrl,e).then((e=>{e.data&&(this.currentTableData=e.data[0],this.total=e.data[0].length?e.data[0][0].total_count:0,this.tableData=e.data[1][0].num,this.approvedData=e.data[2][0].num,this.RefusedData=e.data[3][0].num,this.AllData=e.data[4][0].num),console.log("返回的结果为:",e.data)})).catch((e=>{console.error("请求失败,错误信息:",e)}))},addUser(e){let t={alias:e.name,username:e.username,org:e.orgid,oid:e.oid,ph:e.phonenumber,cid:"",type:1,opid:"",dest:"",eduid:""};N(t).then((e=>{e&&(this.$message({type:"success",message:"操作成功"}),this.ajaxAll())})).catch((e=>{console.error("请求失败,错误信息:",e)}))},ajax_move_user(e,t){let a="";1==e?a="您确定同意此用户申请并创建吗?":2==e&&(a="您确定拒绝此用户申请吗?");let o=0;1==e?o=1:2==e&&(o=2),this.$confirm(a,"确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{let a=[{functionName:U.i.moveUser.functionName,uid:t.id,type:o,euid:this.userid}];this.$ajax.post(U.i.baseUrl,a).then((a=>{console.log(a),1==e?this.addUser(t):(this.$message({type:"success",message:"操作成功"}),this.ajaxAll()),console.log("此条数据处理后的id为:",t.id)})).catch((e=>{this.$message.error("操作失败"),console.error("请求失败,错误信息:",e)}))})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))}},mounted(){this.ajaxAll()}},Q=F,M=(0,i.A)(Q,L,B,!1,null,"13e213af",null),q=M.exports;o["default"].use(u.Ay);const H=[{path:"/login",component:()=>a.e(976).then(a.bind(a,1976)),meta:{title:"登录",keepAlive:!1}},{path:"/",name:"home",component:P,redirect:"/user-list",children:[{path:"user-list",name:"UserList",component:V},{path:"user-examine",name:"UserExamine",component:q}]},{path:"/examineDialog",name:"examineDialog",component:()=>a.e(448).then(a.bind(a,7553))}],K=new u.Ay({routes:H});var W=K;const J={courseId:e=>e.app.courseId,testId:e=>e.app.testId,shareCourseId:e=>e.app.shareCourseId,id:e=>e.user.id,userinfo:e=>e.user.userinfo,token:e=>e.user.token};var G=J;const X={courseId:"",testId:"",shareCourseId:""},Y={SET_COURSEID:(e,t)=>{e.courseId=t},SET_TESTID:(e,t)=>{e.testId=t},SET_SHARECOURSEID:(e,t)=>{e.shareCourseId=t}},Z={};var ee={state:X,mutations:Y,actions:Z},te=a(8704);const ae="vue_admin_template_token";function oe(){return te.A.get(ae)}function se(e){return te.A.set(ae,e)}function ne(){return te.A.remove(ae)}const ie=()=>({token:oe(),id:"",roles:[],name:"",username:"",avatar:"",is_init:!1,userinfo:{}}),re=ie(),le={RESET_STATE:e=>{Object.assign(e,ie())},SET_TOKEN:(e,t)=>{e.token=t},SET_ROLES:(e,t)=>{e.roles=t},SET_ID:(e,t)=>{e.id=t},SET_NAME:(e,t)=>{e.name=t},SET_USERNAME:(e,t)=>{e.username=t},SET_IS_INIT:(e,t)=>{e.is_init=t},SET_AVATAR:(e,t)=>{e.avatar=t},SET_USERINFO:(e,t)=>{e.userinfo=t}},ce={login({commit:e}){return new Promise(((t,a)=>{k().then((a=>{console.log(a);var o=a.data[0][0];e("SET_ID",o.userid),e("SET_TOKEN",o.userid),se(o.userid),t(o.userid)})).catch((e=>{a(e)}))}))},getInfo({commit:e,state:t}){return new Promise(((a,o)=>{e("SET_ID",t.token),T({userid:t.token}).then((t=>{console.log(t);const s=t.data[0][0];s||o("验证失败,请重新登录。"),e("SET_USERINFO",s),a(s)})).catch((e=>{o(e)}))}))},logout({commit:e}){return new Promise((t=>{e("SET_TOKEN",""),e("SET_ROLES",[]),ne(),e("RESET_STATE"),t()}))},resetToken({commit:e}){return new Promise((t=>{e("SET_TOKEN",""),e("SET_ROLES",[]),ne(),t()}))}};var ue={namespaced:!0,state:re,mutations:le,actions:ce};o["default"].use(h.Ay);const de=new h.Ay.Store({modules:{app:ee,user:ue},getters:G});var pe=de,he=a(9143),me=a.n(he),_e=a(4130),fe=a.n(_e);fe().configure({showSpinner:!1});const ge=["/login","examineDialog"];W.beforeEach((async(e,t,a)=>{fe().start();const o=pe.getters.token;if(o)if("/login"===e.path)a({path:"/"}),fe().done();else{const t=pe.getters.userinfo&&Object.keys(pe.getters.userinfo).length>0;if(t)a();else try{const t=await pe.dispatch("user/getInfo");await pe.commit("user/SET_USERINFO",t),a({...e,replace:!0})}catch(s){await pe.dispatch("user/resetToken"),a(`/login?redirect=${e.path}`),fe().done()}}else-1!==ge.indexOf(e.path)?a():(a(`/login?redirect=${e.path}`),fe().done())})),W.afterEach((()=>{fe().done()})),o["default"].config.productionTip=!1,o["default"].use(me()),o["default"].prototype.$ajax=C,new o["default"]({router:W,store:pe,render:e=>e(c)}).$mount("#app")},2634:function(){}},t={};function a(o){var s=t[o];if(void 0!==s)return s.exports;var n=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=e,function(){a.amdO={}}(),function(){var e=[];a.O=function(t,o,s,n){if(!o){var i=1/0;for(u=0;u<e.length;u++){o=e[u][0],s=e[u][1],n=e[u][2];for(var r=!0,l=0;l<o.length;l++)(!1&n||i>=n)&&Object.keys(a.O).every((function(e){return a.O[e](o[l])}))?o.splice(l--,1):(r=!1,n<i&&(i=n));if(r){e.splice(u--,1);var c=s();void 0!==c&&(t=c)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[o,s,n]}}(),function(){a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,{a:t}),t}}(),function(){a.d=function(e,t){for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}}(),function(){a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,o){return a.f[o](e,t),t}),[]))}}(),function(){a.u=function(e){return"js/"+(448===e?"examineDialog":e)+"."+{448:"e22f4e89",976:"6ff2b0f3"}[e]+".js"}}(),function(){a.miniCssF=function(e){return"css/"+(448===e?"examineDialog":e)+"."+{448:"e572bf23",976:"87799d5f"}[e]+".css"}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="userManage:";a.l=function(o,s,n,i){if(e[o])e[o].push(s);else{var r,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==o||d.getAttribute("data-webpack")==t+n){r=d;break}}r||(l=!0,r=document.createElement("script"),r.charset="utf-8",r.timeout=120,a.nc&&r.setAttribute("nonce",a.nc),r.setAttribute("data-webpack",t+n),r.src=o),e[o]=[s];var p=function(t,a){r.onerror=r.onload=null,clearTimeout(h);var s=e[o];if(delete e[o],r.parentNode&&r.parentNode.removeChild(r),s&&s.forEach((function(e){return e(a)})),t)return t(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}}}(),function(){a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){a.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){a.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,o,s,n){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",a.nc&&(i.nonce=a.nc);var r=function(a){if(i.onerror=i.onload=null,"load"===a.type)s();else{var o=a&&a.type,r=a&&a.target&&a.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+r+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=r,i.parentNode&&i.parentNode.removeChild(i),n(l)}};return i.onerror=i.onload=r,i.href=t,o?o.parentNode.insertBefore(i,o.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var a=document.getElementsByTagName("link"),o=0;o<a.length;o++){var s=a[o],n=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(n===e||n===t))return s}var i=document.getElementsByTagName("style");for(o=0;o<i.length;o++){s=i[o],n=s.getAttribute("data-href");if(n===e||n===t)return s}},o=function(o){return new Promise((function(s,n){var i=a.miniCssF(o),r=a.p+i;if(t(i,r))return s();e(o,r,null,s,n)}))},s={524:0};a.f.miniCss=function(e,t){var a={448:1,976:1};s[e]?t.push(s[e]):0!==s[e]&&a[e]&&t.push(s[e]=o(e).then((function(){s[e]=0}),(function(t){throw delete s[e],t})))}}}(),function(){var e={524:0};a.f.j=function(t,o){var s=a.o(e,t)?e[t]:void 0;if(0!==s)if(s)o.push(s[2]);else{var n=new Promise((function(a,o){s=e[t]=[a,o]}));o.push(s[2]=n);var i=a.p+a.u(t),r=new Error,l=function(o){if(a.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){var n=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",r.name="ChunkLoadError",r.type=n,r.request=i,s[1](r)}};a.l(i,l,"chunk-"+t,t)}},a.O.j=function(t){return 0===e[t]};var t=function(t,o){var s,n,i=o[0],r=o[1],l=o[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(s in r)a.o(r,s)&&(a.m[s]=r[s]);if(l)var u=l(a)}for(t&&t(o);c<i.length;c++)n=i[c],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(u)},o=self["webpackChunkuserManage"]=self["webpackChunkuserManage"]||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))}();var o=a.O(void 0,[504],(function(){return a(8277)}));o=a.O(o)})();
- //# sourceMappingURL=app.c6b85176.js.map
|