Files
qhmes/web-dist/js/BindingDetailFieldsEditor-ilFMi7Vw.js

2 lines
15 KiB
Java
Raw Normal View History

2026-06-16 18:19:57 +08:00
var Te=Object.defineProperty,Ce=Object.defineProperties;var Se=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var Fe=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var V=(v,y,o)=>y in v?Te(v,y,{enumerable:!0,configurable:!0,writable:!0,value:o}):v[y]=o,x=(v,y)=>{for(var o in y||(y={}))Fe.call(y,o)&&V(v,o,y[o]);if(P)for(var o of P(y))Me.call(y,o)&&V(v,o,y[o]);return v},T=(v,y)=>Ce(v,Se(y));import{M as ze,s as Ue,aG as $e,aE as Ie,av as _e,au as Be}from"./index-X7Y8jykP.js";import{e as Re,o as Ee,d as Le,h as Ne,C as I,z as w,Q as m,f as u,A as p,K as qe,r as C,c as G,E as g,G as A,y as R,H as Y,F as j,D as Q}from"./vue-vendor-DNhG1Cve.js";import{_ as De}from"./index-DTjkSGYl.js";import Oe from"./index-DklMb9Qc.js";import Ge from"./index-saD4h7VJ.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./eagerComputed-BTlOruLW.js";import"./fromPairs-Dx9PT-t0.js";import"./useMaxLevel-DE205ncc.js";import"./index-DSsDi_fL.js";import"./Group-UHkub2tu.js";import"./Checkbox-Dbxs4we4.js";import"./index-BuONesFs.js";import"./index-CfNJyBRj.js";import"./dropdown-jkliuVyN.js";import"./index-DfHu-LAS.js";import"./Group-DBzJABA_.js";import"./RadioButton-DRBix2Fq.js";import"./index-C7ckZv9Z.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./scrollTo-D49dA-9c.js";import"./operationUnit-vCu2co3e.js";import"./UpOutlined-B1UMbtrP.js";const He={class:"binding-detail-fields-editor"},Pe={class:"binding-actions-row"},Ve={key:2,class:"field-count"},Ae={class:"nested-fields"},Ye={class:"nested-fields-head"},je={class:"modal-section"},Qe={class:"modal-section"},We={class:"modal-section"},Je={class:"modal-section"},Xe=Re({__name:"BindingDetailFieldsEditor",props:{detailTables:{}},emits:["update:detailTables"],setup(v,{emit:y}){const o=v,S=y,{createMessage:z}=Ue(),D=C(typeof window!="undefined"?window.innerHeight:800);function H(){D.value=window.innerHeight}Ee(()=>window.addEventListener("resize",H)),Le(()=>window.removeEventListener("resize",H));const W=G(()=>{const a=D.value;return Math.round(Math.min(500,Math.max(220,a-380)))}),J=G(()=>{const a=D.value;return Math.round(Math.min(300,Math.max(140,a-520)))}),U=C([]),k=C([]),E=C(!1),L=C(1),F=C([{tableKey:"",label:""}]),_=C(!1),$=C(void 0),N=C(1),h=C([{parentKey:"",fieldKey:"",label:""}]),X=G(()=>(o.detailTables||[]).map(a=>({value:a.tableKey,label:a.label?`${a.tableKey}${a.label}`:a.tableKey}))),Z=[{title:"数据源",dataIndex:"tableKey",ellipsis:!0,width:96},{title:"显示名",dataIndex:"label",ellipsis:!0},{title:"字段数",dataIndex:"fieldCount",width:72,align:"right"}],ee=[{title:"字段键",dataIndex:"key",ellipsis:!0},{title:"显示名",dataIndex:"label",ellipsis:!0},{title:"操作",dataIndex:"actions",width:56,align:"center"}];Ne(()=>o.detailTables.map(a=>a.tableKey).join(","),()=>{const a=new Set(o.detailTables.map(e=>e.tableKey));k.value=k.value.filter(e=>a.has(e)),U.value=U.value.filter(e=>a.has(e))});function le(a){k.value=a}function ae(){const a=new Set(o.detailTables.map(e=>e.tableKey.trim()).filter(Boolean));return F.value.forEach(e=>{const t=e.tableKey.trim();t&&a.add(t)}),a}function te(a){let e=0;for(const t of a){const l=String(t).match(/^List(\d+)$/i);l&&(e=Math.max(e,Number(l[1])))}return e}function ne(a){const e=new Set,t=o.detailTables.find(n=>n.tableKey===a);((t==null?void 0:t.fields)||[]).forEach(n=>e.add(n.key)),h.value.forEach(n=>{var i;String((i=n.parentKey)!=null?i:"").trim()===a&&n.fieldKey.trim()&&e.add(n.fieldKey.trim())});let l=0;for(const n of e){const i=String(n).match(/^Field(\d+)$/i);i&&(l=Math.max(l,Number(i[1])))}return l}function ie(a,e){return typeof e=="number"&&e>=0?e:o.detailTables.findIndex(t=>t.tableKey===a.tableKey)}function se(a,e,t){var K,b;const l=ie(a,t),n=(b=(K=o.detailTables[l])==null?void 0:K.tableKey)!=null?b:a.tableKey,i=String(e||"").trim();if(!i){z.warning("数据源键不能为空");return}if(i!==n&&o.detailTables.some(M=>M.tableKey===i)){z.warning("该数据源键已存在");return}const s=[...o.detailTables];l<0||l>=s.length