mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-fd02d2f6"],{"3be0":function(t,e,n){"use strict";var r=n("6beb");n.n(r).a},"448b":function(t,e,n){"use strict";n.r(e),n("a4d3"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("131a"),n("fb6a");var r=n("0122"),i=n("c964"),o=n("f3f3"),a=(n("a434"),n("b0c0"),n("d81d"),n("d3b7"),n("159b"),n("a9e3"),n("2f62")),s=n("a9e7"),c=n("c2c6"),l=n("c276"),u=n("d708");function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o,a,s,c;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),r=new _(r||[]);return i(e,"_invoke",{value:(o=t,a=n,s=r,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return E()}for(s.method=t,s.arg=e;;){var n=s.delegate;if(n&&(n=function t(e,n){var r=n.method,i=e.iterator[r];return void 0===i?(n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f):(r=h(i,e.iterator,n.arg),"throw"===r.type?(n.method="throw",n.arg=r.arg,n.delegate=null,f):(i=r.arg,i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,f):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)))}(n,s),n)){if(n===f)continue;return n}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===c)throw c="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(c="executing",n=h(o,a,s),"normal"===n.type){if(c=s.done?"completed":"suspendedYield",n.arg===f)continue;return{value:n.arg,done:s.done}}"throw"===n.type&&(c="completed",s.method="throw",s.arg=n.arg)}})}),e}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function m(){}function g(){}o={};var v=(l(o,a,(function(){return this})),Object.getPrototypeOf),y=(v=v&&v(v(k([]))),v&&v!==e&&n.call(v,a)&&(o=v),g.prototype=p.prototype=Object.create(o));function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;i(this,"_invoke",{value:function(i,a){function s(){return new e((function(o,s){!function i(o,a,s,c){var l;o=h(t[o],t,a);if("throw"!==o.type)return(a=(l=o.arg).value)&&"object"==Object(r.a)(a)&&n.call(a,"__await")?e.resolve(a.__await).then((function(t){i("next",t,s,c)}),(function(t){i("throw",t,s,c)})):e.resolve(a).then((function(t){l.value=t,s(l)}),(function(t){return i("throw",t,s,c)}));c(o.arg)}(i,a,o,s)}))}return o=o?o.then(s,s):s()}})}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function k(t){if(t){var e,r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(r=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r}).next=r}return{next:E}}function E(){return{value:void 0,done:!0}}return i(y,"constructor",{value:m.prototype=g,configurable:!0}),i(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},b(w.prototype),l(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new w(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),l(y,c,"Generator"),l(y,a,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var a=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,L(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}n("f825"),o={data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},formValidate:{page:1,limit:20,title:""},styles:{height:"calc(100% - 55px)",overflow:"auto",paddingBottom:"53px",position:"static"},loading:!1,pwdModal:!1,buildModals:!1,pwd:"",tabList:[],codeBuildList:[],total:0,columns1:[{title:"ID",key:"id",width:80},{title:"菜单名",key:"name",minWidth:130},{title:"表名",key:"table_name",minWidth:130},{title:"字符集",key:"table_collation",minWidth:130},{title:"表备注",key:"table_comment",minWidth:130},{title:"添加时间",key:"add_time",minWidth:130},{title:"操作",slot:"action",fixed:"right",minWidth:150}],FromData:null,titleFrom:"",groupId:0,addId:"",editorList:[],indexEditor:0,code:"",contextData:null,fileType:"",className:"",spinShow:!1,modals:!1,editor:"",editorIndex:[],title:"",editId:0}},computed:Object(o.a)(Object(o.a)({},Object(a.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getList()},beforeDestroy:function(){this.source&&this.source.close()},methods:{crudSaveFile:function(){var t=this,e={filepath:this.editorIndex[this.indexEditor].pathname,comment:this.editorList[this.indexEditor].editor.getValue(),pwd:this.pwd};Object(s.g)(this.editId,e).then((function(e){t.pwd="",t.$Message.success(e.msg)})).catch((function(e){t.$Message.error(e.msg)}))},downLoad:function(t){Object(s.c)(t.id).then((function(t){window.open(t.data.download_url,"_blank")}))},buildCode:function(){var t;this.buildModals=!0,"undefined"!=typeof EventSource&&(t=u.a.apiBaseURL+"/system/crud/npm?token="+Object(l.c)("token"),this.source=new EventSource(t),this.source.onopen=function(t){},this.source.onmessage=function(t){},this.source.onerror=function(t){})},goList:function(t){this.$router.push({path:this.$routeProStr+"/system/config/system_group/list/"+t.id})},getList:function(){var t=this;this.loading=!0,Object(s.e)(this.formValidate).then(function(){var e=Object(i.a)(d().mark((function e(n){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.tabList=r.list,t.total=r.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.formValidate.page=t,this.getList()},userSearchs:function(){this.formValidate.page=1,this.getList()},groupAdd:function(){this.$router.push({name:"system_code_generation"})},del:function(t,e,n){var r=this;e={title:e,num:n,url:"system/crud/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){r.$Message.success(t.msg),r.tabList.splice(n,1),r.getList()})).catch((function(t){r.$Message.error(t.msg)}))},edit:function(t){var e=this;this.spinShow=!0,this.title=t.name,this.$nextTick((function(n){e.openfile(t.id,!1)}))},editItem:function(t){this.$router.push({name:"system_code_generation",query:{id:t.id}})},openfile:function(t){var e=this;try{this.editId=t;var n=this;this.editorIndex=[],this.editorList=[],Object(s.b)(t).then(function(){var t=Object(i.a)(d().mark((function t(r){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.data.file[0],r.data.file.map((function(t,r){var i=t;e.editorIndex.push({tab:!0,index:r+"",title:i.name,file_name:i.file_name,pathname:i.path}),n.code=i.content,e.initEditor(r,i.content),e.$nextTick((function(t){n.editorList[r].path=i.path,n.editorList[r].oldCode=n.content,n.editorIndex[r].title=i.name,n.editorIndex[r].file_name=i.file_name}))})),n.modals=!0,n.spinShow=!1;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){n.catchFun(t)}))}catch(t){}},winChanges:function(){this.className?this.className="":this.className="diy-fullscreen"},initEditor:function(t,e){try{var n=this;n.$nextTick((function(){n.editor=c.editor.create(document.getElementById("container_"+t),{value:e,language:"sql",automaticLayout:!0,theme:"vs",foldingStrategy:"indentation",overviewRulerBorder:!1,scrollbar:{verticalScrollbarSize:4,horizontalScrollbarSize:10},autoIndent:!0,tabSize:4,autoClosingOvertype:"always",readOnly:!1}),n.editorList.push({editor:n.editor,oldCode:n.code,path:"",index:t})}))}catch(t){}},catchFun:function(t){t.status&&(400==t.status&&this.$Message.error(t.msg),110008==t.status&&(this.isShowLogn=!0,this.isShowList=!1,this.loading=!1)),this.spinShow&&(this.spinShow=!1),this.loading&&(this.loading=!1)},editModalChange:function(){var t=this;t.editorList.forEach((function(e,n){t.editorList[n].editor.dispose(),t.editorList[n].editor=null})),t.modals=!1,t.editor="",t.editorIndex=[{tab:!0,index:"0",title:"",icon:""}],t.editorList=[],t.indexEditor="0",t.code="",t.contextData=null},toggleEditor:function(t){t=Number(t),this.code=this.editorList[t].oldCode,this.editor=this.editorList[t].editor},handleTabRemove:function(t){this.editorIndex[t].tab=!1}}},n("3be0"),a=n("2877"),n=Object(a.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[n("Button",{staticClass:"mr20",attrs:{type:"primary"},on:{click:function(e){return t.groupAdd()}}},[t._v("添加功能")]),n("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.tabList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"statuss",fn:function(e){var r=e.row;return e.index,[n("i-switch",{attrs:{value:r.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(r)}},model:{value:r.status,callback:function(e){t.$set(r,"status",e)},expression:"row.status"}},[n("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),n("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}},{key:"action",fn:function(e){var r=e.row,i=e.index;return[n("a",{on:{click:function(e){return t.edit(r,"编辑")}}},[t._v("查看")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.editItem(r)}}},[t._v("编辑")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.downLoad(r)}}},[t._v("下载")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.del(r,"删除",i)}}},[t._v("删除")])]}}])}),n("div",{staticClass:"acea-row row-right page"},[n("Page",{attrs:{total:t.total,current:t.formValidate.page,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1)],1),n("Drawer",{attrs:{"class-name":t.className,title:"Create",width:"80%","mask-closable":!1,styles:t.styles,"before-close":t.editModalChange},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[n("p",{ref:"diyHeader",staticClass:"diy-header",attrs:{slot:"header"},slot:"header"},[n("span",[t._v(t._s(t.title))])]),n("div",{staticClass:"file",staticStyle:{height:"100%"}},[n("Button",{staticClass:"save",attrs:{type:"primary"},on:{click:function(e){t.pwdModal=!0}}},[t._v("保存")]),n("div",{staticClass:"file-box"},[n("div",{staticClass:"file-fix"}),n("div",{staticClass:"file-content"},[n("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.toggleEditor},model:{value:t.indexEditor,callback:function(e){t.indexEditor=e},expression:"indexEditor"}},t._l(t.editorIndex,(function(e){return n("el-tab-pane",{key:e.index},[n("span",{attrs:{slot:"label"},slot:"label"},[n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.title,placement:"top"}},[n("span",[t._v(t._s(e.file_name))])])],1),n("div",{ref:"container",refInFor:!0,staticStyle:{height:"100%","min-height":"calc(100vh - 110px)"},attrs:{id:"container_"+e.index}})])})),1)],1),t.spinShow?n("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1)]),n("Modal",{attrs:{scrollable:"",title:"终端","footer-hide":"",closable:"","mask-closable":!1,width:"60%","before-close":t.editModalChange},model:{value:t.buildModals,callback:function(e){t.buildModals=e},expression:"buildModals"}},[n("Alert",{attrs:{type:"warning"}},[t._v("当前终端未运行于安装服务下,部分命令可能无法执行.")]),n("div",t._l(t.codeBuildList,(function(e,r){return n("div",{key:r},[t._v(t._s(e))])})),0)],1),n("Modal",{attrs:{title:"文件管理密码",closable:!1},on:{"on-ok":t.crudSaveFile,"on-cancel":function(e){t.pwdModal=!1}},model:{value:t.pwdModal,callback:function(e){t.pwdModal=e},expression:"pwdModal"}},[n("Input",{attrs:{type:"password",placeholder:"请输入文件管理密码"},model:{value:t.pwd,callback:function(e){t.pwd=e},expression:"pwd"}})],1)],1)}),[],!1,null,"8f7da644",null),e.default=n.exports},"6beb":function(t,e,n){},a9e7:function(t,e,n){"use strict";n.d(e,"f",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return l})),n.d(e,"g",(function(){return u}));var r=n("6b6c");function i(){return Object(r.a)({url:"/system/crud/menus",method:"get"})}function o(){return Object(r.a)({url:"/system/crud/column_type",method:"get"})}function a(t){return Object(r.a)({url:"/system/crud/file_path",method:"post",data:t})}function s(t){return Object(r.a)({url:"/system/crud",method:"get",params:t})}function c(t){return Object(r.a)({url:"/system/crud/".concat(t),method:"get"})}function l(t){return Object(r.a)({url:"/system/crud/download/".concat(t),method:"get"})}function u(t,e){return Object(r.a)({url:"/system/crud/save_file/".concat(t),method:"post",data:e})}}}]); |