1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ae7c4296","chunk-90021868","chunk-57a552c4"],{"2c87":function(t,e,r){},"303c":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t._self._c;return e("a-card",{attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{layout:"inline"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchQuery.apply(null,arguments)}}},[e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{xl:6,lg:7,md:8,sm:24}},[e("a-form-item",{attrs:{label:"科目名字"}},[e("a-input",{attrs:{placeholder:"科目名字"},model:{value:t.queryParam.title,callback:function(e){t.$set(t.queryParam,"title",e)},expression:"queryParam.title"}})],1)],1),e("a-col",{attrs:{xl:6,lg:7,md:8,sm:24}},[e("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[e("a-button",{attrs:{type:"primary",icon:"search"},on:{click:t.searchQuery}},[t._v("查询")]),e("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:t.searchReset}},[t._v("重置")])],1)])],1)],1)],1),e("div",{staticClass:"table-operator"},[e("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(e){return t.handleAdd("新增训练科目")}}},[t._v("新增")]),e("a-button",{attrs:{type:"primary",icon:"download"},on:{click:function(e){return t.handleExportXls("科目列表")}}},[t._v("导出打印")])],1),e("div",[e("div",{staticClass:"ant-alert ant-alert-info",staticStyle:{"margin-bottom":"16px"}},[e("i",{staticClass:"anticon anticon-info-circle ant-alert-icon"}),t._v(" 已选择 "),e("a",{staticStyle:{"font-weight":"600"}},[t._v(t._s(t.selectedRowKeys.length))]),t._v("项\n "),e("a",{staticStyle:{"margin-left":"24px"},on:{click:t.onClearSelected}},[t._v("清空")])]),e("a-table",{ref:"table",staticClass:"j-table-force-nowrap",attrs:{size:"middle",bordered:"",rowKey:"id",columns:t.columns,dataSource:t.dataSource,pagination:t.ipagination,loading:t.loading,rowSelection:{selectedRowKeys:t.selectedRowKeys,onChange:t.onSelectChange}},on:{change:t.handleTableChange},scopedSlots:t._u([{key:"htmlSlot",fn:function(r){return[e("div",{domProps:{innerHTML:t._s(r)}})]}},{key:"imgSlot",fn:function(r){return[r?e("img",{staticStyle:{"max-width":"80px","font-size":"12px","font-style":"italic"},attrs:{src:t.getImgView(r),height:"25px",alt:""}}):e("span",{staticStyle:{"font-size":"12px","font-style":"italic"}},[t._v("无图片")])]}},{key:"fileSlot",fn:function(r){return[r?e("a-button",{attrs:{ghost:!0,type:"primary",icon:"download",size:"small"},on:{click:function(e){return t.uploadFile(r)}}},[t._v("\n 下载\n ")]):e("span",{staticStyle:{"font-size":"12px","font-style":"italic"}},[t._v("无文件")])]}},{key:"action",fn:function(r,n){return e("span",{},[e("a",{on:{click:function(e){return t.handleEdit(n,"编辑科目信息")}}},[t._v("编辑")]),e("a-divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.handleLock(n)}}},[t._v(t._s(0==n.state?"冻结":"解冻"))]),e("a-divider",{attrs:{type:"vertical"}}),e("a-dropdown",[e("a",{staticClass:"ant-dropdown-link"},[t._v("更多 "),e("a-icon",{attrs:{type:"down"}})],1),e("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[e("a-menu-item",[e("a-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(){return t.handleDelete(n.id)}}},[e("a",[t._v("删除")])])],1)],1)],1)],1)}}])})],1),e("AddCourseModal",{ref:"modalForm",on:{ok:t.modalFormOk}})],1)},a=[],i=(r("6eb7"),r("ac0d")),o=r("b65a"),s=r("e6cc"),l=r("0fea");function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(I){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof f?e:f,i=Object.create(a.prototype),o=new S(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return L()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=C(o,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=d(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,o),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(I){return{type:"throw",arg:I}}}t.wrap=l;var p={};function f(){}function h(){}function m(){}var v={};s(v,a,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(j([])));g&&g!==e&&r.call(g,a)&&(v=g);var b=m.prototype=f.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==c(p)&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(p).then((function(t){u.value=t,o(u)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var a;this._invoke=function(t,r){function i(){return new e((function(e,a){n(t,r,e,a)}))}return a=a?a.then(i,i):i()}}function C(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=d(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var a=n.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function j(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return h.prototype=m,s(b,"constructor",m),s(m,"constructor",h),h.displayName=s(m,o,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,o,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),s(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new x(l(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(b),s(b,o,"Generator"),s(b,a,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return o.type="throw",o.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;_(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function d(t,e,r,n,a,i,o){try{var s=t[i](o),l=s.value}catch(c){return void r(c)}s.done?e(l):Promise.resolve(l).then(n,a)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function o(t){d(i,n,a,o,s,"next",t)}function s(t){d(i,n,a,o,s,"throw",t)}o(void 0)}))}}var f={name:"UserList",mixins:[o["a"],i["b"]],components:{AddCourseModal:s["default"]},data:function(){return{description:"科目列表",columns:[{title:"#ID",align:"center",dataIndex:"id"},{title:"训练名字",align:"center",dataIndex:"title"},{title:"科目名称",align:"center",dataIndex:"subject"},{title:"添加时间",align:"center",width:100,dataIndex:"add_time"},{title:"状态",align:"center",width:100,dataIndex:"state",customRender:function(t,e,r){return 0==e.state?"正常":"冻结"}},{title:"操作",dataIndex:"action",align:"center",width:147,scopedSlots:{customRender:"action"}}],url:{list:"/admin/course/list",delete:"/admin/course/delete",exportXlsUrl:"/admin/course/exportXls"},dictOptions:{}}},computed:{importExcelUrl:function(){return"".concat(window._CONFIG["domianURL"],"/").concat(this.url.importExcelUrl)}},methods:{initDictConfig:function(){},handleLock:function(){var t=p(u().mark((function t(e){var r;return u().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=3,Object(l["j"])("/admin/course/lock",{state:e.state,id:e.id});case 3:r=t.sent,r.success?(this.$message.success(r.message),e.state=r.result.state):this.$message.error(r.message);case 5:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}},h=f,m=(r("308e"),r("2877")),v=Object(m["a"])(h,n,a,!1,null,"43fc6958",null);e["default"]=v.exports},"308e":function(t,e,r){"use strict";r("45bd")},"45bd":function(t,e,r){},"52be":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"miss-wraper"},[e("div",{staticClass:"row"},[e("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:t.add}},[t._v("添加标准")])],1),e("a-row",{attrs:{gutter:24}},t._l(t.specs,(function(r,n){return e("a-col",{key:n,staticClass:"item",attrs:{span:11}},[e("a-input",{attrs:{"addon-before":"标准:"},model:{value:r.key,callback:function(e){t.$set(r,"key",e)},expression:"item.key"}}),e("a-input",{attrs:{"addon-before":"参考:"},model:{value:r.val,callback:function(e){t.$set(r,"val",e)},expression:"item.val"}}),e("a-icon",{staticClass:"close",attrs:{type:"close"},on:{click:function(e){return t.delItem(n)}}})],1)})),1)],1)},a=[],i={props:{value:{type:Array,default:function(){return[]},required:!1}},watch:{value:function(t){t&&t instanceof Array&&(this.specs=t)}},data:function(){return{specs:[{key:"任务时长",val:"30分钟"}]}},methods:{add:function(){this.specs.push({key:"任务时长",val:"30分钟"}),this.$emit("change",this.specs)},delItem:function(t){this.specs.splice(t,1),this.$emit("change",this.specs)}}},o=i,s=(r("a716"),r("2877")),l=Object(s["a"])(o,n,a,!1,null,"13bee551",null);e["default"]=l.exports},"6eb1":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t._self._c;return e("a-select",{attrs:{getPopupContainer:function(t){return t.parentNode},allowClear:""},on:{change:t.onChange},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}},t._l(t.options,(function(r){return e("a-select-option",{key:r,attrs:{value:r}},[e("span",{staticStyle:{display:"inline-block",width:"100%"},attrs:{title:r}},[t._v("\n "+t._s(r)+"\n ")])])})),1)},a=[],i=r("b441"),o={props:{value:{type:String,default:"",required:!1}},watch:{value:function(t){this.val=t}},data:function(){return{val:"",options:i["a"].Subjects}},methods:{onChange:function(){this.$emit("change",this.val)}}},s=o,l=r("2877"),c=Object(l["a"])(s,n,a,!1,null,null,null);e["default"]=c.exports},"6eb7":function(t,e,r){},a716:function(t,e,r){"use strict";r("2c87")},e610:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t._self._c;return e("a-upload",{attrs:{name:"file",listType:"picture-card",multiple:t.isMultiple,action:t.uploadAction,headers:t.headers,data:{biz:t.bizPath},fileList:t.fileList,beforeUpload:t.beforeUpload,disabled:t.disabled,isMultiple:t.isMultiple,showUploadList:t.isMultiple},on:{change:t.handleChange,preview:t.handlePreview}},[!t.isMultiple&&t.picUrl?e("img",{staticStyle:{height:"104px","max-width":"300px"},attrs:{src:t.getAvatarView()}}):e("div",[e("a-icon",{attrs:{type:t.uploadLoading?"loading":"plus"}}),e("div",{staticClass:"ant-upload-text"},[t._v(t._s(t.text))])],1),e("a-modal",{attrs:{visible:t.previewVisible,footer:null},on:{cancel:function(e){return t.handleCancel()}}},[e("img",{staticStyle:{width:"100%"},attrs:{alt:"example",src:t.previewImage}})])],1)},a=[],i=r("2b0e"),o=r("9fb0"),s=r("0fea"),l=function(){return"-"+parseInt(1e4*Math.random()+1,10)},c=function(t){if(t.lastIndexOf("\\")>=0){var e=new RegExp("\\\\","g");t=t.replace(e,"/")}return t.substring(t.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(t){t instanceof Array?this.initFileList(t.join(",")):this.initFileList(t)}},created:function(){var t=i["default"].ls.get(o["a"]);this.headers={"X-Access-Token":t}},methods:{initFileList:function(t){if(t&&0!=t.length){this.picUrl=!0;for(var e=[],r=t.split(","),n=0;n<r.length;n++){var a=Object(s["e"])(r[n]);e.push({uid:l(),name:c(r[n]),status:"done",url:a,response:{status:"history",message:r[n]}})}this.fileList=e}else this.fileList=[]},beforeUpload:function(t){var e=t.type;if(e.indexOf("image")<0)return this.$message.warning("请上传图片"),!1},handleChange:function(t){this.picUrl=!1;var e=t.fileList;"done"===t.file.status?t.file.response.success&&(this.picUrl=!0,e=e.map((function(t){return t.response&&(t.url=t.response.message),t}))):"error"===t.file.status?this.$message.error("".concat(t.file.name," 上传失败.")):"removed"===t.file.status&&this.handleDelete(t.file),this.fileList=e,"done"!==t.file.status&&"removed"!==t.file.status||this.handlePathChange()},handlePreview:function(t){this.previewImage=t.url||t.thumbUrl,this.previewVisible=!0},getAvatarView:function(){if(this.fileList.length>0){var t=this.fileList[0].url;return Object(s["e"])(t)}},handlePathChange:function(){var t=this.fileList,e="";t&&0!=t.length||(e="");var r=[];if(this.isMultiple)for(var n=0;n<t.length;n++)r.push(t[n].response.message);else r.push(t[t.length-1].response.message);r.length>0&&(e=r.join(",")),this.$emit("change",e)},handleDelete:function(t){},handleCancel:function(){this.close(),this.previewVisible=!1},close:function(){}},model:{prop:"value",event:"change"}},d=u,p=r("2877"),f=Object(p["a"])(d,n,a,!1,null,"244aa1d3",null);e["default"]=f.exports},e6cc:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t._self._c;return e("div",[e("j-modal",{attrs:{title:t.title,width:t.width,visible:t.visible,confirmLoading:t.confirmLoading,switchFullscreen:"",cancelText:"关闭"},on:{ok:t.handleOk,cancel:t.handleCancel}},[e("a-spin",{attrs:{spinning:t.confirmLoading}},[e("a-form",{attrs:{form:t.form}},[e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{span:12}},[e("a-form-item",{attrs:{label:"训练名字",labelCol:t.labelCol,wrapperCol:t.wrapperRowCol}},[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title"],expression:"['title']"}],attrs:{placeholder:"训练名字"}})],1)],1),e("a-col",{attrs:{span:12}},[e("a-form-item",{attrs:{label:"科目名字",labelCol:t.labelCol,wrapperCol:t.wrapperRowCol}},[e("courseType",{directives:[{name:"decorator",rawName:"v-decorator",value:["subject",{initialValue:""}],expression:"['subject', {initialValue:''}]"}],attrs:{placeholder:"科目名字"},on:{change:t.subjectChange}})],1)],1)],1),e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{span:12}},[e("a-form-item",{attrs:{label:"训练地图",labelCol:t.labelCol,wrapperCol:t.wrapperRowCol}},[e("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["sceneId"],expression:"['sceneId']"}]},t._l(t.validMaps,(function(r){return e("a-select-option",{key:r.index,attrs:{value:r.index}},[e("span",{staticStyle:{display:"inline-block",width:"100%"}},[t._v("\n "+t._s(r.name)+"\n ")])])})),1)],1)],1),e("a-col",{attrs:{span:12}},[e("a-form-item",{attrs:{label:"初始天气",labelCol:t.labelCol,wrapperCol:t.wrapperRowCol}},[e("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["weather"],expression:"['weather']"}]},t._l(t.Weathers,(function(r,n){return e("a-select-option",{key:r,attrs:{value:n}},[e("span",{staticStyle:{display:"inline-block",width:"100%"}},[t._v("\n "+t._s(r)+"\n ")])])})),1)],1)],1)],1),e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{span:12}},[e("a-form-item",{attrs:{label:"初始时间",labelCol:t.labelCol,wrapperCol:t.wrapperRowCol}},[e("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["time"],expression:"['time']"}]},[e("a-select-option",{attrs:{value:14}},[e("span",{staticStyle:{display:"inline-block",width:"100%"}},[t._v("\n 白天\n ")])]),e("a-select-option",{attrs:{value:21}},[e("span",{staticStyle:{display:"inline-block",width:"100%"}},[t._v("\n 黑夜\n ")])])],1)],1)],1)],1),e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{span:24}},[e("a-form-item",{attrs:{label:"任务标准",labelCol:t.labelCol2,wrapperCol:t.wrapperRowCol2}},[e("missSpec",{directives:[{name:"decorator",rawName:"v-decorator",value:["objective",{initialValue:[]}],expression:"['objective', {initialValue:[]}]"}]})],1)],1)],1),e("a-row",{attrs:{gutter:24}},[e("a-col",{attrs:{span:24}},[e("a-form-item",{attrs:{label:"编队编组",labelCol:t.labelCol2,wrapperCol:t.wrapperRowCol2}},[e("group",{directives:[{name:"decorator",rawName:"v-decorator",value:["role",{initialValue:[]}],expression:"['role', {initialValue:[]}]"}],attrs:{disabled:""}})],1)],1)],1)],1)],1)],1)],1)},a=[],i=r("0fea"),o=r("88bc"),s=r.n(o),l=(r("ca00"),r("e610")),c=r("a726"),u=r("56d7d"),d=r("6eb1"),p=r("52be"),f=r("b441");function h(t){return g(t)||y(t)||v(t)||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(t,e){if(t){if("string"===typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function y(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function g(t){if(Array.isArray(t))return b(t)}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var w={name:"UserModal",components:{JImageUpload:l["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(t,e){return{name:t,index:e}})),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 t=this.currentSubjectIndex;if(-1==t)return this.maps;var e=f["a"].Subject2Map[t];if(void 0==e||-1==e)return this.maps;var r=[];return r=Array.isArray(e)?h(e):[e],r.map((function(t){return{name:f["a"].Maps[t],index:t}}))}},methods:{subjectChange:function(t){var e=f["a"].Subjects.indexOf(t);this.currentSubjectIndex=e;var r=f["a"].Subject2Map[e];void 0!=r&&-1!=r&&(Array.isArray(r)&&(r=r[0]),this.form.setFieldsValue({sceneId:r}))},add:function(){this.currentSubjectIndex=-1,this.edit({config:"{}"})},edit:function(t){var e=this;this.form.resetFields(),this.model=Object.assign({},t);var r=JSON.parse(t.config);this.model.objective=r.objective?r.objective:[],this.model.role=r.role?r.role:[],this.model.sceneId=r.scene?r.scene.id:"",this.model.time=r.scene?parseInt(r.scene.time):"",this.model.weather=r.scene?r.scene.weather:"",this.currentSubjectIndex=-1,this.model.sceneId&&this.subjectChange(f["a"].Maps[parseInt(this.model.sceneId)]),this.visible=!0,this.$nextTick((function(){e.form.setFieldsValue(s()(e.model,"title","subject","role","objective","sceneId","time","weather"))}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var t=this,e=this;this.form.validateFields((function(r,n){if(!r){var a="",o="";t.model.id?(a+=t.url.edit,o="put"):(a+=t.url.add,o="post");var s={objective:n.objective,role:n.role,scene:{id:n.sceneId,time:n.time,weather:n.weather}},l={config:JSON.stringify(s),title:n.title,subject:n.subject};t.model.id&&(l.id=t.model.id),Object(i["i"])(a,l,o).then((function(t){t.success?(e.$message.success(t.message),e.$emit("ok")):e.$message.warning(t.message)})).finally((function(){e.confirmLoading=!1,e.close()}))}}))},handleCancel:function(){this.close()},popupCallback:function(t){}}},x=w,C=r("2877"),k=Object(C["a"])(x,n,a,!1,null,null,null);e["default"]=k.exports}}]);
|