1 line
164 KiB
JavaScript
1 line
164 KiB
JavaScript
(function(e){function t(t){for(var o,n,s=t[0],l=t[1],c=t[2],d=0,h=[];d<s.length;d++)n=s[d],Object.prototype.hasOwnProperty.call(i,n)&&i[n]&&h.push(i[n][0]),i[n]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(e[o]=l[o]);u&&u(t);while(h.length)h.shift()();return r.push.apply(r,c||[]),a()}function a(){for(var e,t=0;t<r.length;t++){for(var a=r[t],o=!0,s=1;s<a.length;s++){var l=a[s];0!==i[l]&&(o=!1)}o&&(r.splice(t--,1),e=n(n.s=a[0]))}return e}var o={},i={index:0},r=[];function n(t){if(o[t])return o[t].exports;var a=o[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=o,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var u=l;r.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"0ab1":function(e,t,a){},"0f7f":function(e,t,a){},1:function(e,t){},1194:function(e,t,a){"use strict";a("0ab1")},"21df":function(e,t,a){},"2ae8":function(e,t,a){"use strict";a("41a1")},"33e3":function(e,t,a){"use strict";a("8379")},"41a1":function(e,t,a){},"47ee":function(e,t,a){},"4b58":function(e,t,a){},"4e32":function(e,t,a){},"4f94":function(e,t,a){},"54bc":function(e,t,a){},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");var o=a("a026"),i=a("5c96"),r=a.n(i),n=(a("0fae"),a("299f")),s=a.n(n),l=(a("4ba7"),function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[e.fullscreen?[t("router-view")]:t("el-container",[t("el-aside",{staticStyle:{background:"#fafafa"},style:{width:e.rightAsideWidth+"px"}},[t("div",{staticStyle:{padding:"10px",height:"100%","box-sizing":"border-box"}},[t("div",{staticStyle:{"margin-bottom":"10px"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{size:"small",filterable:"",placeholder:"请先选择分组"},on:{change:e.sourceGroupChangeEvents},model:{value:e.choiceDatasourceGroup,callback:function(t){e.choiceDatasourceGroup=t},expression:"choiceDatasourceGroup"}},[t("el-option",{attrs:{value:"",label:"全部分组"}}),e._l(e.datasourceGroupList,(function(e){return t("el-option",{key:e,attrs:{value:e}})}))],2),t("el-select",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{size:"small",filterable:"",placeholder:"请先选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-menu",{staticClass:"el-menu-vertical",staticStyle:{height:"auto"},attrs:{router:!0}},[t("el-menu-item",{attrs:{index:"/data/datasourceManage"}},[t("i",{staticClass:"el-icon-coin"}),e._v("数据源管理")]),t("el-menu-item",{attrs:{index:"/data/executor"}},[t("i",{staticClass:"el-icon-video-play"}),e._v("SQL执行器")]),t("el-submenu",{attrs:{index:"1"}},[t("template",{slot:"title"},[t("i",{staticClass:"el-icon-s-platform"}),t("span",{attrs:{slot:"title"},slot:"title"},[e._v("管理工具")])]),t("el-menu-item",{attrs:{index:"/data/export"}},[t("i",{staticClass:"el-icon-finished"}),e._v("数据库表导出")]),t("el-menu-item",{attrs:{index:"/data/transferData"}},[t("i",{staticClass:"el-icon-document-copy"}),e._v("数据互导工具")])],2)],1),t("el-tree",{directives:[{name:"loading",rawName:"v-loading",value:e.databaseListLoading,expression:"databaseListLoading"}],ref:"databaseTree",staticClass:"database-list-tree",attrs:{props:e.defaultProps,data:e.databaseList,"highlight-current":"","empty-text":"","default-expanded-keys":e.databaseExpandedKeys,"node-key":"id","element-loading-text":"数据库信息加载中"},on:{"node-click":e.handleNodeClick,"node-expand":e.handleNodeExpand},scopedSlots:e._u([{key:"default",fn:function(a){var o=a.node,i=a.data;return t("div",{},[i.needLoad?t("span",[t("i",{staticClass:"el-icon-loading"})]):t("span",[e._v(" "+e._s(o.label)+" "),i.comment?t("el-tooltip",{attrs:{effect:"dark",content:i.comment,placement:"top-start","open-delay":600}},[t("span",{staticStyle:{color:"#aaa"}},[e._v("-"+e._s(i.comment))])]):e._e(),1==i.type?t("el-dropdown",{on:{command:e.databaseActionDropdown}},[t("i",{staticClass:"el-icon-more",on:{click:function(e){e.stopPropagation()}}}),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{icon:"el-icon-coin",command:{command:"procedure",node:o}}},[e._v("函数管理")]),t("el-dropdown-item",{attrs:{icon:"el-icon-refresh",command:{command:"refresh",node:o}}},[e._v("刷新")]),t("el-dropdown-item",{attrs:{icon:"el-icon-download",command:{command:"download",node:o}}},[e._v("数据导出")])],1)],1):e._e()],1)])}}])})],1)]),t("div",{ref:"rightResize",staticClass:"right-resize"},[t("i",{ref:"rightResizeBar"},[e._v("...")])]),t("el-container",[t("el-header",[t("span",{staticClass:"header-right-user-name"},[e._v(e._s(e.userSelfInfo.userName))]),t("el-dropdown",{attrs:{trigger:"click"},on:{command:e.userSettingDropdown}},[t("i",{staticClass:"el-icon-setting",staticStyle:{"margin-right":"15px","font-size":"12px",cursor:"pointer",color:"#fff"}}),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"console"}},[e._v("控制台")]),t("el-dropdown-item",{attrs:{command:"aboutDoc",divided:""}},[e._v("关于")]),t("el-dropdown-item",{attrs:{command:"myInfo"}},[e._v("我的资料")]),t("el-dropdown-item",{attrs:{command:"userSignOut"}},[e._v("退出登录")])],1)],1)],1),t("el-main",{staticStyle:{padding:"0"}},[t("router-view",{on:{initLoadDataList:e.initLoadDataList,loadDatasourceList:e.loadDatasourceList}})],1)],1)],1),t("about-dialog",{ref:"aboutDialog"})],2)}),c=[],u=(a("14d9"),a("d3b7"),a("159b"),a("b0c0"),a("7db0"),a("4de4"),a("a630"),a("3ca3"),a("6062"),a("ddb0"),a("4328")),d=a.n(u),h=a("bc3a"),p=a.n(h),m=p.a.create({baseURL:"./",timeout:6e4,headers:{"Content-type":"application/x-www-form-urlencoded"},withCredentials:!0}),f={"/zyplayer-doc-db/executor/execute":!0,"/zyplayer-doc-db/datasource/test":!0};m.interceptors.request.use((function(e){return e.needValidateResult=!0,f[e.url]&&(e.needValidateResult=!1),e}),(function(e){return console.log(e),Promise.reject(e)})),m.interceptors.response.use((function(e){if(e.message)Qa.$message.error("请求错误:"+e.message);else{if(!e.config.needValidateResult||200==e.data.errCode)return e.data;if(400==e.data.errCode){Qa.$message.error("请先登录");var t=encodeURIComponent(window.location.href);window.location="./#/user/login?redirect="+t}else 402==e.data.errCode?Qa.$router.push("/common/noAuth"):200!==e.data.errCode&&Qa.$message.error(e.data.errMsg||"未知错误")}return Promise.reject("请求错误")}),(function(e){return console.log("err"+e),Qa.$message.info("请求错误:"+e.message),Promise.reject(e)}));var b=m,g={userLogin:function(e){return b({url:"/login",method:"post",data:d.a.stringify(e)})},userLogout:function(){return b({url:"/logout",method:"post",data:d.a.stringify({})})},getSelfUserInfo:function(){return b({url:"/user/info/selfInfo",method:"post",data:d.a.stringify({})})},getUserBaseInfo:function(e){return b({url:"/zyplayer-doc-wiki/common/user/base",method:"post",data:d.a.stringify(e)})}},v={queryTestDatasource:function(e){return b({url:"/zyplayer-doc-db/datasource/test",method:"post",data:d.a.stringify(e)})},queryTableDdl:function(e){return b({url:"/zyplayer-doc-db/doc-db/getTableDdl",method:"post",data:d.a.stringify(e)})},getSourceBaseInfo:function(e){return b({url:"/zyplayer-doc-db/doc-db/getSourceBaseInfo",method:"post",data:d.a.stringify(e)})},datasourceList:function(e){return b({url:"/zyplayer-doc-db/doc-db/getDataSourceList",method:"post",data:d.a.stringify(e)})},datasource:function(e){return b({url:"/zyplayer-doc-db/doc-db/getDataSource",method:"post",data:d.a.stringify(e)})},databaseList:function(e){return b({url:"/zyplayer-doc-db/doc-db/getDatabaseList",method:"post",data:d.a.stringify(e)})},tableList:function(e){return b({url:"/zyplayer-doc-db/doc-db/getTableList",method:"post",data:d.a.stringify(e)})},tableColumnList:function(e){return b({url:"/zyplayer-doc-db/doc-db/getTableColumnList",method:"post",data:d.a.stringify(e)})},tableStatus:function(e){return b({url:"/zyplayer-doc-db/doc-db/getTableStatus",method:"post",data:d.a.stringify(e)})},tableAndColumnBySearch:function(e){return b({url:"/zyplayer-doc-db/doc-db/getTableAndColumnBySearch",method:"post",data:d.a.stringify(e)})},updateTableDesc:function(e){return b({url:"/zyplayer-doc-db/doc-db/updateTableDesc",method:"post",data:d.a.stringify(e)})},updateTableColumnDesc:function(e){return b({url:"/zyplayer-doc-db/doc-db/updateTableColumnDesc",method:"post",data:d.a.stringify(e)})},manageDatasourceList:function(e){return b({url:"/zyplayer-doc-db/datasource/list",method:"post",data:d.a.stringify(e)})},manageDatasourceGroupList:function(e){return b({url:"/zyplayer-doc-db/datasource/groups",method:"post",data:d.a.stringify(e)})},manageUpdateDatasource:function(e){return b({url:"/zyplayer-doc-db/datasource/update",method:"post",data:d.a.stringify(e)})},queryExecuteSql:function(e){return b({url:"/zyplayer-doc-db/executor/execute",method:"post",data:d.a.stringify(e)})},executeSqlCancel:function(e){return b({url:"/zyplayer-doc-db/executor/cancel",method:"post",data:d.a.stringify(e)})},updateFavorite:function(e){return b({url:"/zyplayer-doc-db/executor/favorite/add",method:"post",data:d.a.stringify(e)})},favoriteList:function(e){return b({url:"/zyplayer-doc-db/executor/favorite/list",method:"post",data:d.a.stringify(e)})},historyList:function(e){return b({url:"/zyplayer-doc-db/executor/history/list",method:"post",data:d.a.stringify(e)})},transferStart:function(e){return b({url:"/zyplayer-doc-db/transfer/start",method:"post",data:d.a.stringify(e)})},transferCancel:function(e){return b({url:"/zyplayer-doc-db/transfer/cancel",method:"post",data:d.a.stringify(e)})},transferList:function(e){return b({url:"/zyplayer-doc-db/transfer/list",method:"post",data:d.a.stringify(e)})},transferDetail:function(e){return b({url:"/zyplayer-doc-db/transfer/detail",method:"post",data:d.a.stringify(e)})},transferUpdate:function(e){return b({url:"/zyplayer-doc-db/transfer/update",method:"post",data:d.a.stringify(e)})},transferSqlColumns:function(e){return b({url:"/zyplayer-doc-db/transfer/sqlColumns",method:"post",data:d.a.stringify(e)})},assignDbUserAuth:function(e){return b({url:"/zyplayer-doc-db/auth/assign",method:"post",data:d.a.stringify(e)})},dbUserAuthList:function(e){return b({url:"/zyplayer-doc-db/auth/list",method:"post",data:d.a.stringify(e)})},procedureList:function(e){return b({url:"/zyplayer-doc-db/procedure/list",method:"post",data:d.a.stringify(e)})},deleteProcedure:function(e){return b({url:"/zyplayer-doc-db/procedure/delete",method:"post",data:d.a.stringify(e)})},procedureDetail:function(e){return b({url:"/zyplayer-doc-db/procedure/detail",method:"post",data:d.a.stringify(e)})},saveProcedure:function(e){return b({url:"/zyplayer-doc-db/procedure/save",method:"post",data:d.a.stringify(e)})},procedureLogList:function(e){return b({url:"/zyplayer-doc-db/procedure/log/list",method:"post",data:d.a.stringify(e)})},procedureLogDetail:function(e){return b({url:"/zyplayer-doc-db/procedure/log/detail",method:"post",data:d.a.stringify(e)})},dataViewQuery:function(e){return b({url:"/zyplayer-doc-db/data-view/query",method:"post",data:d.a.stringify(e)})},updateTableColumnRelation:function(e){return b({url:"/zyplayer-doc-db/table-relation/update",method:"post",data:d.a.stringify(e)})},getTableColumnRelation:function(e){return b({url:"/zyplayer-doc-db/table-relation/getRelation",method:"post",data:d.a.stringify(e)})},deleteTableLineData:function(e){return b({url:"/zyplayer-doc-db/data-view/deleteTableLineData",method:"post",data:d.a.stringify(e)})}},y=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"关于",visible:e.aboutDialogVisible,width:"600px","custom-class":"about-zyplayer-doc"},on:{"update:visible":function(t){e.aboutDialogVisible=t}}},[t("div",{},[t("div",{staticStyle:{"font-weight":"bold","font-size":"25px"}},[e._v("zyplayer-doc")]),t("div",{staticStyle:{"line-height":"30px",padding:"10px 0"}},[t("div",[e._v("版本 "+e._s(e.upgradeInfo.nowVersion||"1.0.0"))]),t("div",[e._v("版权所有 © 2018-2021 "),t("a",{attrs:{target:"_blank",href:"http://zyplayer.com"}},[e._v("zyplayer.com")])])]),t("el-tabs",{attrs:{type:"border-card"}},[t("el-tab-pane",{attrs:{label:"支持"}},[t("div",{staticStyle:{"line-height":"30px"}},[t("div",[e._v("文档:"),t("a",{attrs:{target:"_blank",href:"http://doc.zyplayer.com"}},[e._v("http://doc.zyplayer.com")])]),t("div",[e._v("主页:"),t("a",{attrs:{target:"_blank",href:"https://gitee.com/zyplayer/zyplayer-doc"}},[e._v("https://gitee.com/zyplayer/zyplayer-doc")])]),t("div",[e._v("反馈:"),t("a",{attrs:{target:"_blank",href:"https://gitee.com/zyplayer/zyplayer-doc/issues"}},[e._v("https://gitee.com/zyplayer/zyplayer-doc/issues")])]),t("div",[e._v("新功能关注&技术交流QQ群:466363173")])])]),t("el-tab-pane",{attrs:{label:"开源软件"}},[t("div",{staticStyle:{"line-height":"30px"}},[t("div",[e._v("此项目基于以下开源软件构建")]),t("el-divider",{attrs:{"content-position":"left"}},[e._v("后端")]),t("div",[t("a",{attrs:{target:"_blank",href:"https://spring.io/projects/spring-boot"}},[e._v("Spring-Boot")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"http://www.mybatis.org"}},[e._v("MyBatis")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://github.com/alibaba/druid"}},[e._v("Druid")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://mp.baomidou.com"}},[e._v("MyBatis-Plus")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://www.hutool.cn"}},[e._v("Hutool")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://github.com/alibaba/fastjson"}},[e._v("Fastjson")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://alibaba-easyexcel.github.io"}},[e._v("Easy Excel")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"https://swagger.io"}},[e._v("Swagger")]),e._v("、 "),t("a",{attrs:{target:"_blank",href:"http://www.eclipse.org/jgit"}},[e._v("JGit")]),e._v("、... ")]),t("el-divider",{attrs:{"content-position":"left"}},[e._v("前端")]),e._v(" Vue、element-ui、wangeditor、mavon-editor、qrcodejs2、vant、vue-router、axios、vue-hljs、brace、echarts、sql-formatter、vue-clipboard2、... "),t("div")],1)]),e.upgradeInfo.lastVersion?t("el-tab-pane",{attrs:{label:"软件更新"}},[t("span",{attrs:{slot:"label"},slot:"label"},[e._v(" 软件更新 "),t("sup",{staticClass:"el-badge__content el-badge__content--undefined is-fixed is-dot",staticStyle:{top:"10px",right:"20px"}})]),t("div",{staticStyle:{"line-height":"30px"}},[t("div",[e._v("当前版本:"+e._s(e.upgradeInfo.nowVersion))]),t("div",[e._v("最新版本:"+e._s(e.upgradeInfo.lastVersion))]),t("div",[e._v("升级地址:"),t("a",{attrs:{target:"_blank",href:e.upgradeInfo.upgradeUrl}},[e._v(e._s(e.upgradeInfo.upgradeUrl))])]),t("div",[e._v("升级内容:")]),t("pre",{staticStyle:{margin:"0","max-height":"250px",overflow:"auto"}},[e._v(e._s(e.upgradeInfo.upgradeContent))])])]):e._e()],1)],1)])},x=[],w=(a("ac1f"),a("5319"),a("5b81"),{systemUpgradeInfo:function(e){return b({url:"/system/info/upgrade",method:"post",data:d.a.stringify(e)})}}),C={data:function(){return{aboutDialogVisible:!1,upgradeInfo:{}}},mounted:function(){this.checkSystemUpgrade()},methods:{show:function(){this.aboutDialogVisible=!0},checkSystemUpgrade:function(){var e=this;w.systemUpgradeInfo({}).then((function(t){t.data&&(e.upgradeInfo=t.data,e.upgradeInfo.upgradeContent&&(e.upgradeInfo.upgradeContent=e.upgradeInfo.upgradeContent.replaceAll(";","\n")),console.log("zyplayer-doc发现新版本:\n升级地址:"+t.data.upgradeUrl+"\n当前版本:"+t.data.nowVersion+"\n最新版本:"+t.data.lastVersion+"\n升级内容:"+t.data.upgradeContent))}))}}},S=C,D=(a("d9c1"),a("2877")),k=Object(D["a"])(S,y,x,!1,null,null,null),_=k.exports,L={data:function(){return{isCollapse:!1,userSelfInfo:{},datasourceOptions:[],datasourceList:[],datasourceGroupList:[],choiceDatasourceId:"",choiceDatasourceGroup:"",defaultProps:{children:"children",label:"name"},databaseList:[],databaseListLoading:!1,databaseExpandedKeys:[],rightAsideWidth:300}},computed:{fullscreen:function(){return this.$store.state.global.fullscreen}},components:{"about-dialog":_},mounted:function(){this.getSelfUserInfo(),this.loadDatasourceList(),this.dragChangeRightAsideWidth()},methods:{userSettingDropdown:function(e){console.log("command:"+e),"userSignOut"==e?this.userSignOut():"aboutDoc"==e?this.$refs.aboutDialog.show():"myInfo"==e?this.$router.push({path:"/user/myInfo"}):"console"==e?window.open("./","_blank"):this.$message.warning("功能暂未开放")},userSignOut:function(){g.userLogout().then((function(){location.reload()}))},getSelfUserInfo:function(){var e=this;g.getSelfUserInfo().then((function(t){e.userSelfInfo=t.data}))},sourceGroupChangeEvents:function(){var e=this,t=[];this.datasourceList.forEach((function(a){e.choiceDatasourceGroup&&e.choiceDatasourceGroup!=a.groupName||t.push({label:a.name,value:a.id})})),this.datasourceOptions=t,this.choiceDatasourceId="",this.databaseList=[]},datasourceChangeEvents:function(){var e=this,t=this.datasourceList.find((function(t){return t.id==e.choiceDatasourceId}));this.loadDatabaseList(this.choiceDatasourceId,t.name)},handleNodeClick:function(e){console.log("点击节点:",e),1==e.type?(this.nowClickPath={sourceId:this.choiceDatasourceId,host:e.host,dbName:e.dbName,tableName:e.tableName},this.$router.push({path:"/table/database",query:this.nowClickPath})):2==e.type&&(this.nowClickPath={sourceId:this.choiceDatasourceId,host:e.host,dbName:e.dbName,tableName:e.tableName},this.$router.push({path:"/table/info",query:this.nowClickPath}))},handleNodeExpand:function(e){e.children.length>0&&e.children[0].needLoad&&(console.log("加载节点:",e),1==e.type&&this.loadGetTableList(e))},databaseActionDropdown:function(e){if("refresh"==e.command)e.node.loading=!0,e.node.data.children=[],this.loadGetTableList(e.node.data,(function(){setTimeout((function(){return e.node.loading=!1}),500)}));else if("procedure"==e.command){var t=e.node.data,a={sourceId:this.choiceDatasourceId,dbName:t.dbName,host:t.host};this.$router.push({path:"/procedure/list",query:a})}else if("download"==e.command){var o=e.node.data,i={sourceId:this.choiceDatasourceId,dbName:o.dbName};this.$router.push({path:"/data/export",query:i})}else this.$message.warning("暂未支持的选项")},loadGetTableList:function(e,t){v.tableList({sourceId:this.choiceDatasourceId,dbName:e.dbName}).then((function(a){for(var o=[],i=a.data||[],r=0;r<i.length;r++){var n={id:e.host+"_"+e.dbName+"_"+i[r].tableName,host:e.host,dbName:e.dbName,tableName:i[r].tableName,name:i[r].tableName,type:2,comment:i[r].tableComment};o.push(n)}e.children=o,"function"==typeof t&&t(o)}))},loadDatasourceList:function(){var e=this;v.datasourceList({}).then((function(t){if(e.datasourceList=t.data||[],!(e.datasourceList.length<=0)){var a=[];e.datasourceList.forEach((function(e){return a.push({label:e.name,value:e.id})})),e.datasourceOptions=a;var o=[];e.datasourceList.filter((function(e){return!!e.groupName})).forEach((function(e){return o.push(e.groupName)})),e.datasourceGroupList=Array.from(new Set(o))}}))},loadDatabaseList:function(e,t){var a=this;return new Promise((function(o,i){a.databaseList=[],a.databaseListLoading=!0,v.databaseList({sourceId:e}).then((function(e){a.databaseListLoading=!1;for(var i=e.data||[],r=[],n=[],s=0;s<i.length;s++){var l={id:t+"_"+i[s].dbName,host:t,dbName:i[s].dbName,name:i[s].dbName,type:1,children:[{label:"",needLoad:!0}]};n.push(l)}r.push({id:t,host:t,name:t,children:n}),a.databaseList=r,o()})).catch((function(e){a.choiceDatasourceId="",a.databaseListLoading=!1}))}))},initLoadDataList:function(e){var t=this;this.databaseList.length>0||(this.choiceDatasourceId=parseInt(e.sourceId),this.loadDatabaseList(e.sourceId,e.host).then((function(){t.databaseExpandedKeys=[e.host]})))},dragChangeRightAsideWidth:function(){var e=this,t=this.$refs.rightResize,a=this.$refs.rightResizeBar;t.onmousedown=function(o){var i=o.clientX;return t.style.background="#ccc",a.style.background="#aaa",t.left=t.offsetLeft,document.onmousemove=function(t){var a=t.clientX,o=i-a;(o<0&&e.rightAsideWidth<600||o>0&&e.rightAsideWidth>200)&&(i=a,e.rightAsideWidth-=o,e.rightAsideWidth<200&&(e.rightAsideWidth=200))},document.onmouseup=function(){t.style.background="#fafafa",a.style.background="#ccc",document.onmousemove=null,document.onmouseup=null},!1}}}},I=L,E=(a("d343"),Object(D["a"])(I,l,c,!1,null,null,null)),N=E.exports,T=a("8c4f"),P=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{padding:"10px"}},[t("div",{staticStyle:{"max-width":"1200px",margin:"20px auto"}},[t("div",{staticStyle:{"text-align":"center"}},[e._v("欢迎使用"),t("span",{on:{dblclick:e.showErGraph}},[e._v('ヾ(๑╹◡╹)ノ"')]),e._v(" - 在左上角选择一个数据源吧~")])])])},q=[],O={data:function(){return{}},mounted:function(){},methods:{showErGraph:function(){}}},z=O,$=Object(D["a"])(z,P,q,!1,null,null,null),F=$.exports,A=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{padding:"10px"}},[t("er-graph")],1)},j=[],V=function(){var e=this,t=e._self._c;return t("div",{staticClass:"styles.erGraphDemo"},[t("ERGraphDemo")],1)},R=[],U=a("779d"),M=a.n(U),Q=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{width:"100%",height:"650px"}},[t("ERGraph",{attrs:{graphData:e.graphData}})],1)},B=[],G=(a("d81d"),function(){var e=this,t=e._self._c;return t("div",{staticClass:"er-editor-demo-container"},[t("div",{ref:"refContainer",staticStyle:{width:"100%",height:"100%"},attrs:{id:"refContainer"}}),t("div",{ref:"refMinimapContainer",staticClass:"minimap-container",attrs:{id:"refMinimapContainer"}})])}),H=[],J=a("5530"),K=(a("f32d"),a("d4ec")),W=a("bee2"),X=(a("d9e2"),a("5728")),Y=a("15fd"),Z=(a("99af"),a("2ef0")),ee=a.n(Z),te=(a("3e2f"),["id","x","y","width","height","component","data"]),ae=["id","source","target","render","data"],oe="vue-shape",ie=function(){function e(t){Object(K["a"])(this,e),this.graph=t.graph,this.nodes=[],this.edges=[]}return Object(W["a"])(e,[{key:"addNodes",value:function(e){var t=this;e.forEach((function(e){t.addNode(e)}))}},{key:"addNode",value:function(e){console.log(e,"nodeData");var t=e.id,a=e.x,o=e.y,i=e.width,r=e.height,n=e.component,s=(e.data,Object(Y["a"])(e,te)),l=this.graph.addNode(Object(J["a"])({id:t,x:a||0,y:o||0,width:i||100,height:r||60,shape:oe,component:n},s));this.nodes.push(l)}},{key:"updateNode",value:function(e,t){ee.a.isEqual(e.data,t.data)||e.setData(t.data)}},{key:"removeNodes",value:function(e){ee.a.size(e)>0&&(this.graph.removeCells(e),this.nodes=ee.a.pullAll(this.nodes,e))}},{key:"removeNode",value:function(e){if(e)if(e instanceof Node)this.removeNodes([e]);else{var t=this.findNodeById(e);t&&this.removeNodes([t])}}},{key:"addEdges",value:function(e){var t=this;e.forEach((function(e){t.addEdge(e)}))}},{key:"addEdge",value:function(e){var t=e.id,a=e.source,o=e.target,i=(e.render,e.data),r=Object(Y["a"])(e,ae),n=ee.a.find(this.nodes,(function(e){return e.id===a})),s=ee.a.find(this.nodes,(function(e){return e.id===o}));if(!a||!o)throw new Error("edge must has source and target!");var l=this.graph.addEdge(Object(J["a"])({id:t||"".concat(a,"-").concat(o),data:i||void 0,source:n,target:s,attrs:{line:{stroke:"#B4BDCF",strokeWidth:1}}},r));this.edges.push(l)}},{key:"updateEdge",value:function(e,t){ee.a.isEqual(e.data,t.data)||e.setData(t.data)}},{key:"removeEdges",value:function(e){this.graph.removeCells(e),this.edges=ee.a.pullAll(this.edges,e)}},{key:"removeEdge",value:function(e){if(e)if(e instanceof X["a"])this.graph.removeCells([e]),this.removeEdges([e]);else{var t=this.findEdgeById(e);t&&this.removeEdges([t])}}},{key:"findNodeById",value:function(e){return this.nodes.find((function(t){return t.id===e}))}},{key:"findEdgeById",value:function(e){return this.edges.find((function(t){return t.id===e}))}}]),e}(),re=a("ade3"),ne=Object(W["a"])((function e(t){var a=this;Object(K["a"])(this,e),Object(re["a"])(this,"registerEvent",(function(e){e&&e.forEach((function(e){switch(e.eventName){case"scale":a.graph.on("scale",(function(t){var a=t.sx,o=(t.sy,t.ox,t.oy,a);e.handler&&e.handler({scale:o})}));break;case"graph:mouseenter":a.graph.on("graph:mouseenter",(function(t){t.e;e.handler&&e.handler()}));break;case"graph:mouseleave":a.graph.on("graph:mouseleave",(function(t){t.e;e.handler&&e.handler()}));break;case"blank:mouseDown":a.graph.on("blank:mousedown",(function(t){t.e;var a=t.x,o=t.y;e.handler&&e.handler({x:a,y:o})}));break;case"blank:mouseUp":a.graph.on("blank:mouseup",(function(t){t.e;var a=t.x,o=t.y;e.handler&&e.handler({x:a,y:o})}));break;case"node:added":a.graph.on("node:added",(function(e){var t=e.node;a.x6BaseGraph.bringNodesToFront([t])}));break;case"node:removed":a.graph.on("node:removed",(function(e){e.node}));break;case"edge:added":a.graph.on("edge:added",(function(e){e.edge}));break;case"edge:removed":a.graph.on("edge:removed",(function(e){e.edge;a.isDeleteX6DefaultEdge}));break;case"node:mousedown":a.graph.on("node:mousedown",(function(t){t.e;var a=t.view,o=t.x,i=t.y;e.handler&&e.handler({node:a.cell,x:o,y:i})}));break;case"node:mousemove":a.graph.on("node:mousemove",(function(t){t.e;var a=t.view,o=t.x,i=t.y;e.handler&&e.handler({node:a.cell,x:o,y:i})}));break;case"node:mouseup":a.graph.on("node:mouseup",(function(t){t.e;var a=t.view,o=t.x,i=t.y;e.handler&&e.handler({node:a.cell,x:o,y:i})}));break;case"node:click":a.graph.on("node:click",(function(t){var a=t.view;e.handler&&e.handler({node:a.cell})}));break;case"node:dbclick":a.graph.on("node:dblclick",(function(t){var a=t.view;e.handler&&e.handler({node:a.cell})}));break;case"edge:connected":a.graph.on("edge:connected",(function(e){e.edge}));break;case"selection:changed":a.graph.on("selection:changed",(function(t){var o=t.selected,i=t.removed,r=t.added;e.handler&&e.handler({selected:o,removed:i,added:r}),a.x6BaseGraph.bringCellsToFront(o)}));break;default:break}}))})),this.x6BaseGraph=t,this.graph=t.graph})),se=function(){function e(t){Object(K["a"])(this,e);var a=this.getDefaultCfg();this.graph=new X["c"](Object(J["a"])(Object(J["a"])({},a),t)),this.init()}return Object(W["a"])(e,[{key:"init",value:function(){this.cellController=new ie(this),this.eventController=new ne(this)}},{key:"getDefaultCfg",value:function(){var e={scroller:{enabled:!0,pageVisible:!1,pageBreak:!1,pannable:!0},grid:{visible:!0,size:20,type:"doubleMesh",args:[{color:"#888",thickness:1}]},connecting:{connector:{name:"rounded"},router:{name:"er",args:{direction:"H"}}},snapline:{enabled:!0},keyboard:{enabled:!0},clipboard:{enabled:!0}};return e}},{key:"updateGraph",value:function(e){var t=this;if(!e)throw new Error("graphData must be defined first!");var a=this.graphContentDiff(e),o=a.addNodesData,i=a.addEdgesData;this.graph.batchUpdate("updateGraph",(function(){o&&o.length>0&&t.cellController.addNodes(o),i&&i.length>0&&t.cellController.addEdges(i)}))}},{key:"zoomGraph",value:function(e){"number"===typeof e?this.graph.zoom(e):"fit"===e?this.graph.zoomToFit({padding:12}):e&&(this.graph.scale(1),this.graph.centerContent())}},{key:"focusNodeToGraphCenter",value:function(e){if(e instanceof Node)this.graph.centerCell(e);else{var t=this.cellController.findNodeById(e);t&&this.graph.centerCell(t)}}},{key:"bringNodesToFront",value:function(e){e.forEach((function(e){e.toBack()}))}},{key:"bringNodesToBack",value:function(e){e.forEach((function(e){e.toBack()}))}},{key:"clearGraph",value:function(){}},{key:"registerEvent",value:function(e){this.eventController.registerEvent(e)}},{key:"graphContentDiff",value:function(e){var t=this,a=e.nodes,o=e.edges,i=[];a.forEach((function(e){var a=t.cellController.findNodeById(e.id);a||i.push(e)}));var r=[],n=[],s=[];this.cellController.nodes.forEach((function(e){var o=a.find((function(t){return t.id===e.id}));o?ee.a.isEqual(e.data,o.data)?r.push(e):(n.push(e),t.cellController.updateNode(e,o)):s.push(e)}));var l=[];o.forEach((function(e){if(e.id){var a=t.cellController.findEdgeById(e.id);a||l.push(e)}}));var c=[],u=[],d=[];return this.cellController.edges.forEach((function(e){var a=o.find((function(t){return t.id===e.id}));a?ee.a.isEqual(e.data,a.data)?c.push(e):(u.push(e),t.cellController.updateEdge(e,a)):d.push(e)})),this.cellController.removeNodes(s),this.cellController.removeEdges(d),{addNodesData:i,addEdgesData:l}}}]),e}(),le={name:"index",components:{},props:{graphOptions:{type:Object,default:null,required:!1},graphData:{type:Object,default:null,required:!1}},data:function(){return{baseGraph:null}},mounted:function(){var e=this,t=this;setTimeout((function(){e.baseGraph=new se(Object(J["a"])(Object(J["a"])({},e.graphOptions),{},{container:document.getElementById("refContainer"),grid:{visible:!1},minimap:{enabled:!0,container:document.getElementById("refMinimapContainer"),minScale:.5,maxScale:2}})),e.baseGraph.updateGraph(t.graphData)}),100)},methods:{onHandleToolbar:function(e){switch(e){case"in":console.log("in"),this.baseGraph.zoomGraph(.1);break;case"out":console.log("out"),this.baseGraph.zoomGraph(-.1);break;case"fit":console.log("fit"),this.baseGraph.zoomGraph("fit");break;case"real":console.log("real"),this.baseGraph.zoomGraph("real");break;default:}}}},ce=le,ue=Object(D["a"])(ce,G,H,!1,null,"de9abfa8",null),de=ue.exports,he=[{propertyId:"propertyId1",name:"业务日期",propertyType:"string",isPK:!0},{propertyId:"propertyId2",name:"交易号1",propertyType:"bigint",isFK:!0},{propertyId:"propertyId3",name:"最长显示的表单名最长显示的表单名",propertyType:"string"},{propertyId:"propertyId4",name:"交易支付外键",propertyType:"string"},{propertyId:"propertyId5",name:"卖家支付日期",propertyType:"string"},{propertyId:"propertyId6",name:"网商银行",propertyType:"string"},{propertyId:"propertyId7",name:"业务日期",propertyType:"string"},{propertyId:"propertyId8",name:"业务日期111",propertyType:"string"},{propertyId:"propertyId9",name:"业务日期222",propertyType:"string"},{propertyId:"propertyId10",name:"业务日期333",propertyType:"string"}],pe=[{entityId:"fact_1",name:"事实表",entityType:"FACT",properties:he,x:550,y:400,width:214,height:248},{entityId:"fact_up",name:"事实表",entityType:"FACT",properties:he,x:100,y:100,width:214,height:248},{entityId:"dim_up",name:"维度表",entityType:"DIM",properties:he,x:100,y:400,width:214,height:248},{entityId:"other_up",name:"其他表",entityType:"OTHER",properties:he,x:100,y:700,width:214,height:248},{entityId:"other_down",name:"其他表",entityType:"OTHER",properties:he,x:900,y:0,width:214,height:248},{entityId:"fact_down1",name:"事实表",entityType:"FACT",properties:he,x:900,y:280,width:214,height:248},{entityId:"dim_down",name:"维度表",entityType:"DIM",properties:he,x:900,y:580,width:214,height:248},{entityId:"fact_down2",name:"事实表",entityType:"FACT",properties:he,x:900,y:860,width:214,height:248}],me=[{relationId:"relationId_1",sourceEntityId:"fact_up",targetEntityId:"fact_1"},{relationId:"relationId_2",sourceEntityId:"fact_1",targetEntityId:"fact_up"},{relationId:"relationId_1_loop",sourceEntityId:"fact_1",targetEntityId:"fact_1"},{relationId:"relationId_2",sourceEntityId:"dim_up",targetEntityId:"fact_1"},{relationId:"relationId_3",sourceEntityId:"other_up",targetEntityId:"fact_1"},{relationId:"relationId_4",sourceEntityId:"fact_1",targetEntityId:"other_down"},{relationId:"relationId_5",sourceEntityId:"fact_1",targetEntityId:"fact_down1"},{relationId:"relationId_6",sourceEntityId:"fact_1",targetEntityId:"dim_down"},{relationId:"relationId_7",sourceEntityId:"fact_1",targetEntityId:"fact_down2"}],fe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"entity-container fact"},[t("div",{staticClass:"content other"},[t("div",{staticClass:"head"},[t("div",[t("a-icon",{staticClass:"type",attrs:{type:"bars"}}),t("span",[e._v(e._s(e.entity.name))])],1),t("a-icon",{staticClass:"more",attrs:{type:"ellipsis"}})],1),t("div",{staticClass:"body"},e._l(e.entity.properties,(function(a,o){return t("div",{key:o,staticClass:"body-item"},[t("div",{staticClass:"name"},[e._v(" "+e._s(a.name)+" ")]),t("div",{staticClass:"type"},[e._v(e._s(a.propertyType))])])})),0)])])},be=[],ge=(a("8f64"),{name:"Entity",props:{entity:{type:Object,default:null,required:!0}},mounted:function(){console.log(this.entity,"this.entity")}}),ve=ge,ye=Object(D["a"])(ve,fe,be,!1,null,"bb8894ea",null),xe=ye.exports,we={name:"index",components:{ERGraph:de},data:function(){return{graphData:{nodes:"",edges:""}}},mounted:function(){this.calRenderData()},methods:{calRenderData:function(){this.graphData.nodes=pe.map((function(e){var t=e.entityId,a=e.x,o=e.y,i=e.width,r=e.height;return{x:a,y:o,width:i,height:r,id:t,component:{template:'<Entity :entity="entity"/>',data:function(){return{entity:e}},components:{Entity:xe}}}})),this.graphData.edges=me.map((function(e){var t=e.relationId,a=e.sourceEntityId,o=e.targetEntityId;return{id:t,source:a,target:o,label:"1:N",data:e}}))}}},Ce=we,Se=Object(D["a"])(Ce,Q,B,!1,null,"ae20be5a",null),De=Se.exports,ke={name:"index",components:{ERGraphDemo:De},data:function(){return{visible:!1,graph:"",styles:M.a}},mounted:function(){},methods:{showDrawer:function(){this.visible=!0},onClose:function(){this.visible=!1}}},_e=ke,Le=Object(D["a"])(_e,V,R,!1,null,"708be636",null),Ie=Le.exports,Ee={data:function(){return{}},components:{erGraph:Ie},mounted:function(){},methods:{}},Ne=Ee,Te=Object(D["a"])(Ne,A,j,!1,null,null,null),Pe=(Te.exports,function(){var e=this,t=e._self._c;return t("div",{staticStyle:{"padding-top":"50px"}},[t("el-form",{ref:"loginParam",staticClass:"demo-ruleForm login-container",attrs:{model:e.loginParam,rules:e.loginRules,"label-position":"left","label-width":"0px"}},[t("h3",{staticClass:"title"},[e._v("系统登录")]),t("el-form-item",{attrs:{prop:"username"}},[t("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"账号"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loginSubmit.apply(null,arguments)}},model:{value:e.loginParam.username,callback:function(t){e.$set(e.loginParam,"username",t)},expression:"loginParam.username"}})],1),t("el-form-item",{attrs:{prop:"password"}},[t("el-input",{attrs:{type:"password","auto-complete":"off",placeholder:"密码"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.loginSubmit.apply(null,arguments)}},model:{value:e.loginParam.password,callback:function(t){e.$set(e.loginParam,"password",t)},expression:"loginParam.password"}})],1),t("el-form-item",{staticStyle:{width:"100%"}},[t("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:e.logining},nativeOn:{click:function(t){return t.preventDefault(),e.loginSubmit.apply(null,arguments)}}},[e._v("登录")])],1)],1)],1)}),qe=[],Oe={data:function(){return{logining:!1,redirect:"",loginParam:{username:"",password:""},loginRules:{username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},checked:!0}},mounted:function(){this.redirect=this.$route.query.redirect},methods:{loginSubmit:function(){var e=this;this.$refs.loginParam.validate((function(t){t&&g.userLogin(e.loginParam).then((function(){e.redirect?location.href=decodeURIComponent(e.redirect):e.$router.back()}))}))}}},ze=Oe,$e=(a("70e4"),Object(D["a"])(ze,Pe,qe,!1,null,null,null)),Fe=$e.exports,Ae=function(){var e=this,t=e._self._c;return t("div",{staticClass:"my-info-vue"},[t("div",{staticStyle:{margin:"0 auto","max-width":"1000px"}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("我的信息")]),t("el-form",{staticClass:"search-form-box",attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"账号:"}},[e._v(e._s(e.userInfo.userNo))]),t("el-form-item",{attrs:{label:"用户名:"}},[e._v(e._s(e.userInfo.userName))]),t("el-form-item",{attrs:{label:"手机号:"}},[e._v(e._s(e.userInfo.phone))]),t("el-form-item",{attrs:{label:"邮箱:"}},[e._v(e._s(e.userInfo.email))]),t("el-form-item",{attrs:{label:"状态:"}},[e._v(e._s(0==e.userInfo.delFlag?"正常":"停用"))]),t("el-form-item",{attrs:{label:"性别:"}},[e._v(e._s(0==e.userInfo.sex?"女":"男"))])],1)],1)],1)])},je=[],Ve={data:function(){return{userInfo:{}}},mounted:function(){this.getUserInfo()},methods:{getUserInfo:function(){var e=this;g.getSelfUserInfo().then((function(t){e.userInfo=t.data}))}}},Re=Ve,Ue=(a("2ae8"),Object(D["a"])(Re,Ae,je,!1,null,null,null)),Me=Ue.exports,Qe=function(){var e=this,t=e._self._c;return t("router-view")},Be=[],Ge={},He=Object(D["a"])(Ge,Qe,Be,!1,null,null,null),Je=He.exports,Ke=function(){var e=this,t=e._self._c;return t("div",[t("el-tabs",{staticStyle:{padding:"5px 10px 0"},attrs:{type:"card",closable:""},on:{"tab-click":e.changePage,"tab-remove":e.removePageTab},nativeOn:{contextmenu:function(t){return t.preventDefault(),e.openContextMenu(t)}},model:{value:e.activePage,callback:function(t){e.activePage=t},expression:"activePage"}},e._l(e.pageList,(function(a){return t("el-tab-pane",{key:a.fullPath,attrs:{label:e.pageTabNameMap[a.fullPath]||a.name,name:e.getRouteRealPath(a),fullPath:a.fullPath}})})),1),t("keep-alive",[t("router-view",{key:e.$route.fullPath,on:{listenToChildEvent:e.getDatafromChild,initLoadDataList:e.initLoadDataList,loadDatasourceList:e.loadDatasourceList}})],1),t("ul",{directives:[{name:"show",rawName:"v-show",value:e.contextMenuVisible,expression:"contextMenuVisible"}],staticClass:"contextmenu",style:{left:e.left+"px",top:e.top+"px"}},[t("li",{on:{click:function(t){return e.closeAllTabs()}}},[t("el-button",{attrs:{type:"text",size:"mini"}},[e._v("关闭所有")])],1),t("li",{on:{click:function(t){return e.closeOtherTabs("left")}}},[t("el-button",{attrs:{type:"text",size:"mini"}},[e._v("关闭左边")])],1),t("li",{on:{click:function(t){return e.closeOtherTabs("right")}}},[t("el-button",{attrs:{type:"text",size:"mini"}},[e._v("关闭右边")])],1),t("li",{on:{click:function(t){return e.closeOtherTabs("other")}}},[t("el-button",{attrs:{type:"text",size:"mini"}},[e._v("关闭其他")])],1)])],1)},We=[],Xe=(a("a434"),a("c740"),a("a15b"),a("fb6a"),{name:"PageTableView",components:{},data:function(){return{pageList:[],linkList:[],activePage:"",datasourceList:[],multiPage:!0,ignoreParamPath:["/data/export"],contextMenuVisible:!1,left:0,top:0}},computed:{pageTabNameMap:function(){return this.$store.state.global.pageTabNameMap}},created:function(){var e=this,t=this.$route,a=t.name,o=t.path,i=t.fullPath;if("/data/executor"===o){var r=this.$route.query.database,n=this.$route.query.datasourceId;return n?(v.datasource({sourceId:n}).then((function(t){var n=t.data.name;t.data.name;n&&(a=a+"( "+n+"["+r+"] )"),e.pageList.push({name:a,path:o,fullPath:i});var s=e.getRouteRealPath(e.$route);e.linkList.push(s),e.activePage=s,e.$router.push(e.$route.fullPath)})),!1):(v.datasourceList({}).then((function(t){if(e.datasourceList=t.data||[],e.datasourceList.length>0){var o=e.datasourceList[0].name;e.datasourceList[0].id&&v.databaseList({sourceId:e.datasourceList[0].id}).then((function(t){if(t.data.length>0){var i=["information_schema","master","model","msdb","tempdb"],r=t.data.find((function(e){return i.indexOf(e.dbName)<0})),n=r?r.dbName:t.data[0].dbName;o&&n&&(a=a+"( "+o+"["+n+"] )"),e.$router.replace({query:{datasourceId:e.datasourceList[0].id,database:n}})}}))}})),!1)}this.pageList.push({name:a,path:o,fullPath:i});var s=this.getRouteRealPath(this.$route);this.linkList.push(s),this.activePage=s,this.$router.push(this.$route.fullPath)},watch:{$route:function(e,t){var a=this,o=this.getRouteRealPath(e);if(this.activePage=o,this.linkList.indexOf(o)<0){this.linkList.push(o);var i=e.name,r=e.path,n=e.fullPath;if(this.pageList.push({name:i,path:r,fullPath:n}),"/data/executor"===r){var s=e.query.database,l=e.query.datasourceId;l?v.datasource({sourceId:l}).then((function(e){var t=e.data.name;e.data.groupName;t&&(i=i+"( "+t+"["+s+"] )");var r=a.pageList.find((function(e){return a.getRouteRealPath(e)===o}));r.name=i})):v.datasourceList({}).then((function(e){if(a.datasourceList=e.data||[],a.datasourceList.length>0){var t=a.datasourceList[0].name;a.datasourceList[0].id&&v.databaseList({sourceId:a.datasourceList[0].id}).then((function(e){if(e.data.length>0){var o=["information_schema","master","model","msdb","tempdb"],n=e.data.find((function(e){return o.indexOf(e.dbName)<0})),s=n?n.dbName:e.data[0].dbName;t&&s&&(i=i+"( "+t+"["+s+"] )"),a.pageList.splice(a.pageList.findIndex((function(e){return e.fullPath===r})),1),a.linkList.splice(a.linkList.findIndex((function(e){return e===r})),1),a.$router.replace({query:{datasourceId:a.datasourceList[0].id,database:s}})}}))}}))}}},contextMenuVisible:function(e){e?document.body.addEventListener("click",this.closeContextMenu):document.body.removeEventListener("click",this.closeContextMenu)}},methods:{getDatafromChild:function(e){this.datasourceList=e},initLoadDataList:function(e){this.$emit("initLoadDataList",e)},loadDatasourceList:function(){this.$emit("loadDatasourceList")},isIgnoreParamPath:function(e){return this.ignoreParamPath.indexOf(e)>=0},getRouteRealPath:function(e){return this.isIgnoreParamPath(e.path)?e.path:e.fullPath},changePage:function(e){this.activePage=e.name,this.$router.push(e.$attrs.fullPath)},editPage:function(e,t){this[t](e)},removePageTab:function(e){var t=this;if(1!==this.pageList.length){this.pageList=this.pageList.filter((function(a){return t.getRouteRealPath(a)!==e})),this.linkList=this.linkList.filter((function(t){return t!==e}));var a=this.linkList.indexOf(this.activePage);a<0&&(a=this.linkList.length-1,this.activePage=this.linkList[a],this.$router.push(this.activePage))}else this.$message.warning("这是最后一页,不能再关闭了啦")},openContextMenu:function(e){var t=e.srcElement?e.srcElement:e.target;if(t.id){var a=t.id.split("-").slice(1).join("-");this.contextMenuVisible=!0,this.$store.commit("saveCurContextTabId",a),this.left=e.clientX,this.top=e.clientY+10}},curTabReload:function(){for(var e=0,t=this.$store.state.tagsView.curContextTabId,a=0;a<this.pageList.length;a++)if(t===this.pageList[a].fullPath){e=a;break}this.activePage=this.linkList[e],this.$router.push(this.activePage),this.closeContextMenu()},closeAllTabs:function(){this.linkList.splice(0,this.linkList.length),this.pageList.splice(0,this.pageList.length),this.$router.replace({query:{}}),this.closeContextMenu()},closeOtherTabs:function(e){for(var t=0,a=this.$store.state.tagsView.curContextTabId,o=0;o<this.pageList.length;o++)if(a===this.pageList[o].fullPath){t=o;break}switch(e){case"left":this.pageList.splice(0,t),this.linkList.splice(0,t),this.activePage=this.linkList[0],this.$router.push(this.activePage),console.log(t+"删除左侧");break;case"right":this.pageList.splice(t+1,this.pageList.length),this.linkList.splice(t+1,this.linkList.length),this.activePage=this.linkList[t],this.$router.push(this.activePage),console.log(t+"删除右侧");break;case"other":this.pageList.splice(0,t),this.linkList.splice(0,t),this.pageList.splice(t+1,this.pageList.length),this.linkList.splice(t+1,this.linkList.length),this.activePage=this.linkList[0],this.$router.push(this.activePage),console.log(t+"删除其他");break}this.closeContextMenu()},closeContextMenu:function(){this.contextMenuVisible=!1}}}),Ye=Xe,Ze=(a("f014"),Object(D["a"])(Ye,Ke,We,!1,null,"0369a19d",null)),et=Ze.exports,tt=(a("a4d3"),a("e01a"),function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-info-vue"},[t("el-tabs",{on:{"tab-click":e.tabActiveNameChange},model:{value:e.tabActiveName,callback:function(t){e.tabActiveName=t},expression:"tabActiveName"}},[t("el-tab-pane",{attrs:{label:"表字段",name:"columns"}},[t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.columnListLoading,expression:"columnListLoading"}]},[t("el-row",{staticClass:"row-bg",staticStyle:{"margin-bottom":"10px"},attrs:{type:"flex",justify:"space-between"}},[t("el-col",{staticStyle:{color:"#606266","line-height":"40px"}},[t("span",[e._v("表名:"+e._s(e.tableStatusInfo.name))]),t("span",{staticStyle:{"margin-left":"20px"}},[1==e.tableInfo.inEdit?t("span",[t("el-input",{staticStyle:{width:"500px"},attrs:{placeholder:"输入表注释"},on:{blur:e.saveTableDescription},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.saveTableDescription.apply(null,arguments)}},model:{value:e.tableInfo.newDesc,callback:function(t){e.$set(e.tableInfo,"newDesc",t)},expression:"tableInfo.newDesc"}})],1):t("span",[e._v(e._s(e.tableInfo.description||"暂无表注释")+" "),t("i",{staticClass:"el-icon-edit edit-table-desc",on:{click:function(t){e.tableInfo.inEdit=1}}})])])]),t("el-col",{staticStyle:{width:"100px","text-align":"right"}},[t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{plain:"",type:"primary",icon:"el-icon-magic-stick"},on:{click:e.showCreateTableDdl}},[e._v("DDL")])],1)],1),t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.columnList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"字段名",width:"220"}}),t("el-table-column",{attrs:{label:"自增",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.selfIncrement?"是":"否"))]}}])}),t("el-table-column",{attrs:{prop:"type",label:"类型",width:"110"}}),t("el-table-column",{attrs:{prop:"length",label:"长度",width:"110"}}),t("el-table-column",{attrs:{prop:"numericScale",label:"小数点",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(0==t.row.numericScale?"":t.row.numericScale))]}}])}),t("el-table-column",{attrs:{prop:"nullable",label:"空值",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.nullable?"允许":"不允许"))]}}])}),t("el-table-column",{attrs:{label:"主键",width:"50"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.primaryKey?"是":"否"))]}}])}),t("el-table-column",{scopedSlots:e._u([{key:"header",fn:function(a){return[e._v(" 注释 "),t("el-tooltip",{attrs:{effect:"dark",content:"点击注释列可编辑字段注释",placement:"top"}},[t("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])]}},{key:"default",fn:function(a){return[1==a.row.inEdit?t("div",[t("el-input",{attrs:{placeholder:"输入字段注释"},on:{blur:function(t){return e.saveColumnDescription(a.row)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.saveColumnDescription(a.row)}},model:{value:a.row.newDesc,callback:function(t){e.$set(a.row,"newDesc",t)},expression:"scope.row.newDesc"}})],1):t("div",{staticClass:"description",on:{click:function(t){return e.descBoxClick(a.row)}}},[e._v(e._s(a.row.description))])]}}])})],1)],1)]),t("el-tab-pane",{attrs:{label:"表信息",name:"tableInfo"}},[t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:24}},[t("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))])],1),t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("数据表:")]),e._v(e._s(e.tableStatusInfo.name))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("引擎:")]),e._v(e._s(e.tableStatusInfo.engine))])],1),t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("行数:")]),e._v(e._s(e.tableStatusInfo.rows||0))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("自动递增:")]),e._v(e._s(e.tableStatusInfo.autoIncrement||0))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("行格式:")]),e._v(e._s(e.tableStatusInfo.rowFormat))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("排序规则:")]),e._v(e._s(e.tableStatusInfo.collation))])],1),t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("索引长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.indexLength)))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("数据长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.dataLength)))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("最大长度:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.maxDataLength)))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("可用空间:")]),e._v(e._s(e.getBytesSize(e.tableStatusInfo.dataFree)))])],1),t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("创建时间:")]),e._v(e._s(e.tableStatusInfo.createTime))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("修改时间:")]),e._v(e._s(e.tableStatusInfo.updateTime))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("检查时间:")]),e._v(e._s(e.tableStatusInfo.checkTime))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("创建选项:")]),e._v(e._s(e.tableStatusInfo.createOptions))])],1),t("el-row",{staticClass:"status-info-row"},[t("el-col",{attrs:{span:24}},[t("span",{staticClass:"label"},[e._v("表注释:")]),1==e.tableInfo.inEdit?t("span",[t("el-input",{staticStyle:{width:"500px"},attrs:{placeholder:"输入表注释"},on:{blur:e.saveTableDescription},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.saveTableDescription.apply(null,arguments)}},model:{value:e.tableInfo.newDesc,callback:function(t){e.$set(e.tableInfo,"newDesc",t)},expression:"tableInfo.newDesc"}})],1):t("span",[e._v(e._s(e.tableInfo.description||"暂无注释")+" "),t("i",{staticClass:"el-icon-edit edit-table-desc",on:{click:function(t){e.tableInfo.inEdit=1}}})])])],1)],1),t("el-tab-pane",{attrs:{label:"关系图",name:"relationChart"}},[t("table-relation-charts",{ref:"relationChart"})],1),t("el-tab-pane",{attrs:{label:"表数据",name:"tableData"}},[t("data-preview",{ref:"dataPreview"})],1)],1),t("el-dialog",{attrs:{visible:e.tableDDLInfoDialogVisible,footer:null,width:"760px"},on:{"update:visible":function(t){e.tableDDLInfoDialogVisible=t}}},[t("div",{attrs:{slot:"title"},slot:"title"},[t("span",{staticStyle:{"margin-right":"15px"}},[e._v("DDL")]),t("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:e.tableDDLInfo[e.tableDDLInfoTab],expression:"tableDDLInfo[tableDDLInfoTab]",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:e.onCopySuccess,expression:"onCopySuccess",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:e.onCopyError,expression:"onCopyError",arg:"error"}],attrs:{size:"small",icon:"el-icon-document-copy"}},[e._v("复制")])],1),t("el-tabs",{model:{value:e.tableDDLInfoTab,callback:function(t){e.tableDDLInfoTab=t},expression:"tableDDLInfoTab"}},[e.tableDDLInfo.mysql?t("el-tab-pane",{attrs:{label:"mysql",name:"mysql"}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.mysql)}})])])]):e._e(),e.tableDDLInfo.sqlserver?t("el-tab-pane",{attrs:{label:"sqlserver",name:"sqlserver"}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.sqlserver)}})])])]):e._e(),e.tableDDLInfo.oracle?t("el-tab-pane",{attrs:{label:"oracle",name:"oracle"}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.oracle)}})])])]):e._e(),e.tableDDLInfo.postgresql?t("el-tab-pane",{attrs:{label:"postgresql",name:"postgresql"}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.postgresql)}})])])]):e._e(),e.tableDDLInfo.hive?t("el-tab-pane",{attrs:{label:"hive",name:"hive"}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.tableDDLInfo.hive)}})])])]):e._e()],1)],1)],1)}),at=[],ot=(a("b680"),function(){var e=this,t=e._self._c;return t("div",{staticClass:"data-executor-vue"},[t("div",{staticStyle:{padding:"0 10px 10px",height:"100%","box-sizing":"border-box"}},[t("el-card",{staticStyle:{"margin-bottom":"10px"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.aceEditorShow,expression:"aceEditorShow"}]},[t("el-alert",{attrs:{title:"筛选示例 (支持 and , or 等连接符)",type:"info",description:e.executorDesc,"show-icon":""}}),t("ace-editor",{staticStyle:{"margin-bottom":"10px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"60",options:e.sqlEditorConfig,source:e.executorSource},on:{init:e.sqlExecutorInit},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}})],1),t("div",[t("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-search"},on:{click:e.doAceEditorShow}},[e._v("筛选 ")]),e.sqlExecuting?t("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-pause"},on:{click:e.cancelExecutorSql}},[e._v("取消执行 ")]):t("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:e.aceEditorShow,expression:"aceEditorShow"}],attrs:{effect:"dark",content:"Ctrl+R、Ctrl+Enter",placement:"top"}},[t("el-button",{attrs:{type:"primary",plain:"",size:"small",icon:"el-icon-video-play"},on:{click:e.doExecutorClick}},[e._v("执行 ")])],1),t("el-button",{attrs:{icon:"el-icon-refresh-left",size:"small"},on:{click:e.refreshData}},[e._v("重置")]),t("el-button",{staticStyle:{"margin-left":"30px"},attrs:{type:"success",size:"small",icon:"el-icon-download",plain:""},on:{click:e.downloadTableData}},[e._v("导出 ")])],1)]),t("el-card",[e.executeError?t("div",{staticStyle:{color:"#f00"}},[e._v(e._s(e.executeError))]):e.sqlExecuting?t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.sqlExecuting,expression:"sqlExecuting"}],staticStyle:{padding:"20px 0"}},[e._v("数据加载中...")]):e.executeResultList.length<=0?t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.sqlExecuting,expression:"sqlExecuting"}],staticStyle:{padding:"20px 0"}},[e._v(" 暂无数据 ")]):t("div",{staticStyle:{position:"relative"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:"table0"!==e.executeShowTable,expression:"executeShowTable !== 'table0'"}],staticStyle:{position:"absolute",right:"0","z-index":"1"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.choiceResultObj[e.executeShowTable]&&e.choiceResultObj[e.executeShowTable].length>0,expression:"choiceResultObj[executeShowTable] && choiceResultObj[executeShowTable].length > 0"}]},[t("el-button",{staticStyle:{"margin-right":"10px"},attrs:{icon:"el-icon-delete",size:"small",type:"danger",plain:""},on:{click:e.deleteCheckLine}},[e._v("删除")]),t("el-dropdown",{on:{command:e.handleCopyCheckLineCommand}},[t("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-document-copy"}},[e._v(" 复制选中行"),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"insert"}},[e._v("SQL Inserts")]),t("el-dropdown-item",{attrs:{command:"update"}},[e._v("SQL Updates")]),t("el-dropdown-item",{attrs:{command:"json"}},[e._v("JSON")])],1)],1)],1),t("el-tooltip",{attrs:{effect:"dark",content:"选择展示列",placement:"top"}},[t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{icon:"el-icon-setting",size:"small"},on:{click:e.choiceShowColumnDrawerShow}})],1)],1),t("el-tabs",{model:{value:e.executeShowTable,callback:function(t){e.executeShowTable=t},expression:"executeShowTable"}},[t("el-tab-pane",{attrs:{label:"信息",name:"table0"}},[t("pre",{staticClass:"xxpre"},[e._v(e._s(e.executeResultInfo))])]),e._l(e.executeResultList,(function(a,o){return a.index?t("el-tab-pane",{key:o,attrs:{label:"结果"+a.index,name:a.name}},[a.errMsg?t("div",{staticStyle:{color:"#f00"}},[e._v(e._s(a.errMsg))]):a.dataList.length<=0?t("div",{staticStyle:{"text-align":"center",color:"#aaa",padding:"20px 0"}},[e._v("暂无数据 ")]):[t("ux-grid",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClickOutside,expression:"handleClickOutside"}],staticClass:"execute-result-table",staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:a.dataList,stripe:"",border:"",height:e.height,"max-height":e.tableMaxHeight,"default-sort":e.tableSort},on:{"selection-change":e.handleSelectionChange,"cell-click":e.mouseOnFocus,"cell-mouse-leave":e.mouseLeave,"sort-change":e.tableSortChange}},[t("ux-table-column",{attrs:{type:"checkbox",width:"55"}}),t("ux-table-column",{attrs:{type:"index",width:"50",title:" "}}),e._l(a.dataCols,(function(a,o){return t("ux-table-column",{key:o,attrs:{prop:a.prop,title:a.prop,width:a.width,sortable:""},scopedSlots:e._u([{key:"header",fn:function(o){return[t("el-tooltip",{attrs:{effect:"dark",content:a.desc,placement:"top"}},[t("span",[e._v(e._s(a.prop))])])]}},{key:"default",fn:function(e){return[t("textarea",{staticClass:"el-textarea__inner",attrs:{readonly:"",rows:"1"},domProps:{value:e.row[a.prop]}})]}}],null,!0)})}))],2),t("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[50,100,300,500],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})]],2):e._e()}))],2)],1)])],1),t("el-dialog",{attrs:{visible:e.exportConditionVisible,width:"500px",title:"选择更新语句条件"},on:{"update:visible":function(t){e.exportConditionVisible=t}}},[t("div",[e._v(" 更新条件列: "),t("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.conditionDataColsChoice,callback:function(t){e.conditionDataColsChoice=t},expression:"conditionDataColsChoice"}},e._l(e.conditionDataCols,(function(e){return t("el-option",{key:e.prop,attrs:{label:e.prop,value:e.prop}})})),1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.exportConditionVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.doCopyCheckLineUpdate}},[e._v("确 定")])],1)]),t("el-dialog",{attrs:{visible:e.downloadDataVisible,width:"600px",title:"表数据导出"},on:{"update:visible":function(t){e.downloadDataVisible=t}}},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:"导出类型:"}},[t("el-select",{staticStyle:{width:"370px"},attrs:{filterable:"",placeholder:"请选择导出类型"},model:{value:e.downloadDataParam.downloadType,callback:function(t){e.$set(e.downloadDataParam,"downloadType",t)},expression:"downloadDataParam.downloadType"}},[t("el-option",{attrs:{label:"SQL Inserts",value:"insert"}}),t("el-option",{attrs:{label:"SQL Updates",value:"update"}}),t("el-option",{attrs:{label:"JSON",value:"json"}}),t("el-option",{attrs:{label:"Excel",value:"excel"}})],1)],1),"insert"===e.downloadDataParam.downloadType?t("el-form-item",{attrs:{label:"数据表:"}},[t("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.dropTableFlagChange},model:{value:e.downloadDataParam.dropTableFlag,callback:function(t){e.$set(e.downloadDataParam,"dropTableFlag",t)},expression:"downloadDataParam.dropTableFlag"}},[e._v("删除表"+e._s(1==e.downloadDataParam.dropTableFlag?"!!":"")+" ")]),t("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.createTableFlagChange},model:{value:e.downloadDataParam.createTableFlag,callback:function(t){e.$set(e.downloadDataParam,"createTableFlag",t)},expression:"downloadDataParam.createTableFlag"}},[e._v("创建表 ")])],1):e._e(),"update"===e.downloadDataParam.downloadType?t("el-form-item",{attrs:{label:"更新条件列:"}},[t("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"不选则是没有条件的更新"},model:{value:e.downloadDataParam.conditionColumnArr,callback:function(t){e.$set(e.downloadDataParam,"conditionColumnArr",t)},expression:"downloadDataParam.conditionColumnArr"}},e._l(e.conditionDataCols,(function(e){return t("el-option",{key:e.prop,attrs:{label:e.prop,value:e.prop}})})),1)],1):e._e()],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.downloadDataVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.doDownloadTableData}},[e._v("确 定")])],1)],1),t("el-drawer",{attrs:{size:"350px","with-header":!1,visible:e.choiceShowColumnDrawer,"before-close":e.choiceShowColumnDrawerClose,direction:"rtl"},on:{"update:visible":function(t){e.choiceShowColumnDrawer=t}}},[t("div",{staticStyle:{padding:"10px"}},[t("el-row",[t("el-col",{attrs:{span:12}},[e._v("选择展示列")]),t("el-col",{staticStyle:{"text-align":"right"},attrs:{span:12}},[t("el-checkbox",{on:{change:e.choiceShowColumnAllChange},model:{value:e.choiceShowColumnAll,callback:function(t){e.choiceShowColumnAll=t},expression:"choiceShowColumnAll"}},[e._v("全选 ")]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary",size:"mini"},on:{click:e.choiceShowColumnOk}},[e._v("确定 ")])],1)],1)],1),t("div",{staticStyle:{overflow:"auto",height:"calc(100vh - 50px)"}},[t("el-tree",{ref:"showColumnTree",attrs:{"node-key":"name",props:e.showColumnProps,data:e.tableDataColumns,"check-on-click-node":"","show-checkbox":""},on:{"check-change":e.tableDataColumnsCheckChange}})],1)]),t("form",{ref:"downloadForm",attrs:{method:"post",action:e.downloadFormParam.url,target:"_blank"}},e._l(e.downloadFormParam.param,(function(e,a){return t("input",{attrs:{type:"hidden",name:a},domProps:{value:e}})})),0),t("span",{staticStyle:{visibility:"hidden","white-space":"nowrap",position:"fixed"},attrs:{id:"widthCalculate"}})],1)}),it=[],rt=(a("e9c4"),{insert:function(e,t,a,o){var i=a?a+".":"";i+=o||"table";var r="",n="";return e.forEach((function(e){n.length>0&&(n+=", "),n+=e.label||e.prop})),t.forEach((function(t){var a="";e.forEach((function(e){a.length>0&&(a+=", ");var o=t[e.prop];void 0===o||null===o||isNaN(o)?a+="null":"number"!==typeof o||isNaN(o)?(o=String(o).replaceAll("'","''"),a+="'"+o+"'"):a+=o})),r+="insert into "+i+" ("+n+") values ("+a+");\n"})),r},update:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=o?o+".":"";r+=i||"table";var n="";return t.forEach((function(t){var o="",i="";e.forEach((function(e){var r=t[e.prop],n=e.label||e.prop;a.indexOf(e.prop)>=0?(i.length>0&&(i+=" and "),void 0===r||null===r||isNaN(r)?i+=n+" = null":"number"!==typeof r||isNaN(r)?i+=n+" = '"+r+"'":i+=n+" = "+r):(o.length>0&&(o+=", "),o+=n+"=",void 0===r||null===r||isNaN(r)?o+="null":"number"!==typeof r||isNaN(r)?(r=String(r).replaceAll("'","''"),o+="'"+r+"'"):o+=r)})),i.length>0&&(i=" where "+i),n+="update "+r+" set "+o+i+";\n"})),n},json:function(e,t,a,o){var i=[];return t.forEach((function(t){var a={};e.forEach((function(e){var o=e.label||e.prop;a[o]=t[e.prop]})),i.push(a)})),JSON.stringify(i)}}),nt={insert:function(e,t,a,o){var i=a?a+"..":"";i+=o||"table";var r="",n="";return e.forEach((function(e){n.length>0&&(n+=", "),n+=e.label||e.prop})),t.forEach((function(t){var a="";e.forEach((function(e){a.length>0&&(a+=", ");var o=t[e.prop];void 0===o||null===o||isNaN(o)?a+="null":"number"!==typeof o||isNaN(o)?(o=String(o).replaceAll("'","''"),a+="'"+o+"'"):a+=o})),r+="insert into "+i+" ("+n+") values ("+a+");\n"})),r},update:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=o?o+"..":"";r+=i||"table";var n="";return t.forEach((function(t){var o="",i="";e.forEach((function(e){var r=t[e.prop],n=e.label||e.prop;a.indexOf(e.prop)>=0?(i.length>0&&(i+=" and "),void 0===r||null===r||isNaN(r)?i+=n+" = null":"number"!==typeof r||isNaN(r)?i+=n+" = '"+r+"'":i+=n+" = "+r):(o.length>0&&(o+=", "),o+=n+"=",void 0===r||null===r||isNaN(r)?o+="null":"number"!==typeof r||isNaN(r)?(r=String(r).replaceAll("'","''"),o+="'"+r+"'"):o+=r)})),i.length>0&&(i=" where "+i),n+="update "+r+" set "+o+i+";\n"})),n},json:function(e,t,a,o){var i=[];return t.forEach((function(t){var a={};e.forEach((function(e){var o=e.label||e.prop;a[o]=t[e.prop]})),i.push(a)})),JSON.stringify(i)}},st={format:function(e,t,a,o,i,r,n){var s=this.getProduct(t);return"insert"===e?s.insert(a,o,r,n):"update"===e?s.update(a,o,i,r,n):"json"===e?s.json(a,o,r,n):void 0},getProduct:function(e){return"sqlserver"===e?nt:rt}},lt=a("db05"),ct=a.n(lt),ut=(a("00b4"),a("061c")),dt=a.n(ut),ht=(a("2099"),a("842f"),a("6e63"),a("818b"),a("b039"),a("14d4"),a("c7eb")),pt=a("1da1"),mt=(a("8a79"),{isInit:!1,source:{},databaseInfo:{},tableInfo:{},columnInfo:{},lastCallbackArr:[],isAutocomplete:!1,change:function(e){var t=this;if(this.source=e,this.lastCallbackArr=[],console.log("change(sourceId):"+JSON.stringify(this.source)),!this.isInit){console.log("change(sourceId),isInit:"+this.isInit),this.isInit=!0;var a=ace.acequire("ace/ext/language_tools");a.addCompleter(this)}if(this.source.sourceId){var o=this.databaseInfo[this.source.sourceId]||[];if(o.length<=0&&v.databaseList({sourceId:this.source.sourceId}).then((function(e){t.databaseInfo[t.source.sourceId]=e.data||[]})),this.source.dbName){var i=this.source.sourceId+"_"+this.source.dbName,r=this.tableInfo[i]||[];r.length<=0&&v.tableList({sourceId:this.source.sourceId,dbName:this.source.dbName}).then((function(e){t.tableInfo[i]=e.data||[]}))}if(this.source.tableName){var n=this.source.sourceId+"_"+this.source.dbName+"_"+this.source.tableName,s=this.columnInfo[n]||[];s.length<=0&&v.tableColumnList({sourceId:this.source.sourceId,dbName:this.source.dbName,tableName:this.source.tableName}).then((function(e){t.columnInfo[n]=e.data.columnList||[]}))}}},startAutocomplete:function(e){this.isAutocomplete=!0,e.execCommand("startAutocomplete")},getCompletions:function(e,t,a,o,i){var r=this;return Object(pt["a"])(Object(ht["a"])().mark((function e(){var o,n,s;return Object(ht["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(o=[],n=r.isAutocomplete?a.column:a.column-1,s=t.getLine(a.row).substring(0,n),r.isAutocomplete=!1,console.log("Executor.vue getCompletions,sourceId:"+JSON.stringify(r.source)+", lineStr:"+s,a),!r.source.tableName){e.next=12;break}return e.next=8,r.getAssignTableColumns(r.source.dbName,r.source.tableName);case 8:o=e.sent,i(null,o),e.next=35;break;case 12:if(!(s.endsWith("from ")||s.endsWith("join ")||s.endsWith("into ")||s.endsWith("update ")||s.endsWith("table "))){e.next=18;break}o=r.getDatabasesAndTables(),r.lastCallbackArr=o,i(null,o),e.next=35;break;case 18:if(!s.endsWith(".")){e.next=26;break}return e.next=21,r.getTablesAndColumns(s);case 21:o=e.sent,r.lastCallbackArr=o,i(null,o),e.next=35;break;case 26:if(!(s.endsWith("select ")||s.endsWith("where ")||s.endsWith("and ")||s.endsWith("or ")||s.endsWith("set "))){e.next=34;break}return e.next=29,r.getTableColumns(t,a);case 29:o=e.sent,r.lastCallbackArr=o,i(null,o),e.next=35;break;case 34:i(null,r.lastCallbackArr);case 35:case"end":return e.stop()}}),e)})))()},getDatabasesAndTables:function(){var e=[],t=this.tableInfo[this.source.sourceId+"_"+this.source.dbName]||[];t.forEach((function(t){return e.push({caption:t.tableComment?t.tableName+"-"+t.tableComment:t.tableName,snippet:t.tableName,meta:"表",type:"snippet",score:1e3})}));var a=this.databaseInfo[this.source.sourceId]||[];return a.forEach((function(t){return e.push({caption:t.dbName,snippet:t.dbName,meta:"库",type:"snippet",score:1e3})})),e},getTablesAndColumns:function(e){var t=this;return Object(pt["a"])(Object(ht["a"])().mark((function a(){var o,i,r,n,s,l,c,u,d,h;return Object(ht["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:o=!1,i=[],r=t.databaseInfo[t.source.sourceId]||[],n=0;case 4:if(!(n<r.length)){a.next=19;break}if(s=r[n],!e.endsWith(s.dbName+".")){a.next=16;break}if(l=t.tableInfo[t.source.sourceId+"_"+s.dbName]||[],!(l.length<=0)){a.next=14;break}return a.next=11,v.tableList({sourceId:t.source.sourceId,dbName:s.dbName});case 11:c=a.sent,l=c.data||[],t.tableInfo[t.source.sourceId+"_"+s.dbName]=l;case 14:l.forEach((function(e){return i.push({caption:e.tableComment?e.tableName+"-"+e.tableComment:e.tableName,snippet:e.tableName,meta:"表",type:"snippet",score:1e3})})),o=!0;case 16:n++,a.next=4;break;case 19:if(o){a.next=31;break}u=t.tableInfo[t.source.sourceId+"_"+t.source.dbName]||[],d=0;case 22:if(!(d<u.length)){a.next=31;break}if(h=u[d].tableName,!e.endsWith(h+".")){a.next=28;break}return a.next=27,t.getAssignTableColumns(t.source.dbName,h);case 27:i=a.sent;case 28:d++,a.next=22;break;case 31:return a.abrupt("return",i);case 32:case"end":return a.stop()}}),a)})))()},getTableColumns:function(e,t){var a=this;return Object(pt["a"])(Object(ht["a"])().mark((function o(){var i,r,n,s,l,c,u,d,h,p;return Object(ht["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:i="",r=t.row;case 2:if(!(r>=0)){o.next=10;break}if(n=e.getLine(r),i=n+" "+i,!(n.indexOf(";")>=0)){o.next=7;break}return o.abrupt("break",10);case 7:r--,o.next=2;break;case 10:s=t.row+1;case 11:if(!(s<e.getLength())){o.next=19;break}if(l=e.getLine(s),i=i+" "+l,!(l.indexOf(";")>=0)){o.next=16;break}return o.abrupt("break",19);case 16:s++,o.next=11;break;case 19:c=[],u=a.tableInfo[a.source.sourceId+"_"+a.source.dbName]||[],d=0;case 22:if(!(d<u.length)){o.next=32;break}if(h=u[d].tableName,!(i.indexOf(h)>=0)){o.next=29;break}return o.next=27,a.getAssignTableColumns(a.source.dbName,h);case 27:p=o.sent,c=c.concat(p);case 29:d++,o.next=22;break;case 32:return o.abrupt("return",c);case 33:case"end":return o.stop()}}),o)})))()},getAssignTableColumns:function(e,t){var a=this;return Object(pt["a"])(Object(ht["a"])().mark((function o(){var i,r,n,s;return Object(ht["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(i=a.source.sourceId+"_"+e+"_"+t,r=a.columnInfo[i]||[],!(r.length<=0)){o.next=8;break}return o.next=5,v.tableColumnList({sourceId:a.source.sourceId,dbName:e,tableName:t});case 5:n=o.sent,r=n.data.columnList||[],a.columnInfo[i]=r;case 8:return s=[],r.forEach((function(e){var t=e.description?e.name+"-"+e.description:e.name;s.push({caption:t,snippet:e.name,meta:"字段",type:"snippet",score:1e3})})),o.abrupt("return",s);case 11:case"end":return o.stop()}}),o)})))()}}),ft=(a("aa11"),{render:function(e){var t=this.height?this.px(this.height):"100%",a=this.width?this.px(this.width):"100%";return e("div",{attrs:{style:"height: "+t+"; width: "+a}})},props:{value:String,source:Object,lang:!0,theme:String,height:!0,width:!0,options:Object},data:function(){return{editor:null,contentBackup:""}},watch:{value:function(e){this.contentBackup!==e&&(this.editor.session.setValue(e,1),this.contentBackup=e)},theme:function(e){this.editor.setTheme("ace/theme/"+e)},lang:function(e){this.editor.getSession().setMode("string"===typeof e?"ace/mode/"+e:e)},options:function(e){this.editor.setOptions(e)},height:function(){this.$nextTick((function(){this.editor.resize()}))},width:function(){this.$nextTick((function(){this.editor.resize()}))},source:function(e){mt.change(e)}},beforeDestroy:function(){this.editor.destroy(),this.editor.container.remove()},activated:function(){mt.change(this.source)},mounted:function(){var e=this,t=this.lang||"text",o=this.theme||"chrome";a("b378");var i=e.editor=dt.a.edit(this.$el);i.$blockScrolling=1/0,this.$emit("init",i),i.getSession().setMode("string"===typeof t?"ace/mode/"+t:t),i.setTheme("ace/theme/"+o),this.value&&i.setValue(this.value,1),this.contentBackup=this.value,i.on("change",(function(){var t=i.getValue();e.$emit("input",t),e.contentBackup=t})),i.getSession().selection.on("changeSelection",(function(t){var a=i.session.getTextRange(i.getSelectionRange());e.$emit("cursorSelection",a)})),i.commands.addCommand({name:"start-autocomplete",bindKey:{win:"Alt-Enter",mac:"Alt-Enter"},exec:function(e){mt.startAutocomplete(e)}}),e.options&&i.setOptions(e.options),mt.change(this.source)},methods:{px:function(e){return/^\d*$/.test(e)?e+"px":e}}}),bt=(a("4e82"),{set:{save:function(e,t,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;if(window.localStorage){var i=JSON.parse(window.localStorage.getItem(e)||"[]"),r=i.find((function(e){return e.key===t}));r?(r.value=a,r.time=(new Date).getTime()):i.push({key:t,value:a,time:(new Date).getTime()}),i.sort((function(e,t){return t.time-e.time})),i=i.slice(0,o+1),window.localStorage.setItem(e,JSON.stringify(i))}else console.log("当前浏览器不支持localStorage")},get:function(e,t){if(!window.localStorage)return"";var a=JSON.parse(window.localStorage.getItem(e)||"[]"),o=a.find((function(e){return e.key===t}))||{};return o.value||""}}}),gt=a("9169"),vt={name:"dataPreview",directives:{Clickoutside:gt["a"]},data:function(){return{executorDesc:"",aceEditorShow:!1,height:0,sqlExecuting:!1,executeResultList:[],executeResultInfo:"",executeShowTable:"table1",sqlExecutorEditor:{},nowExecutorId:1,executeError:"",pageParam:{},vueQueryParam:{},pageSize:50,currentPage:1,tableTotalCount:0,tableSort:{},tableMaxHeight:600,tableStatusInfo:{},choiceResultObj:{},exportConditionVisible:!1,tableDataColumns:[],conditionDataCols:[],conditionDataColsChoice:[],downloadDataVisible:!1,downloadDataParam:{downloadType:"insert",dropTableFlag:0,createTableFlag:0,conditionColumnArr:[],retainColumnArr:[]},downloadFormParam:{url:"zyplayer-doc-db/data-view/downloadMultiple",param:{}},choiceShowColumnDrawer:!1,showColumnProps:{label:"name"},choiceShowColumnLast:[],choiceShowColumnAll:!0,sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:3,maxLines:3},executorSource:{},columnMap:{},primaryKeyColumn:{},storageKey:{key:"zyplayer-doc-table-show-columns",subKey:""}}},components:{"ace-editor":ft},mounted:function(){var e=this;this.height=360;var t=function(){e.tableMaxHeight=document.body.clientHeight-420};t(),window.onresize=t},methods:{init:function(e,t){var a=this;if(this.pageParam.sourceId!=e.sourceId){this.pageParam=e,this.executorSource={sourceId:e.sourceId,dbName:e.dbName,tableName:e.tableName},this.columnMap={},t.forEach((function(e){a.columnMap[e.name]=e,1==e.primaryKey&&(a.primaryKeyColumn=e)})),this.tableDataColumns=t,this.executorDesc=t[0].name+" = ?",this.storageKey.subKey=e.sourceId+"-"+e.dbName+"-"+e.tableName;var o=bt.set.get(this.storageKey.key,this.storageKey.subKey);if(this.choiceShowColumnLast=t.map((function(e){return e.name})),o){var i=o.split(",");i=i.filter((function(e){return a.choiceShowColumnLast.indexOf(e)>=0})),i.length>0&&(this.choiceShowColumnLast=i)}this.doExecutorSqlCommon()}},sqlExecutorInit:function(e){this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var t=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-R|Ctrl-Shift-R|Ctrl-Enter",mac:"Command-R|Command-Shift-R|Command-Enter"},exec:function(e){t.doExecutorClick()}})},handleCurrentChange:function(e){this.currentPage=e,this.doExecutorSqlCommon()},handlePageSizeChange:function(e){this.pageSize=e,this.currentPage=1,this.doExecutorSqlCommon()},tableSortChange:function(e){this.tableSort.prop===e.column.title&&this.tableSort.order===e.order||(this.tableSort={prop:e.column.title,order:e.order},this.doExecutorSqlCommon())},refreshData:function(){this.tableSort={},this.currentPage=1,this.sqlExecutorEditor.setValue("",1),this.doExecutorSqlCommon()},cancelExecutorSql:function(){var e=this;v.executeSqlCancel({executeId:this.nowExecutorId}).then((function(){e.sqlExecuting=!1,e.$message.success("取消成功")}))},doExecutorClick:function(){this.tableSort={},this.currentPage=1,this.doExecutorSqlCommon()},doAceEditorShow:function(){this.aceEditorShow=!this.aceEditorShow},doExecutorSqlCommon:function(){var e=this;if(this.pageParam.sourceId){this.tableSort.prop||(this.tableSort={prop:this.pageParam.orderColumn,order:"asc"});var t=this.sqlExecutorEditor.getSelectedText();t=t||this.sqlExecutorEditor.getValue(),t=t||"",this.executeError="",this.executeUseTime="",this.choiceResultObj={},this.executeResultList=[],this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random()),this.sqlExecuting=!0;var a={sourceId:this.pageParam.sourceId,dbName:this.pageParam.dbName,tableName:this.pageParam.tableName,executeId:this.nowExecutorId,condition:t,retainColumn:this.choiceShowColumnLast.join(","),pageNum:this.currentPage,pageSize:this.pageSize,orderColumn:this.tableSort.prop,orderType:this.tableSort.order,params:""};v.dataViewQuery(a).then((function(t){if(e.sqlExecuting=!1,200===t.errCode){for(var a=t.data||[],o=[],i="",r=1,n=0;n<a.length;n++){var s=JSON.parse(a[n]);i+=e.getExecuteInfoStr(s);var l=e.dealExecuteResult(s);l.updateCount<0&&(l.index=r,l.name="table"+r,r++),o.push(l)}t.total&&(e.tableTotalCount=t.total||0),e.executeShowTable=1===r?"table0":"table1",e.executeResultInfo=i,e.executeResultList=o}else e.executeError=t.errMsg})).catch((function(t){e.sqlExecuting=!1}))}else this.$message.error("请先选择数据源")},getExecuteInfoStr:function(e){var t=e.sql;return t+="\n> 状态:"+(e.errMsg?"ERROR":"OK"),e.updateCount>=0&&(t+="\n> 影响行数:"+e.updateCount),t+="\n> 耗时:"+(e.useTime||0)/1e3+"s",t+="\n\n",t},dealExecuteResult:function(e){var t=e.result||[],a=[];if(t.length>0){var o=t[0];for(var i in o){document.getElementById("widthCalculate").innerText=i;var r=document.getElementById("widthCalculate").offsetWidth;document.getElementById("widthCalculate").innerText=o[i];var n=document.getElementById("widthCalculate").offsetWidth,s=r>n?r:n;s=s<50?50:s,s=s>200?200:s;var l=this.columnMap[i]||{};a.push({prop:i,width:s+50,desc:l.description||i})}}var c={};return c.dataList=t,c.dataCols=a,c.useTime=e.useTime||0,c.errMsg=e.errMsg||"",c.updateCount=e.updateCount,c},handleSelectionChange:function(e){this.$set(this.choiceResultObj,this.executeShowTable,e)},mouseOnFocus:function(e,t,a,o){this.uxGridCell&&(this.uxGridCell.style.border="none"),a.style.border="2px solid #0078d7",this.uxGridCell=a},mouseLeave:function(e,t,a,o){},handleClickOutside:function(){this.uxGridCell&&(this.uxGridCell.style.border="none")},doCopyCheckLineUpdate:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.executeResultList.find((function(t){return t.name===e.executeShowTable})).dataCols,o=st.format("update",this.pageParam.dbType,a,t,this.conditionDataColsChoice,this.pageParam.dbName,this.pageParam.tableName);this.conditionDataColsChoice=[],this.exportConditionVisible=!1,this.$copyText(o).then((function(t){return e.$message.success("内容已复制到剪切板!")}),(function(t){return e.$message.error("抱歉,复制失败!")}))}},deleteCheckLine:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.primaryKeyColumn.name;if(!a)return void this.$message.error("删除失败,未找到数据表的主键列");var o=[];t.forEach((function(e){var t={};t[a]=e[a],o.push(t)})),this.$confirm("确定要删除选中的".concat(t.length,"行数据吗?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var t={sourceId:e.pageParam.sourceId,dbName:e.pageParam.dbName,tableName:e.pageParam.tableName,lineJson:JSON.stringify(o)};v.deleteTableLineData(t).then((function(){e.$message.success("删除成功!"),e.refreshData()}))})).catch((function(){}))}},handleCopyCheckLineCommand:function(e){var t=this,a=this.choiceResultObj[this.executeShowTable]||[];if(a.length>0){this.conditionDataColsChoice=[];var o=this.executeResultList.find((function(e){return e.name===t.executeShowTable})).dataCols;if("update"===e){if(!this.primaryKeyColumn.name)return this.conditionDataCols=o,void(this.exportConditionVisible=!0);this.conditionDataColsChoice=[this.primaryKeyColumn.name]}var i=st.format(e,this.pageParam.dbType,o,a,this.conditionDataColsChoice,this.pageParam.dbName,this.pageParam.tableName);this.$copyText(i).then((function(e){return t.$message.success("内容已复制到剪切板!")}),(function(e){return t.$message.error("抱歉,复制失败!")}))}},doDownloadTableData:function(){var e=this,t=this.sqlExecutorEditor.getSelectedText();t=t||this.sqlExecutorEditor.getValue(),t=t||"",this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random());var a={},o={},i={};a[this.pageParam.tableName]=t,o[this.pageParam.tableName]=this.downloadDataParam.conditionColumnArr.join(","),i[this.pageParam.tableName]=this.choiceShowColumnLast.join(","),this.downloadFormParam.param={executeId:this.nowExecutorId,sourceId:this.pageParam.sourceId,dbName:this.pageParam.dbName,tableNames:this.pageParam.tableName,downloadType:this.downloadDataParam.downloadType,dropTableFlag:this.downloadDataParam.dropTableFlag,createTableFlag:this.downloadDataParam.createTableFlag,conditionJson:JSON.stringify(a),conditionColumnJson:JSON.stringify(o),retainColumnJson:JSON.stringify(i)},setTimeout((function(){return e.$refs.downloadForm.submit()}),0),this.downloadDataVisible=!1},downloadTableData:function(){var e=this,t=this.executeResultList.find((function(t){return t.name===e.executeShowTable}));if(!t||!t.dataList||t.dataList.length<=0)this.$message.warning("当前筛选条件下无数据,请重新筛选后再操作导出");else{var a=this.primaryKeyColumn.name;this.downloadDataParam.conditionColumnArr.length<=0&&a&&(this.downloadDataParam.conditionColumnArr=[a]),this.conditionDataCols=t.dataCols,this.downloadDataVisible=!0}},dropTableFlagChange:function(){1===this.downloadDataParam.dropTableFlag&&(this.downloadDataParam.createTableFlag=1)},createTableFlagChange:function(){0==this.downloadDataParam.createTableFlag&&(this.downloadDataParam.dropTableFlag=0)},choiceShowColumnDrawerShow:function(){var e=this;this.choiceShowColumnDrawer=!0,setTimeout((function(){e.$refs.showColumnTree.setCheckedKeys(e.choiceShowColumnLast),e.choiceShowColumnAll=e.choiceShowColumnLast.length===e.tableDataColumns.length}),10)},choiceShowColumnDrawerClose:function(){this.choiceShowColumnDrawer=!1},choiceShowColumnOk:function(){var e=this.$refs.showColumnTree.getCheckedKeys();e.length<=0?this.$message.warning("必须选择一列展示"):(bt.set.save(this.storageKey.key,this.storageKey.subKey,e.join(","),50),this.choiceShowColumnLast=e,this.choiceShowColumnDrawer=!1,this.doExecutorClick())},tableDataColumnsCheckChange:function(){var e=this.$refs.showColumnTree.getCheckedKeys();this.choiceShowColumnAll=e.length===this.tableDataColumns.length},choiceShowColumnAllChange:function(){var e=[];this.choiceShowColumnAll&&(e=this.tableDataColumns.map((function(e){return e.name}))),this.$refs.showColumnTree.setCheckedKeys(e)}}},yt=vt,xt=(a("fd56"),Object(D["a"])(yt,ot,it,!1,null,"4d5e1d0f",null)),wt=xt.exports,Ct=function(){var e=this,t=e._self._c;return t("div",{staticClass:"data-executor-vue"},[e._m(0),t("el-dialog",{attrs:{visible:e.choiceRelationColumnVisible,width:"750px",title:"选择关联的表字段 "+e.editNodeInfo.tableName+"."+e.editNodeInfo.columnName},on:{"update:visible":function(t){e.choiceRelationColumnVisible=t}}},[e._l(e.editRelationArr,(function(a){return t("div",{staticStyle:{"margin-top":"10px"}},[t("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择数据库"},on:{change:function(t){return e.dbNameChangeEvents(a)}},model:{value:a.dbName,callback:function(t){e.$set(a,"dbName",t)},expression:"item.dbName"}},e._l(e.databaseList,(function(e){return t("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1),t("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择数据表"},on:{change:function(t){return e.tableNameChangeEvents(a)}},model:{value:a.tableName,callback:function(t){e.$set(a,"tableName",t)},expression:"item.tableName"}},e._l(e.dbTableList[a.dbName],(function(e){return t("el-option",{key:e.tableName,attrs:{label:e.tableName,value:e.tableName}})})),1),t("el-select",{staticStyle:{"margin-right":"10px",width:"200px"},attrs:{filterable:"",placeholder:"请选择表字段"},model:{value:a.columnName,callback:function(t){e.$set(a,"columnName",t)},expression:"item.columnName"}},e._l(e.dbTableColumnList[a.dbName+"."+a.tableName],(function(e){return t("el-option",{key:e.name,attrs:{label:e.name,value:e.name}})})),1),t("el-button",{attrs:{icon:"el-icon-delete",circle:""},on:{click:function(t){return e.delTableColumnRelation(a)}}})],1)})),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.addTableColumnRelation}},[e._v("添加关联")]),t("el-button",{attrs:{type:"primary"},on:{click:e.doUpdateTableColumnRelation}},[e._v("确 定")])],1)],2)],1)},St=[function(){var e=this,t=e._self._c;return t("div",{staticStyle:{width:"max(100%, 1000px)",height:"calc(100vh - 160px)",overflow:"auto"}},[t("div",{staticStyle:{width:"1500px",height:"1000px"},attrs:{id:"relationChart"}})])}],Dt=a("313e"),kt={name:"tableRelation",data:function(){return{pageParam:{},relationChart:{},relationChartData:{},relationChartOption:{},editNodeInfo:{},editRelationArr:[],databaseList:[],dbTableList:{},dbTableColumnList:{},choiceRelationColumnVisible:!1,columnListLoading:!1}},mounted:function(){},methods:{init:function(e){var t=this;this.pageParam.sourceId!=e.sourceId&&(this.pageParam=e,this.relationChartData.name=e.tableName,this.relationChart=Dt["init"](document.getElementById("relationChart")),this.relationChartOption={tooltip:{trigger:"item",triggerOn:"mousemove"},series:[{type:"tree",id:0,name:"tree1",data:[this.relationChartData],top:"10%",left:"8%",bottom:"22%",right:"20%",symbolSize:7,edgeShape:"polyline",edgeForkPosition:"63%",initialTreeDepth:3,lineStyle:{width:2},label:{backgroundColor:"#fff",position:"right",verticalAlign:"middle",align:"left"},leaves:{label:{position:"right",verticalAlign:"middle",align:"left"}},emphasis:{focus:"descendant"},expandAndCollapse:!1,animationDuration:550,animationDurationUpdate:750}]},this.relationChart.setOption(this.relationChartOption),this.relationChart.on("click",(function(e){if(1==e.data.nodeType){t.editNodeInfo=e.data;var a=t.editNodeInfo.children||[];t.editRelationArr=[],a.length<=0?t.editRelationArr.push({dbName:t.pageParam.dbName,tableName:"",columnName:""}):a.forEach((function(e){t.editRelationArr.push({dbName:e.dbName,tableName:e.tableName,columnName:e.columnName})}));var o=[],i=[];t.editRelationArr.forEach((function(e){o.indexOf(e.dbName)<0&&(o.push(e.dbName),t.dbNameChangeEvents(e)),i.indexOf(e.dbName+"."+e.tableName)<0&&(i.push(e.dbName+"."+e.tableName),t.tableNameChangeEvents(e))})),t.choiceRelationColumnVisible=!0}})),this.relationChart.on("contextmenu",(function(e){console.log(e)})),this.doGetTableColumnRelation(),v.databaseList({sourceId:this.pageParam.sourceId}).then((function(e){t.databaseList=e.data||[]})))},doGetTableColumnRelation:function(){var e=this;this.relationChart.clear(),v.getTableColumnRelation(this.pageParam).then((function(t){e.relationChartData=t.data||{},e.relationChartOption.series[0].data=[t.data||{}],e.columnListLoading=!1,e.relationChart.setOption(e.relationChartOption),setTimeout((function(){return e.relationChart.resize()}),0)}))},delTableColumnRelation:function(e){this.editRelationArr=this.editRelationArr.filter((function(t){return t!==e}))},addTableColumnRelation:function(){this.editRelationArr.push({dbName:this.pageParam.dbName,tableName:"",columnName:""})},doUpdateTableColumnRelation:function(){var e=this,t={dbName:this.editNodeInfo.dbName,tableName:this.editNodeInfo.tableName,columnName:this.editNodeInfo.columnName,sourceId:this.pageParam.sourceId,relation:JSON.stringify(this.editRelationArr)};v.updateTableColumnRelation(t).then((function(t){e.choiceRelationColumnVisible=!1,e.doGetTableColumnRelation()}))},dbNameChangeEvents:function(e){var t=this;v.tableList({sourceId:this.pageParam.sourceId,dbName:e.dbName}).then((function(a){t.$set(t.dbTableList,e.dbName,a.data||[])}))},tableNameChangeEvents:function(e){var t=this;v.tableColumnList({sourceId:this.pageParam.sourceId,dbName:e.dbName,tableName:e.tableName}).then((function(a){t.$set(t.dbTableColumnList,e.dbName+"."+e.tableName,a.data.columnList||[])}))}}},_t=kt,Lt=(a("a395"),Object(D["a"])(_t,Ct,St,!1,null,null,null)),It=Lt.exports,Et={data:function(){return{columnListLoading:!1,vueQueryParam:{},tableStatusInfo:{},columnList:[],tableInfo:{},nowExecutorId:1,tableDDLInfoTab:"",tableDDLInfo:"",tableDDLInfoDialogVisible:!1,tabActiveName:"columns"}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500)},activated:function(){this.initQueryParam(this.$route)},components:{"data-preview":wt,"table-relation-charts":It},methods:{initQueryParam:function(e){var t=this;this.columnListLoading||(this.columnListLoading=!0,this.vueQueryParam=e.query,v.tableColumnList(this.vueQueryParam).then((function(e){for(var a=e.data.columnList||[],o=0;o<a.length;o++)a[o].inEdit=0,a[o].description=a[o].description||"",a[o].newDesc=a[o].description;t.columnList=a;var i=e.data.tableInfo||{};i.inEdit=0,i.newDesc=i.description,t.tableInfo=i;var r={key:t.$route.fullPath,val:i.tableName};t.$store.commit("global/addTableName",r),t.columnListLoading=!1})),v.tableStatus(this.vueQueryParam).then((function(e){t.tableStatusInfo=e.data||{}})))},tabActiveNameChange:function(){var e=this;if("relationChart"==this.tabActiveName)this.$refs.relationChart.init({sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName});else if("tableData"==this.tabActiveName){if(!this.columnList||this.columnList.length<=0)return this.$message.error("字段信息尚未加载成功,请稍候..."),void setTimeout((function(){return e.tabActiveName="columns"}),0);var t=this.columnList.find((function(e){return 1==e.primaryKey}))||this.columnList[0];this.$refs.dataPreview.init({sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName,host:this.vueQueryParam.host,dbType:this.tableStatusInfo.dbType,orderColumn:t.name},this.columnList)}},onCopySuccess:function(e){this.$message.success("内容已复制到剪切板!")},onCopyError:function(e){this.$message.error("抱歉,复制失败!")},showCreateTableDdl:function(){var e=this;this.tableDDLInfo="";var t={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,tableName:this.vueQueryParam.tableName},a=this.$loading({lock:!0,text:"加载中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});this.tableDDLInfoTab="",this.tableDDLInfoDialogVisible=!1,v.queryTableDdl(t).then((function(t){a.close(),e.tableDDLInfo=t.data||{},e.tableDDLInfoTab=e.tableDDLInfo.current,setTimeout((function(){return e.tableDDLInfoDialogVisible=!0}),0)})).catch((function(){a.close()}))},descBoxClick:function(e){e.inEdit=1},getBytesSize:function(e){if(!e)return"0 bytes";var t=1024;return e<t?e+" bytes":e<Math.pow(t,2)?(e/t).toFixed(2)+"KB":e<Math.pow(t,3)?(e/Math.pow(t,2)).toFixed(2)+"MB":e<Math.pow(t,4)?(e/Math.pow(t,3)).toFixed(2)+"GB":(e/Math.pow(t,4)).toFixed(2)+"TB"},saveColumnDescription:function(e){var t=this;0!=e.inEdit&&e.description!=e.newDesc?(e.inEdit=0,this.vueQueryParam.columnName=e.name,this.vueQueryParam.newDesc=e.newDesc,v.updateTableColumnDesc(this.vueQueryParam).then((function(){e.description=e.newDesc,t.$message.success("修改成功")}))):e.inEdit=0},saveTableDescription:function(){var e=this;0!=this.tableInfo.inEdit&&this.tableInfo.description!=this.tableInfo.newDesc?(this.tableInfo.inEdit=0,this.vueQueryParam.newDesc=this.tableInfo.newDesc,v.updateTableDesc(this.vueQueryParam).then((function(){e.tableInfo.description=e.tableInfo.newDesc,e.$message.success("修改成功")}))):this.tableInfo.inEdit=0}}},Nt=Et,Tt=(a("d133"),Object(D["a"])(Nt,tt,at,!1,null,null,null)),Pt=Tt.exports,qt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-database-vue"},[t("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("库信息")]),t("el-row",{staticStyle:{"margin-bottom":"20px"}},[t("el-col",{attrs:{span:12}},[t("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),t("el-col",{attrs:{span:12}},[t("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))])],1),t("el-row",[t("el-col",{attrs:{span:24}},[t("span",{staticClass:"label"},[e._v("关键字:")]),t("el-input",{staticStyle:{width:"350px","margin-right":"10px"},attrs:{placeholder:"输入字段名或注释搜索库中相关的表或字段信息"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),t("el-button",{staticClass:"search-submit",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.searchSubmit}},[e._v("模糊搜索")]),t("el-button",{attrs:{icon:"el-icon-coin"},on:{click:e.funcManage}},[e._v("函数管理")])],1)],1)],1),t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.columnListLoading,expression:"columnListLoading"}],staticStyle:{padding:"10px"}},[t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.columnList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"tableName",label:"表名",width:"200"}}),t("el-table-column",{attrs:{prop:"columnName",label:"字段名",width:"200"}}),t("el-table-column",{attrs:{prop:"description",label:"注释"}})],1)],1)],1)},Ot=[],zt={data:function(){return{columnListLoading:!1,vueQueryParam:{},columnList:[],tableInfo:[],keyword:""}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500)},activated:function(){this.initQueryParam(this.$route)},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:this.vueQueryParam.dbName};this.$store.commit("global/addTableName",t)},searchSubmit:function(){var e=this;this.columnListLoading=!0,this.vueQueryParam.searchText=this.keyword,v.tableAndColumnBySearch(this.vueQueryParam).then((function(t){e.columnList=t.data||[],e.columnListLoading=!1}))},funcManage:function(){this.$router.push({path:"/procedure/list",query:this.vueQueryParam})}}},$t=zt,Ft=(a("33e3"),Object(D["a"])($t,qt,Ot,!1,null,null,null)),At=Ft.exports,jt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-procedure-vue"},[t("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("库信息")]),t("el-row",[t("el-col",{attrs:{span:12}},[t("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),t("el-col",{attrs:{span:12}},[t("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))])],1)],1),t("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never",header:"函数管理"}},[t("el-form",{attrs:{inline:!0}},[t("el-form-item",{attrs:{label:"名称"}},[t("el-input",{attrs:{placeholder:"名字"},model:{value:e.searchParam.name,callback:function(t){e.$set(e.searchParam,"name",t)},expression:"searchParam.name"}})],1),t("el-form-item",{attrs:{label:"类型"}},[t("el-select",{attrs:{placeholder:"类型"},model:{value:e.searchParam.type,callback:function(t){e.$set(e.searchParam,"type",t)},expression:"searchParam.type"}},[t("el-option",{attrs:{value:""}},[e._v("全部")]),t("el-option",{attrs:{value:"PROCEDURE",label:"存储过程"}}),t("el-option",{attrs:{value:"FUNCTION",label:"函数"}})],1)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.procedureListLoading,icon:"el-icon-search"},on:{click:e.searchProcedureList}},[e._v("查询")]),t("el-button",{attrs:{icon:"el-icon-circle-plus-outline"},on:{click:e.createProc}},[e._v("新建函数")])],1)],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.procedureList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"名称",width:"200"}}),t("el-table-column",{attrs:{prop:"type",label:"类型",width:"200"}}),t("el-table-column",{attrs:{prop:"definer",label:"定义者"}}),t("el-table-column",{attrs:{prop:"created",label:"创建时间"}}),t("el-table-column",{attrs:{prop:"action",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.doEditProc(a.row)}}},[e._v("编辑")]),t("el-button",{attrs:{type:"danger"},on:{click:function(t){return e.doDeleteProc(a.row)}}},[e._v("删除")])]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})],1),t("el-dialog",{attrs:{inline:!0,title:"新建函数",visible:e.newProcedureDialogVisible,width:"760px"},on:{"update:visible":function(t){e.newProcedureDialogVisible=t}}},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:"类型:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型"},model:{value:e.newProcedureInfo.type,callback:function(t){e.$set(e.newProcedureInfo,"type",t)},expression:"newProcedureInfo.type"}},[t("el-option",{attrs:{value:"PROCEDURE",label:"存储过程"}}),t("el-option",{attrs:{value:"FUNCTION",label:"函数"}})],1)],1),t("el-form-item",{attrs:{label:"函数名:"}},[t("el-input",{attrs:{placeholder:"请输入函数名"},model:{value:e.newProcedureInfo.name,callback:function(t){e.$set(e.newProcedureInfo,"name",t)},expression:"newProcedureInfo.name"}})],1)],1),t("div",{staticStyle:{"text-align":"center"},attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.newProcedureOk}},[e._v("下一步")]),t("el-button",{attrs:{plain:""},on:{click:function(t){e.newProcedureDialogVisible=!1}}},[e._v("取消")])],1)],1)],1)},Vt=[],Rt={data:function(){return{procedureListLoading:!1,vueQueryParam:{},procedureList:[],newProcedureDialogVisible:!1,newProcedureInfo:{type:"",name:""},searchParam:{name:"",type:""},pageSize:30,currentPage:1,tableTotalCount:0}},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500),this.initQueryParam(this.$route),this.searchProcedureList()},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:"函数管理"};this.$store.commit("global/addTableName",t)},handleCurrentChange:function(e){this.currentPage=e,this.searchProcedureList()},handlePageSizeChange:function(e){this.pageSize=e,this.searchProcedureList()},searchProcedureList:function(){var e=this;this.procedureListLoading=!0;var t=Object(J["a"])(Object(J["a"])(Object(J["a"])({},this.vueQueryParam),this.searchParam),{},{pageNum:this.currentPage,pageSize:this.pageSize});v.procedureList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.procedureList=t.data||[],e.procedureListLoading=!1})).catch((function(){e.procedureListLoading=!1}))},doEditProc:function(e){var t=Object(J["a"])(Object(J["a"])({},this.vueQueryParam),{},{typeName:e.type,procName:e.name});this.$router.push({path:"/procedure/edit",query:t})},createProc:function(){this.newProcedureDialogVisible=!0},newProcedureOk:function(){if(this.newProcedureInfo.type)if(this.newProcedureInfo.name){var e=Object(J["a"])(Object(J["a"])({},this.vueQueryParam),{},{typeName:this.newProcedureInfo.type,procName:this.newProcedureInfo.name});this.newProcedureDialogVisible=!1,this.newProcedureInfo={type:"",name:""},this.$router.push({path:"/procedure/edit",query:e})}else this.$message.error("请先输入函数名");else this.$message.error("请先选择类型")},doDeleteProc:function(e){var t=this,a={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,typeName:e.type,procName:e.name};this.$confirm("确定要删除此存储过程吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){v.deleteProcedure(a).then((function(e){t.$message.success("删除成功!"),t.searchProcedureList()}))})).catch((function(){}))}}},Ut=Rt,Mt=(a("f210"),Object(D["a"])(Ut,jt,Vt,!1,null,null,null)),Qt=Mt.exports,Bt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-procedure-edit-vue"},[t("el-card",{staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e._v("函数信息")]),t("el-row",[t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("数据源:")]),e._v(e._s(e.vueQueryParam.host))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("数据库:")]),e._v(e._s(e.vueQueryParam.dbName))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("类型:")]),e._v(e._s(e.vueQueryParam.typeName))]),t("el-col",{attrs:{span:6}},[t("span",{staticClass:"label"},[e._v("名称:")]),e._v(e._s(e.vueQueryParam.procName))])],1)],1),t("el-card",{directives:[{name:"loading",rawName:"v-loading",value:e.procedureInfoLoading,expression:"procedureInfoLoading"}],staticStyle:{margin:"10px"},attrs:{shadow:"never"}},[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[t("span",{staticStyle:{"margin-right":"20px"}},[e._v("编辑函数")]),t("el-button",{attrs:{type:"primary",icon:"el-icon-document-checked",size:"mini"},on:{click:e.saveProcedure}},[e._v("保存")]),t("el-button",{attrs:{type:"",icon:"el-icon-document",size:"mini"},on:{click:e.showProcedureLog}},[e._v("修改日志")])],1),t("ace-editor",{staticStyle:{"margin-bottom":"10px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"500",options:e.sqlEditorConfig},on:{init:e.sqlExecutorInit},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}})],1),t("el-dialog",{attrs:{title:"保存函数失败",visible:e.saveProcedureErrVisible,footer:null},on:{"update:visible":function(t){e.saveProcedureErrVisible=t}}},[t("div",{staticStyle:{width:"700px","max-height":"500px",overflow:"auto"}},[t("pre",[e._v(e._s(e.saveProcedureErrInfo))])])]),t("el-dialog",{attrs:{title:"函数修改日志",visible:e.procLogVisible,footer:null},on:{"update:visible":function(t){e.procLogVisible=t}}},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.procLogList,stripe:"",border:"",height:"400"}},[t("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),t("el-table-column",{attrs:{prop:"createUserName",label:"修改人"}}),t("el-table-column",{attrs:{prop:"createTime",label:"修改时间"}}),t("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(a){return[1==a.row.status?t("el-tag",{attrs:{type:"success"}},[e._v("保存成功")]):2==a.row.status?t("el-tag",{attrs:{type:"danger"}},[e._v("保存失败")]):t("el-tag",{attrs:{type:"danger"}},[e._v("-")])]}}])}),t("el-table-column",{attrs:{prop:"action",label:"操作",width:"130"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:""},on:{click:function(t){return e.reEditProc(a.row.id)}}},[e._v("重新编辑")])]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"10px"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}})],1)],1)},Gt=[],Ht={data:function(){return{procedureInfoLoading:!1,vueQueryParam:{},procedureInfo:{},sqlExecutorEditor:{},saveProcedureErrInfo:"",saveProcedureErrVisible:!1,procLogVisible:!1,procLogList:[],pageSize:30,currentPage:1,tableTotalCount:0,sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:20,maxLines:40}}},components:{"ace-editor":ft},mounted:function(){var e=this;setTimeout((function(){e.$emit("initLoadDataList",{sourceId:e.vueQueryParam.sourceId,host:e.vueQueryParam.host,dbName:e.vueQueryParam.dbName})}),500),this.initQueryParam(this.$route),this.searchProcedureDetail()},methods:{initQueryParam:function(e){this.vueQueryParam=e.query;var t={key:this.$route.fullPath,val:"编辑函数"};this.$store.commit("global/addTableName",t)},sqlExecutorInit:function(e){this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var t=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:function(e){t.saveProcedure()}})},handleCurrentChange:function(e){this.currentPage=e,this.searchProcedureLogList()},handlePageSizeChange:function(e){this.pageSize=e,this.searchProcedureLogList()},showProcedureLog:function(){this.currentPage=1,this.procLogVisible=!0,this.searchProcedureLogList()},searchProcedureLogList:function(){var e=this,t=Object(J["a"])(Object(J["a"])(Object(J["a"])({},this.vueQueryParam),this.searchParam),{},{pageNum:this.currentPage,pageSize:this.pageSize});v.procedureLogList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.procLogList=t.data||[]}))},reEditProc:function(e){var t=this;v.procedureLogDetail({logId:e}).then((function(e){var a=e.data||{};t.sqlExecutorEditor.setValue(a.procBody,1),t.procLogVisible=!1}))},searchProcedureDetail:function(){var e=this;this.procedureInfoLoading=!0,v.procedureDetail(this.vueQueryParam).then((function(t){e.procedureInfo=t.data||{},e.procedureInfoLoading=!1,e.sqlExecutorEditor.setValue(e.procedureInfo.body,1)})).catch((function(){e.procedureInfoLoading=!1}))},saveProcedure:function(){var e=this;this.procedureInfoLoading=!0;var t=Object(J["a"])(Object(J["a"])({},this.vueQueryParam),{},{procSql:this.sqlExecutorEditor.getValue()});v.saveProcedure(t).then((function(t){e.procedureInfoLoading=!1;var a=t.data||{};a.errMsg?(e.saveProcedureErrInfo=a.errMsg,e.saveProcedureErrVisible=!0):e.$message.success("保存成功!")})).catch((function(){e.procedureInfoLoading=!1}))},doDeleteProc:function(e){var t=this,a={sourceId:this.vueQueryParam.sourceId,dbName:this.vueQueryParam.dbName,typeName:e.type,procName:e.name};this.$confirm("确定要删除此存储过程吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){v.deleteProcedure(a).then((function(e){t.$message.success("删除成功!")}))})).catch((function(){}))},initAceEditor:function(e,t){return ace.edit(e,{theme:"ace/theme/monokai",mode:"ace/mode/sql",wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:t,maxLines:40})}}},Jt=Ht,Kt=(a("1194"),Object(D["a"])(Jt,Bt,Gt,!1,null,null,null)),Wt=Kt.exports,Xt=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{padding:"0 10px"}},[t("el-form",{attrs:{inline:!0}},[t("el-form-item",{attrs:{label:"名字"}},[t("el-input",{attrs:{placeholder:"名字"},model:{value:e.searchParam.name,callback:function(t){e.$set(e.searchParam,"name",t)},expression:"searchParam.name"}})],1),t("el-form-item",{attrs:{label:"分组"}},[t("el-select",{attrs:{placeholder:"分组"},model:{value:e.searchParam.groupName,callback:function(t){e.$set(e.searchParam,"groupName",t)},expression:"searchParam.groupName"}},[t("el-option",{attrs:{value:""}},[e._v("全部")]),e._l(e.datasourceGroupList,(function(e){return t("el-option",{attrs:{value:e}})}))],2)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.loadDataListLoading,icon:"el-icon-search"},on:{click:e.getDatasourceList}},[e._v("查询")]),t("el-button",{attrs:{icon:"el-icon-circle-plus-outline"},on:{click:e.addDatasource}},[e._v("新增")])],1)],1),t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.datasourceList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"名字"}}),t("el-table-column",{attrs:{prop:"groupName",label:"分组"}}),t("el-table-column",{attrs:{prop:"driverClassName",label:"驱动类"}}),t("el-table-column",{attrs:{prop:"sourceName",label:"账号"}}),t("el-table-column",{attrs:{label:"操作",width:"220"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.editDatasource(a.row)}}},[e._v("修改")]),t("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(t){return e.editDbAuth(a.row)}}},[e._v("权限")]),t("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.deleteDatasource(a.row)}}},[e._v("删除")])]}}])})],1),t("el-pagination",{staticStyle:{margin:"10px 0 20px 0","text-align":"right"},attrs:{"current-page":e.currentPage,"page-sizes":[10,30,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.tableTotalCount},on:{"size-change":e.handlePageSizeChange,"current-change":e.handleCurrentChange}}),t("el-dialog",{attrs:{inline:!0,title:e.newDatasource.id>0?"编辑数据源":"新增数据源",visible:e.datasourceDialogVisible,width:"760px","close-on-click-modal":!1},on:{"update:visible":function(t){e.datasourceDialogVisible=t}}},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:"分组:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择或输入新的分组名字",filterable:"","allow-create":""},model:{value:e.newDatasource.groupName,callback:function(t){e.$set(e.newDatasource,"groupName",t)},expression:"newDatasource.groupName"}},[t("el-option",{attrs:{value:""}},[e._v("未分组")]),e._l(e.datasourceGroupList,(function(e){return t("el-option",{attrs:{value:e}})}))],2)],1),t("el-form-item",{attrs:{label:"数据源名称:"}},[t("el-input",{attrs:{placeholder:"给数据源起个中文名称"},model:{value:e.newDatasource.name,callback:function(t){e.$set(e.newDatasource,"name",t)},expression:"newDatasource.name"}})],1),t("el-form-item",{attrs:{label:"驱动类:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"驱动类"},on:{change:e.driverClassNameChange},model:{value:e.newDatasource.driverClassName,callback:function(t){e.$set(e.newDatasource,"driverClassName",t)},expression:"newDatasource.driverClassName"}},[t("el-option",{attrs:{label:"com.mysql.jdbc.Driver",value:"com.mysql.jdbc.Driver"}}),t("el-option",{attrs:{label:"net.sourceforge.jtds.jdbc.Driver",value:"net.sourceforge.jtds.jdbc.Driver"}}),t("el-option",{attrs:{label:"oracle.jdbc.driver.OracleDriver",value:"oracle.jdbc.driver.OracleDriver"}}),t("el-option",{attrs:{label:"org.postgresql.Driver",value:"org.postgresql.Driver"}}),t("el-option",{attrs:{label:"org.apache.hive.jdbc.HiveDriver",value:"org.apache.hive.jdbc.HiveDriver"}}),t("el-option",{attrs:{label:"dm.jdbc.driver.DmDriver",value:"dm.jdbc.driver.DmDriver"}})],1)],1),t("el-form-item",{attrs:{label:"数据源URL:"}},[t("el-input",{attrs:{placeholder:e.urlPlaceholder,disabled:e.sourceUrlDisabled&&!e.newDatasource.id>0},model:{value:e.newDatasource.sourceUrl,callback:function(t){e.$set(e.newDatasource,"sourceUrl",t)},expression:"newDatasource.sourceUrl"}},[t("el-button",{attrs:{slot:"append",disabled:e.sourceUrlDisabled&&!e.newDatasource.id>0},on:{click:e.autoFillDialog},slot:"append"},[e._v("智能填入")])],1)],1),t("el-form-item",{attrs:{label:"账号:"}},[t("el-input",{attrs:{placeholder:"账号"},model:{value:e.newDatasource.sourceName,callback:function(t){e.$set(e.newDatasource,"sourceName",t)},expression:"newDatasource.sourceName"}})],1),t("el-form-item",{attrs:{label:"密码:"}},[t("el-input",{attrs:{placeholder:"密码"},model:{value:e.newDatasource.sourcePassword,callback:function(t){e.$set(e.newDatasource,"sourcePassword",t)},expression:"newDatasource.sourcePassword"}})],1),t("el-form-item",{attrs:{label:"测试连接:"}},[t("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.testDatasourceErrLoading,expression:"testDatasourceErrLoading"}],attrs:{type:"primary"},on:{click:e.testDatasource}},[e._v("测试数据源")])],1)],1),t("div",{staticStyle:{"text-align":"center"},attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveDatasource}},[e._v("保存")]),t("el-button",{attrs:{plain:""},on:{click:function(t){e.datasourceDialogVisible=!1}}},[e._v("取消")])],1)],1),t("el-dialog",{attrs:{visible:e.dbSourceAuthDialogVisible,width:"900px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dbSourceAuthDialogVisible=t}}},[t("span",{attrs:{slot:"title"},slot:"title"},[t("span",[e._v("权限编辑")]),t("span",{staticStyle:{"margin-left":"10px",color:"#999","font-size":"12px"}},[t("i",{staticClass:"el-icon-info"}),e._v(" 添加、删除或编辑之后记得点击保存哦~")])]),t("el-row",[t("el-select",{staticStyle:{width:"750px","margin-right":"10px"},attrs:{filterable:"",remote:"","reserve-keyword":"",autoComplete:"new-password",placeholder:"请输入名字、邮箱、账号搜索用户","remote-method":e.getSearchUserList,loading:e.dbSourceAuthUserLoading},model:{value:e.dbSourceAuthNewUser,callback:function(t){e.dbSourceAuthNewUser=t},expression:"dbSourceAuthNewUser"}},e._l(e.searchUserList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.userName,value:e.id}})})),1),t("el-button",{on:{click:e.addDbSourceAuthUser}},[e._v("添加")])],1),t("el-table",{staticStyle:{width:"100%",margin:"10px 0"},attrs:{data:e.dbSourceAuthUserList,border:"",size:"mini"}},[t("el-table-column",{attrs:{prop:"userName",label:"用户",width:"150"}}),t("el-table-column",{attrs:{label:"权限"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-select",{staticStyle:{width:"150px","margin-right":"10px"},attrs:{placeholder:"选择权限"},model:{value:a.row.executeAuth,callback:function(t){e.$set(a.row,"executeAuth",t)},expression:"scope.row.executeAuth"}},[t("el-option",{attrs:{value:""}},[e._v("无权限")]),t("el-option",{attrs:{value:1,label:"库表查看权"}}),t("el-option",{attrs:{value:2,label:"数据查询权"}}),t("el-option",{attrs:{value:3,label:"所有权限"}})],1),t("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:a.row.descEditAuth,callback:function(t){e.$set(a.row,"descEditAuth",t)},expression:"scope.row.descEditAuth"}},[e._v("表字段注释修改权")]),t("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:a.row.procEditAuth,callback:function(t){e.$set(a.row,"procEditAuth",t)},expression:"scope.row.procEditAuth"}},[e._v("函数修改权")])]}}])}),t("el-table-column",{attrs:{label:"操作",width:"80"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"small",type:"danger",plain:""},on:{click:function(t){return e.deleteUserDbSourceAuth(a.row)}}},[e._v("删除")])]}}])})],1),t("div",[t("el-button",{attrs:{type:"primary"},on:{click:e.saveUserDbSourceAuth}},[e._v("保存配置")])],1)],1),t("el-dialog",{attrs:{title:"测试数据源失败",visible:e.testDatasourceErrVisible,footer:null,width:"760px"},on:{"update:visible":function(t){e.testDatasourceErrVisible=t}}},[t("div",{directives:[{name:"highlight",rawName:"v-highlight"}]},[t("pre",[t("code",{domProps:{innerHTML:e._s(e.testDatasourceErrInfo)}})])])]),t("el-dialog",{attrs:{title:"智能填入",visible:e.autoFillDialogVisible,width:"30%","close-on-click-modal":!1},on:{"update:visible":function(t){e.autoFillDialogVisible=t}}},[t("el-form",{ref:"autoFillForm",attrs:{model:e.autoFillForm,rules:e.rules,"label-width":"90px"}},[t("el-form-item",{attrs:{label:"主机地址",prop:"hostIp"}},[t("el-input",{attrs:{placeholder:"请输入主机地址"},model:{value:e.autoFillForm.hostIp,callback:function(t){e.$set(e.autoFillForm,"hostIp",t)},expression:"autoFillForm.hostIp"}})],1),t("el-form-item",{attrs:{label:"端口号",prop:"port"}},[t("el-input",{attrs:{placeholder:"请输入数据库端口号"},model:{value:e.autoFillForm.port,callback:function(t){e.$set(e.autoFillForm,"port",t)},expression:"autoFillForm.port"}})],1),e.oracleServerNameShow?t("el-form-item",{attrs:{label:"服务名",prop:"serverName"}},[t("template",{slot:"label"},[t("span",[e._v("服务名 "),t("el-tooltip",{staticClass:"item",attrs:{effect:"dark",placement:"right"}},[t("i",{staticClass:"el-icon-question",staticStyle:{"font-size":"16px","vertical-align":"middle"}}),t("div",{attrs:{slot:"content"},slot:"content"},[t("p",[e._v("oracle数据库服务名默认为ORCL")]),t("p",[e._v("可使用下面的命令来查看服务名")]),t("p",[e._v("select global_name from global_name;")])])])],1)]),t("el-input",{attrs:{placeholder:"请输入服务名"},model:{value:e.autoFillForm.serverName,callback:function(t){e.$set(e.autoFillForm,"serverName",t)},expression:"autoFillForm.serverName"}}),t("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"Top Left 提示文字",placement:"top-start"}},[t("i",{staticClass:"el-icon-question-solid"})])],2):e._e()],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.autoFillDialogVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.autoFill("autoFillForm")}}},[e._v("确 定")])],1)],1)],1)},Yt=[],Zt={data:function(){return{loadDataListLoading:!1,datasourceDialogVisible:!1,autoFillDialogVisible:!1,datasourceList:[],searchParam:{name:"",groupName:""},pageSize:30,currentPage:1,tableTotalCount:0,newDatasource:{},urlPlaceholder:"数据源URL",dbSourceAuthDialogVisible:!1,dbSourceAuthUserList:[],dbSourceAuthUserLoading:!1,searchUserList:[],dbSourceAuthNewUser:"",testDatasourceErrInfo:"",testDatasourceErrVisible:!1,testDatasourceErrLoading:!1,datasourceGroupList:[],sourceUrlDisabled:!0,autoFillForm:{hostIp:null,port:null,serverName:null},oracleServerNameShow:!1,rules:{hostIp:[{required:!0,message:"请输入主机地址",trigger:"blur"}],port:[{required:!0,message:"请输入数据库端口号",trigger:"blur"}],serverName:[{required:!0,message:"请输入数据库服务名",trigger:"blur"}]}}},mounted:function(){this.getDatasourceList(),this.getDatasourceGroupList()},methods:{editDbAuth:function(e){this.newDatasource=JSON.parse(JSON.stringify(e)),this.dbSourceAuthDialogVisible=!0,this.loadDbAuthUserList()},loadDbAuthUserList:function(){var e=this;this.dbSourceAuthNewUser=[],this.dbSourceAuthUserList=[];var t={sourceId:this.newDatasource.id};v.dbUserAuthList(t).then((function(t){e.dbSourceAuthUserList=t.data||[]}))},saveUserDbSourceAuth:function(){var e=this,t={sourceId:this.newDatasource.id,authList:JSON.stringify(this.dbSourceAuthUserList)};v.assignDbUserAuth(t).then((function(){e.$message.success("保存成功")}))},autoFillDialog:function(){this.autoFillDialogVisible=!0;var e=this.newDatasource.driverClassName;"com.mysql.jdbc.Driver"===e?this.autoFillForm.port="3306":"net.sourceforge.jtds.jdbc.Driver"===e?this.autoFillForm.port="33434":"oracle.jdbc.driver.OracleDriver"===e?(this.autoFillForm.port="1521",this.oracleServerNameShow=!0):"org.postgresql.Driver"===e?this.autoFillForm.port="5432":"org.apache.hive.jdbc.HiveDriver"===e?this.autoFillForm.port="21050":"dm.jdbc.driver.DmDriver"===e&&(this.autoFillForm.port="5236")},autoFill:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;t.autoFillDialogVisible=!1;var a=t.newDatasource.driverClassName,o=t.autoFillForm.hostIp,i=t.autoFillForm.port,r=t.autoFillForm.serverName;"com.mysql.jdbc.Driver"===a?t.newDatasource.sourceUrl="jdbc:mysql://"+o+":"+i:"net.sourceforge.jtds.jdbc.Driver"===a?t.newDatasource.sourceUrl="jdbc:jtds:sqlserver://"+o+":"+i:"oracle.jdbc.driver.OracleDriver"===a?t.newDatasource.sourceUrl="jdbc:oracle:thin:@"+o+":"+i+"/"+r:"org.postgresql.Driver"===a?t.newDatasource.sourceUrl="jdbc:postgresql://"+o+":"+i:"org.apache.hive.jdbc.HiveDriver"===a?t.newDatasource.sourceUrl="jdbc:hive2://"+o+":"+i:"dm.jdbc.driver.DmDriver"===a&&(t.newDatasource.sourceUrl="jdbc:dm://"+o+":"+i)}))},deleteUserDbSourceAuth:function(e){for(var t=[],a=0;a<this.dbSourceAuthUserList.length;a++){var o=this.dbSourceAuthUserList[a];o.userId!=e.userId&&t.push(this.dbSourceAuthUserList[a])}this.dbSourceAuthUserList=t},addDbSourceAuthUser:function(){if(this.dbSourceAuthNewUser.length<=0)this.$message.warning("请先选择用户");else{for(var e="",t=0;t<this.searchUserList.length;t++)if(this.dbSourceAuthNewUser==this.searchUserList[t].id){e=this.searchUserList[t].userName;break}this.dbSourceAuthUserList.push({userName:e,userId:this.dbSourceAuthNewUser,executeAuth:"",descEditAuth:0,procEditAuth:0}),this.dbSourceAuthNewUser=""}},getSearchUserList:function(e){var t=this;e&&(this.dbSourceAuthUserLoading=!0,g.getUserBaseInfo({search:e}).then((function(e){t.searchUserList=e.data||[],t.dbSourceAuthUserLoading=!1})))},addDatasource:function(){this.datasourceDialogVisible=!0,this.testDatasourceErrLoading=!1,this.newDatasource={name:"",driverClassName:"",sourceUrl:"",sourceName:"",sourcePassword:"",groupName:""},this.sourceUrlDisabled=!0},editDatasource:function(e){this.newDatasource=JSON.parse(JSON.stringify(e)),this.datasourceDialogVisible=!0,this.testDatasourceErrLoading=!1},deleteDatasource:function(e){var t=this;this.$confirm("确定要删除此数据源吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.yn=0,v.manageUpdateDatasource(e).then((function(){t.$message.success("删除成功!"),t.$emit("loadDatasourceList"),t.getDatasourceList()}))})).catch((function(){}))},saveDatasource:function(){var e=this;v.manageUpdateDatasource(this.newDatasource).then((function(){e.datasourceDialogVisible=!1,e.$message.success("保存成功!"),e.$emit("loadDatasourceList"),e.getDatasourceList()}))},testDatasource:function(){var e=this;this.testDatasourceErrLoading=!0,v.queryTestDatasource(this.newDatasource).then((function(t){e.testDatasourceErrLoading=!1,200==t.errCode?e.$message.success("连接成功!"):(e.testDatasourceErrVisible=!0,e.testDatasourceErrInfo=t.errMsg||"")})).catch((function(t){e.testDatasourceErrLoading=!1,e.testDatasourceErrVisible=!0,e.testDatasourceErrInfo=t.message||"请求出错"}))},driverClassNameChange:function(){"com.mysql.jdbc.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:mysql://127.0.0.1:3306/user_info?useUnicode=true&characterEncoding=utf8":"net.sourceforge.jtds.jdbc.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:jtds:sqlserver://127.0.0.1:33434;DatabaseName=user_info;socketTimeout=60;":"oracle.jdbc.driver.OracleDriver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:oracle:thin:@127.0.0.1:1521/user_info":"org.postgresql.Driver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:postgresql://127.0.0.1:5432/user_info":"org.apache.hive.jdbc.HiveDriver"==this.newDatasource.driverClassName?this.urlPlaceholder="例:jdbc:hive2://127.0.0.1:21050/user_info;auth=noSasl":"dm.jdbc.driver.DmDriver"==this.newDatasource.driverClassName&&(this.urlPlaceholder="例:jdbc:dm://127.0.0.1:5236?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8"),this.sourceUrlDisabled=!1,this.oracleServerNameShow=!1},handleCurrentChange:function(e){this.currentPage=e,this.getDatasourceList()},handlePageSizeChange:function(e){this.pageSize=e,this.getDatasourceList()},getDatasourceList:function(){var e=this;this.loadDataListLoading=!0;var t=Object(J["a"])(Object(J["a"])({},this.searchParam),{},{pageNum:this.currentPage,pageSize:this.pageSize});v.manageDatasourceList(t).then((function(t){1==e.currentPage&&(e.tableTotalCount=t.total||0),e.datasourceList=t.data||[],setTimeout((function(){e.loadDataListLoading=!1}),800)})).catch((function(){e.loadDataListLoading=!1}))},getDatasourceGroupList:function(){var e=this;v.manageDatasourceGroupList({}).then((function(t){e.datasourceGroupList=t.data||[]}))}}},ea=Zt,ta=(a("db12"),Object(D["a"])(ea,Xt,Yt,!1,null,"336e60d2",null)),aa=ta.exports,oa=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{padding:"0 10px",height:"100%","box-sizing":"border-box"}},[t("el-card",[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("数据库表导出")])]),t("div",{staticStyle:{"margin-bottom":"10px"}},[t("el-select",{attrs:{filterable:"",placeholder:"请选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),t("el-select",{staticStyle:{margin:"0 10px"},attrs:{filterable:"",placeholder:"请选择数据库"},on:{change:e.databaseChangeEvents},model:{value:e.choiceDatabase,callback:function(t){e.choiceDatabase=t},expression:"choiceDatabase"}},e._l(e.databaseList,(function(e){return t("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1),t("el-button",{staticStyle:{margin:"0 10px 0 20px"},attrs:{type:"primary"},on:{click:e.showExportTypeChoice}},[e._v("导出选中的表")]),t("a",{attrs:{target:"_blank",title:"点击查看如何使用",href:"http://doc.zyplayer.com/#/integrate/zyplayer-doc/opensource/117"}},[t("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])],1),t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.tableList,stripe:"",border:""},on:{"selection-change":e.handleSelectionChange}},[t("el-table-column",{attrs:{type:"selection",width:"55"}}),t("el-table-column",{attrs:{prop:"tableName",label:"表名"}}),t("el-table-column",{attrs:{prop:"tableComment",label:"表注释"}})],1)],1),t("form",{ref:"downloadForm",attrs:{method:"post",action:e.downloadFormParam.url,target:"_blank"}},e._l(e.downloadFormParam.param,(function(e,a){return t("input",{attrs:{type:"hidden",name:a},domProps:{value:e}})})),0),t("el-dialog",{attrs:{visible:e.exportTypeChoiceVisible,width:"600px"},on:{"update:visible":function(t){e.exportTypeChoiceVisible=t}}},[t("span",{attrs:{slot:"title"},slot:"title"},[e._v("库表导出选项")]),t("el-form",{attrs:{"label-width":"100px"}},[t("el-form-item",{attrs:{label:"导出类型:"}},[t("el-radio-group",{on:{change:e.exportTypeChange},model:{value:e.exportType,callback:function(t){e.exportType=t},expression:"exportType"}},[t("el-radio",{attrs:{label:3}},[e._v("表数据")]),t("el-radio",{attrs:{label:1}},[e._v("表结构文档")]),t("el-radio",{attrs:{label:2}},[e._v("建表语句SQL")])],1)],1),1==e.exportType?t("el-form-item",{attrs:{label:"导出格式:"}},[t("el-select",{staticStyle:{width:"430px"},attrs:{filterable:"",placeholder:"请选择导出格式"},model:{value:e.exportFormat,callback:function(t){e.exportFormat=t},expression:"exportFormat"}},[t("el-option",{attrs:{label:"HTML格式",value:1}}),t("el-option",{attrs:{label:"Excel格式",value:2}}),t("el-option",{attrs:{label:"Word格式",value:3}})],1)],1):3==e.exportType?[t("el-form-item",{attrs:{label:"导出格式:"}},[t("el-select",{staticStyle:{width:"430px"},attrs:{filterable:"",placeholder:"请选择导出类型"},model:{value:e.downloadType,callback:function(t){e.downloadType=t},expression:"downloadType"}},[t("el-option",{attrs:{label:"SQL Inserts",value:"insert"}}),t("el-option",{attrs:{label:"SQL Updates",value:"update"}}),t("el-option",{attrs:{label:"JSON",value:"json"}}),t("el-option",{attrs:{label:"Excel",value:"excel"}})],1)],1),"insert"===e.downloadType?t("el-form-item",{attrs:{label:"数据表:"}},[t("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.dropTableFlagChange},model:{value:e.dropTableFlag,callback:function(t){e.dropTableFlag=t},expression:"dropTableFlag"}},[e._v("删除表"+e._s(1==e.dropTableFlag?"!!":""))]),t("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.createTableFlagChange},model:{value:e.createTableFlag,callback:function(t){e.createTableFlag=t},expression:"createTableFlag"}},[e._v("创建表")])],1):e._e(),t("el-form-item",{attrs:{label:"导出方式:"}},[t("el-radio-group",{model:{value:e.downloadFileType,callback:function(t){e.downloadFileType=t},expression:"downloadFileType"}},[t("el-radio",{attrs:{label:1}},[e._v("单个文件")]),t("el-radio",{attrs:{label:2}},[e._v("zip压缩文件")])],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.exportTypeChoiceVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.doExport}},[e._v("确 定")])],1)],1)],1)},ia=[],ra={data:function(){return{datasourceOptions:[],datasourceList:[],choiceDatasourceId:"",choiceDatabase:"",choiceTable:"",exportType:3,exportFormat:1,downloadFileType:1,exportTypeChoiceVisible:!1,databaseList:[],tableList:[],selectTables:[],downloadFormParam:{url:"zyplayer-doc-db/doc-db/exportDatabase",param:{}},downloadType:"insert",dropTableFlag:0,createTableFlag:0}},activated:function(){this.initQueryParam(this.$route)},mounted:function(){this.loadDatasourceList()},methods:{initQueryParam:function(e){var t=e.query,a=parseInt(t.sourceId);a&&t.dbName&&(this.choiceDatasourceId===a&&this.choiceDatabase===t.dbName||(this.choiceDatasourceId=a,this.choiceDatabase=t.dbName,this.datasourceChangeEvents(),this.databaseChangeEvents()))},datasourceChangeEvents:function(){this.loadDatabaseList(this.choiceDatasourceId)},databaseChangeEvents:function(){this.loadGetTableList()},exportTypeChange:function(){this.exportFormat=1,console.log(this.exportType)},doExport:function(){var e=this;if(this.exportType)if(this.exportFormat){for(var t="",a=0;a<this.selectTables.length;a++)""!==t&&(t+=","),t+=this.selectTables[a].tableName;this.downloadFormParam.param={sourceId:this.choiceDatasourceId,exportType:this.exportType,exportFormat:this.exportFormat,dbName:this.choiceDatabase,downloadType:this.downloadType,dropTableFlag:this.dropTableFlag,createTableFlag:this.createTableFlag,downloadFileType:this.downloadFileType,tableNames:t},3==this.exportType?this.downloadFormParam.url="zyplayer-doc-db/data-view/downloadMultiple":this.downloadFormParam.url="zyplayer-doc-db/doc-db/exportDatabase",setTimeout((function(){return e.$refs.downloadForm.submit()}),0),this.exportTypeChoiceVisible=!1}else this.$message.info("请选择导出格式");else this.$message.info("请选择导出类型")},showExportTypeChoice:function(){this.selectTables.length<=0?this.$message.info("请选择需要导出的表"):this.exportTypeChoiceVisible=!0},loadGetTableList:function(){var e=this;v.tableList({sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase}).then((function(t){e.tableList=t.data||[]}))},loadDatasourceList:function(){var e=this;v.datasourceList({}).then((function(t){e.datasourceList=t.data||[];for(var a=[],o=0;o<e.datasourceList.length;o++)a.push({label:e.datasourceList[o].name,value:e.datasourceList[o].id});e.datasourceOptions=a}))},loadDatabaseList:function(){var e=this;v.databaseList({sourceId:this.choiceDatasourceId}).then((function(t){e.databaseList=t.data||[]}))},handleSelectionChange:function(e){this.selectTables=e},dropTableFlagChange:function(){1===this.dropTableFlag&&(this.createTableFlag=1)},createTableFlagChange:function(){0==this.createTableFlag&&(this.dropTableFlag=0)}}},na=ra,sa=(a("756e"),Object(D["a"])(na,oa,ia,!1,null,null,null)),la=sa.exports,ca=function(){var e=this,t=e._self._c;return t("div",{staticClass:"data-executor-vue"},[t("div",{staticStyle:{padding:"0 10px 10px",height:"100%","box-sizing":"border-box"}},[t("el-card",{staticStyle:{"margin-bottom":"5px"}},[t("ace-editor",{ref:"sqlEditor",staticStyle:{"margin-bottom":"5px"},attrs:{lang:"sql",theme:"monokai",width:"100%",height:"20",options:e.sqlEditorConfig,source:e.executorSource},on:{init:e.sqlExecutorInit,cursorSelection:e.cursorSelection},model:{value:e.sqlExecutorContent,callback:function(t){e.sqlExecutorContent=t},expression:"sqlExecutorContent"}}),t("div",[e.sqlExecuting?t("el-button",{attrs:{type:"primary",plain:"",size:"mini",icon:"el-icon-video-pause"},on:{click:e.cancelExecutorSql}},[e._v("取消执行 ")]):t("el-tooltip",{attrs:{effect:"dark",content:"Ctrl+R、Ctrl+Enter",placement:"top"}},[t("el-button",{attrs:{type:"primary",plain:"",size:"mini",icon:"el-icon-video-play"},on:{click:e.doExecutorSql}},[e._v(e._s(e.executeButtonText)+" ")])],1),t("el-button",{attrs:{icon:"el-icon-brush",size:"mini"},on:{click:e.formatterSql}},[e._v("SQL美化")]),t("el-button",{attrs:{plain:"",size:"mini",icon:"el-icon-star-off"},on:{click:function(t){return e.addFavorite("")}}},[e._v("收藏")]),t("div",{staticStyle:{float:"right"}},[t("el-select",{staticStyle:{width:"300px","margin-left":"10px"},attrs:{size:"mini",filterable:"",placeholder:"请选择数据源"},on:{change:e.datasourceChangeEvents},model:{value:e.choiceDatasourceId,callback:function(t){e.choiceDatasourceId=t},expression:"choiceDatasourceId"}},e._l(e.datasourceOptions,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),t("el-select",{staticStyle:{width:"200px","margin-left":"10px"},attrs:{size:"mini",filterable:"",placeholder:"请选择数据库"},on:{change:e.databaseChangeEvents},model:{value:e.choiceDatabase,callback:function(t){e.choiceDatabase=t},expression:"choiceDatabase"}},e._l(e.databaseList,(function(e){return t("el-option",{key:e.dbName,attrs:{label:e.dbName,value:e.dbName}})})),1)],1)],1),e.sqlParams.length>0?t("div",{staticClass:"sql-params"},e._l(e.sqlParams,(function(a,o){return t("el-input",{key:o,attrs:{placeholder:"请输入"+a.key+"的值"},model:{value:a.value,callback:function(t){e.$set(a,"value",t)},expression:"param.value"}},[t("template",{slot:"prepend"},[e._v(e._s(a.key))])],2)})),1):e._e()],1),t("el-card",[t("div",{staticStyle:{position:"relative"}},[t("div",{staticStyle:{position:"absolute",right:"0","z-index":"1"}},[t("el-dropdown",{directives:[{name:"show",rawName:"v-show",value:this.choiceResultObj[this.executeShowTable]&&this.choiceResultObj[this.executeShowTable].length>0,expression:"this.choiceResultObj[this.executeShowTable] && this.choiceResultObj[this.executeShowTable].length > 0"}],on:{command:e.handleCopyCheckLineCommand}},[t("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-document-copy"}},[e._v(" 复制选中行"),t("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"insert"}},[e._v("SQL Inserts")]),t("el-dropdown-item",{attrs:{command:"update"}},[e._v("SQL Updates")]),t("el-dropdown-item",{attrs:{command:"json"}},[e._v("JSON")])],1)],1)],1),t("el-tabs",{attrs:{type:"border-card"},on:{"tab-click":e.tabHandleClick},model:{value:e.executeShowTable,callback:function(t){e.executeShowTable=t},expression:"executeShowTable"}},[t("el-tab-pane",{attrs:{label:"执行历史",name:"tabHistory"}},[t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.myHistoryListList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"createTime",label:"执行时间",width:"160px"}}),t("el-table-column",{attrs:{prop:"content",label:"SQL"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("pre",{staticClass:"sql-content-line",attrs:{title:a.row.content},on:{dblclick:function(t){return e.inputFavoriteSql(a.row)}}},[e._v(e._s(a.row.content))])]}}])}),t("el-table-column",{attrs:{label:"操作",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.inputFavoriteSql(a.row)}}},[e._v(" 输入 ")]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"success"},on:{click:function(t){return e.addFavorite(a.row.content)}}},[e._v("收藏 ")])]}}])})],1)],1),t("el-tab-pane",{attrs:{label:"我的收藏",name:"tabFavorite"}},[t("el-table",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll"}],staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.myFavoriteList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"createTime",label:"执行时间",width:"160px"}}),t("el-table-column",{attrs:{prop:"content",label:"SQL"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("pre",{staticClass:"sql-content-line",attrs:{title:a.row.content},on:{dblclick:function(t){return e.inputFavoriteSql(a.row)}}},[e._v(e._s(a.row.content))])]}}])}),t("el-table-column",{attrs:{label:"操作",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.inputFavoriteSql(a.row)}}},[e._v(" 输入 ")]),t("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.delFavorite(a.row)}}},[e._v(" 删除 ")])]}}])})],1)],1),e.executeResultInfo?t("el-tab-pane",{attrs:{label:"信息",name:"tabInfo"}},[t("pre",{staticClass:"execute-result-info"},[e._v(e._s(e.executeResultInfo))])]):e._e(),e.executeError?t("el-tab-pane",{attrs:{label:"错误",name:"tabError"}},[t("div",{staticStyle:{color:"#f00"}},[e._v(e._s(e.executeError))])]):e._l(e.executeResultList,(function(a,o){return t("el-tab-pane",{key:o,attrs:{label:a.label,name:a.name,lazy:""}},[a.errMsg?t("div",{staticStyle:{color:"#f00"}},[e._v(e._s(a.errMsg))]):t("ux-grid",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClickOutside,expression:"handleClickOutside"}],staticClass:"execute-result-table",staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:a.dataList,checkboxConfig:{checkMethod:e.selectable,highlight:!0},stripe:"",border:"",height:e.height,"max-height":"600"},on:{"table-body-scroll":e.scroll,"selection-change":e.handleSelectionChange,"cell-click":e.mouseOnFocus,"cell-mouse-leave":e.mouseLeave}},[t("ux-table-column",{attrs:{type:"checkbox",width:"55"}}),t("ux-table-column",{attrs:{type:"index",width:"55",title:" "}}),e._l(a.dataCols,(function(a,o){return t("ux-table-column",{key:o,attrs:{prop:a.prop,title:a.label,width:a.width},scopedSlots:e._u([{key:"header",fn:function(o){return[t("el-tooltip",{attrs:{effect:"dark",content:a.desc,placement:"top"}},[t("span",[e._v(e._s(a.label))])])]}},{key:"default",fn:function(e){return[t("textarea",{staticClass:"el-textarea__inner",attrs:{readonly:"",rows:"1"},domProps:{value:e.row[a.prop]}})]}}],null,!0)})}))],2),a.selectCount?t("el-pagination",{attrs:{"current-page":e.currentPage,"page-size":e.pageSize,"page-sizes":[1e3],layout:"total, sizes, prev, pager, next, jumper",total:a.selectCount},on:{"current-change":e.handleCurrentChange}}):e._e(),a.selectCount?t("div",{staticStyle:{position:"absolute",right:"5px",bottom:"5px"}},[t("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){return e.viewAllData()}}},[e._v("查看所有")])],1):e._e(),a.selectCount?e._e():t("div",{staticStyle:{height:"20px","font-size":"13px","font-weight":"400",color:"#606266","padding-left":"5px"}},[e._v(" 共 "+e._s(a.totalCount)+" 条 ")])],1)})),t("el-main",{directives:[{name:"loading",rawName:"v-loading",value:e.loadingAll,expression:"loadingAll"},{name:"show",rawName:"v-show",value:e.loadingAll,expression:"loadingAll"}],staticStyle:{height:"175px"},attrs:{"element-loading-text":"正在加载中","element-loading-spinner":"el-icon-loading"}})],2)],1)])],1),t("el-dialog",{attrs:{visible:e.exportConditionVisible,width:"500px",title:"选择更新语句条件"},on:{"update:visible":function(t){e.exportConditionVisible=t}}},[t("div",[e._v(" 更新条件列: "),t("el-select",{staticStyle:{width:"370px"},attrs:{multiple:"",placeholder:"请选择"},model:{value:e.conditionDataColsChoice,callback:function(t){e.conditionDataColsChoice=t},expression:"conditionDataColsChoice"}},e._l(e.conditionDataCols,(function(e){return t("el-option",{key:e.prop,attrs:{label:e.label,value:e.prop}})})),1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.exportConditionVisible=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.doCopyCheckLineUpdate}},[e._v("确 定")])],1)]),t("span",{staticStyle:{visibility:"hidden","white-space":"nowrap",position:"fixed"},attrs:{id:"widthCalculate"}})],1)},ua=[],da={parser:function(e,t,a){var o=[];if(!e)return o;var i=e.indexOf(t,0);if(-1==i)return o;var r=0,n="";while(i>-1){if(i>0&&"\\"==e[i-1])r=i+t.length;else{n="",r=i+t.length;var s=e.indexOf(a,r);while(s>-1){if(!(s>r&&"\\"==e[s-1])){n+=e.substr(r,s-r),r=s+a.length;break}n+=e.substr(r,s-r-1),r=s+a.length,s=e.indexOf(a,r)}-1==s?r=e.length:(n&&o.push(n),r=s+a.length)}i=e.indexOf(t,r)}return o},parserArr:function(e,t){var a=this,o={};t.forEach((function(t){var i=a.parser(e,t.start,t.end);i.forEach((function(e){return o[e]=1}))}));var i=[];for(var r in o)i.push(r);return i}},ha=(a("7ce2"),{directives:{Clickoutside:gt["a"]},data:function(){return{loadingAll:!1,height:0,scrollTop:0,datasourceList:[],choiceDatasourceId:"",datasourceOptions:[],datasourceGroupList:[],choiceDatasourceGroup:"",databaseList:[],choiceDatabase:"",editorDbProduct:"",editorDbInfo:[],editorDbTableInfo:{},editorColumnInfo:{},uxGridCell:"",pageSize:1e3,currentPage:1,sqlExecuting:!1,executeResultList:[],executeResultInfo:"",executeShowTable:"tabHistory",sqlExecutorEditor:{},nowExecutorId:1,executeError:"",myFavoriteList:[],myHistoryListList:[],choiceResultObj:{},exportConditionVisible:!1,conditionDataCols:[],conditionDataColsChoice:[],executeButtonText:"执行",sqlExecutorContent:"",sqlEditorConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:15,maxLines:15},executorSource:{},sqlParams:[],sqlParamWaiting:!1,sqlParamHistory:{}}},components:{"ace-editor":ft},mounted:function(){this.height=190,this.loadDatasourceList()},activated:function(){this.loadDatasourceList()},methods:{sqlExecutorInit:function(e){var t=this;this.sqlExecutorEditor=e,this.sqlExecutorEditor.setFontSize(16);var a=this;this.sqlExecutorEditor.commands.addCommand({name:"execute-sql",bindKey:{win:"Ctrl-R|Ctrl-Shift-R|Ctrl-Enter",mac:"Command-R|Command-Shift-R|Command-Enter"},exec:function(e){a.doExecutorSql()}}),e.on("change",(function(){t.sqlParamWaiting||(t.sqlParamWaiting=!0,setTimeout((function(){var a=e.getValue(),o=da.parserArr(a,[{start:"${",end:"}"},{start:"#{",end:"}"}]);t.sqlParams=[],o.forEach((function(e){t.sqlParams.push({key:e,value:t.sqlParamHistory[e]||""})})),t.sqlParamWaiting=!1}),300))}))},cursorSelection:function(e){this.executeButtonText=e?"执行已选择的":"执行"},scroll:function(e){var t=e.scrollTop;e.scrollLeft;this.scrollTop=t},selectable:function(e){var t=e.row;return 2!==t.id},cancelExecutorSql:function(){var e=this;v.executeSqlCancel({executeId:this.nowExecutorId}).then((function(){e.$message.success("取消成功")}))},loadHistoryAndFavoriteList:function(){this.loadHistoryList(),this.loadFavoriteList()},loadFavoriteList:function(){var e=this;v.favoriteList({sourceId:this.choiceDatasourceId}).then((function(t){e.myFavoriteList=t.data||[]}))},loadHistoryList:function(){var e=this;v.historyList({sourceId:this.choiceDatasourceId}).then((function(t){e.myHistoryListList=t.data||[]}))},addFavorite:function(e){var t=this;e||(e=this.sqlExecutorEditor.getSelectedText(),e||(e=this.sqlExecutorEditor.getValue()));var a={};this.sqlParams.forEach((function(e){e.value&&(a[e.key]=e.value)}));var o={name:"我的收藏",content:e,paramJson:JSON.stringify(a),datasourceId:this.choiceDatasourceId};v.updateFavorite(o).then((function(){t.$message.success("收藏成功"),t.loadFavoriteList()}))},delFavorite:function(e){var t=this;v.updateFavorite({id:e.id,yn:0}).then((function(){t.$message.success("删除成功"),t.loadFavoriteList()}))},inputFavoriteSql:function(e){if(this.sqlExecutorEditor.setValue(e.content,1),e.paramJson){var t=JSON.parse(e.paramJson);for(var a in t)this.sqlParamHistory[a]=t[a]}},formatterSql:function(){var e=this.sqlExecutorEditor.getSelectedText();if(e){var t=this.sqlExecutorEditor.getSelectionRange();this.sqlExecutorEditor.remove(t)}else e=this.sqlExecutorEditor.getValue(),this.sqlExecutorEditor.setValue("",1);e&&(e=ct.a.format(e),this.sqlExecutorEditor.insert(e))},doExecutorSql:function(e){var t=this;if(this.choiceDatasourceId)if(this.choiceDatabase){this.executeError="",this.executeUseTime="",this.executeResultList=[];var a={};this.sqlParams.forEach((function(e){e.value&&(a[e.key]=e.value,t.sqlParamHistory[e.key]=e.value)})),this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random());var o=this.sqlExecutorEditor.getSelectedText();o||(o=this.sqlExecutorEditor.getValue()),this.sqlExecuting=!0,v.queryExecuteSql({sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase,executeId:this.nowExecutorId,pageNum:this.currentPage,pageSize:this.pageSize,sql:o,params:JSON.stringify(a)}).then((function(a){if(t.sqlExecuting=!1,200!=a.errCode)return t.executeShowTable="tabError",void(t.executeError=a.errMsg);var o=1,i=[],r=a.data||[],n="";r.forEach((function(e){var a=[],r=[];if(n+=t.getExecuteInfoStr(e),0===e.errCode){var s=e.data||[],l=e.header||[],c={};if(l.length>0){var u=0;l.forEach((function(e){var t="value_"+u++;c[t]=e,r.push({prop:t,label:e,desc:e})})),s.forEach((function(e){var t={},o=0;r.forEach((function(a){var i=a.prop;t[i]=e[o++],(t[i]+"").length>c[i].length&&(c[i]=t[i]+"")})),a.push(t)})),r.forEach((function(e){document.getElementById("widthCalculate").innerText=c[e.prop];var t=document.getElementById("widthCalculate").offsetWidth;t+=c[e.prop]===e.label?35:55,t=t<50?50:t,e.width=t>200?200:t}))}}i.push({label:"结果"+o,name:"result_"+o,errMsg:e.errMsg,errCode:e.errCode,queryTime:e.queryTime,selectCount:e.selectCount,totalCount:a.length,dataCols:r,dataList:a}),o++,e.selectCount&&(t.height=170)})),1!=e&&(t.executeShowTable=1===o?"tabInfo":"result_1"),t.executeResultInfo=n,t.executeResultList=i,t.loadHistoryList()}))}else this.$message.error("请先选择数据库");else this.$message.error("请先选择数据源")},viewAllData:function(e){var t=this;if(this.loadingAll=!0,this.choiceDatasourceId){this.executeError="",this.executeUseTime="",this.executeResultList=[];var a={};this.sqlParams.forEach((function(e){e.value&&(a[e.key]=e.value,t.sqlParamHistory[e.key]=e.value)})),this.nowExecutorId=(new Date).getTime()+Math.ceil(1e3*Math.random());var o=this.sqlExecutorEditor.getSelectedText();o||(o=this.sqlExecutorEditor.getValue()),this.sqlExecuting=!0,v.queryExecuteSql({sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase,executeId:this.nowExecutorId,pageNum:this.currentPage,pageSize:this.pageSize,sql:o,type:"noPage",params:JSON.stringify(a)}).then((function(a){if(t.sqlExecuting=!1,t.loadingAll=!1,200!=a.errCode)return t.executeShowTable="tabError",void(t.executeError=a.errMsg);var o=1,i=[],r=a.data||[],n="";r.forEach((function(e){var a=[],r=[];if(n+=t.getExecuteInfoStr(e),0===e.errCode){var s=e.data||[],l=e.header||[],c={};if(l.length>0){var u=0;l.forEach((function(e){var t="value_"+u++;c[t]=e,r.push({prop:t,label:e})})),s.forEach((function(e){var t={},o=0;r.forEach((function(a){var i=a.prop;t[i]=e[o++],(t[i]+"").length>c[i].length&&(c[i]=t[i]+"")})),a.push(t)})),r.forEach((function(e){document.getElementById("widthCalculate").innerText=c[e.prop];var t=document.getElementById("widthCalculate").offsetWidth;t+=c[e.prop]===e.label?35:55,t=t<50?50:t,e.width=t>200?200:t}))}}i.push({label:"结果"+o,name:"result_"+o,errMsg:e.errMsg,errCode:e.errCode,queryTime:e.queryTime,selectCount:e.selectCount,totalCount:a.length,dataCols:r,dataList:a}),o++,e.selectCount&&(t.height=170)})),1!=e&&(t.executeShowTable=1===o?"tabInfo":"result_1"),t.executeResultInfo=n,t.executeResultList=i,t.loadHistoryList()}))}else this.$message.error("请先选择数据源")},handleCurrentChange:function(e){this.currentPage=e;var t=1;this.doExecutorSql(t)},loadDatasourceList:function(){var e=this;v.datasourceList({}).then((function(t){e.datasourceList=t.data||[],e.datasourceOptions=e.datasourceList;var a=[];e.datasourceList.filter((function(e){return!!e.groupName})).forEach((function(e){return a.push(e.groupName||"")})),e.datasourceGroupList=Array.from(new Set(a)),e.datasourceList.length>0&&(e.choiceDatasourceId=e.datasourceList[0].id,e.$route.query.datasourceId&&(e.choiceDatasourceId=parseInt(e.$route.query.datasourceId)),e.$route.query.database&&(e.choiceDatabase=e.$route.query.database),e.executorSource={sourceId:e.choiceDatasourceId},e.loadDatabaseList(!0),e.loadSourceBaseInfo(),e.loadHistoryAndFavoriteList())}))},loadDatabaseList:function(e){var t=this;v.databaseList({sourceId:this.choiceDatasourceId}).then((function(a){if(t.databaseList=a.data||[],t.databaseList.length>0){var o=["information_schema","master","model","msdb","tempdb"],i=t.databaseList.find((function(e){return o.indexOf(e.dbName)<0}));e||(t.choiceDatabase=i?i.dbName:t.databaseList[0].dbName,t.$router.replace({query:{datasourceId:t.choiceDatasourceId,database:t.choiceDatabase}})),t.executorSource={sourceId:t.choiceDatasourceId,dbName:t.choiceDatabase}}}))},loadSourceBaseInfo:function(){var e=this;v.getSourceBaseInfo({sourceId:this.choiceDatasourceId}).then((function(t){var a=t.data||{};e.editorDbProduct=a.product||""}))},sourceGroupChangeEvents:function(){for(var e=[],t=0;t<this.datasourceList.length;t++){var a=this.datasourceList[t];this.choiceDatasourceGroup&&this.choiceDatasourceGroup!=a.groupName||e.push(a)}this.datasourceOptions=e,e.length>0&&(this.choiceDatasourceId=e[0].id,this.executorSource={sourceId:this.choiceDatasourceId},this.loadDatabaseList(),this.loadSourceBaseInfo(),this.loadHistoryAndFavoriteList())},datasourceChangeEvents:function(){this.executorSource={sourceId:this.choiceDatasourceId},this.currentPage=1,this.loadDatabaseList(),this.loadSourceBaseInfo(),this.loadHistoryAndFavoriteList()},databaseChangeEvents:function(){this.$router.replace({query:{datasourceId:this.choiceDatasourceId,database:this.choiceDatabase}}),this.executorSource={sourceId:this.choiceDatasourceId,dbName:this.choiceDatabase},this.currentPage=1},getExecuteInfoStr:function(e){var t=e.executeSql;return t+="\n> 状态:"+(e.errMsg?"ERROR":"OK"),e.updateCount>=0&&(t+="\n> 影响行数:"+e.updateCount),t+="\n> 耗时:"+(e.queryTime||0)/1e3+"s",t+="\n\n",t},dealExecuteResult:function(e){var t=e.result||[],a=[];if(t.length>0){var o=t[0];for(var i in o){document.getElementById("widthCalculate").innerText=i;var r=document.getElementById("widthCalculate").offsetWidth;document.getElementById("widthCalculate").innerText=o[i];var n=document.getElementById("widthCalculate").offsetWidth,s=r>n?r:n;s=s<50?50:s,s=s>200?200:s,a.push({prop:i,width:s+25})}}var l={};return l.dataList=t,l.dataCols=a,l.useTime=e.useTime||0,l.errMsg=e.errMsg||"",l.updateCount=e.updateCount,l},handleSelectionChange:function(e){this.$set(this.choiceResultObj,this.executeShowTable,e)},tabHandleClick:function(e){},doCopyCheckLineUpdate:function(){var e=this,t=this.choiceResultObj[this.executeShowTable]||[];if(t.length>0){var a=this.executeResultList.find((function(t){return t.name===e.executeShowTable})).dataCols,o=st.format("update",this.editorDbProduct,a,t,this.conditionDataColsChoice);this.conditionDataColsChoice=[],this.exportConditionVisible=!1,this.$copyText(o).then((function(t){return e.$message.success("内容已复制到剪切板!")}),(function(t){return e.$message.error("抱歉,复制失败!")}))}},handleCopyCheckLineCommand:function(e){var t=this,a=this.choiceResultObj[this.executeShowTable]||[];if(a.length>0){var o=this.executeResultList.find((function(e){return e.name===t.executeShowTable})).dataCols;if("update"===e)return this.conditionDataCols=o,void(this.exportConditionVisible=!0);var i=st.format(e,this.editorDbProduct,o,a,"");this.$copyText(i).then((function(e){return t.$message.success("内容已复制到剪切板!")}),(function(e){return t.$message.error("抱歉,复制失败!")}))}},mouseOnFocus:function(e,t,a,o){this.uxGridCell&&(this.uxGridCell.style.border="none"),a.style.border="2px solid #0078d7",this.uxGridCell=a},mouseLeave:function(e,t,a,o){},handleClickOutside:function(){this.uxGridCell&&(this.uxGridCell.style.border="none")}}}),pa=ha,ma=(a("9715"),Object(D["a"])(pa,ca,ua,!1,null,"2ce452e8",null)),fa=ma.exports,ba=function(){var e=this,t=e._self._c;return t("div",{staticClass:"data-transfer-vue"},[t("div",{staticStyle:{padding:"0 10px",height:"100%","box-sizing":"border-box"}},[t("el-card",[t("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[t("span",[e._v("数据互导工具")]),t("a",{attrs:{target:"_blank",title:"点击查看如何使用",href:"http://doc.zyplayer.com/#/integrate/zyplayer-doc/opensource/128"}},[t("i",{staticClass:"el-icon-info",staticStyle:{color:"#999"}})])]),t("div",{staticStyle:{"margin-bottom":"10px","text-align":"right"}},[t("el-button",{attrs:{type:"success",icon:"el-icon-plus"},on:{click:e.createNewTask}},[e._v("新建")]),t("el-button",{attrs:{type:"primary",loading:e.loadDataListLoading,icon:"el-icon-refresh"},on:{click:e.loadGetTaskList}},[e._v("查询")])],1),t("el-table",{staticStyle:{width:"100%","margin-bottom":"5px"},attrs:{data:e.taskList,stripe:"",border:""}},[t("el-table-column",{attrs:{prop:"id",label:"ID",width:"55"}}),t("el-table-column",{attrs:{prop:"name",label:"任务名称"}}),t("el-table-column",{attrs:{label:"条数查询"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(1==t.row.needCount?"是":"否"))]}}])}),t("el-table-column",{attrs:{prop:"lastExecuteStatus",label:"最后执行状态"},scopedSlots:e._u([{key:"default",fn:function(a){return[0==a.row.lastExecuteStatus?t("el-tag",[e._v("未执行")]):1==a.row.lastExecuteStatus?t("el-tag",{attrs:{type:"info"}},[e._v("执行中")]):2==a.row.lastExecuteStatus?t("el-tag",{attrs:{type:"success"}},[e._v("执行成功")]):3==a.row.lastExecuteStatus?t("el-tag",{attrs:{type:"danger"}},[e._v("执行失败")]):4==a.row.lastExecuteStatus?t("el-tag",{attrs:{type:"warning"}},[e._v("取消执行")]):e._e()]}}])}),t("el-table-column",{attrs:{prop:"lastExecuteTime",label:"最后执行时间"}}),t("el-table-column",{attrs:{prop:"createUserName",label:"创建人"}}),t("el-table-column",{attrs:{prop:"createTime",label:"创建时间"}}),t("el-table-column",{attrs:{label:"操作",width:"290"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.viewTask(a.row.id)}}},[e._v("查看")]),t("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(t){return e.editTask(a.row)}}},[e._v("编辑")]),t("el-button",{attrs:{size:"mini",type:"warning"},on:{click:function(t){return e.executeTask(a.row.id)}}},[e._v("执行")]),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.deleteTask(a.row.id)}}},[e._v("删除")])]}}])})],1)],1)],1),t("el-dialog",{attrs:{visible:e.taskEditDialogVisible,width:"900px","close-on-click-modal":!1},on:{"update:visible":function(t){e.taskEditDialogVisible=t}}},[e.taskEditInfo.id?t("span",{attrs:{slot:"title"},slot:"title"},[e._v("编辑任务")]):t("span",{attrs:{slot:"title"},slot:"title"},[e._v("新建任务")]),t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:"任务名称:"}},[t("el-input",{attrs:{placeholder:"任务名称"},model:{value:e.taskEditInfo.name,callback:function(t){e.$set(e.taskEditInfo,"name",t)},expression:"taskEditInfo.name"}})],1),t("el-form-item",{attrs:{label:"查询数据源:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择查询数据源"},model:{value:e.taskEditInfo.queryDatasourceId,callback:function(t){e.$set(e.taskEditInfo,"queryDatasourceId",t)},expression:"taskEditInfo.queryDatasourceId"}},e._l(e.datasourceOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"查询SQL:"}},[t("ace-editor",{attrs:{lang:"sql",theme:"monokai",width:"100%",height:"100",options:e.editSqlConfig},on:{init:e.querySqlInit},model:{value:e.querySqlContent,callback:function(t){e.querySqlContent=t},expression:"querySqlContent"}})],1),t("el-form-item",{attrs:{label:"总条数查询:"}},[t("el-radio",{attrs:{label:0},model:{value:e.taskEditInfo.needCount,callback:function(t){e.$set(e.taskEditInfo,"needCount",t)},expression:"taskEditInfo.needCount"}},[e._v("不查询")]),t("el-radio",{attrs:{label:1},model:{value:e.taskEditInfo.needCount,callback:function(t){e.$set(e.taskEditInfo,"needCount",t)},expression:"taskEditInfo.needCount"}},[e._v("自动查询")])],1),t("el-form-item",{attrs:{label:"入库数据源:"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择写入数据源"},model:{value:e.taskEditInfo.storageDatasourceId,callback:function(t){e.$set(e.taskEditInfo,"storageDatasourceId",t)},expression:"taskEditInfo.storageDatasourceId"}},e._l(e.datasourceOptions,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),t("el-form-item",{attrs:{label:"入库SQL:"}},[t("ace-editor",{attrs:{lang:"sql",theme:"monokai",width:"100%",height:"100",options:e.editSqlConfig},on:{init:e.storageSqlInit},model:{value:e.storageSqlContent,callback:function(t){e.storageSqlContent=t},expression:"storageSqlContent"}}),t("el-button",{staticStyle:{"margin-top":"10px"},on:{click:e.autoFillStorageSql}},[e._v("智能填充")])],1)],1),t("div",{staticStyle:{"text-align":"center"}},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveEditTask}},[e._v("保存")]),t("el-button",{attrs:{type:"warning"},on:{click:function(t){e.taskEditDialogVisible=!1}}},[e._v("取消")])],1)],1),t("el-dialog",{attrs:{visible:e.taskViewDialogVisible,width:"80%"},on:{"update:visible":function(t){e.taskViewDialogVisible=t}}},[t("span",{attrs:{slot:"title"},slot:"title"},[e._v("查看任务")]),t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:"任务名称:"}},[e._v(e._s(e.taskEditInfo.name))]),t("el-form-item",{attrs:{label:"最后执行状态:"}},[0==e.taskEditInfo.lastExecuteStatus?t("el-tag",[e._v("未执行")]):1==e.taskEditInfo.lastExecuteStatus?t("el-tag",{attrs:{type:"info"}},[e._v("执行中")]):2==e.taskEditInfo.lastExecuteStatus?t("el-tag",{attrs:{type:"success"}},[e._v("执行成功")]):3==e.taskEditInfo.lastExecuteStatus?t("el-tag",{attrs:{type:"danger"}},[e._v("执行失败")]):4==e.taskEditInfo.lastExecuteStatus?t("el-tag",{attrs:{type:"warning"}},[e._v("取消执行")]):e._e()],1),t("el-form-item",{attrs:{label:"最后执行时间:"}},[e._v(e._s(e.taskEditInfo.lastExecuteTime))]),t("el-form-item",{attrs:{label:"执行信息:"}},[t("pre",{staticStyle:{"word-wrap":"break-word","word-break":"break-all","white-space":"pre-wrap","line-height":"22px"}},[e._v(e._s(e.taskEditInfo.lastExecuteInfo))])]),1==e.taskEditInfo.lastExecuteStatus?t("el-form-item",{attrs:{label:"操作:"}},[t("el-button",{attrs:{type:"success",icon:"el-icon-refresh",loading:e.viewTaskLoading},on:{click:function(t){return e.viewTask(e.taskEditInfo.id)}}},[e._v("刷新")]),t("el-button",{attrs:{type:"danger"},on:{click:e.cancelTask}},[e._v("取消执行")])],1):e._e()],1)],1)],1)},ga=[],va={data:function(){return{viewTaskLoading:!1,loadDataListLoading:!1,datasourceOptions:[],queryDatasourceId:"",storageDatasourceId:"",taskList:[],datasourceMap:{},taskViewDialogVisible:!1,taskEditDialogVisible:!1,taskEditInfo:{},querySqlEditor:{},storageSqlEditor:{},querySqlContent:"",storageSqlContent:"",editSqlConfig:{wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:10,maxLines:25}}},components:{"ace-editor":ft},mounted:function(){this.loadDatasourceList()},methods:{editTask:function(e){var t=this;this.taskEditInfo=JSON.parse(JSON.stringify(e)),this.taskEditDialogVisible=!0,setTimeout((function(){t.querySqlEditor.setValue(t.taskEditInfo.querySql,1),t.storageSqlEditor.setValue(t.taskEditInfo.storageSql,1)}),200)},querySqlInit:function(e){this.querySqlEditor=e,this.querySqlEditor.setFontSize(16)},storageSqlInit:function(e){this.storageSqlEditor=e,this.storageSqlEditor.setFontSize(16)},createNewTask:function(){var e=this;this.taskEditInfo={querySql:"",storageSql:"",name:"",needCount:1,queryDatasourceId:"",storageDatasourceId:""},this.taskEditDialogVisible=!0,setTimeout((function(){e.querySqlEditor.setValue("",1),e.storageSqlEditor.setValue("",1)}),200)},deleteTask:function(e){var t=this;this.$confirm("确定要删除此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){v.transferUpdate({id:e,delFlag:1}).then((function(){t.$message.success("删除成功"),t.loadGetTaskList()}))})).catch((function(){}))},executeTask:function(e){var t=this;this.$confirm("确定要执行一次此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){v.transferStart({id:e}).then((function(){t.$message.success("任务提交成功")}))})).catch((function(){}))},saveEditTask:function(){var e=this;this.taskEditInfo.querySql=this.querySqlEditor.getValue(),this.taskEditInfo.storageSql=this.storageSqlEditor.getValue(),v.transferUpdate(this.taskEditInfo).then((function(){e.$message.success("保存成功"),e.taskEditDialogVisible=!1,e.loadGetTaskList()}))},viewTask:function(e){var t=this;this.viewTaskLoading=!0,this.taskViewDialogVisible=!0,v.transferDetail({id:e}).then((function(e){t.taskEditInfo=e.data||{},setTimeout((function(){t.viewTaskLoading=!1}),300)}))},cancelTask:function(){var e=this;this.$confirm("确定要取消执行此任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){v.transferCancel({id:e.taskEditInfo.id}).then((function(){e.$message.success("取消成功"),e.viewTask(e.taskEditInfo.id)}))})).catch((function(){}))},loadGetTaskList:function(){var e=this;this.loadDataListLoading=!0,v.transferList({}).then((function(t){e.taskList=t.data||[],setTimeout((function(){e.loadDataListLoading=!1}),800)}))},autoFillStorageSql:function(){var e=this,t=this.querySqlEditor.getValue();v.transferSqlColumns({sql:t}).then((function(t){var a=t.data||[];if(a.length<=0)e.$message.error("查询的字段不明确,不能自动填充");else{var o="\n";o+="insert into TableName (\n";for(var i=0;i<a.length;i++)o+="\t"+(0===i?"":",")+a[i]+"\n";o+=") values (\n";for(var r=0;r<a.length;r++)o+="\t"+(0===r?"":",")+"#{"+a[r]+"}\n";o+=")\n\n",e.storageSqlEditor.setValue(o,1)}}))},loadDatasourceList:function(){var e=this;v.datasourceList({}).then((function(t){e.datasourceList=t.data||[];for(var a=[],o={},i=0;i<e.datasourceList.length;i++)o[e.datasourceList[i].id]=e.datasourceList[i].name,a.push({label:e.datasourceList[i].name,value:e.datasourceList[i].id});e.datasourceMap=o,e.datasourceOptions=a,e.loadGetTaskList()}))},initAceEditor:function(e,t){return ace.edit(e,{theme:"ace/theme/monokai",mode:"ace/mode/sql",wrap:!0,autoScrollEditorIntoView:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,minLines:t,maxLines:25})}}},ya=va,xa=(a("e39c"),Object(D["a"])(ya,ba,ga,!1,null,null,null)),wa=xa.exports,Ca=function(){var e=this,t=e._self._c;return t("div",[e._v("没有权限访问该模块")])},Sa=[],Da={data:function(){return{}},mounted:function(){},methods:{}},ka=Da,_a=Object(D["a"])(ka,Ca,Sa,!1,null,null,null),La=_a.exports,Ia=[{path:"/home",component:F,name:"主页",meta:{requireAuth:!0}},{path:"/",redirect:"/home"},{path:"/",name:"Tab标签页",component:et,children:[{path:"/table/info",name:"表信息",component:Pt},{path:"/table/database",name:"库信息",component:At},{path:"/procedure/list",name:"存储过程",component:Qt},{path:"/procedure/edit",name:"编辑存储过程",component:Wt},{path:"/data/datasourceManage",name:"数据源管理",component:aa},{path:"/data/export",name:"数据库导出",component:la},{path:"/data/executor",name:"SQL执行器",component:fa},{path:"/data/transferData",name:"数据互导工具",component:wa},{path:"/data/dataPreview",name:"表数据预览",component:wt},{path:"/user/myInfo",name:"我的信息",component:Me}]},{path:"/user",name:"用户管理",component:Je,children:[{path:"login",name:"系统登录",component:Fe,meta:{fullscreen:!0}}]},{path:"/common",name:"",component:Je,children:[{path:"noAuth",name:"没有权限",component:La}]}],Ea=Ia,Na=a("2f62"),Ta={namespaced:!0,state:{pageTabNameMap:{},fullscreen:!1},getters:{getPageTabNameMap:function(e){return e.pageTabNameMap}},mutations:{addTableName:function(e,t){var a=Object.assign({},e.pageTabNameMap);a[t.key]=t.val,e.pageTabNameMap=a},setFullscreen:function(e,t){e.fullscreen=t}}},Pa={},qa={saveCurContextTabId:function(e,t){e.curContextTabId=t}},Oa={state:Pa,mutations:qa};o["default"].use(Na["a"]);var za=new Na["a"].Store({modules:{global:Ta,tagsView:Oa}}),$a=a("a7fe"),Fa=a.n($a),Aa=a("2315"),ja=a.n(Aa),Va=(a("f1e9"),a("4eb5")),Ra=a.n(Va);o["default"].use(Ra.a),o["default"].use(r.a,{size:"small"}),o["default"].use(s.a),o["default"].use(T["a"]),o["default"].use(Fa.a,p.a),o["default"].use(ja.a),o["default"].prototype.$store=za;var Ua=new T["a"]({routes:Ea});Ua.beforeEach((function(e,t,a){e.meta.title&&(document.title=e.meta.title),za.commit("global/setFullscreen",!!e.meta.fullscreen),a()}));var Ma=new o["default"]({el:"#app",router:Ua,render:function(e){return e(N)}}),Qa=t["default"]=Ma},"70e4":function(e,t,a){"use strict";a("bc60")},"756e":function(e,t,a){"use strict";a("4e32")},"779d":function(e,t,a){},8379:function(e,t,a){},"84d0":function(e,t,a){},"8f64":function(e,t,a){},9715:function(e,t,a){"use strict";a("4f94")},"9a36":function(e,t,a){},a395:function(e,t,a){"use strict";a("54bc")},aa11:function(e,t,a){},bc60:function(e,t,a){},d133:function(e,t,a){"use strict";a("f4c6")},d343:function(e,t,a){"use strict";a("0f7f")},d9c1:function(e,t,a){"use strict";a("9a36")},db12:function(e,t,a){"use strict";a("47ee")},e39c:function(e,t,a){"use strict";a("84d0")},ea38:function(e,t,a){},f014:function(e,t,a){"use strict";a("4b58")},f210:function(e,t,a){"use strict";a("ea38")},f32d:function(e,t,a){},f4c6:function(e,t,a){},fd56:function(e,t,a){"use strict";a("21df")}}); |