(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-33cc"],{"DI+d":function(e,t,a){"use strict";a.r(t);var l=a("dWSf"),n={name:"sys-dev-sys_mvctableinfo",components:{splitPane:a("QpdM").a},mixins:[l.a],data:function(){return{filterText:"",dataTree:[],props:{label:"label",children:"children",isLeaf:"isLeaf"},dialogFieldVisible:!1,formField:{dbServer:"Sys",projectName:null,tableName:null,cnName:null,enName:null,folderName:null,parentId:null},currentTreeNode:{},isLoading:!1}},methods:{detailButtonClick:function(e,t,a){switch(e){case"detailAdd":return this.editor.addDetailDataRow([{isManagerDataSet:1,nullable:1,dataType:"String"}],t.subTableView),!0}},loadTreeNode:function(e,t){this.currentTreeNode={};var a=this;a.$nextTick(function(){var l={DBServer:"Sys",tableName:"Sys_MvcTableInfo",tableView:"Sys_MvcTableInfo",keyName:"table_Id",nodeName:"cnName",fixHasChild:!1,isBreakWay:!1,displayBreakWay:!1,parentName:"parentId",orderBy:"orderNo desc, table_Id",where:0===e.level?{parentId:0}:{parentId:e.data.table_Id},extendColumns:"Namespace as projectName, folderName",folder:"sys/core"};a.common.ajax("/api/common/loadTreeNode",l,function(l){l.result?(0===e.level&&l.data.push({table_Id:-1,hasChild:"1",cnName:"[未使用节点]"}),l.data.forEach(function(e){e.label=e.cnName,e.isLeaf=!e.hasChild}),t(l.data)):a.$message.error(l.msg)},!0)})},filterTreeNode:function(e,t){return!e||-1!==t.label.indexOf(e)},nodeClick:function(e,t,a){this.currentTreeNode=e,this.editor.editData(e.table_Id)},treeRefresh:function(){this.filterText="";for(var e=this.$refs.tree.store.root;e.childNodes.length;)this.$refs.tree.remove(e.childNodes[0]);this.loadTreeNode(e,function(t){e.doCreateChildren(t)})},createModel:function(e,t){var a=this,l={table_Id:e.table_Id};this.common.ajax("/api/sysmvc/createModel",l,function(e){a.common.showMsg(e)},!0)},onSaveBefore:function(e){e.Sys_MvcTableColumn.rows.forEach(function(t){t.tableView!==e.tableView&&(t.tableView=e.tableView,t.__ischange__=!0)})},showFieldDialog:function(){var e=this.currentTreeNode;e&&(this.formField.parentId=e.parentId,this.formField.projectName=e.projectName||this.formField.projectName,this.formField.folderName=e.folderName),this.dialogFieldVisible=!0},createField:function(){var e=this;if(this.formField.dbServer)if(this.formField.projectName)if(this.formField.tableName)if(this.formField.cnName)if(this.formField.enName)if(this.formField.folderName)if(this.formField.parentId){this.isLoading=!0;var t=this.formField;this.common.ajax("/api/sysmvc/createField",t,function(t){if(e.isLoading=!1,e.common.showMsg(t),t.result){if(e.dialogFieldVisible=!1,e.$refs.tree.getNode(t.data.table_Id))return void e.editor.editData(t.data.table_Id);var a=e.$refs.tree.getNode(e.currentTreeNode.parentId);e.$refs.tree.append({hasChild:"0",isLeaf:!0,table_Id:t.data.table_Id,projectName:e.formField.projectName,folderName:t.data.folderName,cnName:t.data.cnName,label:t.data.cnName},a),e.$refs.tree.setCurrentKey(t.data.table_Id),e.nodeClick(t.data)}})}else this.$message.error("父级ID不能为空");else this.$message.error("文件夹不能为空");else this.$message.error("表(视图)英文名称不能为空");else this.$message.error("数据库不能为空");else this.$message.error("表(视图)名称不能为空");else this.$message.error("项目名称不能为空");else this.$message.error("数据库不能为空")},onSaveAfter:function(e){var t=this.$refs.tree.getCurrentNode();if(t.table_Id!==e.table_Id){var a=this.$refs.tree.getNode(t.parentId);"son"===this.addLevel?a=this.$refs.tree.getNode(t.table_Id):(t.cnName=e.cnName,t.label=e.cnName),this.$refs.tree.append({hasChild:"0",isLeaf:!0,table_Id:e.table_Id,sql:e.sql,cnName:e.cnName,label:e.cnName},a),this.$refs.tree.setCurrentKey(e.table_Id),this.nodeClick(e)}else t.cnName=e.cnName,t.label=e.cnName},createBrotherNode:function(e,t){var a=e.parentId,l=e.folderName;(e=this.editor.addData()).table_Id=0,e.parentId=a,e.folderName=l,e.cnName=null,e.sql=null,this.addLevel="brother"},createSonNode:function(e,t){var a=e.table_Id,l=e.folderName;(e=this.editor.addData()).parentId=a,e.folderName=l,e.table_Id=0,e.cnName=null,this.addLevel="son"},deleteNode:function(e,t){var a=this;this.$confirm("此操作将永久删除该节点, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){!function(){var t={DBServer:"Sys",tableName:"Sys_MvcTableInfo",tableView:"Sys_MvcTableInfo",keyName:"table_Id",keyValue:e.table_Id,nodeName:"cnName",parentName:"parentId",extendColumns:"",folder:"sys/core"};a.common.ajax("/api/common/deleteTreeData",t,function(t){a.common.showMsg(t),t.result&&a.$refs.tree.remove(e.table_Id)},!0)}()}).catch(function(){a.$message({type:"info",message:"已取消删除"})})},copyNode:function(e,t){var a=this,l={tableName:"Sys_MvcTableInfo",keyName:"table_Id",keyValue:e.table_Id,nodeName:"cnName",parentName:"parentId",folder:"sys/core",where:{table_Id:e.table_Id}};this.common.ajax("/api/common/copy",l,function(t){if(a.common.showMsg(t),t.result){var l=a.$refs.tree.getCurrentNode(),n=a.$refs.tree.getNode(l.parentId),o=t.data[0];a.$refs.tree.append({hasChild:"0",isLeaf:!0,table_Id:o.table_Id,sql:e.sql,cnName:o.cnName,label:o.cnName},n),a.$refs.tree.setCurrentKey(o.table_Id),a.nodeClick(o)}},!0)},createFolder:function(){this.editor.addData()}}},o=(a("ZziG"),a("KHd+")),r=Object(o.a)(n,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"container",staticClass:"page-list-container"},[a("split-pane",{attrs:{"max-width":500,"default-width":260,split:"vertical"}},[a("div",{staticClass:"left-container",attrs:{slot:"paneL"},slot:"paneL"},[a("el-form",{staticClass:"form-tool"},[a("el-form-item",{staticClass:"margin-bottom-0"},[a("el-input",{staticClass:"search-input",attrs:{placeholder:"搜索名称","prefix-icon":"el-icon-search"},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),e._v(" "),a("el-button",{staticClass:"btn-refresh",attrs:{title:"刷新",icon:"el-icon-yrt-shuaxin"},nativeOn:{click:function(t){return e.treeRefresh(t)}}})],1),e._v(" "),a("el-form-item",{staticClass:"padding-right-0 margin-bottom-0"},[a("el-scrollbar",{attrs:{noresize:!1,native:!1,"wrap-class":"tree scrollbar-wrap"}},[a("el-tree",{ref:"tree",attrs:{data:e.dataTree,"expand-on-click-node":!1,load:function(t,a){e.loadTreeNode(t,a)},"filter-node-method":e.filterTreeNode,props:e.props,"default-expand-all":!1,"highlight-current":"",lazy:"","node-key":"table_Id"},on:{"node-click":e.nodeClick},scopedSlots:e._u([{key:"default",fn:function(t){var l=t.node,n=t.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[n.hasChild?a("i",{staticClass:"el-icon-menu"}):a("i",{staticClass:"el-icon-tickets"}),e._v("\n "+e._s(l.label)+"\n ")])])}}])})],1)],1)],1)],1),e._v(" "),a("div",{staticClass:"right-container",attrs:{slot:"paneR"},slot:"paneR"},[a("yrt-editor",e._b({ref:e.editorRef,attrs:{"edit-type":"inner","data-list-ref":e.dataListRef,"data-options":e.dataOptions,action:e.editorOptions.action,visible:e.editorOptions.config.visible,"auth-nodes":e.authNodes,"on-save-before":e.onSaveBefore,"detail-button-click":e.detailButtonClick},on:{"update:action":function(t){return e.$set(e.editorOptions,"action",t)},"update:visible":function(t){return e.$set(e.editorOptions.config,"visible",t)},"on-save-after":e.onSaveAfter},scopedSlots:e._u([{key:"footer-button-region",fn:function(t){var l=t.formData,n=t.details;return[a("el-button",{attrs:{type:"success",icon:"el-icon-yrt-liebiao"},nativeOn:{click:function(t){return e.createModel(l,n)}}},[e._v("生成model")]),e._v(" "),a("el-button",{attrs:{type:"success",icon:"el-icon-yrt-zanwushourumingxi"},nativeOn:{click:function(t){return e.showFieldDialog(t)}}},[e._v("提取字段")]),e._v(" "),a("el-button",{attrs:{type:"success",icon:"el-icon-yrt-liebiaolist46"},nativeOn:{click:function(t){return e.createFolder(t)}}},[e._v("创建文件夹")])]}}])},"yrt-editor",e.editorOptions,!1))],1)]),e._v(" "),a("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],attrs:{visible:e.dialogFieldVisible,"append-to-body":!0,width:"600px",title:"提取表字段"},on:{"update:visible":function(t){e.dialogFieldVisible=t}}},[a("el-form",{ref:"form",staticClass:"w-500",attrs:{model:e.formField,"label-width":"140px"}},[a("el-form-item",{attrs:{label:"数据库"}},[a("el-select",{staticClass:"w-100pc",attrs:{placeholder:"请选择数据库"},model:{value:e.formField.dbServer,callback:function(t){e.$set(e.formField,"dbServer",t)},expression:"formField.dbServer"}},[a("el-option",{attrs:{label:"Rattan.Sys",value:"Rattan.Sys"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"项目名称"}},[a("el-select",{staticClass:"w-100pc",attrs:{placeholder:"请选择项目名称"},model:{value:e.formField.projectName,callback:function(t){e.$set(e.formField,"projectName",t)},expression:"formField.projectName"}},[a("el-option",{attrs:{label:"Rattan.Core",value:"Rattan.Core"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Sys",value:"Rattan.Sys"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.BasicInfo",value:"Rattan.BasicInfo"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.ERP.Outbound",value:"Rattan.ERP.Outbound"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.ERP.Inbound",value:"Rattan.ERP.Inbound"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.ERP.Storage",value:"Rattan.ERP.Storage"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.TMS",value:"Rattan.TMS"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.tms",value:"Rattan.tms"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Finance",value:"Rattan.Finance"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.CRM",value:"Rattan.CRM"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Interface",value:"Rattan.Interface"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Interface.Express",value:"Rattan.Interface.Express"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Interface.Common",value:"Rattan.Interface.Common"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.OA",value:"Rattan.OA"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Cms",value:"Rattan.Cms"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Stat",value:"Rattan.Stat"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Messager",value:"Rattan.Messager"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Promotion",value:"Rattan.Promotion"}}),e._v(" "),a("el-option",{attrs:{label:"Rattan.Tms",value:"Rattan.Tms"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"表(视图)名称"}},[a("el-input",{on:{change:function(t){e.formField.enName=e.formField.tableName}},model:{value:e.formField.tableName,callback:function(t){e.$set(e.formField,"tableName",t)},expression:"formField.tableName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"表(视图)中文名称"}},[a("el-input",{model:{value:e.formField.cnName,callback:function(t){e.$set(e.formField,"cnName",t)},expression:"formField.cnName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"表(视图)英文名称"}},[a("el-input",{model:{value:e.formField.enName,callback:function(t){e.$set(e.formField,"enName",t)},expression:"formField.enName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"文件夹"}},[a("el-input",{model:{value:e.formField.folderName,callback:function(t){e.$set(e.formField,"folderName",t)},expression:"formField.folderName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"父级ID"}},[a("el-input",{attrs:{type:"number"},model:{value:e.formField.parentId,callback:function(t){e.$set(e.formField,"parentId",e._n(t))},expression:"formField.parentId"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:e.isLoading,expression:"isLoading",modifiers:{fullscreen:!0,lock:!0}}],attrs:{type:"primary"},on:{click:e.createField}},[e._v("提取字段")]),e._v(" "),a("el-button",{on:{click:function(t){e.dialogFieldVisible=!1}}},[e._v("关闭")])],1)],1)],1)},[],!1,null,"a537bf80",null);r.options.__file="mvctableinfo.vue";t.default=r.exports},DNkW:function(e,t,a){var l=a("93I4"),n=Math.floor;e.exports=function(e){return!l(e)&&isFinite(e)&&n(e)===e}},"GW1+":function(e,t,a){"use strict";var l=a("mxV5"),n=a.n(l);t.a=function(e){return new n.a(e)}},ZziG:function(e,t,a){"use strict";var l=a("iOoT");a.n(l).a},h5AQ:function(e,t,a){a("hRZT"),e.exports=a("WEpk").Number.isInteger},hRZT:function(e,t,a){var l=a("Y7ZC");l(l.S,"Number",{isInteger:a("DNkW")})},iOoT:function(e,t,a){},ql3t:function(e,t,a){e.exports={default:a("h5AQ"),__esModule:!0}},yaWU:function(e,t,a){"use strict";a.d(t,"a",function(){return l});var l={bind:function(e,t,a){e.children[2].onscroll=function(t){var a=e.children[3];a&&a.classList.contains("el-table__footer-wrapper")&&(a.scrollLeft=t.target.scrollLeft)}},update:function(e,t,a){}}}}]);
|