forked from golang/hotime
1 line
35 KiB
JavaScript
1 line
35 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-1a458102"],{"016e":function(e,t,a){"use strict";a("ad3a")},"0331":function(e,t,a){"use strict";a("7ec1")},"0cb2":function(e,t,a){var n=a("7b0b"),b=Math.floor,l="".replace,_=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,m=/\$([$&'`]|\d{1,2})/g;e.exports=function(r,o,i,c,u,e){var s=i+r.length,d=c.length,t=m;return void 0!==u&&(u=n(u),t=_),l.call(e,t,function(e,t){var a;switch(t.charAt(0)){case"$":return"$";case"&":return r;case"`":return o.slice(0,i);case"'":return o.slice(s);case"<":a=u[t.slice(1,-1)];break;default:var n,l=+t;if(0==l)return e;if(d<l)return 0!==(n=b(l/10))&&n<=d?void 0===c[n-1]?t.charAt(1):c[n-1]+t.charAt(1):e;a=c[l-1]}return void 0===a?"":a})}},"31a1":function(module,__webpack_exports__,__webpack_require__){"use strict";var D_work_iedc_web_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("b85c"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_string_link_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("9911"),core_js_modules_es_string_link_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_string_link_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7__),_api_common_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("2934"),moment__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("c1df"),moment__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_9__),_bus_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("83c5");__webpack_exports__.a={props:{routerPath:String,routerId:Number,editDialogPath:String},components:{},data:function(){return{templateData:{},form:{},authList:[],HotimeDataTree:[],defaultProps:{children:"children",label:"label",disabled:"disabled"},formAuth:{},expandedKeys:[],checkedKeys:[],showDialog:!1,dialogData:null,dialogTitle:"",mapShow:!1,map_id:"allmap_"+(new Date).getTime()}},methods:{clickEdit:function(e,t){e=e.replace("/info",""),null!=this.routerPath&&0<this.routerPath.length?_bus_js__WEBPACK_IMPORTED_MODULE_10__.a.$emit("tabs",{name:"Edit",path:e+"/edit",id:t}):null!=this.editDialogPath?_bus_js__WEBPACK_IMPORTED_MODULE_10__.a.$emit("tabs-edit",{name:"Edit",path:e+"/edit",id:t}):this.$router.push({path:e+"/edit",query:{id:t}})},clickLink:function(e,t){t={name:"Info",path:window.Hotime.tableMapData[e].path+"/info",id:t,title:window.Hotime.tableMapData[e].parent.label+"-"+window.Hotime.tableMapData[e].label};null!=this.editDialogPath?_bus_js__WEBPACK_IMPORTED_MODULE_10__.a.$emit("tabs-edit",t):_bus_js__WEBPACK_IMPORTED_MODULE_10__.a.$emit("tabs",t)},onSubmit:function(){},routeInit:function routeInit(){var that=this,Hotime=window.Hotime,templateData,id,id=null!=Hotime.mapData[this.routerPath]?(templateData=Hotime.mapData[this.routerPath],this.routerId):(templateData=Hotime.mapData[this.$route.path.substring(0,this.$route.path.lastIndexOf("/info"))],this.$route.query.id);if(null!=templateData){if(null!=templateData.columns){var _iterator=Object(D_work_iedc_web_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0__.a)(templateData.columns),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var item=_step.value;null==item.value&&(item.value=item.name)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}Object(_api_common_js__WEBPACK_IMPORTED_MODULE_8__.f)(Hotime.data.name+"/"+templateData.name+"/"+id).then(function(data){if(null!=templateData.columns){var _iterator2=Object(D_work_iedc_web_node_modules_babel_runtime_helpers_esm_createForOfIteratorHelper__WEBPACK_IMPORTED_MODULE_0__.a)(templateData.columns),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _item=_step2.value;if(null!=_item.link)try{data.result[_item.value]=eval("data.result."+_item.value)}catch(e){}else"unixtTime"==_item.type?data.result[_item.value]=moment__WEBPACK_IMPORTED_MODULE_9___default()(1e3*data.result[_item.value]).utc().format("YYYY-MM-DD HH:mm:ss"):"lng"!=_item.name&&"lat"!=_item.name||(that.mapShow=!0,that.getMap(data.result.lng,data.result.lat))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}var arr,arr_1;that.form=data.result,that.templateData=templateData,that.form.auth&&(arr=that.getHotimeDataTree(Hotime.data.menus,""),that.HotimeDataTree=arr,that.formAuth=JSON.parse(that.form.auth),arr_1=[],arr_1.push(that.templateData.name),that.expandedKeys=arr_1,setTimeout(function(){that.changeCss()},20))})}},getHotimeDataTree:function(e,t){var a,n=[];for(a in e){var l,r=e[a];"Home"!=r.name&&(r.menus?r.children=this.getHotimeDataTree(r.menus,r.name):(r.parent_name=t,l=JSON.parse(this.form.auth)[r.name]||[],r.children=l.filter(function(e){return"show"!=e}).map(function(e){return{label:window.Hotime.data.labelConfig[e],name:r.name+"_"+e,label_1:e,parent_name:r.name,checked:!1}})),r.children.length&&n.push(r))}return n},renderContent:function(e,t){var t=t.node,a="";return e("div",{class:a=3===t.level?"foo":a},t.label)},changeCss:function(){for(var e=document.getElementsByClassName("foo"),t=0;t<e.length;t++)e[t].parentNode.style.cssFloat="left",e[t].parentNode.style.styleFloat="left",e[t].parentNode.onmouseover=function(){this.style.backgroundColor="#fff"}},handleExpand:function(){var e=this;setTimeout(function(){e.changeCss()},1)},clickJson:function(e,t){this.dialogTitle=e,this.dialogData=JSON.parse(t),this.showDialog=!0},closeDialog:function(){this.showDialog=!1,this.dialogTitle="",this.dialogData=null},getMap:function(e,t){var a=new window.BMap.Map(this.map_id),n=new window.BMap.Point(e,t),e=(a.centerAndZoom(n,18),new window.BMap.Marker(n)),l=(a.addOverlay(e),a.enableScrollWheelZoom(!0),setTimeout(function(){a.setCenter(n)},100),{width:200,height:0}),r=new window.BMap.Geocoder;e.addEventListener("click",function(){r.getLocation(n,function(e){e&&(e=e.address,e=new window.BMap.InfoWindow(e,l),a.openInfoWindow(e,n))})})}},watch:{},mounted:function(){this.routeInit()}}},"3a3a":function(e,t,a){},5319:function(e,t,a){"use strict";var n=a("d784"),l=a("d039"),v=a("825a"),w=a("a691"),g=a("50c4"),D=a("577e"),r=a("1d80"),L=a("8aa5"),E=a("0cb2"),x=a("14c3"),o=a("b622")("replace"),M=Math.max,P=Math.min,a="$0"==="a".replace(/./,"$0"),i=!!/./[o]&&""===/./[o]("a","$0");n("replace",function(e,j,k){var y=i?"$":"$0";return[function(e,t){var a=r(this),n=null==e?void 0:e[o];return void 0!==n?n.call(e,a,t):j.call(D(a),e,t)},function(e,t){var a=v(this),n=D(e);if("string"==typeof t&&-1===t.indexOf(y)&&-1===t.indexOf("$<")){e=k(j,a,n,t);if(e.done)return e.value}for(var l,r="function"==typeof t,o=(r||(t=D(t)),a.global),i=(o&&(l=a.unicode,a.lastIndex=0),[]);null!==(b=x(a,n))&&(i.push(b),o);)""===D(b[0])&&(a.lastIndex=L(n,g(a.lastIndex),l));for(var c,u="",s=0,d=0;d<i.length;d++){for(var b=i[d],_=D(b[0]),m=M(P(w(b.index),n.length),0),f=[],p=1;p<b.length;p++)f.push(void 0===(c=b[p])?c:String(c));var h=b.groups,O=r?(O=[_].concat(f,m,n),void 0!==h&&O.push(h),D(t.apply(void 0,O))):E(_,n,m,f,h,t);s<=m&&(u+=n.slice(s,m)+O,s=m+_.length)}return u+n.slice(s)}]},!!l(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!a||i)},"72b5":function(e,t,a){"use strict";a("3a3a")},"7ec1":function(e,t,a){},8625:function(e,t,a){},8668:function(e,t,a){"use strict";a("8625")},"8aa5":function(e,t,a){"use strict";var n=a("6547").charAt;e.exports=function(e,t,a){return t+(a?n(e,t).length:1)}},"8f33":function(e,t,a){"use strict";a("9911"),a("b0c0"),a("b64b");var f=a("f2bf"),p={class:"info-descriptions",style:{display:"flex","flex-direction":"column",background:"#f0f0f0",padding:"20px"}},h=Object(f.r)("查看>>"),O={key:1},j=Object(f.r)("编辑"),k={key:0,style:{}},y={style:{display:"block",height:"auto","overflow-x":"hidden"}},v=["innerHTML"],w={key:0,style:{display:"flex","flex-direction":"row",margin:"20px 0"}},g={style:{width:"130px",display:"inline-block","margin-right":"10px","text-align":"center"}},D={style:{display:"inline-block",flex:"1"}},L={class:"custom-tree-node"},E={style:{background:"rgb(240, 240, 240)"}},x=["id"],M={key:0,class:"dialog-box"},P={key:0},T={key:1};var n=a("31a1"),l=(a("0331"),a("016e"),a("6b0d")),a=a.n(l)()(n.a,[["render",function(t,e,a,n,l,r){var o=Object(f.U)("el-link"),i=Object(f.U)("el-descriptions-item"),c=Object(f.U)("el-image"),u=Object(f.U)("el-button"),s=Object(f.U)("el-descriptions"),d=Object(f.U)("el-tree"),b=Object(f.U)("el-table-column"),_=Object(f.U)("el-table"),m=Object(f.U)("el-dialog");return Object(f.L)(),Object(f.n)(f.b,null,[Object(f.o)("div",p,[Object(f.s)(s,{border:""},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(l.templateData.columns,function(t){return Object(f.L)(),Object(f.n)(f.b,{key:t.type},[null!=t.link?(Object(f.L)(),Object(f.n)(f.b,{key:0},[0!=t.info?(Object(f.L)(),Object(f.l)(i,{key:0,label:t.label+":"},{default:Object(f.kb)(function(){return[""!=l.form[t.link]&&null!=l.form[t.link]?(Object(f.L)(),Object(f.l)(o,{key:0,icon:"el-icon-link",href:"javascript:;",onClick:function(e){return r.clickLink(t.link,l.form[t.name])}},{default:Object(f.kb)(function(){return[Object(f.r)(Object(f.Y)(l.form[t.link]&&l.form[t.link][t.value]?l.form[t.link][t.value]:"无"),1)]}),_:2},1032,["onClick"])):Object(f.m)("",!0)]}),_:2},1032,["label"])):Object(f.m)("",!0)],64)):"textArea"==t.type?(Object(f.L)(),Object(f.n)(f.b,{key:1},[],64)):null==t.link?(Object(f.L)(),Object(f.n)(f.b,{key:2},[null==t.options&&0!=t.info&&"form"!==t.type&&"auth"!==t.type?(Object(f.L)(),Object(f.l)(i,{key:0,label:t.label+":"},{default:Object(f.kb)(function(){return["json"==t.type?(Object(f.L)(),Object(f.n)(f.b,{key:0},[Object.keys(JSON.parse(l.form[t.value])).length?(Object(f.L)(),Object(f.l)(o,{key:0,href:"javascript:;",onClick:function(e){return r.clickJson(t.label,l.form[t.value])},style:{"font-size":"12px"}},{default:Object(f.kb)(function(){return[h]}),_:2},1032,["onClick"])):(Object(f.L)(),Object(f.n)("span",O,"无"))],64)):"image"==t.type?(Object(f.L)(),Object(f.l)(c,{key:1,style:{width:"50px",height:"50px"},src:l.form[t.value],"preview-src-list":[l.form[t.value]]},null,8,["src","preview-src-list"])):"file"==t.type?(Object(f.L)(),Object(f.n)(f.b,{key:2},[l.form[t.value]?(Object(f.L)(),Object(f.l)(o,{key:0,target:"_blank",href:l.form[t.value]},{default:Object(f.kb)(function(){return[Object(f.r)(Object(f.Y)(l.form[t.value]),1)]}),_:2},1032,["href"])):Object(f.m)("",!0)],64)):"image"!=t.type&&"file"!=t.type&&"form"!==t.type?(Object(f.L)(),Object(f.n)(f.b,{key:3},[Object(f.r)(Object(f.Y)(l.form[t.value])+" ",1),"id"==t.name?(Object(f.L)(),Object(f.l)(u,{key:0,onClick:e[0]||(e[0]=function(e){return r.clickEdit(l.templateData.path,l.form.id)})},{default:Object(f.kb)(function(){return[j]}),_:1})):Object(f.m)("",!0)],64)):Object(f.m)("",!0)]}),_:2},1032,["label"])):Object(f.m)("",!0),null!=t.options&&0!=t.info?(Object(f.L)(),Object(f.l)(i,{key:1,label:t.label+":"},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(t.options,function(e){return Object(f.L)(),Object(f.n)(f.b,{key:e.name},[l.form[t.value]==e.value+""?(Object(f.L)(),Object(f.n)("span",k,Object(f.Y)(e.name),1)):Object(f.m)("",!0)],64)}),128))]}),_:2},1032,["label"])):Object(f.m)("",!0)],64)):Object(f.m)("",!0)],64)}),128))]}),_:1}),Object(f.s)(s,{column:"1"},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(l.templateData.columns,function(e){return Object(f.L)(),Object(f.n)(f.b,{key:e.type},["textArea"==e.type?(Object(f.L)(),Object(f.l)(i,{key:0,label:" "+e.label+":",style:{margin:"40px"}},{default:Object(f.kb)(function(){return[Object(f.o)("template",y,[l.form[e.value]?(Object(f.L)(),Object(f.n)("div",{key:0,class:"textarea-box",style:{width:"auto",height:"auto",background:"#fff",padding:"20px","overflow-x":"scroll"},innerHTML:l.form[e.value]},null,8,v)):Object(f.m)("",!0)])]}),_:2},1032,["label"])):Object(f.m)("",!0)],64)}),128))]}),_:1})]),(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(l.templateData.columns,function(e){return Object(f.L)(),Object(f.n)("div",{key:e.type},["auth"==e.type?(Object(f.L)(),Object(f.n)("div",w,[Object(f.o)("div",g,Object(f.Y)(e.label+":"),1),Object(f.o)("div",D,[Object(f.s)(d,{class:"tree-line",indent:0,data:l.HotimeDataTree,props:l.defaultProps,"node-key":"name","default-expanded-keys":l.expandedKeys,"default-checked-keys":l.checkedKeys,onCheck:t.checkChange,"render-content":r.renderContent,onNodeExpand:r.handleExpand,"default-expand-all":!0},{default:Object(f.kb)(function(e){e=e.node;return[Object(f.o)("span",L,[Object(f.o)("div",null,Object(f.Y)(e.label),1)])]}),_:1},8,["data","props","default-expanded-keys","default-checked-keys","onCheck","render-content","onNodeExpand"])])])):Object(f.m)("",!0)])}),128)),Object(f.o)("div",E,[Object(f.lb)(Object(f.o)("div",{id:l.map_id,style:{width:"94%",height:"50vh","min-height":"600px"}},null,8,x),[[f.hb,l.mapShow]])]),l.showDialog?(Object(f.L)(),Object(f.n)("div",M,[Object(f.s)(m,{title:l.dialogTitle,modelValue:l.showDialog,"onUpdate:modelValue":e[1]||(e[1]=function(e){return l.showDialog=e}),"destroy-on-close":"",onClose:r.closeDialog,width:"70%","lock-scroll":""},{default:Object(f.kb)(function(){return[l.dialogData.constructor==Object?(Object(f.L)(!0),Object(f.n)(f.b,{key:0},Object(f.S)(l.dialogData,function(e,t){return Object(f.L)(),Object(f.l)(s,{key:t,title:t,column:"4"},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(e,function(e,t){return Object(f.L)(),Object(f.l)(i,{key:t,label:l.templateData.Auth[t]+":",style:{padding:"20px"}},{default:Object(f.kb)(function(){return[Object(f.r)(Object(f.Y)(e),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["title"])}),128)):Object(f.m)("",!0),l.dialogData.constructor==Array?(Object(f.L)(),Object(f.l)(_,{key:1,data:l.dialogData,stripe:"",fit:"",border:"",size:"mini"},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(l.dialogData[0],function(e,a){return Object(f.L)(),Object(f.n)(f.b,{key:a},[e&&e.constructor==Object?(Object(f.L)(),Object(f.l)(b,{key:0,label:a,align:"center"},{default:Object(f.kb)(function(){return[(Object(f.L)(!0),Object(f.n)(f.b,null,Object(f.S)(e,function(e,t){return Object(f.L)(),Object(f.l)(b,{key:t,label:t,align:"center"},{default:Object(f.kb)(function(e){return[l.templateData.Auth[e.row[a][t]]?(Object(f.L)(),Object(f.n)("span",P,Object(f.Y)(l.templateData.Auth[e.row[a][t]]),1)):(Object(f.L)(),Object(f.n)("span",T,Object(f.Y)(e.row[a][t]),1))]}),_:2},1032,["label"])}),128))]}),_:2},1032,["label"])):(Object(f.L)(),Object(f.l)(b,{key:1,label:a,align:"center"},{default:Object(f.kb)(function(e){return[Object(f.o)("span",null,Object(f.Y)(e.row[a]),1)]}),_:2},1032,["label"]))],64)}),128))]}),_:1},8,["data"])):Object(f.m)("",!0)]}),_:1},8,["title","modelValue","onClose"])])):Object(f.m)("",!0)],64)}],["__scopeId","data-v-4d4566fc"]]);t.a=a},ad3a:function(e,t,a){},b50c:function(e,t,a){"use strict";a.r(t);a("b0c0");var j=a("f2bf");function n(e){return Object(j.O)("data-v-51dbed3c"),e=e(),Object(j.M)(),e}var s=a("b85c"),k=(a("a9e3"),a("159b"),a("4de4"),a("fb6a"),a("ac1f"),a("5319"),a("9911"),Object(j.r)(" 清除 ")),y={style:{position:"relative"}},v=["id"],w=n(function(){return Object(j.o)("div",{style:{position:"absolute",top:"10px",left:"10px","z-index":"2",background:"#fff",padding:"5px 10px"}},[Object(j.o)("div",{id:"r-result"},[Object(j.r)("搜索:"),Object(j.o)("input",{type:"text",id:"suggestId",size:"20",value:"",style:{width:"150px"}})]),Object(j.o)("div",{id:"searchResultPanel",style:{border:"1px solid #C0C0C0",width:"150px",height:"auto",display:"none"}})],-1)}),g=["src"],D={key:1,class:"el-icon-plus avatar-uploader-icon"},L=Object(j.r)("上传文件"),E=["title"],x={key:1,class:"radio-wrap"},M=Object(j.r)("立即修改"),P=Object(j.r)("取消");a("d81d"),a("c740"),a("a434"),a("caad"),a("2532"),a("841c");var l=a("ceb0"),i=a("2934"),d=a("83c5"),l={props:{routerPath:String,routerId:Number},components:{Editor:l.a},data:function(){return{fileName:"",id:null,templateData:{},formLink:{},form:{},shortcuts:[{text:"今天",value:new Date},{text:"昨天",value:((e=new Date).setTime(e.getTime()-864e5),e)},{text:"一周前",value:((e=new Date).setTime(e.getTime()-6048e5),e)}],checkList:[],authList:[],HotimeDataTree:[],defaultProps:{children:"children",label:"label",disabled:"disabled"},formAuth:{},expandedKeys:[],checkedKeys:[],mapShow:!1,mapId:"allmap_"+(new Date).getTime()};var e},methods:{checkSelf:function(e){if(null==this.templateData||null==this.templateData.table||null==window.Hotime.user)return!1;if(this.templateData.table!=window.Hotime.user.table||window.Hotime.user.id!=this.routerId)return!1;if(null!=e.link)for(var t=0;t<window.Hotime.tableMapData[e.link].columns.length;t++)if("parent_id"==window.Hotime.tableMapData[e.link].columns[t].name)return!0;return!1},clickLink:function(t,a){var e={name:"Table",path:window.Hotime.tableMapData[t.link].path,title:window.Hotime.tableMapData[t.link].parent.label+"-"+window.Hotime.tableMapData[t.link].label};null!=this.editDialogPath?d.a.$emit("tabs-edit",e):(d.a.$emit("dialog-edit",e),d.a.$off("table:"+window.Hotime.tableMapData[t.link].path)),d.a.$on("table:"+window.Hotime.tableMapData[t.link].path,function(e){a[t.link]=e,a[t.name]=e.id})},closeDialog:function(){this.showDialog=!1,this.dialogDataPath=null,this.dialogDataId=null,this.dialogDataQuery={}},beforeAvatarUpload:function(e,t){var a=this;return null==e||Object(i.h)(e).then(function(e){a.form[t]=e.result}),!1},close:function(){d.a.$emit("tabs-close",{name:"Edit",path:this.templateData.path,id:this.id})},onSubmit:function(){var t=this,a=this;this.$confirm("此操作将进行修改操作,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var e=window.Hotime;Object(i.c)(e.data.name+"/"+t.templateData.name+"/"+t.id,a.form).then(function(e){0==e.status?(a.$message({type:"success",message:"修改成功!"}),a.close()):a.$message({type:"warn",message:e.error.msg})})})},routeInit:function(){var r=this,o=window.Hotime;if(null!=o.mapData[this.routerPath]?(this.templateData=o.mapData[this.routerPath],this.id=this.routerId):(this.templateData=o.mapData[this.$route.path.substring(0,this.$route.path.lastIndexOf("/edit"))],this.id=this.$route.query.id),null!=this.templateData){if(null!=this.templateData.columns){var e,t=Object(s.a)(this.templateData.columns);try{for(t.s();!(e=t.n()).done;){var a=e.value;null==a.value&&(a.value=a.name)}}catch(e){t.e(e)}finally{t.f()}}Object(i.f)(o.data.name+"/"+this.templateData.name+"/"+this.id).then(function(a){if(null!=r.templateData.columns){var e,t=Object(s.a)(r.templateData.columns);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value;null!=t.link&&Object(i.g)(o.data.name+"/"+t.link,{pageSize:100}).then(function(e){0==e.status&&(r.formLink[t.link]=e.result.data,null!=a.result[t.link]&&r.formLink[t.link].push(a.result[t.link]))}),"lng"!=t.name&&"lat"!=t.name||(r.mapShow=!0,r.getMap(a.result.lng,a.result.lat))}()}catch(e){t.e(e)}finally{t.f()}}for(var n in a.result)a.result[n]instanceof Object?r.form[n]=a.result[n]:r.form[n]=a.result[n]+"";var l=r.getHotimeDataTree(o.data.menus,"");r.HotimeDataTree=l;try{r.formAuth=JSON.parse(r.form.auth)}catch(e){r.formAuth={}}l=[];l.push(r.templateData.name),r.expandedKeys=l,setTimeout(function(){r.changeCss()},20)})}},getHotimeDataTree:function(e,t){var a,n=this,l=[];for(a in e){var r=e[a];"Home"!=r.name&&(r.menus?r.children=this.getHotimeDataTree(r.menus,r.name):(r.parent_name=t,r.disabled=!r.auth.length,r.children=r.auth.filter(function(e){return"show"!=e}).map(function(t){var e={label:window.Hotime.data.labelConfig[t],name:r.name+"_"+t,label_1:t,parent_name:r.name,checked:!1,auth:r.auth},a=[];return-1!=(a=n.form.auth?JSON.parse(n.form.auth)[r.name]||[]:a).findIndex(function(e){return e==t})&&(e.checked=!0,n.checkedKeys.push(e.name)),e})),l.push(Object.assign({},r)))}return l},checkChange:function(t,e){var a,n,l=this.form.auth?JSON.parse(this.form.auth):{};if(t.parent_name&&(-1!=(n=(a=l[t.parent_name]||[]).findIndex(function(e){return e==t.label_1}))?a.splice(n,1):a.push(t.label_1),"tag"!=t.parent_name&&("1"==a.length&&"show"==a[0]?a=[]:-1==a.findIndex(function(e){return"show"==e})&&a.unshift("show")),l[t.parent_name]=a),t.children&&t.children.length)for(var r in this.forAuth(l,t),t.children)t.children[r].children&&t.children[r].children.length&&this.forAuth(l,t.children[r]);this.form.auth=JSON.stringify(l)},forAuth:function(e,t){t.auth=e[t.name]||[];var a=!1;if(t.auth.length){for(var n in t.Auth)t.auth.includes(n)||(a=!0,t.auth.push(n));a||(t.auth=[])}else for(var l in t.Auth)t.Auth[l]&&!t.auth.includes(l)&&t.auth.push(l);e[t.name]=t.auth},renderContent:function(e,t){var t=t.node,a="";return e("div",{class:a=3===t.level?"foo":a},t.label)},changeCss:function(){for(var e=document.getElementsByClassName("foo"),t=0;t<e.length;t++)e[t].parentNode.style.cssFloat="left",e[t].parentNode.style.styleFloat="left",e[t].parentNode.onmouseover=function(){this.style.backgroundColor="#fff"}},handleExpand:function(){var e=this;setTimeout(function(){e.changeCss()},1)},getMap:function(e,t){function a(){c("suggestId").innerHTML="",c("searchResultPanel").innerHTML="",r.clearOverlays();var e=r.pointToOverlayPixel(r.getCenter()),t=r.overlayPixelToPoint({x:e.x,y:e.y});l.form.lng=t.lng,l.form.lat=t.lat,setTimeout(function(){i(t)},30)}var n,l=this,r=new window.BMap.Map(this.mapId),o=new window.BMap.Point(e,t),i=(r.centerAndZoom(o,20),r.enableScrollWheelZoom(!0),function(t){var a,e,n="";n?n.setPosition(t):n=new window.BMap.Marker(t),r.addOverlay(n),a={width:200,height:0,title:"信息窗口"},e=new window.BMap.Geocoder,n.addEventListener("click",function(){e.getLocation(t,function(e){e&&(e=e.address,e=new window.BMap.InfoWindow(e,a),r.openInfoWindow(e,t))})})}),c=(i(o),setTimeout(function(){r.setCenter(o)},100),function(e){return document.getElementById(e)}),e=new window.BMap.Autocomplete({input:"suggestId",location:r}),u=(document.addEventListener&&document.addEventListener("DOMMouseScroll",a,!1),window.onmousewheel=document.onmousewheel=a,r.addEventListener("dragend",a,!1),r.addEventListener("moveend",a,!1),r.addEventListener("zoomend",a,!1),r.addEventListener("resize",a,!1),e.addEventListener("onhighlight",function(e){var t,a=e.fromitem.value,n="";-1<e.fromitem.index&&(n=a.province+a.city+a.district+a.street+a.business),t="FromItem<br />index = "+e.fromitem.index+"<br />value = "+n,n="",-1<e.toitem.index&&(n=(a=e.toitem.value).province+a.city+a.district+a.street+a.business),t+="<br />ToItem<br />index = "+e.toitem.index+"<br />value = "+n,c("searchResultPanel").innerHTML=t}),e.addEventListener("onconfirm",function(e){var t=e.item.value;n=t.province+t.city+t.district+t.street+t.business,c("searchResultPanel").innerHTML="onconfirm<br />index = "+e.item.index+"<br />myValue = "+n,u()}),function(){r.clearOverlays();var t=new window.BMap.LocalSearch(r,{onSearchComplete:function(){var e=t.getResults().getPoi(0).point;r.centerAndZoom(e,20),i(e),l.form.lng=e.lng,l.form.lat=e.lat}});t.search(n)})},clearLink:function(e){this.form[e]=""}},watch:{},mounted:function(){this.routeInit()}},r=(a("8668"),a("72b5"),a("6b0d")),r=a.n(r),l=r()(l,[["render",function(e,t,a,n,l,r){var o=Object(j.U)("el-button"),i=Object(j.U)("el-form-item"),c=Object(j.U)("el-input"),u=Object(j.U)("Editor"),s=Object(j.U)("el-input-number"),d=Object(j.U)("el-date-picker"),b=Object(j.U)("el-upload"),_=Object(j.U)("el-option"),m=Object(j.U)("el-select"),f=Object(j.U)("el-radio"),p=Object(j.U)("el-tree"),h=Object(j.U)("el-affix"),O=Object(j.U)("el-form");return Object(j.L)(),Object(j.l)(O,{ref:"form",model:l.form,"label-width":"180px",style:{"padding-top":"10px","overflow-y":"auto",width:"90%","padding-right":"30px",background:"white",display:"block","flex-direction":"row","flex-wrap":"wrap","align-content":"flex-start","justify-content":"flex-start"}},{default:Object(j.kb)(function(){return[(Object(j.L)(!0),Object(j.n)(j.b,null,Object(j.S)(l.templateData.columns,function(t){return Object(j.L)(),Object(j.n)("div",{key:t.type},[null!=t.link?(Object(j.L)(),Object(j.n)(j.b,{key:0},[0==t.edit||r.checkSelf(t)?Object(j.m)("",!0):(Object(j.L)(),Object(j.l)(i,{key:0,label:t.label+":",required:t.must},{default:Object(j.kb)(function(){return[Object(j.s)(o,{icon:"el-icon-link",href:"javascript:;",onClick:function(e){return r.clickLink(t,l.form)}},{default:Object(j.kb)(function(){return[Object(j.r)(Object(j.Y)(l.form[t.link]&&null!=l.form[t.link][t.value]?l.form[t.link][t.value]:"选择"),1)]}),_:2},1032,["onClick"]),l.form[t.link]?(Object(j.L)(),Object(j.l)(o,{key:0,onClick:function(e){return r.clearLink(t.link)},icon:"el-icon-circle-close"},{default:Object(j.kb)(function(){return[k]}),_:2},1032,["onClick"])):Object(j.m)("",!0)]}),_:2},1032,["label","required"]))],64)):Object(j.m)("",!0),null==t.link?(Object(j.L)(),Object(j.n)(j.b,{key:1},["lng"==t.name?(Object(j.L)(),Object(j.l)(i,{key:0,required:t.must},{default:Object(j.kb)(function(){return[Object(j.lb)(Object(j.o)("div",y,[Object(j.o)("div",{id:l.mapId,style:{width:"400px",height:"300px"}},null,8,v),w],512),[[j.hb,l.mapShow]])]}),_:2},1032,["required"])):Object(j.m)("",!0),0!=t.edit?(Object(j.L)(),Object(j.l)(i,{key:1,label:t.label+":",required:t.must},{default:Object(j.kb)(function(){return[null==t.options?(Object(j.L)(),Object(j.n)(j.b,{key:0},["password"==t.type?(Object(j.L)(),Object(j.l)(c,{key:0,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},"show-password":"",style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):"text"==t.type||"json"==t.type?(Object(j.L)(),Object(j.l)(c,{key:1,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},type:"textarea",style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):"textArea"==t.type?(Object(j.L)(),Object(j.l)(u,{key:2,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},style:{width:"100%","min-width":"800px"}},null,8,["modelValue","onUpdate:modelValue"])):"number"==t.type?(Object(j.L)(),Object(j.l)(s,{key:3,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue"])):"time"==t.type?(Object(j.L)(),Object(j.l)(d,{key:4,"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},align:"right",type:"datetime",placeholder:"选择日期",shortcuts:l.shortcuts,style:{width:"400px"}},null,8,["modelValue","onUpdate:modelValue","shortcuts"])):"unixTime"==t.type?(Object(j.L)(),Object(j.l)(d,{key:5,"value-format":"X",modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},style:{width:"400px"},align:"right",type:"datetime",placeholder:"选择日期","disabled-date":e.disabledDate,shortcuts:l.shortcuts},null,8,["modelValue","onUpdate:modelValue","disabled-date","shortcuts"])):"image"==t.type?(Object(j.L)(),Object(j.l)(b,{key:6,action:"#","show-file-list":!1,"before-upload":function(e){return r.beforeAvatarUpload(e,t.value)}},{default:Object(j.kb)(function(){return[l.form[t.value]?(Object(j.L)(),Object(j.n)("img",{key:0,src:l.form[t.value]},null,8,g)):(Object(j.L)(),Object(j.n)("i",D))]}),_:2},1032,["before-upload"])):Object(j.m)("",!0),"file"==t.type?(Object(j.L)(),Object(j.l)(b,{key:7,class:"file-upload",action:"#","show-file-list":!1,style:{width:"400px"},"before-upload":function(e){return r.beforeAvatarUpload(e,t.value)}},{default:Object(j.kb)(function(){return[Object(j.s)(o,{type:"primary"},{default:Object(j.kb)(function(){return[L]}),_:1}),Object(j.o)("span",{class:"file-name",title:l.fileName},Object(j.Y)(l.fileName),9,E)]}),_:2},1032,["before-upload"])):Object(j.m)("",!0)],64)):Object(j.m)("",!0),null!=t.options?(Object(j.L)(),Object(j.n)(j.b,{key:1},[3<t.options.length?(Object(j.L)(),Object(j.l)(m,{key:0,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},placeholder:"请选择",style:{width:"400px"}},{default:Object(j.kb)(function(){return[(Object(j.L)(!0),Object(j.n)(j.b,null,Object(j.S)(t.options,function(e){return Object(j.L)(),Object(j.l)(_,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue"])):t.options.length<4?(Object(j.L)(),Object(j.n)("div",x,[(Object(j.L)(!0),Object(j.n)(j.b,null,Object(j.S)(t.options,function(e){return Object(j.L)(),Object(j.l)(f,{key:e,modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},label:e.value},{default:Object(j.kb)(function(){return[Object(j.r)(Object(j.Y)(e.name),1)]}),_:2},1032,["modelValue","onUpdate:modelValue","label"])}),128))])):Object(j.m)("",!0)],64)):"auth"==t.type?(Object(j.L)(),Object(j.n)(j.b,{key:2},[Object(j.s)(c,{modelValue:l.form[t.value],"onUpdate:modelValue":function(e){return l.form[t.value]=e},type:"textarea",style:{width:"400px",display:"none"}},null,8,["modelValue","onUpdate:modelValue"]),Object(j.s)(p,{class:"tree-line",indent:0,data:l.HotimeDataTree,props:l.defaultProps,"node-key":"name","default-expanded-keys":l.expandedKeys,"default-checked-keys":l.checkedKeys,"show-checkbox":"",onCheck:r.checkChange,"render-content":r.renderContent,onNodeExpand:r.handleExpand,"default-expand-all":!0},null,8,["data","props","default-expanded-keys","default-checked-keys","onCheck","render-content","onNodeExpand"])],64)):Object(j.m)("",!0)]}),_:2},1032,["label","required"])):Object(j.m)("",!0)],64)):Object(j.m)("",!0)])}),128)),Object(j.s)(h,{position:"bottom",offset:0,style:{width:"100%"}},{default:Object(j.kb)(function(){return[Object(j.s)(i,{style:{background:"white","padding-bottom":"10px"}},{default:Object(j.kb)(function(){return[Object(j.s)(o,{type:"primary",onClick:r.onSubmit},{default:Object(j.kb)(function(){return[M]}),_:1},8,["onClick"]),Object(j.s)(o,{onClick:r.close},{default:Object(j.kb)(function(){return[P]}),_:1},8,["onClick"])]}),_:1})]}),_:1})]}),_:1},8,["model"])}],["__scopeId","data-v-51dbed3c"]]),o=a("8f33"),c=a("0748"),a=a("d0c8"),a={props:{routerPath:String,routerId:Number,close:Function},name:"Tabs",components:{Add:a.default,Table:c.default,Info:o.a,Edit:l},data:function(){return{activeName:"",tabs:[]}},methods:{removeTab:function(a){var n=this.tabs,l=this.activeName;n.forEach(function(e,t){e.path+e.id===a&&(e=n[t+1]||n[t-1])&&(l=e.path+e.id)}),this.activeName=l,this.tabs=n.filter(function(e){return e.path+e.id!==a})}},mounted:function(){var e,t,a,n=window.Hotime,o=this,l=null!=n.mapData[this.routerPath]?(e=n.mapData[this.routerPath],this.routerId):(e=n.mapData[this.$route.path],this.$route.query.id);if(e.id=l,e.path.lastIndexOf("/info")==e.path.length-5?(e.tabType="info",this.tabs.push(e),this.activeName=e.path+l,!0===(t=n.mapData[e.path.slice(0,e.path.lastIndexOf("/info"))+"/edit"]).Auth.edit&&(t.tabType="edit",t.id=l,this.tabs.push(t))):e.path.lastIndexOf("/edit")==e.path.length-5?(e.tabType="edit",this.tabs.push(e),this.activeName=e.path+l,!0===(a=n.mapData[e.path.slice(0,e.path.lastIndexOf("/edit"))+"/info"]).Auth.info&&(a.tabType="info",a.id=l,this.tabs.push(a))):(e.path.lastIndexOf("/add")==e.path.length-4?e.tabType="add":(e.tabType="table",a.id=l),this.tabs.push(e),this.activeName=e.path),null!=e.byLink&&null!=l){var r,i=Object(s.a)(e.byLink);try{for(i.s();!(r=i.n()).done;){var c,u=r.value;null!=n.tableMapData[u.table]&&((c=Object.assign({},n.tableMapData[u.table])).label="关联"+c.label.replace("管理","").replace("关联",""),c.tabType="table",c.query={},c.query[u.name]=l,this.tabs.push(c))}}catch(e){i.e(e)}finally{i.f()}}d.a.$off("tabs"),d.a.$on("tabs",function(e){var t=Object.assign({},n.mapData[e.path]),a=(t.label="关联"+t.parent.label.replace("管理","").replace("关联","")+t.label.replace("管理","").replace("关联",""),t.tabType=t.path.slice(t.path.lastIndexOf("/")+1,t.path.length),t.id=e.id,!1);o.tabs.forEach(function(e){e.path==t.path&&e.id==t.id&&(a=!0)}),a||(t.closable=!0,t.query=e.query,o.tabs.push(t)),o.activeName=t.path+t.id}),d.a.$off("tabs-close"),d.a.$on("tabs-close",function(a){var n=o.activeName,l=-1,r=o.tabs;r.forEach(function(e,t){e.path==a.path&&e.id==a.id&&(e=r[(l=t)-1]||r[t+1])&&(n=e.path+e.id)}),1==r[l].closable?(o.activeName=n,o.tabs=r.filter(function(e,t){return t!==l})):1==l?o.activeName=n:null!=o.close?o.close():o.$router.go(-1)})}};t.default=r()(a,[["render",function(e,t,a,n,l,r){var o=Object(j.U)("Edit"),i=Object(j.U)("Info"),c=Object(j.U)("Table"),u=Object(j.U)("Add"),s=Object(j.U)("el-tab-pane"),d=Object(j.U)("el-tabs");return Object(j.L)(),Object(j.l)(d,{modelValue:l.activeName,"onUpdate:modelValue":t[0]||(t[0]=function(e){return l.activeName=e}),type:"border-card",style:{width:"100%","overflow-y":"auto"},onTabRemove:r.removeTab},{default:Object(j.kb)(function(){return[(Object(j.L)(!0),Object(j.n)(j.b,null,Object(j.S)(l.tabs,function(e){return Object(j.L)(),Object(j.l)(s,{key:e.name,label:e.label,name:e.path+e.id,lazy:"",closable:1==e.closable},{default:Object(j.kb)(function(){return["edit"==e.tabType?(Object(j.L)(),Object(j.l)(o,{key:0,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(j.m)("",!0),"info"==e.tabType?(Object(j.L)(),Object(j.l)(i,{key:1,"router-path":e.path,"router-id":e.id},null,8,["router-path","router-id"])):Object(j.m)("",!0),"table"==e.tabType?(Object(j.L)(),Object(j.l)(c,{key:2,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(j.m)("",!0),"add"==e.tabType?(Object(j.L)(),Object(j.l)(u,{key:3,"router-query":e.query,"router-path":e.path},null,8,["router-query","router-path"])):Object(j.m)("",!0)]}),_:2},1032,["label","name","closable"])}),128))]}),_:1},8,["modelValue","onTabRemove"])}]])},b64b:function(e,t,a){var n=a("23e7"),l=a("7b0b"),r=a("df75");n({target:"Object",stat:!0,forced:a("d039")(function(){r(1)})},{keys:function(e){return r(l(e))}})}}]); |