index-DKlHv26v.js 5.1 KB

1
  1. var M=(e,t,r)=>new Promise((c,g)=>{var f=a=>{try{d(r.next(a))}catch(u){g(u)}},n=a=>{try{d(r.throw(a))}catch(u){g(u)}},d=a=>a.done?c(a.value):Promise.resolve(a.value).then(f,n);d((r=r.apply(e,t)).next())});import{_ as E}from"./BasicTable.vue_vue_type_script_setup_true_lang-LfIfgHfU.js";import"./TableImg.vue_vue_type_style_index_0_lang-Bw1yjZfI.js";import{_ as $}from"./index-COaHNk09.js";import{u as U}from"./useTable-Ckkpwxcg.js";import{b as J,d as N}from"./index-BXL90VpN.js";import{l as V,d as x,f as p,al as O,a9 as m,Z as j,_ as q,$ as I,a0 as T,k as o,a8 as s,G as _}from"./vue-ByATgq5d.js";import{u as z}from"./index-CFdteMiu.js";import G from"./managerDrawer-DnAOe0Sn.js";import{C as H}from"./index-1wV_tWu7.js";import{r as L,_ as P}from"./entry/index-C7JiT1GB.js";import{M as Z,R as K}from"./antd-FjOLgRLC.js";import"./BasicForm.vue_vue_type_script_setup_true_lang-CNQgK2hZ.js";import"./FormItem.vue_vue_type_script_lang-DShPDeWl.js";import"./componentMap-Bl3zv6Ms.js";import"./useFormItem-DmfL7Ss_.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-DXgKlWOB.js";import"./index-DdNcNAMt.js";import"./IconPicker.vue_vue_type_script_setup_true_lang-DORWVBs9.js";import"./copyTextToClipboard-D9zCzvi-.js";import"./index-3Ue_ZFSu.js";import"./index-DU88M1nq.js";import"./index-Cj7S-5xp.js";import"./useWindowSizeFn-JqODWlR_.js";import"./base64Conver-bBv-IO2K.js";import"./helper-Ba5FUquL.js";import"./BasicForm.vue_vue_type_style_index_0_lang-9WP9An_0.js";import"./useForm-BijxHkUB.js";import"./uuid-D0SLUWHI.js";import"./sortable.esm-CoO8jRpa.js";import"./onMountedOrActivated-BDlj7Upy.js";import"./useSortable-y7X8pv8d.js";import"./download-DGeKzh-1.js";const Q=[{title:"标题",dataIndex:"title",width:150},{title:"字段",dataIndex:"code"},{title:"表名",dataIndex:"table",width:150,sorter:!0},{title:"类型",dataIndex:"type",width:175,customRender:({record:e})=>V("span",e.type+(e.length?" "+e.length:"")+(e.decimal?" "+e.decimal:"")+(e.is_null?"":" not null"))},{title:"ES属性",dataIndex:"es_property",width:175},{title:"备注",dataIndex:"remark"}],A={title:"站点列表",titleHelpMessage:"比如:后台管理模块,前台管理模块,命名空间必须与代码模块保持一致!",api:J,columns:Q,bordered:!0,showTableSetting:!0,loading:!0,pagination:{pageSize:30},actionColumn:{width:160,title:"操作",dataIndex:"action",slots:{customRender:"action"}}},W=x({components:{BasicTable:E,TableAction:$,ManagerDrawer:G,Modal:Z,Card:K,CodeEditor:H},setup(){const[e,{openDrawer:t}]=z(),r=p(!1),c=p(!1),g=O(),f=p({}),n=g.query.mid;n||L.back(),A.beforeFetch=i=>{i.mid=n};const[d,{reload:a,getDataSource:u}]=U(A);function b(i){t(!0,{record:i,assemble_mid:n,isUpdate:!0})}function C(i){}function y(){a()}function l(){c.value=!1,t(!0,{assemble_mid:n,isUpdate:!1})}const v=p(!1),h=p({});function F(){v.value=!0;const i=u();let B={};i.map(D=>{B[D.code]=JSON.parse(D.es_property)}),h.value=B,c.value=!0}const k=p(!1),w=p({});function R(){k.value=!0}function S(){return M(this,null,function*(){f.value=yield N({mid:n}),w.value=JSON.parse(f.value.es_index)})}return S(),{loading:r,registerTable:d,registerDrawer:e,handleCreate:l,handleEdit:b,handleSuccess:y,handleDelete:C,handleMapping:F,modalMapping:v,mappingJson:h,isReadonly:c,assembleInfo:f,esIndex:w,modalIndex:k,handleIndex:R,getAction:i=>i.category_type==1?[]:[{label:"编辑",icon:"clarity:note-edit-line",color:"success",onClick:b.bind(null,i)},{label:"删除",icon:"ic:outline-delete-outline",color:"error",onClick:C.bind(null,i)}]}}}),X={class:"p-4"},Y={class:"p-4"};function ee(e,t,r,c,g,f){const n=m("a-button"),d=m("TableAction"),a=m("BasicTable"),u=m("ManagerDrawer"),b=m("CodeEditor"),C=m("Card"),y=m("Modal");return j(),q("div",X,[I("div",Y," 集合: "+T(e.assembleInfo.schema)+" ("+T(e.assembleInfo.title)+") ",1),o(a,{onRegister:e.registerTable},{toolbar:s(()=>[o(n,{type:"primary",onClick:e.handleCreate},{default:s(()=>[_(" 添加字段 ")]),_:1},8,["onClick"]),o(n,{type:"default",onClick:e.handleCreate},{default:s(()=>[_(" 历史字段 ")]),_:1},8,["onClick"]),o(n,{type:"default",onClick:e.handleIndex},{default:s(()=>[_(" 索引配置 ")]),_:1},8,["onClick"]),o(n,{type:"default",onClick:e.handleMapping},{default:s(()=>[_(" Mapping ")]),_:1},8,["onClick"])]),action:s(({record:l})=>[o(d,{actions:e.getAction(l)},null,8,["actions"])]),_:1},8,["onRegister"]),o(u,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"]),o(y,{open:e.modalIndex,"onUpdate:open":t[1]||(t[1]=l=>e.modalIndex=l),footer:null,title:"索引配置"},{default:s(()=>[I("div",null,[o(C,{title:"",bordered:!1},{default:s(()=>[o(b,{value:e.esIndex,"onUpdate:value":t[0]||(t[0]=l=>e.esIndex=l),readonly:e.isReadonly},null,8,["value","readonly"])]),_:1})])]),_:1},8,["open"]),o(y,{open:e.modalMapping,"onUpdate:open":t[3]||(t[3]=l=>e.modalMapping=l),footer:null,title:"查看Mapping信息"},{default:s(()=>[I("div",null,[o(C,{title:"",bordered:!1},{default:s(()=>[o(b,{value:e.mappingJson,"onUpdate:value":t[2]||(t[2]=l=>e.mappingJson=l),readonly:e.isReadonly},null,8,["value","readonly"])]),_:1})])]),_:1},8,["open"])])}const Ue=P(W,[["render",ee]]);export{Ue as default};