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 lines
6.4 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d207eed"],{a349:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e._self._c;return t("div",e._l(e.list,(function(s,i){return t("div",{key:s.id,staticClass:"d-flex my-2 justify-space-between"},[t("p",{staticStyle:{margin:"0 0 10px 0 !important"}},[e._v(e._s(s.showTitle)+":")]),"textarea"===s.showForm?t("div",{staticStyle:{width:"60%"}},[0===s.calcType?t("div",{staticClass:"d-flex flex-wrap justify-start"},[e._l(e.processList,(function(s,i){return[t("a-popconfirm",{key:i,attrs:{title:"是否确定删除?","ok-text":"是","cancel-text":"否",disabled:e.recordsDisabled},on:{confirm:function(t){return e.delPro(i)}}},[t("a-tag",{staticClass:"mt-2",staticStyle:{width:"70px","text-align":"center","margin-bottom":"4px"},attrs:{color:"#0038c5"}},[e._v(" "+e._s(s.name)+" ")])],1)]}))],2):t("a-textarea",{staticStyle:{height:"120px"},attrs:{disabled:e.recordsDisabled},model:{value:s.answers[0],callback:function(t){e.$set(s.answers,0,t)},expression:"item.answers[0]"}})],1):"number"===s.showForm?t("div",{staticClass:"d-flex",staticStyle:{width:"60%"}},[3===s.type?[t("a-button",{attrs:{disabled:e.recordsDisabled||!e.canTime,icon:"minus"},on:{click:e.numberTimeDel}}),t("a-input-number",{staticClass:"flex-1",attrs:{min:0,disabled:e.recordsDisabled},on:{change:e.handleNumChange},model:{value:e.canTime,callback:function(t){e.canTime=t},expression:"canTime"}}),t("a-button",{attrs:{icon:"plus",disabled:e.recordsDisabled},on:{click:e.numberTimeAdd}})]:[t("a-button",{attrs:{disabled:e.recordsDisabled||0==s.answers||s.answers[0]<=0,icon:"minus"},on:{click:function(t){return e.reduceAnswer(i)}}}),t("a-input-number",{staticClass:"flex-1",attrs:{min:0,disabled:e.recordsDisabled},model:{value:s.answers[0],callback:function(t){e.$set(s.answers,0,t)},expression:"item.answers[0]"}}),t("a-button",{attrs:{disabled:e.recordsDisabled,icon:"plus"},on:{click:function(t){return e.increaseAnswer(i)}}})]],2):"radio"===s.showForm?t("div",{staticStyle:{width:"60%"}},[t("a-radio-group",{staticClass:"d-flex flex-wrap",class:s.options.length>4?"flex-column":"",attrs:{"default-value":s.answers[0]?s.answers[0]:"",disabled:e.recordsDisabled},on:{change:function(t){return e.changeRadio(t,i)}}},e._l(s.options,(function(s){return t("a-radio",{key:s.dataKey,staticClass:"mb-3 pr-3 txtUpsideDown",attrs:{value:s.dataKey}},[e._v(" "+e._s(s.dataValue)+" ")])})),1)],1):e._e()])})),0)},a=[],r=(s("14d9"),s("2f62")),n={name:"OtherRecordsCopy",props:{question:{type:Array,default:()=>[]},recordsDisabled:{type:Boolean,default:()=>!1}},data(){return{str:"其他记录",list:[],correctNum:0,correctList:[],processList:[],insertNum:0,repeatNum:0,time:0}},computed:{...Object(r["e"])("ht",["Steps","timeNum"]),canTime:{get(){return this.timeNum},set(e){this.setTimeNum(e)}}},watch:{Steps(e,t){if(e<t){let{list:t}=this,s=JSON.parse(localStorage.getItem("Arr"+e));console.log("processList: ",s,e),localStorage.removeItem("Arr"+e);let i=[];for(let e=0;e<(null===s||void 0===s?void 0:s.length);e++)-1===i.indexOf(s[e].name)&&i.push(s[e].name);console.log("Arr11: ",i),this.list=[...t],this.$emit("Reevaluate")}}},created(){this.list=[...this.question],this.getAnswers();let e=this.list.find(e=>1===e.calcType&&3===e.type);e&&e.answers[0]&&this.setTimeNum(e.answers[0])},methods:{...Object(r["d"])("ht",["setSteps","setTimeNum"]),numberTimeDel(){let e=this.timeNum-1;this.handleNumChange(e)},numberTimeAdd(){let e=this.timeNum+1;this.handleNumChange(e)},handleNumChange(e){this.setTimeNum(e);let t=this.list.find(e=>1===e.calcType&&3===e.type);const s=this.list.findIndex(e=>1===e.calcType&&3===e.type);t.answers[0]=this.timeNum,this.list[s]},getAnswers(){let{list:e}=this;for(let a=0;a<this.list.length;a++){if(0===e[a].calcType&&e[a].answers.length){var t=Date.now(),s=e[a].answers[0].split(","),i=[];for(let e=0;e<s.length;e++){let a={time:t,name:s[e]};i.push(a)}this.processList=[...i]}1===e[a].calcType&&1===e[a].type&&(this.correctNum=e[a].answers[0]),1===e[a].calcType&&2===e[a].type&&(this.insertNum=e[a].answers[0]),1===e[a].calcType&&3===e[a].type&&(this.repeatNum=e[a].answers[0])}},delPro(e){let{list:t,processList:s,Steps:i}=this;this.setPro(i,s),s.splice(e,1);let a=[];for(let r=0;r<s.length;r++)-1===a.indexOf(s[r].name)&&a.push(s[r].name);this.getListAndTime(s),this.getCorrect(a),this.getInsert(a,s),this.getRepeat(a,s);for(let r=0;r<t.length;r++)if(0===t[r].calcType)if(s.length)for(let e=0;e<s.length;e++)0===e?t[r].answers[0]=s[e].name:t[r].answers[0]+=","+s[e].name;else t[r].answers=[];this.list=[...t],this.processList=[...s],this.$emit("Reevaluate")},changeRadio(e,t){const{list:s}=this;s[t].answers[0]=e.target.value,this.list=[...s]},reduceAnswer(e){const{list:t}=this;t[e].answers[0]--,0===t[e].type?this.correctNum--:1===t[e].type?this.insertNum--:2===t[e].type&&this.repeatNum--,this.list=[...t]},increaseAnswer(e){const{list:t}=this;t[e].answers[0]?t[e].answers[0]++:t[e].answers[0]=1,0===t[e].type?this.correctNum++:1===t[e].type?this.insertNum++:2===t[e].type&&this.repeatNum++,this.list=[...t]},getProcess(e,t){let{list:s,processList:i,Steps:a}=this;this.setPro(a,i);for(let l=0;l<s.length;l++)if(0===s[l].calcType)if(s[l].answers.length&&""!==s[l].answers[0]){s[l].answers[0]+=","+e.display;const a={time:t,name:e.display};i.push(a)}else s[l].answers[0]=e.display,i=[{time:t,name:e.display}];let r=[];for(var n=0;n<i.length;n++)-1===r.indexOf(i[n].name)&&r.push(i[n].name);this.getListAndTime(i),this.getCorrect(r),this.getInsert(r,i),this.getRepeat(r,i),this.list=[...s],this.processList=[...i]},getListAndTime(e){let{correctList:t}=this,s=[],i=[];for(var a=0;a<e.length;a++)-1===i.indexOf(e[a].name)&&(i.push(e[a].name),s.push(e[a]));t=[...s],this.correctList=[...t]},getCorrect(e){let{list:t,correctNum:s}=this;for(let i=0;i<t.length;i++)1===t[i].calcType&&0===t[i].type&&(t[i].answers[0]=e.length,s=e.length);this.correctNum=s,this.list=[...t]},getInsert(e,t){let{list:s,insertNum:i}=this,a=0;for(let r=0;r<e.length;r++){let s=t.filter(t=>t.name===e[r]);s.length>1&&a++}for(let r=0;r<s.length;r++)1===s[r].calcType&&1===s[r].type&&(i=a,s[r].answers[0]=a);this.insertNum=i,this.list=[...s]},getRepeat(e,t){const{list:s}=this;for(let i=0;i<s.length;i++)1===s[i].calcType&&2===s[i].type&&(s[i].answers[0]=t.length-e.length,this.repeatNum=t.length-e.length);this.this=[...s]},setPro(e,t){localStorage.setItem("Arr"+e,JSON.stringify(t)),e++,this.setSteps(e),console.log("Steps: ",e)}}},l=n,c=s("2877"),o=Object(c["a"])(l,i,a,!1,null,"1587d33c",null);t["default"]=o.exports}}]);