chunk-90021868.e65840c5.js 12 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-90021868","chunk-57a552c4"],{"2c87":function(e,t,a){},"52be":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"miss-wraper"},[t("div",{staticClass:"row"},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.add}},[e._v("添加标准")])],1),t("a-row",{attrs:{gutter:24}},e._l(e.specs,(function(a,i){return t("a-col",{key:i,staticClass:"item",attrs:{span:11}},[t("a-input",{attrs:{"addon-before":"标准:"},model:{value:a.key,callback:function(t){e.$set(a,"key",t)},expression:"item.key"}}),t("a-input",{attrs:{"addon-before":"参考:"},model:{value:a.val,callback:function(t){e.$set(a,"val",t)},expression:"item.val"}}),t("a-icon",{staticClass:"close",attrs:{type:"close"},on:{click:function(t){return e.delItem(i)}}})],1)})),1)],1)},r=[],s={props:{value:{type:Array,default:function(){return[]},required:!1}},watch:{value:function(e){e&&e instanceof Array&&(this.specs=e)}},data:function(){return{specs:[{key:"任务时长",val:"30分钟"}]}},methods:{add:function(){this.specs.push({key:"任务时长",val:"30分钟"}),this.$emit("change",this.specs)},delItem:function(e){this.specs.splice(e,1),this.$emit("change",this.specs)}}},n=s,l=(a("a716"),a("2877")),o=Object(l["a"])(n,i,r,!1,null,"13bee551",null);t["default"]=o.exports},"6eb1":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-select",{attrs:{getPopupContainer:function(e){return e.parentNode},allowClear:""},on:{change:e.onChange},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}},e._l(e.options,(function(a){return t("a-select-option",{key:a,attrs:{value:a}},[t("span",{staticStyle:{display:"inline-block",width:"100%"},attrs:{title:a}},[e._v("\n "+e._s(a)+"\n ")])])})),1)},r=[],s=a("b441"),n={props:{value:{type:String,default:"",required:!1}},watch:{value:function(e){this.val=e}},data:function(){return{val:"",options:s["a"].Subjects}},methods:{onChange:function(){this.$emit("change",this.val)}}},l=n,o=a("2877"),c=Object(o["a"])(l,i,r,!1,null,null,null);t["default"]=c.exports},a716:function(e,t,a){"use strict";a("2c87")},e610:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("a-upload",{attrs:{name:"file",listType:"picture-card",multiple:e.isMultiple,action:e.uploadAction,headers:e.headers,data:{biz:e.bizPath},fileList:e.fileList,beforeUpload:e.beforeUpload,disabled:e.disabled,isMultiple:e.isMultiple,showUploadList:e.isMultiple},on:{change:e.handleChange,preview:e.handlePreview}},[!e.isMultiple&&e.picUrl?t("img",{staticStyle:{height:"104px","max-width":"300px"},attrs:{src:e.getAvatarView()}}):t("div",[t("a-icon",{attrs:{type:e.uploadLoading?"loading":"plus"}}),t("div",{staticClass:"ant-upload-text"},[e._v(e._s(e.text))])],1),t("a-modal",{attrs:{visible:e.previewVisible,footer:null},on:{cancel:function(t){return e.handleCancel()}}},[t("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:e.previewImage}})])],1)},r=[],s=a("2b0e"),n=a("9fb0"),l=a("0fea"),o=function(){return"-"+parseInt(1e4*Math.random()+1,10)},c=function(e){if(e.lastIndexOf("\\")>=0){var t=new RegExp("\\\\","g");e=e.replace(t,"/")}return e.substring(e.lastIndexOf("/")+1)},u={name:"JImageUpload",data:function(){return{uploadAction:window._CONFIG["domianURL"]+"/sys/common/upload",uploadLoading:!1,picUrl:!1,headers:{},fileList:[],previewImage:"",previewVisible:!1}},props:{text:{type:String,required:!1,default:"上传"},bizPath:{type:String,required:!1,default:"temp"},value:{type:[String,Array],required:!1},disabled:{type:Boolean,required:!1,default:!1},isMultiple:{type:Boolean,required:!1,default:!1}},watch:{value:function(e){e instanceof Array?this.initFileList(e.join(",")):this.initFileList(e)}},created:function(){var e=s["default"].ls.get(n["a"]);this.headers={"X-Access-Token":e}},methods:{initFileList:function(e){if(e&&0!=e.length){this.picUrl=!0;for(var t=[],a=e.split(","),i=0;i<a.length;i++){var r=Object(l["e"])(a[i]);t.push({uid:o(),name:c(a[i]),status:"done",url:r,response:{status:"history",message:a[i]}})}this.fileList=t}else this.fileList=[]},beforeUpload:function(e){var t=e.type;if(t.indexOf("image")<0)return this.$message.warning("请上传图片"),!1},handleChange:function(e){this.picUrl=!1;var t=e.fileList;"done"===e.file.status?e.file.response.success&&(this.picUrl=!0,t=t.map((function(e){return e.response&&(e.url=e.response.message),e}))):"error"===e.file.status?this.$message.error("".concat(e.file.name," 上传失败.")):"removed"===e.file.status&&this.handleDelete(e.file),this.fileList=t,"done"!==e.file.status&&"removed"!==e.file.status||this.handlePathChange()},handlePreview:function(e){this.previewImage=e.url||e.thumbUrl,this.previewVisible=!0},getAvatarView:function(){if(this.fileList.length>0){var e=this.fileList[0].url;return Object(l["e"])(e)}},handlePathChange:function(){var e=this.fileList,t="";e&&0!=e.length||(t="");var a=[];if(this.isMultiple)for(var i=0;i<e.length;i++)a.push(e[i].response.message);else a.push(e[e.length-1].response.message);a.length>0&&(t=a.join(",")),this.$emit("change",t)},handleDelete:function(e){},handleCancel:function(){this.close(),this.previewVisible=!1},close:function(){}},model:{prop:"value",event:"change"}},d=u,p=a("2877"),f=Object(p["a"])(d,i,r,!1,null,"244aa1d3",null);t["default"]=f.exports},e6cc:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e._self._c;return t("div",[t("j-modal",{attrs:{title:e.title,width:e.width,visible:e.visible,confirmLoading:e.confirmLoading,switchFullscreen:"",cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{label:"训练名字",labelCol:e.labelCol,wrapperCol:e.wrapperRowCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title"],expression:"['title']"}],attrs:{placeholder:"训练名字"}})],1)],1),t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{label:"科目名字",labelCol:e.labelCol,wrapperCol:e.wrapperRowCol}},[t("courseType",{directives:[{name:"decorator",rawName:"v-decorator",value:["subject",{initialValue:""}],expression:"['subject', {initialValue:''}]"}],attrs:{placeholder:"科目名字"},on:{change:e.subjectChange}})],1)],1)],1),t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{label:"训练地图",labelCol:e.labelCol,wrapperCol:e.wrapperRowCol}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["sceneId"],expression:"['sceneId']"}]},e._l(e.validMaps,(function(a){return t("a-select-option",{key:a.index,attrs:{value:a.index}},[t("span",{staticStyle:{display:"inline-block",width:"100%"}},[e._v("\n "+e._s(a.name)+"\n ")])])})),1)],1)],1),t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{label:"初始天气",labelCol:e.labelCol,wrapperCol:e.wrapperRowCol}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["weather"],expression:"['weather']"}]},e._l(e.Weathers,(function(a,i){return t("a-select-option",{key:a,attrs:{value:i}},[t("span",{staticStyle:{display:"inline-block",width:"100%"}},[e._v("\n "+e._s(a)+"\n ")])])})),1)],1)],1)],1),t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{label:"初始时间",labelCol:e.labelCol,wrapperCol:e.wrapperRowCol}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["time"],expression:"['time']"}]},[t("a-select-option",{attrs:{value:14}},[t("span",{staticStyle:{display:"inline-block",width:"100%"}},[e._v("\n 白天\n ")])]),t("a-select-option",{attrs:{value:21}},[t("span",{staticStyle:{display:"inline-block",width:"100%"}},[e._v("\n 黑夜\n ")])])],1)],1)],1)],1),t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:24}},[t("a-form-item",{attrs:{label:"任务标准",labelCol:e.labelCol2,wrapperCol:e.wrapperRowCol2}},[t("missSpec",{directives:[{name:"decorator",rawName:"v-decorator",value:["objective",{initialValue:[]}],expression:"['objective', {initialValue:[]}]"}]})],1)],1)],1),t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:24}},[t("a-form-item",{attrs:{label:"编队编组",labelCol:e.labelCol2,wrapperCol:e.wrapperRowCol2}},[t("group",{directives:[{name:"decorator",rawName:"v-decorator",value:["role",{initialValue:[]}],expression:"['role', {initialValue:[]}]"}],attrs:{disabled:""}})],1)],1)],1)],1)],1)],1)],1)},r=[],s=a("0fea"),n=a("88bc"),l=a.n(n),o=(a("ca00"),a("e610")),c=a("a726"),u=a("56d7d"),d=a("6eb1"),p=a("52be"),f=a("b441");function h(e){return w(e)||b(e)||v(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){if(e){if("string"===typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function b(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function w(e){if(Array.isArray(e))return g(e)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,i=new Array(t);a<t;a++)i[a]=e[a];return i}var y={name:"UserModal",components:{JImageUpload:o["default"],JCheckbox:c["default"],group:u["default"],courseType:d["default"],missSpec:p["default"]},data:function(){return{form:this.$form.createForm(this),title:"操作",width:800,visible:!1,model:{},maps:f["a"].Maps.map((function(e,t){return{name:e,index:t}})),Weathers:f["a"].Weathers,labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},labelCol2:{xs:{span:24},sm:{span:3}},wrapperRowCol2:{xs:{span:24},sm:{span:20}},wrapperRowCol:{xs:{span:24},sm:{span:19}},confirmLoading:!1,validatorRules:{countryName:{rules:[{required:!0,message:"请输入国家!"}]}},url:{add:"/admin/course/add",edit:"/admin/course/edit"},currentSubjectIndex:-1}},created:function(){},mounted:function(){this.currentSubjectIndex=-1},computed:{validMaps:function(){var e=this.currentSubjectIndex;if(-1==e)return this.maps;var t=f["a"].Subject2Map[e];if(void 0==t||-1==t)return this.maps;var a=[];return a=Array.isArray(t)?h(t):[t],a.map((function(e){return{name:f["a"].Maps[e],index:e}}))}},methods:{subjectChange:function(e){var t=f["a"].Subjects.indexOf(e);this.currentSubjectIndex=t;var a=f["a"].Subject2Map[t];void 0!=a&&-1!=a&&(Array.isArray(a)&&(a=a[0]),this.form.setFieldsValue({sceneId:a}))},add:function(){this.currentSubjectIndex=-1,this.edit({config:"{}"})},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},e);var a=JSON.parse(e.config);this.model.objective=a.objective?a.objective:[],this.model.role=a.role?a.role:[],this.model.sceneId=a.scene?a.scene.id:"",this.model.time=a.scene?parseInt(a.scene.time):"",this.model.weather=a.scene?a.scene.weather:"",this.currentSubjectIndex=-1,this.model.sceneId&&this.subjectChange(f["a"].Maps[parseInt(this.model.sceneId)]),this.visible=!0,this.$nextTick((function(){t.form.setFieldsValue(l()(t.model,"title","subject","role","objective","sceneId","time","weather"))}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this,t=this;this.form.validateFields((function(a,i){if(!a){var r="",n="";e.model.id?(r+=e.url.edit,n="put"):(r+=e.url.add,n="post");var l={objective:i.objective,role:i.role,scene:{id:i.sceneId,time:i.time,weather:i.weather}},o={config:JSON.stringify(l),title:i.title,subject:i.subject};e.model.id&&(o.id=e.model.id),Object(s["i"])(r,o,n).then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},handleCancel:function(){this.close()},popupCallback:function(e){}}},C=y,x=a("2877"),j=Object(x["a"])(C,i,r,!1,null,null,null);t["default"]=j.exports}}]);