import{s as r,e as c,g as o,a as u}from"./index.f55d88c9.js";import{n as v}from"./vueComponentNormalizer.9ef17bb1.js";import"./index.51e15757.js";var d=function(){var t,e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"evaluation-student"},[a("selfStepVue",{attrs:{activeStep:(t=e.activeStep)===null||t===void 0?void 0:t.key,successList:e.successList,stepData:e.stepData},on:{check:e.check},scopedSlots:e._u([{key:"xxx",fn:function(s){return[a("span",{staticStyle:{color:"#cccccc"}},[e._v(e._s(s.item.role===e.$store.user.roleId&&"\u7531\u6211\u8BC4\u4EF7"||""))])]}}])}),a("el-divider"),a("div",{staticClass:"user-list"},e._l(e.userList,function(s){return a("div",{key:s.studentId,staticClass:"user-list-item"},[a("span",{staticClass:"user-name item_text"},[e._v(" "+e._s(s.name)+":")]),a("span",{staticClass:"user-id item_text"},[e._v(" \u8D26\u53F7\uFF1A"+e._s(s.account))]),a("span",{staticClass:"user-id item_text"},[e._v(" \u7EC4\u7EC7\uFF1A"+e._s(s.orgName))]),a("el-rate",{attrs:{disabled:e.activeStep.role!==e.$store.user.roleId,"show-score":""},on:{change:function(i){return e.rateChange(s)}},model:{value:s[e.activeStep.key],callback:function(i){e.$set(s,e.activeStep.key,i)},expression:"item[activeStep.key]"}})],1)}),0)],1)},h=[];const p={data(){return{activeStep:null,successList:[],userList:[],stepData:[{title:"\u5B66\u5458\u961F",key:1,icon:"el-icon-orange"},{title:"\u6559\u5458",key:2,icon:"el-icon-user"},{title:"\u8BFE\u7A0B",key:3,icon:"el-icon-reading"},{title:"\u539F\u5355\u4F4D",key:4,icon:"el-icon-school"},{title:"\u6BD5\u4E1A\u540E",key:5,icon:"el-icon-finished"}],getAllTakeChargeStudentTimer:null}},activated(){this.getInfo(),this.getAllTakeChargeStudent(),this.setInterval()},deactivated(){this.clearInterval()},components:{selfStepVue:r},methods:{check(t){if(this.activeStep===t.key){this.activeStep=null;return}this.activeStep=t},async rateChange(t){this.getAllTakeChargeStudentTimer&&this.clearInterval(),t.evaluation=[];for(const e in t)Number.isNaN(+e)||t.evaluation.push(`${e}-${t[e]}`);console.log(t.evaluation,t.evaluation.join(",")),t.evaluation=t.evaluation.join(","),await c(t),this.setInterval()},async getInfo(){const{data:t}=await o();this.stepData=t.evaluationRule||[],this.stepData.length<=0&&this.$message.error("\u8BF7\u5C06\u8BC4\u4EF7\u8BBE\u7F6E\u8865\u5145\u5B8C\u6574\u540E\u518D\u8BD5\uFF01"),this.activeStep=this.stepData[0]},async getAllTakeChargeStudent(){const{data:t}=await u();t.forEach(e=>{e.evaluation?e.evaluationArray=e.evaluation.split(","):e.evaluationArray=[],e.evaluationArray.forEach(n=>{const a=n.split("-");e[a[0]]=a[1]})}),this.userList=t},setInterval(){this.getAllTakeChargeStudentTimer=setInterval(()=>{this.getAllTakeChargeStudent()},5e3)},clearInterval(){clearInterval(this.getAllTakeChargeStudentTimer)}}},l={};var _=v(p,d,h,!1,g,"7f013ba8",null,null);function g(t){for(let e in l)this[e]=l[e]}const y=function(){return _.exports}();export{y as default};
