1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7abe2d4a"],{"0dbd":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"type-setting"},[n("h2",[t._v("教学宝排版")]),n("set-table",{attrs:{tableData:t.tableData,tableOption:t.tableOption}}),n("div",{staticClass:"save-btn"},[n("el-button",{attrs:{id:"saveSetting"},on:{click:t.handleSetting}},[t._v(" 保存设置 ")])],1)],1)},c=[],r=(n("4160"),n("a434"),n("b0c0"),n("159b"),n("2674")),o=n("b063"),l=n("f1ed"),i={name:"TypeSetting",components:{SetTable:r["a"]},data:function(){return{isAccurate:null,tableData:[],TypeSetData:[{title:"共性问题",cellItem:[{text:"显示【共性问题】模式",name:"common",value:!0},{text:"显示共性问题的【错题原题】",name:"common_wrong",value:!0}]},{title:"试卷讲评",cellItem:[{text:"显示【试卷讲评】",name:"paper",value:!0},{text:"显示试卷讲评的【错题原题】",name:"paper_wrong",value:!0}]},{title:"真题速递",cellItem:[{text:"显示【真题速递】",name:"real_topic",value:!0}]},{title:"同学优解",cellItem:[{text:"显示【同学优解】",name:"classmateOptimization",value:!0}]}],tableOption:[{label:"一级栏目",prop:"title"},{label:"二级栏目",prop:"cellItem",class:"show-text"},{label:"设置",class:"switch-block",type:"switch"}],params:{template_id:this.$route.query.template_id,json:""}}},computed:{},created:function(){this.getProduct()},mounted:function(){},methods:{getProduct:function(){var t=this;Object(o["b"])().then((function(e){if(t.isAccurate=e.isPrecise,1==t.isAccurate){var n=t.TypeSetData;n.forEach((function(t,e){"真题速递"===t.title&&n.splice(e,1)})),t.tableData=n}else t.tableData=t.TypeSetData;t.getTemplateSet()}))},getTemplateSet:function(){var t=this,e={template_id:this.params.template_id},n=Object(l["b"])(e);Object(o["j"])(n).then((function(e){var n=JSON.parse(e.data);t.tableData.forEach((function(t){var e=t.cellItem;e.forEach((function(t){for(var e in n)t.name===e&&(t.value=!!n[e])}))}))}))},handleSetting:function(){var t=this,e={common:1,common_wrong:1,paper:1,paper_wrong:1,real_topic:1,classmateOptimization:1};this.tableData.forEach((function(t){var n=t.cellItem;n.forEach((function(t){for(var n in e)t.name===n&&(e[n]=t.value?1:0)}))})),1==this.isAccurate&&(e.real_topic=0),this.params.json=JSON.stringify(e);var n=Object(l["b"])(this.params);Object(o["l"])(n).then((function(e){1===e.status?t.$alert("保存成功","信息",{confirmButtonText:"确定",callback:function(e){t.$router.go(-1)}}):t.$message({type:"error",message:e.msg})}))}}},u=i,s=(n("9041"),n("2877")),p=Object(s["a"])(u,a,c,!1,null,null,null);e["default"]=p.exports},2674:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"set-table"},[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","header-cell-style":{background:"#f2f2f2",color:"#606266"}}},[t._l(t.tableOption,(function(e,a){return[e.type?t._e():n("el-table-column",{key:a,attrs:{prop:e.prop,label:e.label,width:e.width},scopedSlots:t._u([{key:"default",fn:function(a){return["string"==typeof a.row[e.prop]?n("div",[t._v(" "+t._s(t._f("dataFormat")(a.row[e.prop],e.formatter))+" ")]):t._l(a.row.cellItem,(function(a,c){return n("div",{key:c,class:e.class},[t._v(" "+t._s(a.text)+" ")])}))]}}],null,!0)}),"switch"===e.type?n("el-table-column",{key:a,attrs:{prop:e.prop,label:e.label,width:e.width},scopedSlots:t._u([{key:"default",fn:function(a){return t._l(a.row.cellItem,(function(a,c){return n("div",{key:c,class:e.class},[n("el-switch",{attrs:{"active-color":"#16ae68","inactive-color":"#ddd"},on:{change:function(e){return t.handleChange(a.name,a.value,c)}},model:{value:a.value,callback:function(e){t.$set(a,"value",e)},expression:"list.value"}})],1)}))}}],null,!0)}):t._e(),"buttons"===e.type?n("el-table-column",{key:a,attrs:{prop:e.prop,label:e.label,width:e.width},scopedSlots:t._u([{key:"default",fn:function(c){return[n("div",{key:a,class:e.class},t._l(e.button,(function(e,a){return n("el-button",{key:a,on:{click:function(n){return t.handleClick(e,c.$index,c.row)}}},[t._v(t._s(e.text))])})),1)]}}],null,!0)}):t._e()]}))],2)],1)},c=[],r={name:"SetTable",props:{tableData:{type:Array},tableOption:{type:Array}},data:function(){return{}},computed:{},watch:{},created:function(){},mounted:function(){},methods:{handleChange:function(t,e,n){this.$emit("handleChange",t,e,n)},handleClick:function(t,e,n){this.$emit("handleClick",t,e,n)}},filters:{}},o=r,l=n("2877"),i=Object(l["a"])(o,a,c,!1,null,null,null);e["a"]=i.exports},"4ba9":function(t,e,n){},9041:function(t,e,n){"use strict";var a=n("4ba9"),c=n.n(a);c.a},a434:function(t,e,n){"use strict";var a=n("23e7"),c=n("23cb"),r=n("a691"),o=n("50c4"),l=n("7b0b"),i=n("65f0"),u=n("8418"),s=n("1dde"),p=n("ae40"),d=s("splice"),f=p("splice",{ACCESSORS:!0,0:0,1:2}),h=Math.max,m=Math.min,b=9007199254740991,v="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!d||!f},{splice:function(t,e){var n,a,s,p,d,f,g=l(this),_=o(g.length),y=c(t,_),w=arguments.length;if(0===w?n=a=0:1===w?(n=0,a=_-y):(n=w-2,a=m(h(r(e),0),_-y)),_+n-a>b)throw TypeError(v);for(s=i(g,a),p=0;p<a;p++)d=y+p,d in g&&u(s,p,g[d]);if(s.length=a,n<a){for(p=y;p<_-a;p++)d=p+a,f=p+n,d in g?g[f]=g[d]:delete g[f];for(p=_;p>_-a+n;p--)delete g[p-1]}else if(n>a)for(p=_-a;p>y;p--)d=p+a-1,f=p+n-1,d in g?g[f]=g[d]:delete g[f];for(p=0;p<n;p++)g[p+y]=arguments[p+2];return g.length=_-a+n,s}})},b063:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"k",(function(){return l})),n.d(e,"h",(function(){return i})),n.d(e,"i",(function(){return u})),n.d(e,"g",(function(){return s})),n.d(e,"j",(function(){return p})),n.d(e,"l",(function(){return d})),n.d(e,"a",(function(){return f})),n.d(e,"c",(function(){return h})),n.d(e,"e",(function(){return m})),n.d(e,"f",(function(){return b}));var a=n("1e04"),c="";function r(t){return a["a"].post("productset/getProductEdition".concat(c),t)}function o(t){return a["a"].post("/productset/teachingList".concat(c),t)}function l(t){return a["a"].post("/productset/teachingTemplateList".concat(c),t)}function i(t){return a["a"].post("/productset/teachingTemplateCopy".concat(c),t)}function u(t){return a["a"].post("/productset/teachingTemplateDel".concat(c),t)}function s(t){return a["a"].post("/productset/teachingTemplateChangeName".concat(c),t)}function p(t){return a["a"].post("/productset/teachingTemplateDetail".concat(c),t)}function d(t){return a["a"].post("/productset/teachingTemplateSave".concat(c),t)}function f(t){return a["a"].post("/productset/getClassByGrade".concat(c),t)}function h(t){return a["a"].post("/productset/teachingEdit".concat(c),t)}function m(t){return a["a"].post("/productset/teachingRestoreClass".concat(c),t)}function b(){return a["a"].post("/productset/teachingSearchTeacher".concat(c))}c=""}}]);
|