2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[492],{4339:function(e,t,n){n.d(t,{b:function(){return a}});var a="document_template_properties"},6631:function(e,t,n){n.d(t,{D:function(){return r},z:function(){return u}});var a=n(3872),l="/api/v1.0",r=function(){return a.Z.get(l+"/document_template/properties")},u=function(e){return a.Z.patch(l+"/document_template/properties",e)}},1492:function(e,t,n){n.r(t),n.d(t,{default:function(){return f}});var a=n(6252),l=(0,a._)("div",{class:"h3"},"Columns",-1),r=(0,a._)("div",{class:"h3"},"Indexes",-1),u=(0,a._)("div",{class:"h3"},"Foreign Keys",-1),i=(0,a._)("div",{class:"h3"},"Trigger",-1);function o(e,t,n,o,s,m){var p=(0,a.up)("el-switch"),d=(0,a.up)("el-col"),c=(0,a.up)("el-row"),f=(0,a.up)("el-input"),h=(0,a.up)("el-table-column"),g=(0,a.up)("el-table");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(c,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(p,{modelValue:s.showSampleData,"onUpdate:modelValue":t[0]||(t[0]=function(e){return s.showSampleData=e}),size:"large","active-text":"展示示例数据","inactive-text":"隐藏示例数据",onChange:m.onSwitchShowSampleData},null,8,["modelValue","onChange"])]})),_:1})]})),_:1}),(0,a.Wm)(c,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[l]})),_:1}),(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(g,{border:"",data:s.sampleData.columns,"highlight-current-row":""},{default:(0,a.w5)((function(){return[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.template.columnFieldNameProperties,(function(e){return(0,a.wg)(),(0,a.j4)(h,{label:e.key,key:e.key,prop:e.key},{header:(0,a.w5)((function(){return[(0,a.Wm)(f,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},placeholder:e.key,onChange:t[1]||(t[1]=function(e){return m.saveColumnProperties()}),"input-style":s.inputStyle},null,8,["modelValue","onUpdate:modelValue","placeholder","input-style"])]})),_:2},1032,["label","prop"])})),128))]})),_:1},8,["data"])]})),_:1})]})),_:1}),(0,a.Wm)(c,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[r]})),_:1}),(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(g,{border:"",data:s.sampleData.indexes},{default:(0,a.w5)((function(){return[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.template.indexFieldNameProperties,(function(e){return(0,a.wg)(),(0,a.j4)(h,{label:e.key,key:e.key,prop:e.key},{header:(0,a.w5)((function(){return[(0,a.Wm)(f,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},placeholder:e.key,onChange:t[2]||(t[2]=function(e){return m.saveIndexProperties()}),"input-style":s.inputStyle},null,8,["modelValue","onUpdate:modelValue","placeholder","input-style"])]})),_:2},1032,["label","prop"])})),128))]})),_:1},8,["data"])]})),_:1})]})),_:1}),(0,a.Wm)(c,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[u]})),_:1}),(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(g,{border:"",data:s.sampleData.foreignKeys},{default:(0,a.w5)((function(){return[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.template.foreignKeyFieldNameProperties,(function(e){return(0,a.wg)(),(0,a.j4)(h,{label:e.key,key:e.key,prop:e.key},{header:(0,a.w5)((function(){return[(0,a.Wm)(f,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},placeholder:e.key,onChange:t[3]||(t[3]=function(e){return m.saveForeignKeyProperties()}),"input-style":s.inputStyle},null,8,["modelValue","onUpdate:modelValue","placeholder","input-style"])]})),_:2},1032,["label","prop"])})),128))]})),_:1},8,["data"])]})),_:1})]})),_:1}),(0,a.Wm)(c,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[i]})),_:1}),(0,a.Wm)(d,null,{default:(0,a.w5)((function(){return[(0,a.Wm)(g,{border:"",data:s.sampleData.triggers},{default:(0,a.w5)((function(){return[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(s.template.triggerFieldNameProperties,(function(e){return(0,a.wg)(),(0,a.j4)(h,{label:e.key,key:e.key,prop:e.key},{header:(0,a.w5)((function(){return[(0,a.Wm)(f,{modelValue:e.value,"onUpdate:modelValue":function(t){return e.value=t},placeholder:e.key,onChange:t[4]||(t[4]=function(e){return m.saveTriggerProperties()}),"input-style":s.inputStyle},null,8,["modelValue","onUpdate:modelValue","placeholder","input-style"])]})),_:2},1032,["label","prop"])})),128))]})),_:1},8,["data"])]})),_:1})]})),_:1})],64)}var s=n(6631),m=n(4339),p={data:function(){return{template:{columnFieldNameProperties:[],foreignKeyFieldNameProperties:[],indexFieldNameProperties:[],triggerFieldNameProperties:[]},sampleData:{columns:[],indexes:[],foreignKeys:[],triggers:[]},showSampleData:!1,inputStyle:{border:"none"}}},watch:{},created:function(){this.fetchDocumentTemplateProperties()},methods:{fetchDocumentTemplateProperties:function(){var e=this;(0,s.D)().then((function(t){t.errCode||(e.template=t.data)}))},clearPropertyCache:function(){sessionStorage.removeItem(m.b)},saveColumnProperties:function(){var e=this,t={type:"COLUMN_FIELD_NAME",properties:this.template.columnFieldNameProperties};(0,s.z)(t).then((function(t){t.errCode||(e.$message.success("保存成功"),e.clearPropertyCache())}))},saveIndexProperties:function(){var e=this,t={type:"INDEX_FIELD_NAME",properties:this.template.indexFieldNameProperties};(0,s.z)(t).then((function(t){t.errCode||(e.$message.success("保存成功"),e.clearPropertyCache())}))},saveTriggerProperties:function(){var e=this,t={type:"TRIGGER_FIELD_NAME",properties:this.template.triggerFieldNameProperties};(0,s.z)(t).then((function(t){t.errCode||(e.$message.success("保存成功"),e.clearPropertyCache())}))},saveForeignKeyProperties:function(){var e=this,t={type:"FOREIGN_KEY_FIELD_NAME",properties:this.template.foreignKeyFieldNameProperties};(0,s.z)(t).then((function(t){t.errCode||(e.$message.success("保存成功"),e.clearPropertyCache())}))},onSwitchShowSampleData:function(e){if(e){var t='[{"id":409,"name":"id","type":"INT","size":10,"decimalDigits":1,"comment":"id comment","description":"this is id","isPrimaryKey":true,"nullable":"NO","autoIncrement":"YES","defaultValue":"1","discussionCount":null,"createAt":"2022-04-10 13:45:06"},{"id":410,"name":"email","type":"VARCHAR","size":512,"decimalDigits":null,"comment":"","description":null,"isPrimaryKey":false,"nullable":"NO","autoIncrement":"NO","defaultValue":null,"discussionCount":null,"createAt":"2022-04-10 13:45:06"},{"id":411,"name":"username","type":"VARCHAR","size":128,"decimalDigits":null,"comment":"","description":null,"isPrimaryKey":false,"nullable":"NO","autoIncrement":"NO","defaultValue":null,"discussionCount":null,"createAt":"2022-04-10 13:45:06"},{"id":412,"name":"password","type":"TEXT","size":65535,"decimalDigits":null,"comment":"","description":null,"isPrimaryKey":false,"nullable":"NO","autoIncrement":"NO","defaultValue":null,"discussionCount":null,"createAt":"2022-04-10 13:45:06"}]';this.sampleData.columns=JSON.parse(t);var n='[{"id":96,"name":"uk_email","isUnique":true,"columnNames":["email","deleted_token"],"createAt":"2022-04-10 13:45:06"},{"id":97,"name":"uk_username","isUnique":true,"columnNames":["username","deleted_token"],"createAt":"2022-04-10 13:45:06"},{"id":98,"name":"PRIMARY","isUnique":true,"columnNames":["id"],"createAt":"2022-04-10 13:45:06"}]';this.sampleData.indexes=JSON.parse(n);var a='[{"fkName":"dept_manager_ibfk_2","fkTableName":"dept_manager","fkColumnName":"dept_no","pkName":"PRIMARY","pkTableName":"departments","pkColumnName":"dept_no","updateRule":"CASCADE","deleteRule":"CASCADE"},{"fkName":"dept_manager_ibfk_1","fkTableName":"dept_manager","fkColumnName":"emp_no","pkName":"PRIMARY","pkTableName":"employees","pkColumnName":"emp_no","updateRule":"CASCADE","deleteRule":"CASCADE"}]';this.sampleData.foreignKeys=JSON.parse(a);var l='[{"id":1,"name":"custom trigger","timing":"before","manipulation":"insert","statement":"sql","triggerCreateAt":"1970-01-01 00:00:00"}]';this.sampleData.triggers=JSON.parse(l)}else this.sampleData.columns=[],this.sampleData.indexes=[],this.sampleData.foreignKeys=[],this.triggers=[]}}},d=n(3744);const c=(0,d.Z)(p,[["render",o]]);var f=c}}]);
|
|
//# sourceMappingURL=492-legacy.4e70196c.js.map
|