1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4683994e","chunk-2d0df437"],{"88bc":function(e,t,i){(function(t){var i=1/0,a=9007199254740991,n="[object Arguments]",r="[object Function]",l="[object GeneratorFunction]",s="[object Symbol]",o="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=o||u||Function("return this")();function d(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}function p(e,t){var i=-1,a=e?e.length:0,n=Array(a);while(++i<a)n[i]=t(e[i],i,e);return n}function f(e,t){var i=-1,a=t.length,n=e.length;while(++i<a)e[n+i]=t[i];return e}var h=Object.prototype,m=h.hasOwnProperty,v=h.toString,g=c.Symbol,b=h.propertyIsEnumerable,w=g?g.isConcatSpreadable:void 0,y=Math.max;function C(e,t,i,a,n){var r=-1,l=e.length;i||(i=O),n||(n=[]);while(++r<l){var s=e[r];t>0&&i(s)?t>1?C(s,t-1,i,a,n):f(n,s):a||(n[n.length]=s)}return n}function j(e,t){return e=Object(e),L(e,t,(function(t,i){return i in e}))}function L(e,t,i){var a=-1,n=t.length,r={};while(++a<n){var l=t[a],s=e[l];i(s,l)&&(r[l]=s)}return r}function x(e,t){return t=y(void 0===t?e.length-1:t,0),function(){var i=arguments,a=-1,n=y(i.length-t,0),r=Array(n);while(++a<n)r[a]=i[t+a];a=-1;var l=Array(t+1);while(++a<t)l[a]=i[a];return l[t]=r,d(e,this,l)}}function O(e){return F(e)||k(e)||!!(w&&e&&e[w])}function A(e){if("string"==typeof e||_(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}function k(e){return M(e)&&m.call(e,"callee")&&(!b.call(e,"callee")||v.call(e)==n)}var F=Array.isArray;function U(e){return null!=e&&N(e.length)&&!I(e)}function M(e){return $(e)&&U(e)}function I(e){var t=S(e)?v.call(e):"";return t==r||t==l}function N(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function S(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $(e){return!!e&&"object"==typeof e}function _(e){return"symbol"==typeof e||$(e)&&v.call(e)==s}var V=x((function(e,t){return null==e?{}:j(e,p(C(t,1),A))}));e.exports=V}).call(this,i("c8ba"))},"8faa":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e._self._c;return 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-form-item",{attrs:{label:"景点名字",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("j-popup",{directives:[{name:"decorator",rawName:"v-decorator",value:["spotName"],expression:"['spotName']"}],attrs:{"trigger-change":!0,"org-fields":"id,name,avatar,country_name","dest-fields":"id,spotName,spotAvatar,spotCountry",code:"tourism_spots"},on:{callback:e.popupCallback}})],1),t("a-form-item",{attrs:{label:"景点封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("j-image-upload",{directives:[{name:"decorator",rawName:"v-decorator",value:["spotAvatar"],expression:"['spotAvatar']"}],attrs:{isMultiple:""}})],1),t("a-form-item",{attrs:{label:"景点国家",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["spotCountry"],expression:"['spotCountry']"}],attrs:{placeholder:"请输入景点国家"}})],1)],1)],1)],1)},n=[],r=i("0fea"),l=i("88bc"),s=i.n(l),o=(i("ca00"),i("e610")),u={name:"TourismHotspotsModal",components:{JImageUpload:o["default"]},data:function(){return{form:this.$form.createForm(this),title:"操作",width:800,visible:!1,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,validatorRules:{},url:{add:"/tourism/tourismHotspots/add",edit:"/tourism/tourismHotspots/edit"}}},created:function(){},methods:{add:function(){this.edit()},edit:function(e){var t=this;this.adding=null==e,this.form.resetFields(),this.model=Object.assign({},e),this.visible=!0,this.$nextTick((function(){t.form.setFieldsValue(s()(t.model,"spotName","spotAvatar","spotCountry"))}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this;this.form.validateFields((function(t,i){if(!t){e.confirmLoading=!0;var a="",n="";e.adding?(a+=e.url.add,n="post"):(a+=e.url.edit,n="put");var l=Object.assign(e.model,i);Object(r["i"])(a,l,n).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(e){this.adding&&(this.model.id=e.id),this.form.setFieldsValue(s()(e,"spotName","spotAvatar","spotCountry"))}}},c=u,d=i("2877"),p=Object(d["a"])(c,a,n,!1,null,null,null);t["default"]=p.exports},e610:function(e,t,i){"use strict";i.r(t);var a=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)},n=[],r=i("2b0e"),l=i("9fb0"),s=i("0fea"),o=function(){return"-"+parseInt(1e4*Math.random()+1,10)},u=function(e){if(e.lastIndexOf("\\")>=0){var t=new RegExp("\\\\","g");e=e.replace(t,"/")}return e.substring(e.lastIndexOf("/")+1)},c={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=r["default"].ls.get(l["a"]);this.headers={"X-Access-Token":e}},methods:{initFileList:function(e){if(e&&0!=e.length){this.picUrl=!0;for(var t=[],i=e.split(","),a=0;a<i.length;a++){var n=Object(s["e"])(i[a]);t.push({uid:o(),name:u(i[a]),status:"done",url:n,response:{status:"history",message:i[a]}})}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(s["e"])(e)}},handlePathChange:function(){var e=this.fileList,t="";e&&0!=e.length||(t="");var i=[];if(this.isMultiple)for(var a=0;a<e.length;a++)i.push(e[a].response.message);else i.push(e[e.length-1].response.message);i.length>0&&(t=i.join(",")),this.$emit("change",t)},handleDelete:function(e){},handleCancel:function(){this.close(),this.previewVisible=!1},close:function(){}},model:{prop:"value",event:"change"}},d=c,p=i("2877"),f=Object(p["a"])(d,a,n,!1,null,"244aa1d3",null);t["default"]=f.exports}}]);
|