cd-form 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cd-form.js CHANGED
@@ -7066,7 +7066,7 @@ const cd = { class: "add-container" }, fd = { class: "panel-footer" }, vd = { cl
7066
7066
  ]);
7067
7067
  };
7068
7068
  }
7069
- }), nu = /* @__PURE__ */ Re(su, [["__scopeId", "data-v-88b3f513"]]);
7069
+ }), nu = /* @__PURE__ */ Re(su, [["__scopeId", "data-v-7f2a595e"]]);
7070
7070
  (function() {
7071
7071
  try {
7072
7072
  if (typeof document < "u") {
@@ -26,7 +26,7 @@
26
26
  `)({formData:c,setFormData:ce=>Object.assign(c,ce),setShowOrHide:()=>{},setRequired:()=>{},setDisabled:()=>{},onlineUtils:{}})}catch(W){console.error("执行 beforeSubmit 出错:",W),re.MessagePlugin.error("提交前验证失败");return}if(h.value==="add"?p("add",c):h.value==="edit"&&p("edit",c),(T=r.formData.funcs)!=null&&T.afterSubmit)try{new Function("context",`
27
27
  const { formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils } = context;
28
28
  ${r.formData.funcs.afterSubmit}
29
- `)({formData:c,setFormData:()=>{},setShowOrHide:()=>{},setRequired:()=>{},setDisabled:()=>{},onlineUtils:{}})}catch(W){console.error("执行 afterSubmit 出错:",W)}i.value=!1,p("refresh")},Me=async()=>{await he(),setTimeout(()=>{Y()},300)},Se=()=>{i.value=!1},Xe=l=>{console.log("🚀 CdForm: 接收到 select-org-data 事件:",l),p("select-org-data",l),console.log("📡 CdForm: 已转发 select-org-data 事件到 app.vue")},Je=l=>{p("page-change",{currentPage:l.current,pageSize:j.value})},Qe=l=>{le.value=1,p("page-change",{currentPage:1,pageSize:l})},Ze=l=>{},ve=l=>{},qe=l=>{p("filter-search",l)},ze=()=>{p("filter-reset")},et=l=>{p("save-plan",l)},tt=l=>{console.log("删除筛选方案:",l),p("delete-plan",l)},lt=l=>{console.log("复制筛选方案:",l),p("copy-plan",l)},at=l=>{console.log("设置默认方案:",l),p("set-default-plan",l)},Re=l=>{console.log("更新筛选方案:",l),p("update-plan",l)},ot=l=>{console.log("加载用户:",l),p("load-users",l)},nt=l=>{console.log("搜索人员:",l),p("search-persons",l)},rt=l=>{console.log("部门点击:",l),p("dept-click",l)},st=l=>{console.log("列配置变更0:",l),l&&l.length>0&&(l.forEach(c=>{R.value.set(c.value,{width:c.width?parseInt(c.width):void 0,fixed:c.fixed&&c.fixed!=="none"?c.fixed:void 0,show:c.show})}),e.nextTick(()=>{M.columns=we(),b.value&&b.value.refreshColumn()})),p("column-change",l)},it=l=>{console.log("颜色筛选变化:",l),F.value=l||[],p("color-filter-change",l)},Ae=()=>{console.log("清除颜色筛选"),F.value=[],p("color-filter-clear")},Oe=e.computed(()=>{var l;return((l=r.businessFlow)==null?void 0:l.downstream)&&r.businessFlow.downstream.length>0}),je=()=>{var g,y;const l=(g=b.value)==null?void 0:g.getCheckboxRecords();if(!l||l.length===0){re.MessagePlugin.warning("请选择要下推的数据");return}const c=((y=r.businessFlow)==null?void 0:y.downstream)||[];if(c.length===0){re.MessagePlugin.warning("未配置下游单据");return}c.length===1?p("push-down",{downstream:c[0],selectedRows:l}):O.value=!0},ct=()=>{var c;if(!J.value){re.MessagePlugin.warning("请选择下推目标");return}const l=(c=b.value)==null?void 0:c.getCheckboxRecords();p("push-down",{downstream:J.value,selectedRows:l}),O.value=!1,J.value=null},dt=l=>{p("select-upstream",{upstream:l})},mt=()=>{var g;if(!S.value||S.value.length===0){if(M.aggregateConfig={},M.columns){const y=M.columns.findIndex(P=>P.field==="group");y>-1&&M.columns.splice(y,1),M.columns.forEach(P=>{P.rowGroupNode&&(P.rowGroupNode=!1,delete P.slots)})}return k.value=!1,p("group",{groupFields:[],mergeFields:!1}),!0}k.value=!1;const l=S.value.filter(y=>y&&y.trim()!=="");return l.length===0?(M.aggregateConfig={},k.value=!1,p("group",{groupFields:[],mergeFields:!1}),!0):(M.data&&Array.isArray(M.data)&&M.data.forEach(y=>{y.group=l.map(P=>y[P]||"").join("-")}),!((g=M.columns)==null?void 0:g.some(y=>y.field==="group"))&&M.columns&&M.columns.splice(1,0,{field:"group",title:"分组",width:200,align:"left",headerAlign:"center",sortable:!0,rowGroupNode:!0}),a.value?M.aggregateConfig={mode:"column",groupFields:["group"],showTotal:!0}:M.aggregateConfig={mode:"column",groupFields:l,showTotal:!0},p("group",{groupFields:l,mergeFields:a.value,updatedData:fe.value}),console.log("gridOptions.columns",M.columns),k.value=!1,!0)},ft=()=>{k.value=!1},Te=e.ref(new Map),He=e.computed(()=>{const l=[];return!r.formData.fields||r.formData.fields.length===0||r.formData.fields.forEach(c=>{const g=c.__config__;if(g.cdkey==="vxeSubGrid"&&!g.noShow){const y=c.__vModel__,P=c.children||c.__config__.children||[];l.push({vModel:y,label:g.label,children:P,field:c})}}),l}),pt=(l,c)=>{const g=String(l.id);Te.value.has(c)||Te.value.set(c,new Set);const y=Te.value.get(c);y.has(g)?(y.delete(g),!Array.from(Te.value.entries()).some(([W,X])=>W!==c&&X.has(g))&&b.value&&b.value.setRowExpand(l,!1)):(y.add(g),b.value&&b.value.setRowExpand(l,!0))},z=(l,c)=>{var y;const g=String(l.id);return((y=Te.value.get(c))==null?void 0:y.has(g))||!1},oe=l=>{const c=[];return(l.children||[]).forEach(y=>{const P=y.__config__;if(!P||P.noShow)return;const T=y.field||y.__vModel__;if(!T)return;const W={field:T,title:y.title||P.label||T,width:y.width||y.minWidth||P.tableWidth||150,align:y.align||P.tableAlign||"left",sortable:!1};c.push(W)}),c},Be=e.reactive({border:!0,stripe:!0,size:"small",maxHeight:350,minHeight:200,round:!0,showOverflow:!0,showHeaderOverflow:!0,rowConfig:{isCurrent:!0,isHover:!0},cellConfig:{height:35},columnConfig:{resizable:!0}});return U({tableRef:b,formRenderRef:E,handleAdd:Y,handleEdit:ae,handleDelete:Ee,handleDetail:ye,handleSaveChanges:me,handlePushDown:je,handleSelectUpstream:dt,isInlineEdit:x,showGroupDialog:k,selectedGroupField:S,mergeGroupFields:a,openFormPopup:(l={},c="新增")=>{h.value="add",n.value=c,i.value=!0,e.nextTick(()=>{var g;(g=E.value)==null||g.initFormData(l)})}}),(l,c)=>{var $t;const g=e.resolveComponent("t-button"),y=e.resolveComponent("t-dropdown-item"),P=e.resolveComponent("t-dropdown-menu"),T=e.resolveComponent("t-dropdown"),W=e.resolveComponent("t-select"),X=e.resolveComponent("t-switch"),ce=e.resolveComponent("t-dialog"),De=e.resolveComponent("t-radio"),Ue=e.resolveComponent("t-radio-group"),Ie=e.resolveComponent("t-empty"),xt=e.resolveComponent("t-loading"),gt=e.resolveComponent("t-tag"),Bt=e.resolveComponent("vxe-grid"),od=e.resolveComponent("t-pagination"),nd=e.resolveComponent("t-space"),rd=e.resolveComponent("t-drawer");return e.openBlock(),e.createElementBlock("div",Ui,[e.createElementVNode("div",Li,[e.createElementVNode("div",Ri,[t.showFilter&&de.value&&de.value.length>0?(e.openBlock(),e.createElementBlock("div",Ii,[e.createVNode(e.unref(St.CdFilterBar),{"field-options":de.value,"filter-count":2,"select-options":$e.value,"plan-filter-options":r.planFilterOptions||[],"person-tabs":[],"person-organizations":[],"visible-columns":[],onSearch:qe,onConfirm:qe,onReset:ze,onSavePlan:et,onDeletePlan:tt,onCopyPlan:lt,onSetDefaultPlan:at,onUpdatePlan:Re,onLoadUsers:ot,onSearchPersons:nt,onDeptClick:rt,onColumnChange:st,onColorFilterChange:it,onColorFilterClear:Ae},null,8,["field-options","select-options","plan-filter-options"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",qi,[x.value?(e.openBlock(),e.createBlock(g,{key:0,variant:"outline",size:"small",theme:"success",disabled:!L.value,onClick:me},{icon:e.withCtx(()=>[...c[10]||(c[10]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[c[11]||(c[11]=e.createTextVNode(" 保存更改 ",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnData.btnsList||[],Q=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Q.label},[Q.children&&Q.children.length>0?(e.openBlock(),e.createBlock(T,{key:0,onClick:ie,"overlay-class-name":"filter-dropdown"},{default:e.withCtx(()=>[e.createVNode(g,{variant:"outline",size:"small",theme:"primary"},e.createSlots({suffix:e.withCtx(()=>[c[12]||(c[12]=e.createElementVNode("i",{class:"ri-arrow-down-s-line"},null,-1))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label)+" ",1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(Q.icon)},null,2)]),key:"0"}:void 0]),1024),e.createVNode(P,{onClick:c[0]||(c[0]=pe=>ie({value:pe.value}))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.children.filter(pe=>pe.show!==!1),pe=>(e.openBlock(),e.createBlock(y,{key:pe.value||Math.random(),value:pe.value,disabled:pe.disabled,divider:pe.divider},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pe.label),1)]),_:2},1032,["value","disabled","divider"]))),128))]),_:2},1024)]),_:2},1024)):Q.show&&!H(Q.value)?(e.openBlock(),e.createBlock(g,{key:1,variant:"outline",size:"small",theme:"primary",onClick:pe=>ie({value:Q.value})},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label),1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[]),key:"0"}:void 0]),1032,["onClick"])):e.createCommentVNode("",!0)],64))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnData.customBtnsList||[],Q=>e.withDirectives((e.openBlock(),e.createBlock(g,{variant:"outline",size:"small",key:Q.value,onClick:pe=>ke(Q)},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label),1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[]),key:"0"}:void 0]),1032,["onClick"])),[[e.vShow,Q.show]])),128)),e.renderSlot(l.$slots,"toolbar-right",{},void 0,!0),Oe.value?(e.openBlock(),e.createBlock(g,{key:1,variant:"outline",size:"small",theme:"primary",onClick:je},{icon:e.withCtx(()=>[...c[13]||(c[13]=[e.createElementVNode("i",{class:"ri-arrow-down-line"},null,-1)])]),default:e.withCtx(()=>[c[14]||(c[14]=e.createTextVNode(" 下推 ",-1))]),_:1})):e.createCommentVNode("",!0)])]),e.createVNode(ce,{visible:k.value,"onUpdate:visible":c[3]||(c[3]=Q=>k.value=Q),header:"选择分组字段","confirm-btn":{content:"确定",theme:"primary"},"cancel-btn":{content:"取消",theme:"default"},onConfirm:mt,onClose:ft},{default:e.withCtx(()=>[e.createElementVNode("div",Oi,[e.createVNode(W,{modelValue:S.value,"onUpdate:modelValue":c[1]||(c[1]=Q=>S.value=Q),placeholder:"请选择要分组的字段(可多选)",options:Ne.value,keys:{label:"label",value:"value"},multiple:"",clearable:""},null,8,["modelValue","options"]),e.createElementVNode("div",Hi,[c[15]||(c[15]=e.createElementVNode("span",{class:"switch-label"},"分组:",-1)),e.createVNode(X,{modelValue:a.value,"onUpdate:modelValue":c[2]||(c[2]=Q=>a.value=Q)},null,8,["modelValue"]),e.createElementVNode("span",Wi,e.toDisplayString(a.value?"字段合并分组":"独立分组"),1)])])]),_:1},8,["visible"]),e.createVNode(ce,{visible:O.value,"onUpdate:visible":c[5]||(c[5]=Q=>O.value=Q),header:"选择下推目标",width:"400px","confirm-btn":{content:"确定",theme:"primary"},"cancel-btn":{content:"取消",theme:"default"},onConfirm:ct},{default:e.withCtx(()=>[e.createVNode(Ue,{modelValue:J.value,"onUpdate:modelValue":c[4]||(c[4]=Q=>J.value=Q),class:"push-down-options"},{default:e.withCtx(()=>{var Q;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((Q=t.businessFlow)==null?void 0:Q.downstream)||[],pe=>(e.openBlock(),e.createBlock(De,{key:pe.formId,value:pe},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pe.formName),1)]),_:2},1032,["value"]))),128))]}),_:1},8,["modelValue"])]),_:1},8,["visible"]),e.createElementVNode("div",{class:"cd-form-table",ref_key:"tableContainerRef",ref:u},[!t.loading&&G.value.length===0?(e.openBlock(),e.createBlock(xt,{key:0,loading:t.loading,text:t.loadingText},{default:e.withCtx(()=>[e.createElementVNode("div",ji,[e.createVNode(Ie,{description:"暂无数据"})])]),_:1},8,["loading","text"])):t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Bt,e.mergeProps({key:1,ref_key:"tableRef",ref:b},M,{onCheckboxChange:Ze,onCheckboxAll:ve,onEditClosed:xe,onEditChange:v,onCellDblclick:K,onFilterChange:_,onFilterReset:m,style:{"--vxe-ui-table-header-background-color":"#eef7ff","--vxe-ui-table-footer-background-color":"#fcfffa"}}),e.createSlots({checkbox_footer:e.withCtx(({$rowIndex:Q})=>[M.footerData&&M.footerData[Q]?(e.openBlock(),e.createElementBlock("span",Yi,e.toDisplayString(M.footerData[Q].checkbox),1)):e.createCommentVNode("",!0)]),nameGroupContent:e.withCtx(({groupContent:Q})=>[e.createVNode(gt,{theme:"warning",variant:"light"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q),1)]),_:2},1024)]),nameDefault:e.withCtx(({row:Q,column:pe})=>[e.createTextVNode(e.toDisplayString(Q[pe.field]),1)]),expand_content_unified:e.withCtx(({row:Q})=>[e.createElementVNode("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,pe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`content_${pe.vModel}`},[z(Q,pe.vModel)?(e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",Xi,e.toDisplayString(pe.label),1),e.createVNode(Bt,e.mergeProps({ref_for:!0},Be,{data:Q[pe.vModel]||[],columns:oe(pe)}),null,16,["data","columns"])])):e.createCommentVNode("",!0)],64))),128))])]),_:2},[e.renderList(He.value,Q=>({name:`subgrid_trigger_${Q.vModel}`,fn:e.withCtx(({row:pe})=>[e.createVNode(g,{variant:"text",size:"small",disabled:!pe[Q.vModel]||pe[Q.vModel].length===0,onClick:We=>pt(pe,Q.vModel)},{icon:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(z(pe,Q.vModel)?"ri-arrow-down-s-line":"ri-arrow-right-s-line")},null,2)]),default:e.withCtx(()=>{var We;return[e.createTextVNode(" "+e.toDisplayString(((We=pe[Q.vModel])==null?void 0:We.length)||0)+" 条 ",1)]}),_:2},1032,["disabled","onClick"])])})),e.renderList(l.$slots,(Q,pe)=>({name:pe,fn:e.withCtx(We=>[e.renderSlot(l.$slots,pe,e.normalizeProps(e.guardReactiveProps(We)),void 0,!0)])}))]),1040))],512),r.columnData.hasPage&&(($t=r.pageConfig)!=null&&$t.enabled)&&fe.value.length>0?(e.openBlock(),e.createElementBlock("div",Ji,[e.createVNode(od,{modelValue:le.value,"onUpdate:modelValue":c[6]||(c[6]=Q=>le.value=Q),pageSize:j.value,"onUpdate:pageSize":c[7]||(c[7]=Q=>j.value=Q),total:r.pageConfig.total||0,"page-size-options":r.pageConfig.pageSizes||[10,20,50,100,200],"show-jumper":"","show-page-size":"","show-total":!0,onChange:Je,onPageSizeChange:Qe},null,8,["modelValue","pageSize","total","page-size-options"])])):e.createCommentVNode("",!0),e.createVNode(rd,{visible:i.value,"onUpdate:visible":c[9]||(c[9]=Q=>i.value=Q),header:n.value,size:ge(),footer:h.value!=="detail","close-on-overlay-click":!0,placement:"bottom","destroy-on-close":"",class:"custom-drawer",onConfirm:he,onCancel:Se},e.createSlots({default:e.withCtx(()=>[e.createVNode(Ge,{ref_key:"formRenderRef",ref:E,"form-conf":t.formData,fields:t.formData.fields,modelValue:e.unref(C),"onUpdate:modelValue":c[8]||(c[8]=Q=>e.isRef(C)?C.value=Q:C=Q),mode:h.value,onSelectOrgData:Xe},null,8,["form-conf","fields","modelValue","mode"])]),_:2},[h.value!=="detail"?{name:"footer",fn:e.withCtx(()=>[e.createVNode(nd,null,{default:e.withCtx(()=>[t.formData.hasCancelBtn?(e.openBlock(),e.createBlock(g,{key:0,theme:"default",onClick:Se},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formData.cancelButtonText),1)]),_:1})):e.createCommentVNode("",!0),t.formData.hasConfirmBtn?(e.openBlock(),e.createBlock(g,{key:1,theme:"primary",onClick:he},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formData.confirmButtonText),1)]),_:1})):e.createCommentVNode("",!0),t.formData.hasConfirmAndAddBtn&&h.value==="add"?(e.openBlock(),e.createBlock(g,{key:2,theme:"primary",variant:"outline",onClick:Me},{default:e.withCtx(()=>[...c[16]||(c[16]=[e.createTextVNode(" 保存并继续 ",-1)])]),_:1})):e.createCommentVNode("",!0)]),_:1})]),key:"0"}:void 0]),1032,["visible","header","size","footer"])])}}}),[["__scopeId","data-v-88b3f513"]]);(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".cd-share-content[data-v-bd14b324]{display:flex;flex-direction:column;gap:10px;box-sizing:border-box}.cd-share-content[data-v-bd14b324] *{box-sizing:border-box}.cd-share-header[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px}.cd-share-title[data-v-bd14b324]{font:500 16px Microsoft Yahei;display:flex;align-items:center;gap:8px}.cd-share-back-icon[data-v-bd14b324]{margin-right:3px;cursor:pointer}.cd-share-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-cooperators[data-v-bd14b324]{display:flex;align-items:center;gap:12px;margin:0 16px}.cd-share-label[data-v-bd14b324]{width:80px;flex-shrink:0;color:#000}.cd-share-collaborators-wrapper[data-v-bd14b324]{display:flex;align-items:center;gap:12px;margin-left:auto}.cd-share-avatars-container[data-v-bd14b324]{display:flex;align-items:center;flex:1;gap:12px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:background-color .2s}.cd-share-avatars-container[data-v-bd14b324]:hover{background-color:#f5f5f5}.cd-share-avatar-owner[data-v-bd14b324]{flex-shrink:0}.cd-share-divider[data-v-bd14b324]{width:1px;height:32px;background-color:#e5e7eb;flex-shrink:0}.cd-share-collaborators-avatars[data-v-bd14b324]{display:flex;align-items:center;gap:8px;flex:1}.cd-share-more-avatars[data-v-bd14b324]{width:32px;height:32px;border-radius:50%;background-color:#f0f0f0;color:#666;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}.cd-share-expand-icon[data-v-bd14b324]{margin-left:auto;flex-shrink:0;color:#999;cursor:pointer}.cd-share-add-collaborator-btn[data-v-bd14b324]{width:32px;height:32px;border:1px dashed #d9d9d9;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#999;transition:all .2s;flex-shrink:0}.cd-share-add-collaborator-btn[data-v-bd14b324]:hover{border-color:#0052d9;color:#0052d9;background-color:#f0f5ff}.cd-share-collaborator-list[data-v-bd14b324]{margin:8px 16px 0;border:1px solid #e5e7eb;border-radius:4px;overflow:hidden}.cd-share-collaborator-list-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid #f0f0f0}.cd-share-collaborator-list-item[data-v-bd14b324]:last-child{border-bottom:none}.cd-share-collaborator-info[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-collaborator-name[data-v-bd14b324]{font-size:14px;color:#333}.cd-share-collaborator-role[data-v-bd14b324]{font-size:14px;color:#999}.cd-share-collaborator-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-selector-wrapper[data-v-bd14b324]{margin:0 16px}.cd-share-selector-content[data-v-bd14b324]{display:flex;align-items:center;flex:1}.cd-share-readonly-tip[data-v-bd14b324]{margin:0 16px;padding:12px;background-color:#f5f5f5;border-radius:4px;font-size:14px;color:#666;display:flex;align-items:center}.cd-share-options[data-v-bd14b324]{margin-left:16px;display:flex;height:30px;align-items:center;gap:16px}.cd-share-form-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px;margin-top:8px;justify-content:flex-end;padding:16px 16px 0}.cd-share-footer[data-v-bd14b324]{display:flex;flex-direction:column;gap:8px;align-items:flex-start;margin-top:15px}.cd-share-footer-top[data-v-bd14b324]{width:100%;padding:0 16px}.cd-share-footer-title[data-v-bd14b324]{margin-bottom:10px;color:#000}.cd-share-footer-controls[data-v-bd14b324]{display:flex;align-items:center;width:100%;margin-top:6px;justify-content:space-between}.cd-share-footer-bottom[data-v-bd14b324]{display:flex;align-items:center;gap:10px;padding:16px;width:100%;background-color:#f5f6f7;margin-bottom:-10px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}.cd-share-org-control[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-org-icon[data-v-bd14b324]{background-color:#0594fa;width:35px;height:35px;color:#fff;padding:6px;border-radius:50%}.cd-share-org-content[data-v-bd14b324]{display:flex;flex-direction:column}.cd-share-org-note[data-v-bd14b324]{font-size:12px;color:#666}.cd-share-copy-action[data-v-bd14b324]{cursor:pointer;border:1px solid rgb(208,211,214);padding:5px 12px;border-radius:26px;transition:color .2s ease;display:flex;align-items:center;gap:4px}.cd-share-copy-action[data-v-bd14b324]:hover,.cd-share-copy-action[data-v-bd14b324]:hover .t-icon{color:#0594fa}.cd-share-icon-actions[data-v-bd14b324]{display:flex;align-items:center;gap:12px}.cd-share-icon-btn[data-v-bd14b324]{width:36px;height:36px;border:1px solid rgb(208,211,214);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.cd-share-icon-btn[data-v-bd14b324] .t-icon{font-size:20px}.cd-share-icon-btn.is-disabled[data-v-bd14b324]{opacity:.4;cursor:not-allowed;pointer-events:none}[data-v-bd14b324] .t-textarea{padding:0 10px}.cd-permission-settings[data-v-bd14b324]{display:flex;flex-direction:column;gap:24px;padding:16px}.cd-permission-section[data-v-bd14b324]{display:flex;flex-direction:column;gap:12px}.cd-permission-section-title[data-v-bd14b324]{font-size:14px;font-weight:500;color:#000;margin-bottom:4px}.cd-permission-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:8px 0}.cd-permission-item-label[data-v-bd14b324]{font-size:14px;color:#333;flex:1}.cd-permission-item-note[data-v-bd14b324]{font-size:12px;color:#999;margin-top:-8px}.cd-permission-actions[data-v-bd14b324]{display:flex;justify-content:flex-end;gap:8px;padding-top:8px;border-top:1px solid #e5e7eb}.cd-collaborator-list-content[data-v-bd14b324]{max-height:400px;overflow-y:auto}.cd-collaborator-list-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:12px;border-bottom:1px solid #f0f0f0}.cd-collaborator-list-item[data-v-bd14b324]:last-child{border-bottom:none}.cd-collaborator-list-item[data-v-bd14b324]:hover{background-color:#f5f5f5}.cd-collaborator-item-info[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-collaborator-item-name[data-v-bd14b324]{font-size:14px;color:#333}.cd-collaborator-item-role[data-v-bd14b324]{font-size:14px;color:#999}.cd-collaborator-item-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-collaborator-item-permission-text[data-v-bd14b324]{font-size:14px;color:#666;padding:4px 12px;background-color:#f5f5f5;border-radius:4px}.cd-qrcode-content[data-v-bd14b324]{display:flex;flex-direction:column;align-items:center;padding:24px;gap:16px}.cd-qrcode-image[data-v-bd14b324]{width:300px;height:300px;border:1px solid #e5e7eb;border-radius:8px}.cd-qrcode-url[data-v-bd14b324]{font-size:14px;color:#666;word-break:break-all;text-align:center;padding:0 16px}.cd-qrcode-tip[data-v-bd14b324]{font-size:12px;color:#999}.cd-encrypt-content[data-v-bd14b324]{display:flex;flex-direction:column;padding:16px;gap:16px}.cd-encrypt-field[data-v-bd14b324]{display:flex;flex-direction:column;gap:8px}.cd-encrypt-label[data-v-bd14b324]{font-size:14px;font-weight:500;color:#333}.cd-encrypt-note[data-v-bd14b324]{display:flex;align-items:flex-start;font-size:12px;color:#666;background-color:#f5f5f5;padding:12px;border-radius:4px;line-height:1.6}.cd-encrypt-actions[data-v-bd14b324]{display:flex;justify-content:flex-end;gap:8px;padding-top:8px;border-top:1px solid #e5e7eb}.cd-share-dialog .t-dialog{padding:0!important}.cd-share-dialog .t-dialog__header,.cd-share-dialog .t-dialog__body,.cd-share-dialog .t-dialog__content{padding:0!important;overflow:visible!important;max-height:none!important}.cd-share-dialog .t-dialog__body{overflow-y:visible!important}:deep(.t-select__dropdown)>.t-select__dropdown-inner>.t-select-option-group>.t-select-option-group__header{color:#999!important}")),document.head.appendChild(t)}}catch(U){console.error("vite-plugin-css-injected-by-js",U)}})();const Qi={class:"cd-share-header"},Zi={class:"cd-share-title"},vi={key:0,class:"cd-share-actions"},ec={key:0,class:"cd-share-content"},tc={class:"cd-share-cooperators"},lc={class:"cd-share-collaborators-wrapper"},ac={class:"cd-share-avatar-owner"},oc={key:0,class:"cd-share-selector-wrapper"},nc={class:"cd-share-selector-content"},rc={key:1,class:"cd-share-readonly-tip"},sc={key:2,class:"cd-share-footer"},ic={class:"cd-share-footer-top"},cc={class:"cd-share-footer-controls"},dc={class:"cd-share-org-control"},mc={class:"cd-share-org-content"},fc={class:"cd-share-footer-bottom"},pc={class:"cd-share-icon-actions"},gc={class:"cd-share-icon-btn"},hc={key:1,class:"cd-share-content"},uc={class:"cd-share-cooperators"},kc={class:"cd-share-collaborators-wrapper"},bc={class:"cd-share-avatar-owner"},yc={class:"cd-share-selector-wrapper"},_c={class:"cd-share-selector-content"},Vc={class:"cd-share-options"},Cc={class:"cd-share-form-actions"},Nc={class:"cd-permission-settings"},wc={class:"cd-permission-section"},Ec={class:"cd-permission-item"},xc={class:"cd-permission-section"},Bc={class:"cd-permission-section"},$c={class:"cd-permission-item"},Sc={class:"cd-permission-item"},Dc={class:"cd-permission-item"},Mc={class:"cd-permission-section"},zc={class:"cd-permission-item"},Tc={class:"cd-permission-actions"},Fc={class:"cd-collaborator-list-content"},Pc={class:"cd-collaborator-list-item"},Ac={class:"cd-collaborator-item-info"},Uc={class:"cd-collaborator-item-name"},Lc={class:"cd-collaborator-item-info"},Rc={class:"cd-collaborator-item-name"},Ic={class:"cd-collaborator-item-actions"},qc={key:0,class:"cd-collaborator-item-permission-text"},Oc={key:0,class:"cd-collaborator-item-permission-text"},Hc={class:"cd-qrcode-content"},Wc=["src"],jc={class:"cd-qrcode-url"},Yc={class:"cd-encrypt-content"},Kc={class:"cd-encrypt-field"},Gc={class:"cd-encrypt-note"},Xc={class:"cd-encrypt-actions"},Jc=e.defineComponent({name:"CdShareDialog",__name:"ShareDialog",props:{visible:{type:Boolean,default:!1},title:{default:"分享"},shareUrl:{default:""},helpUrl:{default:""},width:{default:"500px"},currentPermission:{default:"edit"},owner:{},managers:{default:()=>[]},collaborators:{default:()=>[]},tabs:{default:()=>[]},organizations:{default:()=>[]},defaultPermissionSettings:{}},emits:["update:visible","confirm","search","load-users","request-permission","permission-settings-change","manage-collaborators","remove-collaborator","collaborator-permission-change"],setup(t,{emit:U}){var o;const N=t,f=U,s=e.ref(N.visible),r=e.ref(N.shareUrl),p=e.ref([]),b=e.ref(!1),E=e.ref(1),u=e.ref("read"),B=e.ref(!0),V=e.ref(!1),x=e.ref(""),L=e.ref(""),A=e.ref(!1),I=e.ref(!1),le=e.ref(!1),j=e.ref(!1),k=e.ref(""),S=e.ref({allowExternalShare:((o=N.defaultPermissionSettings)==null?void 0:o.allowExternalShare)??!1,collaboratorManagement:"org-only",copyPermission:"edit",downloadPermission:"edit",commentPermission:"all",viewerAvatarsPermission:"all"}),a=e.computed(()=>{const w=N.organizations||[],d=w.filter(ie=>ie.id!=="internet"),te=w.find(ie=>ie.id==="internet"),ge=[];return d.forEach(ie=>{ge.push({label:ie.name,value:ie.id})}),te&&ge.push({label:"互联网获得链接的人",value:te.id}),[{group:"分享范围",children:ge}]}),i=[{label:"可阅读",value:"read"},{label:"可编辑",value:"edit"},{label:"可管理",value:"manage"}],n=e.computed(()=>C.value==="manage"?i:C.value==="edit"?i.filter(w=>w.value!=="manage"):[]),h=[{label:"所有人",value:"all"},{label:"可编辑及以上",value:"edit"},{label:"可管理",value:"manage"},{label:"仅所有者",value:"owner"}],C=e.computed(()=>N.currentPermission||"edit"),O=e.computed(()=>(N.collaborators||[]).map(w=>({id:w.id,name:w.displayName||w.name||String(w.id),avatar:w.avatar||"",isUser:!0}))),J=e.computed(()=>r.value?`https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${encodeURIComponent(r.value)}`:""),F=w=>w?w.substring(0,2).toUpperCase():"所";e.watch(()=>N.visible,w=>s.value=w),e.watch(()=>N.shareUrl,w=>r.value=w),e.watch(s,w=>{f("update:visible",w),w&&R()}),e.watch(p,w=>{if(C.value==="read"){b.value=!1;return}b.value=w.length>0});const R=()=>{var w;p.value=[],E.value=((w=N.organizations[0])==null?void 0:w.id)||1,L.value="",u.value="read",B.value=!0,V.value=!1,x.value="",b.value=!1},D=()=>{b.value=!1},$=()=>{D()},se=()=>{if(C.value==="read"){re.MessagePlugin.warning("您当前为只读权限,无法分享");return}const w={sharerIds:p.value.map(d=>d.isUser===!1?`depot:${d.id}`:d.isGroup?`usergroup:${d.id}`:d.isPost?`post:${d.id}`:d.isOutUser?`outuser:${d.id}`:`user:${d.id}`),orgId:E.value,permission:u.value,sendNotification:B.value,password:V.value?x.value:void 0,remark:L.value};console.log("分享参数:",w),f("confirm",w),s.value=!1},ee=async()=>{try{await navigator.clipboard.writeText(r.value||""),re.MessagePlugin.success("链接已复制")}catch{re.MessagePlugin.error("复制失败")}},q=()=>{N.helpUrl&&window.open(N.helpUrl,"_blank")},fe=w=>{f("search",w)},G=w=>{f("load-users",w)},H=()=>{f("request-permission","edit"),re.MessagePlugin.info("已发送编辑权限申请")},ue=()=>{if(C.value!=="manage"){re.MessagePlugin.warning("只有管理员才能修改权限设置");return}f("permission-settings-change",S.value),re.MessagePlugin.success("权限设置已保存"),A.value=!1},de=w=>{console.log("点击协作者:",w)},$e=w=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法添加协作者");return}console.log("选择人员:",w),f("manage-collaborators",w)},Ne=w=>{if(C.value!=="manage"){re.MessagePlugin.warning("只有管理员才能删除协作者");return}f("remove-collaborator",w)},_e=(w,d)=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法修改协作者权限");return}if(C.value==="edit"&&d==="manage"){re.MessagePlugin.warning("编辑权限无法将协作者设置为管理员");return}f("collaborator-permission-change",{id:w,permission:d})},Z=()=>{const w="ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";let d="";for(let te=0;te<6;te++)d+=w.charAt(Math.floor(Math.random()*w.length));k.value=d},we=async()=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法设置链接密码");return}if(!k.value||k.value.length!==6){re.MessagePlugin.warning("请先生成或输入6位密码");return}const w=r.value||"",d=w.includes("?")?"&":"?",te=`链接:${`${w}${d}pwd=${k.value}`} 密码:${k.value}`;try{await navigator.clipboard.writeText(te),re.MessagePlugin.success("链接和密码已复制")}catch{re.MessagePlugin.error("复制失败")}},M=()=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法设置链接密码");return}if(!k.value||k.value.length!==6){re.MessagePlugin.warning("请输入6位密码");return}re.MessagePlugin.success("密码设置成功"),j.value=!1,console.log("链接密码:",k.value)};return e.watch(j,w=>{w&&!k.value&&Z()}),(w,d)=>{const te=e.resolveComponent("t-icon"),ge=e.resolveComponent("t-tooltip"),ie=e.resolveComponent("t-button"),ke=e.resolveComponent("t-avatar"),_=e.resolveComponent("t-select"),m=e.resolveComponent("t-checkbox"),Y=e.resolveComponent("t-input"),ne=e.resolveComponent("t-textarea"),ae=e.resolveComponent("t-dialog"),ye=e.resolveComponent("t-switch"),K=e.resolveComponent("t-radio"),Ee=e.resolveComponent("t-radio-group");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ae,{visible:s.value,"onUpdate:visible":d[13]||(d[13]=v=>s.value=v),width:"500",footer:!1,placement:"center","destroy-on-close":"",closeBtn:!1,class:"cd-share-dialog"},{header:e.withCtx(()=>[e.createElementVNode("div",Qi,[e.createElementVNode("div",Zi,[b.value?(e.openBlock(),e.createBlock(te,{key:0,name:"chevron-left",size:"18px",class:"cd-share-back-icon",onClick:D})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.title)+" ",1),!b.value&&t.helpUrl?(e.openBlock(),e.createBlock(ge,{key:1,content:"查看详情"},{default:e.withCtx(()=>[e.createVNode(te,{name:"help-circle",size:"14px",onClick:q})]),_:1})):e.createCommentVNode("",!0)]),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vi,[e.renderSlot(w.$slots,"header-actions",{},()=>[C.value==="read"?(e.openBlock(),e.createBlock(ie,{key:0,variant:"text",size:"small",onClick:H},{icon:e.withCtx(()=>[e.createVNode(te,{name:"user-add",size:"18px"})]),default:e.withCtx(()=>[d[27]||(d[27]=e.createTextVNode(" 申请编辑权限 ",-1))]),_:1})):C.value==="manage"?(e.openBlock(),e.createBlock(ie,{key:1,variant:"text",size:"small",onClick:d[0]||(d[0]=v=>A.value=!0)},{icon:e.withCtx(()=>[e.createVNode(te,{name:"setting",size:"18px"})]),default:e.withCtx(()=>[d[28]||(d[28]=e.createTextVNode(" 权限设置 ",-1))]),_:1})):e.createCommentVNode("",!0)],!0)]))])]),default:e.withCtx(()=>{var v,xe;return[b.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",uc,[d[36]||(d[36]=e.createElementVNode("div",{class:"cd-share-label"},"邀请协作者",-1)),e.createElementVNode("div",kc,[e.createElementVNode("div",bc,[(xe=t.owner)!=null&&xe.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"medium"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"medium"},{default:e.withCtx(()=>{var me,he;return[e.createTextVNode(e.toDisplayString(F(((me=t.owner)==null?void 0:me.displayName)||((he=t.owner)==null?void 0:he.name)||"所有者")),1)]}),_:1}))]),d[35]||(d[35]=e.createElementVNode("div",{class:"cd-share-divider"},null,-1)),e.createVNode(e.unref(Ct),{users:O.value,"avatar-size":32,"max-display":3,edit:!1,"person-tabs":t.tabs,"person-organizations":t.organizations,onPersonSelect:$e,onLoadUsers:G,onSearch:fe,onUserClick:de},null,8,["users","person-tabs","person-organizations"]),e.createVNode(te,{name:"chevron-right",size:"16px",class:"cd-share-expand-icon",onClick:d[7]||(d[7]=me=>I.value=!0)})])]),e.createElementVNode("div",yc,[e.createElementVNode("div",_c,[e.createVNode(e.unref(_t),{modelValue:p.value,"onUpdate:modelValue":d[8]||(d[8]=me=>p.value=me),multiple:"",placeholder:"搜索用户、部门、职位",tabs:t.tabs,organizations:t.organizations,"show-selector":!1,onSearch:fe,onLoadUsers:G},null,8,["modelValue","tabs","organizations"])])]),e.createElementVNode("div",Vc,[e.createVNode(m,{modelValue:B.value,"onUpdate:modelValue":d[9]||(d[9]=me=>B.value=me)},{default:e.withCtx(()=>[...d[37]||(d[37]=[e.createTextVNode("发送通知",-1)])]),_:1},8,["modelValue"]),e.createVNode(m,{modelValue:V.value,"onUpdate:modelValue":d[10]||(d[10]=me=>V.value=me)},{default:e.withCtx(()=>[...d[38]||(d[38]=[e.createTextVNode("设置密码",-1)])]),_:1},8,["modelValue"]),V.value?(e.openBlock(),e.createBlock(Y,{key:0,modelValue:x.value,"onUpdate:modelValue":d[11]||(d[11]=me=>x.value=me),type:"password",placeholder:"设置密码",size:"small",style:{width:"200px","margin-left":"10px"}},null,8,["modelValue"])):e.createCommentVNode("",!0)]),e.createVNode(ne,{modelValue:L.value,"onUpdate:modelValue":d[12]||(d[12]=me=>L.value=me),placeholder:"添加分享备注",autosize:{minRows:10,maxRows:15},style:{height:"100px"}},null,8,["modelValue"]),e.createElementVNode("div",Cc,[e.createVNode(ie,{variant:"outline",onClick:$},{default:e.withCtx(()=>[...d[39]||(d[39]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",onClick:se},{default:e.withCtx(()=>[...d[40]||(d[40]=[e.createTextVNode("确认",-1)])]),_:1})])])):(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",tc,[d[30]||(d[30]=e.createElementVNode("div",{class:"cd-share-label"},"邀请协作者",-1)),e.createElementVNode("div",lc,[e.createElementVNode("div",ac,[(v=t.owner)!=null&&v.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"medium"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"medium"},{default:e.withCtx(()=>{var me,he;return[e.createTextVNode(e.toDisplayString(F(((me=t.owner)==null?void 0:me.displayName)||((he=t.owner)==null?void 0:he.name)||"所有者")),1)]}),_:1}))]),d[29]||(d[29]=e.createElementVNode("div",{class:"cd-share-divider"},null,-1)),e.createVNode(e.unref(Ct),{users:O.value,"avatar-size":32,"max-display":3,edit:!1,"person-tabs":t.tabs,"person-organizations":t.organizations,onPersonSelect:$e,onLoadUsers:G,onSearch:fe,onUserClick:de},null,8,["users","person-tabs","person-organizations"]),e.createVNode(te,{name:"chevron-right",size:"16px",class:"cd-share-expand-icon",onClick:d[1]||(d[1]=me=>I.value=!0)})])]),C.value!=="read"?(e.openBlock(),e.createElementBlock("div",oc,[e.createElementVNode("div",nc,[e.createVNode(e.unref(_t),{modelValue:p.value,"onUpdate:modelValue":d[2]||(d[2]=me=>p.value=me),multiple:"",placeholder:"搜索用户、部门、职位",tabs:t.tabs,organizations:t.organizations,"show-selector":!1,onSearch:fe,onLoadUsers:G},null,8,["modelValue","tabs","organizations"])])])):(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(te,{name:"info-circle",size:"14px",style:{color:"#999","margin-right":"4px"}}),d[31]||(d[31]=e.createTextVNode(" 您当前为只读权限,无法添加协作者 ",-1))])),r.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",ic,[d[33]||(d[33]=e.createElementVNode("div",{class:"cd-share-footer-title"},"链接分享",-1)),e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.createVNode(te,{name:"city-1",class:"cd-share-org-icon",size:"18px"}),e.createElementVNode("div",mc,[e.createVNode(_,{modelValue:E.value,"onUpdate:modelValue":d[3]||(d[3]=me=>E.value=me),options:a.value,placeholder:"选择组织",disabled:C.value==="read",style:{width:"auto"},autoWidth:"",borderless:"",size:"small"},null,8,["modelValue","options","disabled"]),d[32]||(d[32]=e.createElementVNode("div",{class:"cd-share-org-note"},"组织内获得链接的人可阅读",-1))])]),e.createVNode(_,{modelValue:u.value,"onUpdate:modelValue":d[4]||(d[4]=me=>u.value=me),options:i,disabled:C.value==="read",style:{width:"auto"},autoWidth:"",borderless:""},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",fc,[e.createElementVNode("div",{class:"cd-share-copy-action",onClick:ee},[e.createVNode(te,{name:"link",size:"14px"}),d[34]||(d[34]=e.createTextVNode(" 复制链接 ",-1))]),e.createElementVNode("div",pc,[e.renderSlot(w.$slots,"share-channels",{},()=>[e.createVNode(ge,{content:"二维码"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cd-share-icon-btn",onClick:d[5]||(d[5]=me=>le.value=!0)},[e.createVNode(te,{name:"qrcode"})])]),_:1}),e.createVNode(ge,{content:"邮件"},{default:e.withCtx(()=>[e.createElementVNode("div",gc,[e.createVNode(te,{name:"mail"})])]),_:1}),e.createVNode(ge,{content:C.value==="read"?"只读权限无法设置密码":"加密连接"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["cd-share-icon-btn",{"is-disabled":C.value==="read"}]),onClick:d[6]||(d[6]=me=>C.value!=="read"&&(j.value=!0))},[e.createVNode(te,{name:"lock-on"})],2)]),_:1},8,["content"])],!0)])])])):e.createCommentVNode("",!0)]))]}),_:3},8,["visible"]),e.createVNode(ae,{visible:A.value,"onUpdate:visible":d[21]||(d[21]=v=>A.value=v),header:"权限设置",width:"600px",footer:!1,placement:"center",class:"cd-permission-settings-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Nc,[e.createElementVNode("div",wc,[d[42]||(d[42]=e.createElementVNode("div",{class:"cd-permission-section-title"},"对外分享",-1)),e.createElementVNode("div",Ec,[d[41]||(d[41]=e.createElementVNode("div",{class:"cd-permission-item-label"},"允许内容被分享到组织外",-1)),e.createVNode(ye,{modelValue:S.value.allowExternalShare,"onUpdate:modelValue":d[14]||(d[14]=v=>S.value.allowExternalShare=v),disabled:C.value!=="manage"},null,8,["modelValue","disabled"])]),d[43]||(d[43]=e.createElementVNode("div",{class:"cd-permission-item-note"},' 仅"可管理权限"可以将内容分享到组织外 ',-1))]),e.createElementVNode("div",xc,[d[46]||(d[46]=e.createElementVNode("div",{class:"cd-permission-section-title"},"谁可以查看、添加、移除协作者",-1)),e.createVNode(Ee,{modelValue:S.value.collaboratorManagement,"onUpdate:modelValue":d[15]||(d[15]=v=>S.value.collaboratorManagement=v),disabled:C.value!=="manage"},{default:e.withCtx(()=>[e.createVNode(K,{value:"org-only"},{default:e.withCtx(()=>[...d[44]||(d[44]=[e.createTextVNode("仅组织内的用户可以查看、添加、移除协作者",-1)])]),_:1}),e.createVNode(K,{value:"all"},{default:e.withCtx(()=>[...d[45]||(d[45]=[e.createTextVNode("所有协作者都可以查看、添加、移除协作者",-1)])]),_:1})]),_:1},8,["modelValue","disabled"])]),e.createElementVNode("div",Bc,[d[50]||(d[50]=e.createElementVNode("div",{class:"cd-permission-section-title"},"内容操作权限",-1)),e.createElementVNode("div",$c,[d[47]||(d[47]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以复制内容",-1)),e.createVNode(_,{modelValue:S.value.copyPermission,"onUpdate:modelValue":d[16]||(d[16]=v=>S.value.copyPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Sc,[d[48]||(d[48]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以创建副本、打印和下载",-1)),e.createVNode(_,{modelValue:S.value.downloadPermission,"onUpdate:modelValue":d[17]||(d[17]=v=>S.value.downloadPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Dc,[d[49]||(d[49]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以评论",-1)),e.createVNode(_,{modelValue:S.value.commentPermission,"onUpdate:modelValue":d[18]||(d[18]=v=>S.value.commentPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",Mc,[d[52]||(d[52]=e.createElementVNode("div",{class:"cd-permission-section-title"},"更多高级设置",-1)),e.createElementVNode("div",zc,[d[51]||(d[51]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以查看访问者头像和点赞者头像",-1)),e.createVNode(_,{modelValue:S.value.viewerAvatarsPermission,"onUpdate:modelValue":d[19]||(d[19]=v=>S.value.viewerAvatarsPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",Tc,[e.createVNode(ie,{variant:"outline",onClick:d[20]||(d[20]=v=>A.value=!1)},{default:e.withCtx(()=>[...d[53]||(d[53]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",disabled:C.value!=="manage",onClick:ue},{default:e.withCtx(()=>[...d[54]||(d[54]=[e.createTextVNode("保存",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["visible"]),e.createVNode(ae,{visible:I.value,"onUpdate:visible":d[22]||(d[22]=v=>I.value=v),header:"协作者权限管理",width:"500px",footer:!1,placement:"center",class:"cd-collaborator-list-dialog"},{default:e.withCtx(()=>{var v,xe,me;return[e.createElementVNode("div",Fc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",Ac,[(v=t.owner)!=null&&v.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"small"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"small"},{default:e.withCtx(()=>{var he,Me;return[e.createTextVNode(e.toDisplayString(F(((he=t.owner)==null?void 0:he.displayName)||((Me=t.owner)==null?void 0:Me.name))),1)]}),_:1})),e.createElementVNode("span",Uc,e.toDisplayString(((xe=t.owner)==null?void 0:xe.displayName)||((me=t.owner)==null?void 0:me.name)||"所有者"),1)]),d[55]||(d[55]=e.createElementVNode("div",{class:"cd-collaborator-item-role"},"所有者",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.collaborators,he=>{var Me;return e.openBlock(),e.createElementBlock("div",{key:he.id,class:"cd-collaborator-list-item"},[e.createElementVNode("div",Lc,[he.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:he.avatar,size:"small"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F(he.displayName||he.name)),1)]),_:2},1024)),e.createElementVNode("span",Rc,e.toDisplayString(he.displayName||he.name),1)]),e.createElementVNode("div",Ic,[C.value==="read"?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(((Me=i.find(Se=>Se.value===he.permission))==null?void 0:Me.label)||"可阅读"),1)):C.value==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[he.permission==="manage"?(e.openBlock(),e.createElementBlock("div",Oc," 可管理 ")):(e.openBlock(),e.createBlock(_,{key:1,value:he.permission,options:n.value,size:"small",onChange:Se=>_e(he.id,Se),style:{width:"100px"}},null,8,["value","options","onChange"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(_,{value:he.permission,options:n.value,size:"small",onChange:Se=>_e(he.id,Se),style:{width:"100px"}},null,8,["value","options","onChange"]),e.createVNode(ie,{variant:"text",size:"small",theme:"danger",onClick:Se=>Ne(he.id)},{icon:e.withCtx(()=>[e.createVNode(te,{name:"delete",size:"16px"})]),_:1},8,["onClick"])],64))])])}),128))])]}),_:1},8,["visible"]),e.createVNode(ae,{visible:le.value,"onUpdate:visible":d[23]||(d[23]=v=>le.value=v),header:"分享二维码",width:"400px",footer:!1,placement:"center",class:"cd-qrcode-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Hc,[J.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:J.value,alt:"分享二维码",class:"cd-qrcode-image"},null,8,Wc)):e.createCommentVNode("",!0),e.createElementVNode("div",jc,e.toDisplayString(r.value),1),d[56]||(d[56]=e.createElementVNode("div",{class:"cd-qrcode-tip"},"扫描二维码或复制链接分享",-1))])]),_:1},8,["visible"]),e.createVNode(ae,{visible:j.value,"onUpdate:visible":d[26]||(d[26]=v=>j.value=v),header:"设置链接密码",width:"450px",footer:!1,placement:"center",class:"cd-encrypt-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Yc,[e.createElementVNode("div",Kc,[d[58]||(d[58]=e.createElementVNode("div",{class:"cd-encrypt-label"},"链接密码",-1)),e.createVNode(Y,{modelValue:k.value,"onUpdate:modelValue":d[24]||(d[24]=v=>k.value=v),placeholder:"6位数字和字母组合",maxlength:"6",disabled:C.value==="read",style:{width:"200px"}},{suffix:e.withCtx(()=>[e.createVNode(ie,{variant:"text",size:"small",disabled:C.value==="read",onClick:Z},{default:e.withCtx(()=>[...d[57]||(d[57]=[e.createTextVNode(" 重新生成 ",-1)])]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]),e.createElementVNode("div",Gc,[e.createVNode(te,{name:"info-circle",size:"14px",style:{color:"#999","margin-right":"4px"}}),d[59]||(d[59]=e.createTextVNode(" 密码仅对当前页面生效。组织外用户需要密码访问,组织内用户无需密码可直接访问 ",-1))]),e.createElementVNode("div",Xc,[e.createVNode(ie,{variant:"outline",disabled:C.value==="read",onClick:we},{icon:e.withCtx(()=>[e.createVNode(te,{name:"link"})]),default:e.withCtx(()=>[d[60]||(d[60]=e.createTextVNode(" 复制连接和密码 ",-1))]),_:1},8,["disabled"]),d[63]||(d[63]=e.createElementVNode("div",{style:{flex:"1"}},null,-1)),e.createVNode(ie,{variant:"outline",onClick:d[25]||(d[25]=v=>j.value=!1)},{default:e.withCtx(()=>[...d[61]||(d[61]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",disabled:C.value==="read",onClick:M},{default:e.withCtx(()=>[...d[62]||(d[62]=[e.createTextVNode(" 确认 ",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["visible"])],64)}}}),Qc=(t,U)=>{const o=t.__vccOpts||t;for(const[N,f]of U)o[N]=f;return o},wt=Qc(Jc,[["__scopeId","data-v-bd14b324"]]),Zc={class:"field-manage-header"},vc={class:"field-manage-content"},ed={class:"field-manage-toolbar"},Et=be(e.defineComponent({__name:"FieldManageDialog",props:{modelValue:{type:Boolean},fields:{}},emits:["update:modelValue","save","advanced-edit","advanced-design"],setup(t,{emit:U}){const o=t,N=U,f=e.computed({get:()=>o.modelValue,set:a=>N("update:modelValue",a)}),s=e.ref([]);e.watch(()=>o.fields,a=>{s.value=JSON.parse(JSON.stringify(a))},{immediate:!0,deep:!0});const r=[{label:"单行文本",value:"input"},{label:"多行文本",value:"textarea"},{label:"数字",value:"number"},{label:"下拉选择",value:"select"},{label:"日期",value:"date"},{label:"日期时间",value:"datetime"},{label:"开关",value:"switch"},{label:"评分",value:"rate"},{label:"图片上传",value:"uploadImg"}],p={border:!0,stripe:!0,round:!0,height:500,rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},cellConfig:{height:35},columnConfig:{resizable:!0}},b=[{field:"label",title:"字段名称",width:200,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入字段名称"}}},{field:"fieldName",title:"字段标识",width:180,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入字段标识"}}},{field:"type",title:"字段类型",width:150,slots:{edit:"fieldType_edit"}},{field:"required",title:"必填",width:80,align:"center",slots:{edit:"required_edit"}},{field:"placeholder",title:"提示文本",minWidth:150,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入提示文本"}}},{field:"actions",title:"操作",width:150,fixed:"right",slots:{default:"actions"}}],E={trigger:"click",mode:"cell",showStatus:!0},u=()=>{const a=Math.max(...s.value.map(n=>n.id),0)+1,i={id:a,fieldName:`field_${a}`,label:`新字段${a}`,type:"input",required:!1,placeholder:"请输入",span:12,options:[]};s.value.push(i),re.MessagePlugin.success("字段已添加")},B=a=>{const i={__config__:{formId:a.id,visibility:["pc","app"],cdkey:a.type,noShow:!1,tipLabel:"",tableFixed:"none",dragDisabled:!1,className:[],label:a.label,trigger:a.type==="select"||a.type==="radio"||a.type==="checkbox"?"change":"blur",showLabel:!0,required:a.required,tableName:"",renderKey:Date.now(),layout:"colFormItem",tagIcon:`icon-ym icon-ym-generator-${a.type}`,tag:V(a.type),regList:[],tableAlign:"left",span:a.span||12},__vModel__:a.fieldName,placeholder:a.placeholder||`请输入${a.label}`,clearable:!0,disabled:!1,style:{width:"100%"}};switch(a.type){case"textarea":return{...i,rows:3,autosize:!0};case"number":return{...i,min:0,max:999999,step:1};case"select":case"radio":case"checkbox":return{...i,__config__:{...i.__config__,dataType:"static"},options:a.options||[],props:{label:"label",value:"value"},...a.type==="select"?{filterable:!1,multiple:!1}:{},...a.type==="checkbox"?{defaultValue:[]}:{}};case"date":return{...i,type:"date",format:"YYYY-MM-DD"};case"datetime":return{...i,type:"datetime",format:"YYYY-MM-DD HH:mm:ss"};case"switch":return{...i,__config__:{...i.__config__,defaultValue:!1}};case"rate":return{...i,__config__:{...i.__config__,defaultValue:0},max:5,allowHalf:!1,showText:!0,showScore:!1};case"uploadImg":return{...i,action:"/api/upload",listType:"image-card",multiple:!1,limit:1};default:return i}},V=a=>({input:"Input",textarea:"Textarea",number:"InputNumber",select:"Select",radio:"Radio",checkbox:"Checkbox",date:"DatePicker",datetime:"DatePicker",time:"TimePicker",switch:"Switch",rate:"Rate",slider:"Slider",uploadImg:"Upload",uploadFile:"Upload"})[a]||"Input",x=a=>{s.value.splice(a,1),re.MessagePlugin.success("字段已删除")},L=a=>{if(a>0){const i=s.value[a];s.value[a]=s.value[a-1],s.value[a-1]=i}},A=a=>{if(a<s.value.length-1){const i=s.value[a];s.value[a]=s.value[a+1],s.value[a+1]=i}},I=()=>{},le=()=>{const a=s.value.map(i=>i._originalConfig?{...i._originalConfig,__config__:{...i._originalConfig.__config__,label:i.label,required:i.required,span:i.span||12},__vModel__:i.fieldName,placeholder:i.placeholder||`请输入${i.label}`}:B(i));N("save",a),f.value=!1,re.MessagePlugin.success("字段配置已保存")},j=()=>{f.value=!1},k=()=>{N("advanced-edit")},S=()=>{N("advanced-design")};return(a,i)=>{const n=e.resolveComponent("t-button"),h=e.resolveComponent("t-space"),C=e.resolveComponent("t-select"),O=e.resolveComponent("t-switch"),J=e.resolveComponent("vxe-grid"),F=e.resolveComponent("t-dialog");return e.openBlock(),e.createBlock(F,{visible:f.value,"onUpdate:visible":i[0]||(i[0]=R=>f.value=R),header:"字段管理",width:"1200px",placement:"center",footer:!1,class:"field-manage-dialog",onClose:j},{header:e.withCtx(()=>[e.createElementVNode("div",Zc,[i[3]||(i[3]=e.createElementVNode("span",null,"字段管理",-1)),e.createVNode(n,{theme:"primary",variant:"outline",size:"small",onClick:k},{icon:e.withCtx(()=>[...i[1]||(i[1]=[e.createElementVNode("i",{class:"ri-code-box-line"},null,-1)])]),default:e.withCtx(()=>[i[2]||(i[2]=e.createTextVNode(" 高级编辑 ",-1))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",vc,[e.createElementVNode("div",ed,[e.createVNode(n,{theme:"primary",onClick:u,size:"small"},{icon:e.withCtx(()=>[...i[4]||(i[4]=[e.createElementVNode("i",{class:"ri-add-line"},null,-1)])]),default:e.withCtx(()=>[i[5]||(i[5]=e.createTextVNode(" 添加字段 ",-1))]),_:1}),e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(n,{onClick:S,theme:"warning",size:"small"},{icon:e.withCtx(()=>[...i[6]||(i[6]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[i[7]||(i[7]=e.createTextVNode(" 高级设计 ",-1))]),_:1}),e.createVNode(n,{onClick:le,size:"small"},{icon:e.withCtx(()=>[...i[8]||(i[8]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[i[9]||(i[9]=e.createTextVNode(" 保存 ",-1))]),_:1}),e.createVNode(n,{variant:"outline",onClick:j,size:"small"},{default:e.withCtx(()=>[...i[10]||(i[10]=[e.createTextVNode(" 取消 ",-1)])]),_:1})]),_:1})]),e.createVNode(J,e.mergeProps({ref:"gridRef"},p,{data:s.value,columns:b,"edit-config":E,onEditClosed:I}),{fieldType_edit:e.withCtx(({row:R})=>[e.createVNode(C,{modelValue:R.type,"onUpdate:modelValue":D=>R.type=D,options:r,size:"small",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue"])]),required_edit:e.withCtx(({row:R})=>[e.createVNode(O,{modelValue:R.required,"onUpdate:modelValue":D=>R.required=D,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),actions:e.withCtx(({rowIndex:R})=>[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(n,{variant:"text",size:"small",theme:"primary",onClick:D=>L(R),disabled:R===0},{icon:e.withCtx(()=>[...i[11]||(i[11]=[e.createElementVNode("i",{class:"ri-arrow-up-line"},null,-1)])]),_:1},8,["onClick","disabled"]),e.createVNode(n,{variant:"text",size:"small",theme:"primary",onClick:D=>A(R),disabled:R===s.value.length-1},{icon:e.withCtx(()=>[...i[12]||(i[12]=[e.createElementVNode("i",{class:"ri-arrow-down-line"},null,-1)])]),_:1},8,["onClick","disabled"]),e.createVNode(n,{variant:"text",size:"small",theme:"danger",onClick:D=>x(R)},{icon:e.withCtx(()=>[...i[13]||(i[13]=[e.createElementVNode("i",{class:"ri-delete-bin-line"},null,-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:1},16,["data"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-6492ecb6"]]);function td(t){const{formModel:U,formConf:o,fields:N,formId:f="",formStatus:s="add",context:r={},onRefresh:p,onClose:b,onSave:E,httpClient:u}=t,B=new Map,V=(a,i)=>{!a||!Array.isArray(a)||a.forEach(n=>{var C;const h=n.__vModel__;if(h){const O=i?`${i}.${h}`:h;B.set(O,n)}(C=n.__config__)!=null&&C.children&&V(n.__config__.children,h)})};return V(N),{field:(a,i)=>{if(i!==void 0)return U[a]=i,i;const n=B.get(a);return{value:()=>U[a],empty:()=>{const h=U[a];return h==null||h===""||Array.isArray(h)&&h.length===0},lock:()=>{n&&(n.disabled=!0)},unlock:()=>{n&&(n.disabled=!1)},show:()=>{n!=null&&n.__config__&&(n.__config__.noShow=!1)},hide:()=>{n!=null&&n.__config__&&(n.__config__.noShow=!0)},required:h=>{n!=null&&n.__config__&&(n.__config__.required=h)}}},msg:{info:a=>re.MessagePlugin.info(a),success:a=>re.MessagePlugin.success(a),warning:a=>re.MessagePlugin.warning(a),error:a=>re.MessagePlugin.error(a),confirm:(a,i)=>new Promise(n=>{const h=re.DialogPlugin.confirm({header:(i==null?void 0:i.title)||"确认",body:a,confirmBtn:(i==null?void 0:i.yes)||"确定",cancelBtn:(i==null?void 0:i.no)||"取消",onConfirm:()=>{h.destroy(),n(!0)},onCancel:()=>{h.destroy(),n(!1)},onClose:()=>{h.destroy(),n(!1)}})})},form:{id:()=>f,title:()=>(o==null?void 0:o.title)||"",status:()=>s,refresh:()=>p==null?void 0:p(),lock:()=>{o&&(o.disabled=!0)},unlock:()=>{o&&(o.disabled=!1)},close:()=>b==null?void 0:b(),save:()=>E==null?void 0:E(),entry_row_count:a=>{const i=U[a];return Array.isArray(i)?i.length:0},entry_value:(a,i)=>{const n=i.split("."),h=n.length>1?n[0]:"",C=n.length>1?n[1]:i,O=h?U[h]:U;if(Array.isArray(O)&&O[a])return O[a][C]},entry_field_set:(a,i,n)=>{const h=i.split("."),C=h.length>1?h[0]:"",O=h.length>1?h[1]:i,J=C?U[C]:U;Array.isArray(J)&&J[a]&&(J[a][O]=n)},entry_add_row:a=>{U[a]||(U[a]=[]),U[a].push({})},entry_delete_row:(a,i)=>{Array.isArray(U[a])&&U[a].splice(i,1)},entry_clear:a=>{U[a]=[]}},context:r,date:{today:()=>{const a=new Date;return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`},now:()=>{const a=new Date;return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`},format:(a,i)=>{const n=new Date(a),h={YYYY:n.getFullYear(),MM:n.getMonth()+1,DD:n.getDate(),HH:n.getHours(),mm:n.getMinutes(),ss:n.getSeconds()};return i.replace(/YYYY|MM|DD|HH|mm|ss/g,C=>String(h[C]).padStart(2,"0"))}},util:{uuid:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const i=Math.random()*16|0;return(a==="x"?i:i&3|8).toString(16)}),format:(a,i)=>{const n=(i.split(".")[1]||"").length;return a.toFixed(n)},toChineseMoney:a=>{const i=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","拾","佰","仟","万","拾","佰","仟","亿"];if(a===0)return"零元整";const h=Math.floor(a),C=Math.round((a-h)*100);let O="";const J=h.toString();for(let F=0;F<J.length;F++){const R=parseInt(J[F]),D=n[J.length-1-F];R!==0?O+=i[R]+D:O.endsWith("零")||(O+="零")}if(O=O.replace(/零+$/,"")+"元",C===0)O+="整";else{const F=Math.floor(C/10),R=C%10;F>0&&(O+=i[F]+"角"),R>0&&(O+=i[R]+"分")}return O}},event:{cancelled:!1,cancel(){this.cancelled=!0}},db:{query:async(a,i)=>{if(!u)return console.warn("db.query: httpClient not configured"),[];try{return(await u.post("/api/script/query",{sql:a,params:i})).data}catch(n){return console.error("db.query error:",n),[]}},execute:async(a,i)=>{if(!u)return console.warn("db.execute: httpClient not configured"),{affected:0};try{return(await u.post("/api/script/execute",{sql:a,params:i})).data}catch(n){return console.error("db.execute error:",n),{affected:0}}}},api:{call:async(a,i)=>{if(!u)return console.warn("api.call: httpClient not configured"),null;try{return(await u.post(`/api/script/call/${a}`,i)).data}catch(n){return console.error("api.call error:",n),null}},get:async(a,i)=>{if(!u)return console.warn("api.get: httpClient not configured"),null;try{return(await u.get(a,{params:i})).data}catch(n){return console.error("api.get error:",n),null}},post:async(a,i)=>{if(!u)return console.warn("api.post: httpClient not configured"),null;try{return(await u.post(a,i)).data}catch(n){return console.error("api.post error:",n),null}}}}}async function ld(t,U,o){if(!t||!t.trim())return{success:!0};try{return await new Function("field","msg","form","context","date","util","event","db","api",...Object.keys(o||{}),`"use strict";
29
+ `)({formData:c,setFormData:()=>{},setShowOrHide:()=>{},setRequired:()=>{},setDisabled:()=>{},onlineUtils:{}})}catch(W){console.error("执行 afterSubmit 出错:",W)}i.value=!1,p("refresh")},Me=async()=>{await he(),setTimeout(()=>{Y()},300)},Se=()=>{i.value=!1},Xe=l=>{console.log("🚀 CdForm: 接收到 select-org-data 事件:",l),p("select-org-data",l),console.log("📡 CdForm: 已转发 select-org-data 事件到 app.vue")},Je=l=>{p("page-change",{currentPage:l.current,pageSize:j.value})},Qe=l=>{le.value=1,p("page-change",{currentPage:1,pageSize:l})},Ze=l=>{},ve=l=>{},qe=l=>{p("filter-search",l)},ze=()=>{p("filter-reset")},et=l=>{p("save-plan",l)},tt=l=>{console.log("删除筛选方案:",l),p("delete-plan",l)},lt=l=>{console.log("复制筛选方案:",l),p("copy-plan",l)},at=l=>{console.log("设置默认方案:",l),p("set-default-plan",l)},Re=l=>{console.log("更新筛选方案:",l),p("update-plan",l)},ot=l=>{console.log("加载用户:",l),p("load-users",l)},nt=l=>{console.log("搜索人员:",l),p("search-persons",l)},rt=l=>{console.log("部门点击:",l),p("dept-click",l)},st=l=>{console.log("列配置变更0:",l),l&&l.length>0&&(l.forEach(c=>{R.value.set(c.value,{width:c.width?parseInt(c.width):void 0,fixed:c.fixed&&c.fixed!=="none"?c.fixed:void 0,show:c.show})}),e.nextTick(()=>{M.columns=we(),b.value&&b.value.refreshColumn()})),p("column-change",l)},it=l=>{console.log("颜色筛选变化:",l),F.value=l||[],p("color-filter-change",l)},Ae=()=>{console.log("清除颜色筛选"),F.value=[],p("color-filter-clear")},Oe=e.computed(()=>{var l;return((l=r.businessFlow)==null?void 0:l.downstream)&&r.businessFlow.downstream.length>0}),je=()=>{var g,y;const l=(g=b.value)==null?void 0:g.getCheckboxRecords();if(!l||l.length===0){re.MessagePlugin.warning("请选择要下推的数据");return}const c=((y=r.businessFlow)==null?void 0:y.downstream)||[];if(c.length===0){re.MessagePlugin.warning("未配置下游单据");return}c.length===1?p("push-down",{downstream:c[0],selectedRows:l}):O.value=!0},ct=()=>{var c;if(!J.value){re.MessagePlugin.warning("请选择下推目标");return}const l=(c=b.value)==null?void 0:c.getCheckboxRecords();p("push-down",{downstream:J.value,selectedRows:l}),O.value=!1,J.value=null},dt=l=>{p("select-upstream",{upstream:l})},mt=()=>{var g;if(!S.value||S.value.length===0){if(M.aggregateConfig={},M.columns){const y=M.columns.findIndex(P=>P.field==="group");y>-1&&M.columns.splice(y,1),M.columns.forEach(P=>{P.rowGroupNode&&(P.rowGroupNode=!1,delete P.slots)})}return k.value=!1,p("group",{groupFields:[],mergeFields:!1}),!0}k.value=!1;const l=S.value.filter(y=>y&&y.trim()!=="");return l.length===0?(M.aggregateConfig={},k.value=!1,p("group",{groupFields:[],mergeFields:!1}),!0):(M.data&&Array.isArray(M.data)&&M.data.forEach(y=>{y.group=l.map(P=>y[P]||"").join("-")}),!((g=M.columns)==null?void 0:g.some(y=>y.field==="group"))&&M.columns&&M.columns.splice(1,0,{field:"group",title:"分组",width:200,align:"left",headerAlign:"center",sortable:!0,rowGroupNode:!0}),a.value?M.aggregateConfig={mode:"column",groupFields:["group"],showTotal:!0}:M.aggregateConfig={mode:"column",groupFields:l,showTotal:!0},p("group",{groupFields:l,mergeFields:a.value,updatedData:fe.value}),console.log("gridOptions.columns",M.columns),k.value=!1,!0)},ft=()=>{k.value=!1},Te=e.ref(new Map),He=e.computed(()=>{const l=[];return!r.formData.fields||r.formData.fields.length===0||r.formData.fields.forEach(c=>{const g=c.__config__;if(g.cdkey==="vxeSubGrid"&&!g.noShow){const y=c.__vModel__,P=c.children||c.__config__.children||[];l.push({vModel:y,label:g.label,children:P,field:c})}}),l}),pt=(l,c)=>{const g=String(l.id);Te.value.has(c)||Te.value.set(c,new Set);const y=Te.value.get(c);y.has(g)?(y.delete(g),!Array.from(Te.value.entries()).some(([W,X])=>W!==c&&X.has(g))&&b.value&&b.value.setRowExpand(l,!1)):(y.add(g),b.value&&b.value.setRowExpand(l,!0))},z=(l,c)=>{var y;const g=String(l.id);return((y=Te.value.get(c))==null?void 0:y.has(g))||!1},oe=l=>{const c=[];return(l.children||[]).forEach(y=>{const P=y.__config__;if(!P||P.noShow)return;const T=y.field||y.__vModel__;if(!T)return;const W={field:T,title:y.title||P.label||T,width:y.width||y.minWidth||P.tableWidth||150,align:y.align||P.tableAlign||"left",sortable:!1};c.push(W)}),c},Be=e.reactive({border:!0,stripe:!0,size:"small",maxHeight:350,minHeight:200,round:!0,showOverflow:!0,showHeaderOverflow:!0,rowConfig:{isCurrent:!0,isHover:!0},cellConfig:{height:35},columnConfig:{resizable:!0}});return U({tableRef:b,formRenderRef:E,handleAdd:Y,handleEdit:ae,handleDelete:Ee,handleDetail:ye,handleSaveChanges:me,handlePushDown:je,handleSelectUpstream:dt,isInlineEdit:x,showGroupDialog:k,selectedGroupField:S,mergeGroupFields:a,openFormPopup:(l={},c="新增")=>{h.value="add",n.value=c,i.value=!0,e.nextTick(()=>{var g;(g=E.value)==null||g.initFormData(l)})}}),(l,c)=>{var $t;const g=e.resolveComponent("t-button"),y=e.resolveComponent("t-dropdown-item"),P=e.resolveComponent("t-dropdown-menu"),T=e.resolveComponent("t-dropdown"),W=e.resolveComponent("t-select"),X=e.resolveComponent("t-switch"),ce=e.resolveComponent("t-dialog"),De=e.resolveComponent("t-radio"),Ue=e.resolveComponent("t-radio-group"),Ie=e.resolveComponent("t-empty"),xt=e.resolveComponent("t-loading"),gt=e.resolveComponent("t-tag"),Bt=e.resolveComponent("vxe-grid"),od=e.resolveComponent("t-pagination"),nd=e.resolveComponent("t-space"),rd=e.resolveComponent("t-drawer");return e.openBlock(),e.createElementBlock("div",Ui,[e.createElementVNode("div",Li,[e.createElementVNode("div",Ri,[t.showFilter&&de.value&&de.value.length>0?(e.openBlock(),e.createElementBlock("div",Ii,[e.createVNode(e.unref(St.CdFilterBar),{"field-options":de.value,"filter-count":2,"select-options":$e.value,"plan-filter-options":r.planFilterOptions||[],"person-tabs":[],"person-organizations":[],"visible-columns":[],onSearch:qe,onConfirm:qe,onReset:ze,onSavePlan:et,onDeletePlan:tt,onCopyPlan:lt,onSetDefaultPlan:at,onUpdatePlan:Re,onLoadUsers:ot,onSearchPersons:nt,onDeptClick:rt,onColumnChange:st,onColorFilterChange:it,onColorFilterClear:Ae},null,8,["field-options","select-options","plan-filter-options"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",qi,[x.value?(e.openBlock(),e.createBlock(g,{key:0,variant:"outline",size:"small",theme:"success",disabled:!L.value,onClick:me},{icon:e.withCtx(()=>[...c[10]||(c[10]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[c[11]||(c[11]=e.createTextVNode(" 保存更改 ",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnData.btnsList||[],Q=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Q.label},[Q.children&&Q.children.length>0?(e.openBlock(),e.createBlock(T,{key:0,onClick:ie,"overlay-class-name":"filter-dropdown"},{default:e.withCtx(()=>[e.createVNode(g,{variant:"outline",size:"small",theme:"primary"},e.createSlots({suffix:e.withCtx(()=>[c[12]||(c[12]=e.createElementVNode("i",{class:"ri-arrow-down-s-line"},null,-1))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label)+" ",1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(Q.icon)},null,2)]),key:"0"}:void 0]),1024),e.createVNode(P,{onClick:c[0]||(c[0]=pe=>ie({value:pe.value}))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.children.filter(pe=>pe.show!==!1),pe=>(e.openBlock(),e.createBlock(y,{key:pe.value||Math.random(),value:pe.value,disabled:pe.disabled,divider:pe.divider},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pe.label),1)]),_:2},1032,["value","disabled","divider"]))),128))]),_:2},1024)]),_:2},1024)):Q.show&&!H(Q.value)?(e.openBlock(),e.createBlock(g,{key:1,variant:"outline",size:"small",theme:"primary",onClick:pe=>ie({value:Q.value})},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label),1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[]),key:"0"}:void 0]),1032,["onClick"])):e.createCommentVNode("",!0)],64))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columnData.customBtnsList||[],Q=>e.withDirectives((e.openBlock(),e.createBlock(g,{variant:"outline",size:"small",key:Q.value,onClick:pe=>ke(Q)},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(Q.label),1)]),_:2},[Q.icon?{name:"icon",fn:e.withCtx(()=>[]),key:"0"}:void 0]),1032,["onClick"])),[[e.vShow,Q.show]])),128)),e.renderSlot(l.$slots,"toolbar-right",{},void 0,!0),Oe.value?(e.openBlock(),e.createBlock(g,{key:1,variant:"outline",size:"small",theme:"primary",onClick:je},{icon:e.withCtx(()=>[...c[13]||(c[13]=[e.createElementVNode("i",{class:"ri-arrow-down-line"},null,-1)])]),default:e.withCtx(()=>[c[14]||(c[14]=e.createTextVNode(" 下推 ",-1))]),_:1})):e.createCommentVNode("",!0)])]),e.createVNode(ce,{visible:k.value,"onUpdate:visible":c[3]||(c[3]=Q=>k.value=Q),header:"选择分组字段","confirm-btn":{content:"确定",theme:"primary"},"cancel-btn":{content:"取消",theme:"default"},onConfirm:mt,onClose:ft},{default:e.withCtx(()=>[e.createElementVNode("div",Oi,[e.createVNode(W,{modelValue:S.value,"onUpdate:modelValue":c[1]||(c[1]=Q=>S.value=Q),placeholder:"请选择要分组的字段(可多选)",options:Ne.value,keys:{label:"label",value:"value"},multiple:"",clearable:""},null,8,["modelValue","options"]),e.createElementVNode("div",Hi,[c[15]||(c[15]=e.createElementVNode("span",{class:"switch-label"},"分组:",-1)),e.createVNode(X,{modelValue:a.value,"onUpdate:modelValue":c[2]||(c[2]=Q=>a.value=Q)},null,8,["modelValue"]),e.createElementVNode("span",Wi,e.toDisplayString(a.value?"字段合并分组":"独立分组"),1)])])]),_:1},8,["visible"]),e.createVNode(ce,{visible:O.value,"onUpdate:visible":c[5]||(c[5]=Q=>O.value=Q),header:"选择下推目标",width:"400px","confirm-btn":{content:"确定",theme:"primary"},"cancel-btn":{content:"取消",theme:"default"},onConfirm:ct},{default:e.withCtx(()=>[e.createVNode(Ue,{modelValue:J.value,"onUpdate:modelValue":c[4]||(c[4]=Q=>J.value=Q),class:"push-down-options"},{default:e.withCtx(()=>{var Q;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((Q=t.businessFlow)==null?void 0:Q.downstream)||[],pe=>(e.openBlock(),e.createBlock(De,{key:pe.formId,value:pe},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pe.formName),1)]),_:2},1032,["value"]))),128))]}),_:1},8,["modelValue"])]),_:1},8,["visible"]),e.createElementVNode("div",{class:"cd-form-table",ref_key:"tableContainerRef",ref:u},[!t.loading&&G.value.length===0?(e.openBlock(),e.createBlock(xt,{key:0,loading:t.loading,text:t.loadingText},{default:e.withCtx(()=>[e.createElementVNode("div",ji,[e.createVNode(Ie,{description:"暂无数据"})])]),_:1},8,["loading","text"])):t.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Bt,e.mergeProps({key:1,ref_key:"tableRef",ref:b},M,{onCheckboxChange:Ze,onCheckboxAll:ve,onEditClosed:xe,onEditChange:v,onCellDblclick:K,onFilterChange:_,onFilterReset:m,style:{"--vxe-ui-table-header-background-color":"#eef7ff","--vxe-ui-table-footer-background-color":"#fcfffa"}}),e.createSlots({checkbox_footer:e.withCtx(({$rowIndex:Q})=>[M.footerData&&M.footerData[Q]?(e.openBlock(),e.createElementBlock("span",Yi,e.toDisplayString(M.footerData[Q].checkbox),1)):e.createCommentVNode("",!0)]),nameGroupContent:e.withCtx(({groupContent:Q})=>[e.createVNode(gt,{theme:"warning",variant:"light"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q),1)]),_:2},1024)]),nameDefault:e.withCtx(({row:Q,column:pe})=>[e.createTextVNode(e.toDisplayString(Q[pe.field]),1)]),expand_content_unified:e.withCtx(({row:Q})=>[e.createElementVNode("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,pe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`content_${pe.vModel}`},[z(Q,pe.vModel)?(e.openBlock(),e.createElementBlock("div",Gi,[e.createElementVNode("div",Xi,e.toDisplayString(pe.label),1),e.createVNode(Bt,e.mergeProps({ref_for:!0},Be,{data:Q[pe.vModel]||[],columns:oe(pe)}),null,16,["data","columns"])])):e.createCommentVNode("",!0)],64))),128))])]),_:2},[e.renderList(He.value,Q=>({name:`subgrid_trigger_${Q.vModel}`,fn:e.withCtx(({row:pe})=>[e.createVNode(g,{variant:"text",size:"small",disabled:!pe[Q.vModel]||pe[Q.vModel].length===0,onClick:We=>pt(pe,Q.vModel)},{icon:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass(z(pe,Q.vModel)?"ri-arrow-down-s-line":"ri-arrow-right-s-line")},null,2)]),default:e.withCtx(()=>{var We;return[e.createTextVNode(" "+e.toDisplayString(((We=pe[Q.vModel])==null?void 0:We.length)||0)+" 条 ",1)]}),_:2},1032,["disabled","onClick"])])})),e.renderList(l.$slots,(Q,pe)=>({name:pe,fn:e.withCtx(We=>[e.renderSlot(l.$slots,pe,e.normalizeProps(e.guardReactiveProps(We)),void 0,!0)])}))]),1040))],512),r.columnData.hasPage&&(($t=r.pageConfig)!=null&&$t.enabled)&&fe.value.length>0?(e.openBlock(),e.createElementBlock("div",Ji,[e.createVNode(od,{modelValue:le.value,"onUpdate:modelValue":c[6]||(c[6]=Q=>le.value=Q),pageSize:j.value,"onUpdate:pageSize":c[7]||(c[7]=Q=>j.value=Q),total:r.pageConfig.total||0,"page-size-options":r.pageConfig.pageSizes||[10,20,50,100,200],"show-jumper":"","show-page-size":"","show-total":!0,onChange:Je,onPageSizeChange:Qe},null,8,["modelValue","pageSize","total","page-size-options"])])):e.createCommentVNode("",!0),e.createVNode(rd,{visible:i.value,"onUpdate:visible":c[9]||(c[9]=Q=>i.value=Q),header:n.value,size:ge(),footer:h.value!=="detail","close-on-overlay-click":!0,placement:"bottom","destroy-on-close":"",class:"custom-drawer",onConfirm:he,onCancel:Se},e.createSlots({default:e.withCtx(()=>[e.createVNode(Ge,{ref_key:"formRenderRef",ref:E,"form-conf":t.formData,fields:t.formData.fields,modelValue:e.unref(C),"onUpdate:modelValue":c[8]||(c[8]=Q=>e.isRef(C)?C.value=Q:C=Q),mode:h.value,onSelectOrgData:Xe},null,8,["form-conf","fields","modelValue","mode"])]),_:2},[h.value!=="detail"?{name:"footer",fn:e.withCtx(()=>[e.createVNode(nd,null,{default:e.withCtx(()=>[t.formData.hasCancelBtn?(e.openBlock(),e.createBlock(g,{key:0,theme:"default",onClick:Se},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formData.cancelButtonText),1)]),_:1})):e.createCommentVNode("",!0),t.formData.hasConfirmBtn?(e.openBlock(),e.createBlock(g,{key:1,theme:"primary",onClick:he},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.formData.confirmButtonText),1)]),_:1})):e.createCommentVNode("",!0),t.formData.hasConfirmAndAddBtn&&h.value==="add"?(e.openBlock(),e.createBlock(g,{key:2,theme:"primary",variant:"outline",onClick:Me},{default:e.withCtx(()=>[...c[16]||(c[16]=[e.createTextVNode(" 保存并继续 ",-1)])]),_:1})):e.createCommentVNode("",!0)]),_:1})]),key:"0"}:void 0]),1032,["visible","header","size","footer"])])}}}),[["__scopeId","data-v-7f2a595e"]]);(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".cd-share-content[data-v-bd14b324]{display:flex;flex-direction:column;gap:10px;box-sizing:border-box}.cd-share-content[data-v-bd14b324] *{box-sizing:border-box}.cd-share-header[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:10px}.cd-share-title[data-v-bd14b324]{font:500 16px Microsoft Yahei;display:flex;align-items:center;gap:8px}.cd-share-back-icon[data-v-bd14b324]{margin-right:3px;cursor:pointer}.cd-share-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-cooperators[data-v-bd14b324]{display:flex;align-items:center;gap:12px;margin:0 16px}.cd-share-label[data-v-bd14b324]{width:80px;flex-shrink:0;color:#000}.cd-share-collaborators-wrapper[data-v-bd14b324]{display:flex;align-items:center;gap:12px;margin-left:auto}.cd-share-avatars-container[data-v-bd14b324]{display:flex;align-items:center;flex:1;gap:12px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:background-color .2s}.cd-share-avatars-container[data-v-bd14b324]:hover{background-color:#f5f5f5}.cd-share-avatar-owner[data-v-bd14b324]{flex-shrink:0}.cd-share-divider[data-v-bd14b324]{width:1px;height:32px;background-color:#e5e7eb;flex-shrink:0}.cd-share-collaborators-avatars[data-v-bd14b324]{display:flex;align-items:center;gap:8px;flex:1}.cd-share-more-avatars[data-v-bd14b324]{width:32px;height:32px;border-radius:50%;background-color:#f0f0f0;color:#666;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}.cd-share-expand-icon[data-v-bd14b324]{margin-left:auto;flex-shrink:0;color:#999;cursor:pointer}.cd-share-add-collaborator-btn[data-v-bd14b324]{width:32px;height:32px;border:1px dashed #d9d9d9;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#999;transition:all .2s;flex-shrink:0}.cd-share-add-collaborator-btn[data-v-bd14b324]:hover{border-color:#0052d9;color:#0052d9;background-color:#f0f5ff}.cd-share-collaborator-list[data-v-bd14b324]{margin:8px 16px 0;border:1px solid #e5e7eb;border-radius:4px;overflow:hidden}.cd-share-collaborator-list-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid #f0f0f0}.cd-share-collaborator-list-item[data-v-bd14b324]:last-child{border-bottom:none}.cd-share-collaborator-info[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-collaborator-name[data-v-bd14b324]{font-size:14px;color:#333}.cd-share-collaborator-role[data-v-bd14b324]{font-size:14px;color:#999}.cd-share-collaborator-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-selector-wrapper[data-v-bd14b324]{margin:0 16px}.cd-share-selector-content[data-v-bd14b324]{display:flex;align-items:center;flex:1}.cd-share-readonly-tip[data-v-bd14b324]{margin:0 16px;padding:12px;background-color:#f5f5f5;border-radius:4px;font-size:14px;color:#666;display:flex;align-items:center}.cd-share-options[data-v-bd14b324]{margin-left:16px;display:flex;height:30px;align-items:center;gap:16px}.cd-share-form-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px;margin-top:8px;justify-content:flex-end;padding:16px 16px 0}.cd-share-footer[data-v-bd14b324]{display:flex;flex-direction:column;gap:8px;align-items:flex-start;margin-top:15px}.cd-share-footer-top[data-v-bd14b324]{width:100%;padding:0 16px}.cd-share-footer-title[data-v-bd14b324]{margin-bottom:10px;color:#000}.cd-share-footer-controls[data-v-bd14b324]{display:flex;align-items:center;width:100%;margin-top:6px;justify-content:space-between}.cd-share-footer-bottom[data-v-bd14b324]{display:flex;align-items:center;gap:10px;padding:16px;width:100%;background-color:#f5f6f7;margin-bottom:-10px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}.cd-share-org-control[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-share-org-icon[data-v-bd14b324]{background-color:#0594fa;width:35px;height:35px;color:#fff;padding:6px;border-radius:50%}.cd-share-org-content[data-v-bd14b324]{display:flex;flex-direction:column}.cd-share-org-note[data-v-bd14b324]{font-size:12px;color:#666}.cd-share-copy-action[data-v-bd14b324]{cursor:pointer;border:1px solid rgb(208,211,214);padding:5px 12px;border-radius:26px;transition:color .2s ease;display:flex;align-items:center;gap:4px}.cd-share-copy-action[data-v-bd14b324]:hover,.cd-share-copy-action[data-v-bd14b324]:hover .t-icon{color:#0594fa}.cd-share-icon-actions[data-v-bd14b324]{display:flex;align-items:center;gap:12px}.cd-share-icon-btn[data-v-bd14b324]{width:36px;height:36px;border:1px solid rgb(208,211,214);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.cd-share-icon-btn[data-v-bd14b324] .t-icon{font-size:20px}.cd-share-icon-btn.is-disabled[data-v-bd14b324]{opacity:.4;cursor:not-allowed;pointer-events:none}[data-v-bd14b324] .t-textarea{padding:0 10px}.cd-permission-settings[data-v-bd14b324]{display:flex;flex-direction:column;gap:24px;padding:16px}.cd-permission-section[data-v-bd14b324]{display:flex;flex-direction:column;gap:12px}.cd-permission-section-title[data-v-bd14b324]{font-size:14px;font-weight:500;color:#000;margin-bottom:4px}.cd-permission-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:8px 0}.cd-permission-item-label[data-v-bd14b324]{font-size:14px;color:#333;flex:1}.cd-permission-item-note[data-v-bd14b324]{font-size:12px;color:#999;margin-top:-8px}.cd-permission-actions[data-v-bd14b324]{display:flex;justify-content:flex-end;gap:8px;padding-top:8px;border-top:1px solid #e5e7eb}.cd-collaborator-list-content[data-v-bd14b324]{max-height:400px;overflow-y:auto}.cd-collaborator-list-item[data-v-bd14b324]{display:flex;align-items:center;justify-content:space-between;padding:12px;border-bottom:1px solid #f0f0f0}.cd-collaborator-list-item[data-v-bd14b324]:last-child{border-bottom:none}.cd-collaborator-list-item[data-v-bd14b324]:hover{background-color:#f5f5f5}.cd-collaborator-item-info[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-collaborator-item-name[data-v-bd14b324]{font-size:14px;color:#333}.cd-collaborator-item-role[data-v-bd14b324]{font-size:14px;color:#999}.cd-collaborator-item-actions[data-v-bd14b324]{display:flex;align-items:center;gap:8px}.cd-collaborator-item-permission-text[data-v-bd14b324]{font-size:14px;color:#666;padding:4px 12px;background-color:#f5f5f5;border-radius:4px}.cd-qrcode-content[data-v-bd14b324]{display:flex;flex-direction:column;align-items:center;padding:24px;gap:16px}.cd-qrcode-image[data-v-bd14b324]{width:300px;height:300px;border:1px solid #e5e7eb;border-radius:8px}.cd-qrcode-url[data-v-bd14b324]{font-size:14px;color:#666;word-break:break-all;text-align:center;padding:0 16px}.cd-qrcode-tip[data-v-bd14b324]{font-size:12px;color:#999}.cd-encrypt-content[data-v-bd14b324]{display:flex;flex-direction:column;padding:16px;gap:16px}.cd-encrypt-field[data-v-bd14b324]{display:flex;flex-direction:column;gap:8px}.cd-encrypt-label[data-v-bd14b324]{font-size:14px;font-weight:500;color:#333}.cd-encrypt-note[data-v-bd14b324]{display:flex;align-items:flex-start;font-size:12px;color:#666;background-color:#f5f5f5;padding:12px;border-radius:4px;line-height:1.6}.cd-encrypt-actions[data-v-bd14b324]{display:flex;justify-content:flex-end;gap:8px;padding-top:8px;border-top:1px solid #e5e7eb}.cd-share-dialog .t-dialog{padding:0!important}.cd-share-dialog .t-dialog__header,.cd-share-dialog .t-dialog__body,.cd-share-dialog .t-dialog__content{padding:0!important;overflow:visible!important;max-height:none!important}.cd-share-dialog .t-dialog__body{overflow-y:visible!important}:deep(.t-select__dropdown)>.t-select__dropdown-inner>.t-select-option-group>.t-select-option-group__header{color:#999!important}")),document.head.appendChild(t)}}catch(U){console.error("vite-plugin-css-injected-by-js",U)}})();const Qi={class:"cd-share-header"},Zi={class:"cd-share-title"},vi={key:0,class:"cd-share-actions"},ec={key:0,class:"cd-share-content"},tc={class:"cd-share-cooperators"},lc={class:"cd-share-collaborators-wrapper"},ac={class:"cd-share-avatar-owner"},oc={key:0,class:"cd-share-selector-wrapper"},nc={class:"cd-share-selector-content"},rc={key:1,class:"cd-share-readonly-tip"},sc={key:2,class:"cd-share-footer"},ic={class:"cd-share-footer-top"},cc={class:"cd-share-footer-controls"},dc={class:"cd-share-org-control"},mc={class:"cd-share-org-content"},fc={class:"cd-share-footer-bottom"},pc={class:"cd-share-icon-actions"},gc={class:"cd-share-icon-btn"},hc={key:1,class:"cd-share-content"},uc={class:"cd-share-cooperators"},kc={class:"cd-share-collaborators-wrapper"},bc={class:"cd-share-avatar-owner"},yc={class:"cd-share-selector-wrapper"},_c={class:"cd-share-selector-content"},Vc={class:"cd-share-options"},Cc={class:"cd-share-form-actions"},Nc={class:"cd-permission-settings"},wc={class:"cd-permission-section"},Ec={class:"cd-permission-item"},xc={class:"cd-permission-section"},Bc={class:"cd-permission-section"},$c={class:"cd-permission-item"},Sc={class:"cd-permission-item"},Dc={class:"cd-permission-item"},Mc={class:"cd-permission-section"},zc={class:"cd-permission-item"},Tc={class:"cd-permission-actions"},Fc={class:"cd-collaborator-list-content"},Pc={class:"cd-collaborator-list-item"},Ac={class:"cd-collaborator-item-info"},Uc={class:"cd-collaborator-item-name"},Lc={class:"cd-collaborator-item-info"},Rc={class:"cd-collaborator-item-name"},Ic={class:"cd-collaborator-item-actions"},qc={key:0,class:"cd-collaborator-item-permission-text"},Oc={key:0,class:"cd-collaborator-item-permission-text"},Hc={class:"cd-qrcode-content"},Wc=["src"],jc={class:"cd-qrcode-url"},Yc={class:"cd-encrypt-content"},Kc={class:"cd-encrypt-field"},Gc={class:"cd-encrypt-note"},Xc={class:"cd-encrypt-actions"},Jc=e.defineComponent({name:"CdShareDialog",__name:"ShareDialog",props:{visible:{type:Boolean,default:!1},title:{default:"分享"},shareUrl:{default:""},helpUrl:{default:""},width:{default:"500px"},currentPermission:{default:"edit"},owner:{},managers:{default:()=>[]},collaborators:{default:()=>[]},tabs:{default:()=>[]},organizations:{default:()=>[]},defaultPermissionSettings:{}},emits:["update:visible","confirm","search","load-users","request-permission","permission-settings-change","manage-collaborators","remove-collaborator","collaborator-permission-change"],setup(t,{emit:U}){var o;const N=t,f=U,s=e.ref(N.visible),r=e.ref(N.shareUrl),p=e.ref([]),b=e.ref(!1),E=e.ref(1),u=e.ref("read"),B=e.ref(!0),V=e.ref(!1),x=e.ref(""),L=e.ref(""),A=e.ref(!1),I=e.ref(!1),le=e.ref(!1),j=e.ref(!1),k=e.ref(""),S=e.ref({allowExternalShare:((o=N.defaultPermissionSettings)==null?void 0:o.allowExternalShare)??!1,collaboratorManagement:"org-only",copyPermission:"edit",downloadPermission:"edit",commentPermission:"all",viewerAvatarsPermission:"all"}),a=e.computed(()=>{const w=N.organizations||[],d=w.filter(ie=>ie.id!=="internet"),te=w.find(ie=>ie.id==="internet"),ge=[];return d.forEach(ie=>{ge.push({label:ie.name,value:ie.id})}),te&&ge.push({label:"互联网获得链接的人",value:te.id}),[{group:"分享范围",children:ge}]}),i=[{label:"可阅读",value:"read"},{label:"可编辑",value:"edit"},{label:"可管理",value:"manage"}],n=e.computed(()=>C.value==="manage"?i:C.value==="edit"?i.filter(w=>w.value!=="manage"):[]),h=[{label:"所有人",value:"all"},{label:"可编辑及以上",value:"edit"},{label:"可管理",value:"manage"},{label:"仅所有者",value:"owner"}],C=e.computed(()=>N.currentPermission||"edit"),O=e.computed(()=>(N.collaborators||[]).map(w=>({id:w.id,name:w.displayName||w.name||String(w.id),avatar:w.avatar||"",isUser:!0}))),J=e.computed(()=>r.value?`https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${encodeURIComponent(r.value)}`:""),F=w=>w?w.substring(0,2).toUpperCase():"所";e.watch(()=>N.visible,w=>s.value=w),e.watch(()=>N.shareUrl,w=>r.value=w),e.watch(s,w=>{f("update:visible",w),w&&R()}),e.watch(p,w=>{if(C.value==="read"){b.value=!1;return}b.value=w.length>0});const R=()=>{var w;p.value=[],E.value=((w=N.organizations[0])==null?void 0:w.id)||1,L.value="",u.value="read",B.value=!0,V.value=!1,x.value="",b.value=!1},D=()=>{b.value=!1},$=()=>{D()},se=()=>{if(C.value==="read"){re.MessagePlugin.warning("您当前为只读权限,无法分享");return}const w={sharerIds:p.value.map(d=>d.isUser===!1?`depot:${d.id}`:d.isGroup?`usergroup:${d.id}`:d.isPost?`post:${d.id}`:d.isOutUser?`outuser:${d.id}`:`user:${d.id}`),orgId:E.value,permission:u.value,sendNotification:B.value,password:V.value?x.value:void 0,remark:L.value};console.log("分享参数:",w),f("confirm",w),s.value=!1},ee=async()=>{try{await navigator.clipboard.writeText(r.value||""),re.MessagePlugin.success("链接已复制")}catch{re.MessagePlugin.error("复制失败")}},q=()=>{N.helpUrl&&window.open(N.helpUrl,"_blank")},fe=w=>{f("search",w)},G=w=>{f("load-users",w)},H=()=>{f("request-permission","edit"),re.MessagePlugin.info("已发送编辑权限申请")},ue=()=>{if(C.value!=="manage"){re.MessagePlugin.warning("只有管理员才能修改权限设置");return}f("permission-settings-change",S.value),re.MessagePlugin.success("权限设置已保存"),A.value=!1},de=w=>{console.log("点击协作者:",w)},$e=w=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法添加协作者");return}console.log("选择人员:",w),f("manage-collaborators",w)},Ne=w=>{if(C.value!=="manage"){re.MessagePlugin.warning("只有管理员才能删除协作者");return}f("remove-collaborator",w)},_e=(w,d)=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法修改协作者权限");return}if(C.value==="edit"&&d==="manage"){re.MessagePlugin.warning("编辑权限无法将协作者设置为管理员");return}f("collaborator-permission-change",{id:w,permission:d})},Z=()=>{const w="ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";let d="";for(let te=0;te<6;te++)d+=w.charAt(Math.floor(Math.random()*w.length));k.value=d},we=async()=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法设置链接密码");return}if(!k.value||k.value.length!==6){re.MessagePlugin.warning("请先生成或输入6位密码");return}const w=r.value||"",d=w.includes("?")?"&":"?",te=`链接:${`${w}${d}pwd=${k.value}`} 密码:${k.value}`;try{await navigator.clipboard.writeText(te),re.MessagePlugin.success("链接和密码已复制")}catch{re.MessagePlugin.error("复制失败")}},M=()=>{if(C.value==="read"){re.MessagePlugin.warning("只读权限无法设置链接密码");return}if(!k.value||k.value.length!==6){re.MessagePlugin.warning("请输入6位密码");return}re.MessagePlugin.success("密码设置成功"),j.value=!1,console.log("链接密码:",k.value)};return e.watch(j,w=>{w&&!k.value&&Z()}),(w,d)=>{const te=e.resolveComponent("t-icon"),ge=e.resolveComponent("t-tooltip"),ie=e.resolveComponent("t-button"),ke=e.resolveComponent("t-avatar"),_=e.resolveComponent("t-select"),m=e.resolveComponent("t-checkbox"),Y=e.resolveComponent("t-input"),ne=e.resolveComponent("t-textarea"),ae=e.resolveComponent("t-dialog"),ye=e.resolveComponent("t-switch"),K=e.resolveComponent("t-radio"),Ee=e.resolveComponent("t-radio-group");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ae,{visible:s.value,"onUpdate:visible":d[13]||(d[13]=v=>s.value=v),width:"500",footer:!1,placement:"center","destroy-on-close":"",closeBtn:!1,class:"cd-share-dialog"},{header:e.withCtx(()=>[e.createElementVNode("div",Qi,[e.createElementVNode("div",Zi,[b.value?(e.openBlock(),e.createBlock(te,{key:0,name:"chevron-left",size:"18px",class:"cd-share-back-icon",onClick:D})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.title)+" ",1),!b.value&&t.helpUrl?(e.openBlock(),e.createBlock(ge,{key:1,content:"查看详情"},{default:e.withCtx(()=>[e.createVNode(te,{name:"help-circle",size:"14px",onClick:q})]),_:1})):e.createCommentVNode("",!0)]),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vi,[e.renderSlot(w.$slots,"header-actions",{},()=>[C.value==="read"?(e.openBlock(),e.createBlock(ie,{key:0,variant:"text",size:"small",onClick:H},{icon:e.withCtx(()=>[e.createVNode(te,{name:"user-add",size:"18px"})]),default:e.withCtx(()=>[d[27]||(d[27]=e.createTextVNode(" 申请编辑权限 ",-1))]),_:1})):C.value==="manage"?(e.openBlock(),e.createBlock(ie,{key:1,variant:"text",size:"small",onClick:d[0]||(d[0]=v=>A.value=!0)},{icon:e.withCtx(()=>[e.createVNode(te,{name:"setting",size:"18px"})]),default:e.withCtx(()=>[d[28]||(d[28]=e.createTextVNode(" 权限设置 ",-1))]),_:1})):e.createCommentVNode("",!0)],!0)]))])]),default:e.withCtx(()=>{var v,xe;return[b.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",uc,[d[36]||(d[36]=e.createElementVNode("div",{class:"cd-share-label"},"邀请协作者",-1)),e.createElementVNode("div",kc,[e.createElementVNode("div",bc,[(xe=t.owner)!=null&&xe.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"medium"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"medium"},{default:e.withCtx(()=>{var me,he;return[e.createTextVNode(e.toDisplayString(F(((me=t.owner)==null?void 0:me.displayName)||((he=t.owner)==null?void 0:he.name)||"所有者")),1)]}),_:1}))]),d[35]||(d[35]=e.createElementVNode("div",{class:"cd-share-divider"},null,-1)),e.createVNode(e.unref(Ct),{users:O.value,"avatar-size":32,"max-display":3,edit:!1,"person-tabs":t.tabs,"person-organizations":t.organizations,onPersonSelect:$e,onLoadUsers:G,onSearch:fe,onUserClick:de},null,8,["users","person-tabs","person-organizations"]),e.createVNode(te,{name:"chevron-right",size:"16px",class:"cd-share-expand-icon",onClick:d[7]||(d[7]=me=>I.value=!0)})])]),e.createElementVNode("div",yc,[e.createElementVNode("div",_c,[e.createVNode(e.unref(_t),{modelValue:p.value,"onUpdate:modelValue":d[8]||(d[8]=me=>p.value=me),multiple:"",placeholder:"搜索用户、部门、职位",tabs:t.tabs,organizations:t.organizations,"show-selector":!1,onSearch:fe,onLoadUsers:G},null,8,["modelValue","tabs","organizations"])])]),e.createElementVNode("div",Vc,[e.createVNode(m,{modelValue:B.value,"onUpdate:modelValue":d[9]||(d[9]=me=>B.value=me)},{default:e.withCtx(()=>[...d[37]||(d[37]=[e.createTextVNode("发送通知",-1)])]),_:1},8,["modelValue"]),e.createVNode(m,{modelValue:V.value,"onUpdate:modelValue":d[10]||(d[10]=me=>V.value=me)},{default:e.withCtx(()=>[...d[38]||(d[38]=[e.createTextVNode("设置密码",-1)])]),_:1},8,["modelValue"]),V.value?(e.openBlock(),e.createBlock(Y,{key:0,modelValue:x.value,"onUpdate:modelValue":d[11]||(d[11]=me=>x.value=me),type:"password",placeholder:"设置密码",size:"small",style:{width:"200px","margin-left":"10px"}},null,8,["modelValue"])):e.createCommentVNode("",!0)]),e.createVNode(ne,{modelValue:L.value,"onUpdate:modelValue":d[12]||(d[12]=me=>L.value=me),placeholder:"添加分享备注",autosize:{minRows:10,maxRows:15},style:{height:"100px"}},null,8,["modelValue"]),e.createElementVNode("div",Cc,[e.createVNode(ie,{variant:"outline",onClick:$},{default:e.withCtx(()=>[...d[39]||(d[39]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",onClick:se},{default:e.withCtx(()=>[...d[40]||(d[40]=[e.createTextVNode("确认",-1)])]),_:1})])])):(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",tc,[d[30]||(d[30]=e.createElementVNode("div",{class:"cd-share-label"},"邀请协作者",-1)),e.createElementVNode("div",lc,[e.createElementVNode("div",ac,[(v=t.owner)!=null&&v.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"medium"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"medium"},{default:e.withCtx(()=>{var me,he;return[e.createTextVNode(e.toDisplayString(F(((me=t.owner)==null?void 0:me.displayName)||((he=t.owner)==null?void 0:he.name)||"所有者")),1)]}),_:1}))]),d[29]||(d[29]=e.createElementVNode("div",{class:"cd-share-divider"},null,-1)),e.createVNode(e.unref(Ct),{users:O.value,"avatar-size":32,"max-display":3,edit:!1,"person-tabs":t.tabs,"person-organizations":t.organizations,onPersonSelect:$e,onLoadUsers:G,onSearch:fe,onUserClick:de},null,8,["users","person-tabs","person-organizations"]),e.createVNode(te,{name:"chevron-right",size:"16px",class:"cd-share-expand-icon",onClick:d[1]||(d[1]=me=>I.value=!0)})])]),C.value!=="read"?(e.openBlock(),e.createElementBlock("div",oc,[e.createElementVNode("div",nc,[e.createVNode(e.unref(_t),{modelValue:p.value,"onUpdate:modelValue":d[2]||(d[2]=me=>p.value=me),multiple:"",placeholder:"搜索用户、部门、职位",tabs:t.tabs,organizations:t.organizations,"show-selector":!1,onSearch:fe,onLoadUsers:G},null,8,["modelValue","tabs","organizations"])])])):(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(te,{name:"info-circle",size:"14px",style:{color:"#999","margin-right":"4px"}}),d[31]||(d[31]=e.createTextVNode(" 您当前为只读权限,无法添加协作者 ",-1))])),r.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",ic,[d[33]||(d[33]=e.createElementVNode("div",{class:"cd-share-footer-title"},"链接分享",-1)),e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.createVNode(te,{name:"city-1",class:"cd-share-org-icon",size:"18px"}),e.createElementVNode("div",mc,[e.createVNode(_,{modelValue:E.value,"onUpdate:modelValue":d[3]||(d[3]=me=>E.value=me),options:a.value,placeholder:"选择组织",disabled:C.value==="read",style:{width:"auto"},autoWidth:"",borderless:"",size:"small"},null,8,["modelValue","options","disabled"]),d[32]||(d[32]=e.createElementVNode("div",{class:"cd-share-org-note"},"组织内获得链接的人可阅读",-1))])]),e.createVNode(_,{modelValue:u.value,"onUpdate:modelValue":d[4]||(d[4]=me=>u.value=me),options:i,disabled:C.value==="read",style:{width:"auto"},autoWidth:"",borderless:""},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",fc,[e.createElementVNode("div",{class:"cd-share-copy-action",onClick:ee},[e.createVNode(te,{name:"link",size:"14px"}),d[34]||(d[34]=e.createTextVNode(" 复制链接 ",-1))]),e.createElementVNode("div",pc,[e.renderSlot(w.$slots,"share-channels",{},()=>[e.createVNode(ge,{content:"二维码"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cd-share-icon-btn",onClick:d[5]||(d[5]=me=>le.value=!0)},[e.createVNode(te,{name:"qrcode"})])]),_:1}),e.createVNode(ge,{content:"邮件"},{default:e.withCtx(()=>[e.createElementVNode("div",gc,[e.createVNode(te,{name:"mail"})])]),_:1}),e.createVNode(ge,{content:C.value==="read"?"只读权限无法设置密码":"加密连接"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["cd-share-icon-btn",{"is-disabled":C.value==="read"}]),onClick:d[6]||(d[6]=me=>C.value!=="read"&&(j.value=!0))},[e.createVNode(te,{name:"lock-on"})],2)]),_:1},8,["content"])],!0)])])])):e.createCommentVNode("",!0)]))]}),_:3},8,["visible"]),e.createVNode(ae,{visible:A.value,"onUpdate:visible":d[21]||(d[21]=v=>A.value=v),header:"权限设置",width:"600px",footer:!1,placement:"center",class:"cd-permission-settings-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Nc,[e.createElementVNode("div",wc,[d[42]||(d[42]=e.createElementVNode("div",{class:"cd-permission-section-title"},"对外分享",-1)),e.createElementVNode("div",Ec,[d[41]||(d[41]=e.createElementVNode("div",{class:"cd-permission-item-label"},"允许内容被分享到组织外",-1)),e.createVNode(ye,{modelValue:S.value.allowExternalShare,"onUpdate:modelValue":d[14]||(d[14]=v=>S.value.allowExternalShare=v),disabled:C.value!=="manage"},null,8,["modelValue","disabled"])]),d[43]||(d[43]=e.createElementVNode("div",{class:"cd-permission-item-note"},' 仅"可管理权限"可以将内容分享到组织外 ',-1))]),e.createElementVNode("div",xc,[d[46]||(d[46]=e.createElementVNode("div",{class:"cd-permission-section-title"},"谁可以查看、添加、移除协作者",-1)),e.createVNode(Ee,{modelValue:S.value.collaboratorManagement,"onUpdate:modelValue":d[15]||(d[15]=v=>S.value.collaboratorManagement=v),disabled:C.value!=="manage"},{default:e.withCtx(()=>[e.createVNode(K,{value:"org-only"},{default:e.withCtx(()=>[...d[44]||(d[44]=[e.createTextVNode("仅组织内的用户可以查看、添加、移除协作者",-1)])]),_:1}),e.createVNode(K,{value:"all"},{default:e.withCtx(()=>[...d[45]||(d[45]=[e.createTextVNode("所有协作者都可以查看、添加、移除协作者",-1)])]),_:1})]),_:1},8,["modelValue","disabled"])]),e.createElementVNode("div",Bc,[d[50]||(d[50]=e.createElementVNode("div",{class:"cd-permission-section-title"},"内容操作权限",-1)),e.createElementVNode("div",$c,[d[47]||(d[47]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以复制内容",-1)),e.createVNode(_,{modelValue:S.value.copyPermission,"onUpdate:modelValue":d[16]||(d[16]=v=>S.value.copyPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Sc,[d[48]||(d[48]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以创建副本、打印和下载",-1)),e.createVNode(_,{modelValue:S.value.downloadPermission,"onUpdate:modelValue":d[17]||(d[17]=v=>S.value.downloadPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Dc,[d[49]||(d[49]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以评论",-1)),e.createVNode(_,{modelValue:S.value.commentPermission,"onUpdate:modelValue":d[18]||(d[18]=v=>S.value.commentPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",Mc,[d[52]||(d[52]=e.createElementVNode("div",{class:"cd-permission-section-title"},"更多高级设置",-1)),e.createElementVNode("div",zc,[d[51]||(d[51]=e.createElementVNode("div",{class:"cd-permission-item-label"},"谁可以查看访问者头像和点赞者头像",-1)),e.createVNode(_,{modelValue:S.value.viewerAvatarsPermission,"onUpdate:modelValue":d[19]||(d[19]=v=>S.value.viewerAvatarsPermission=v),options:h,disabled:C.value!=="manage",style:{width:"200px"}},null,8,["modelValue","disabled"])])]),e.createElementVNode("div",Tc,[e.createVNode(ie,{variant:"outline",onClick:d[20]||(d[20]=v=>A.value=!1)},{default:e.withCtx(()=>[...d[53]||(d[53]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",disabled:C.value!=="manage",onClick:ue},{default:e.withCtx(()=>[...d[54]||(d[54]=[e.createTextVNode("保存",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["visible"]),e.createVNode(ae,{visible:I.value,"onUpdate:visible":d[22]||(d[22]=v=>I.value=v),header:"协作者权限管理",width:"500px",footer:!1,placement:"center",class:"cd-collaborator-list-dialog"},{default:e.withCtx(()=>{var v,xe,me;return[e.createElementVNode("div",Fc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",Ac,[(v=t.owner)!=null&&v.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:t.owner.avatar,size:"small"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"small"},{default:e.withCtx(()=>{var he,Me;return[e.createTextVNode(e.toDisplayString(F(((he=t.owner)==null?void 0:he.displayName)||((Me=t.owner)==null?void 0:Me.name))),1)]}),_:1})),e.createElementVNode("span",Uc,e.toDisplayString(((xe=t.owner)==null?void 0:xe.displayName)||((me=t.owner)==null?void 0:me.name)||"所有者"),1)]),d[55]||(d[55]=e.createElementVNode("div",{class:"cd-collaborator-item-role"},"所有者",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.collaborators,he=>{var Me;return e.openBlock(),e.createElementBlock("div",{key:he.id,class:"cd-collaborator-list-item"},[e.createElementVNode("div",Lc,[he.avatar?(e.openBlock(),e.createBlock(ke,{key:0,image:he.avatar,size:"small"},null,8,["image"])):(e.openBlock(),e.createBlock(ke,{key:1,size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F(he.displayName||he.name)),1)]),_:2},1024)),e.createElementVNode("span",Rc,e.toDisplayString(he.displayName||he.name),1)]),e.createElementVNode("div",Ic,[C.value==="read"?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(((Me=i.find(Se=>Se.value===he.permission))==null?void 0:Me.label)||"可阅读"),1)):C.value==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[he.permission==="manage"?(e.openBlock(),e.createElementBlock("div",Oc," 可管理 ")):(e.openBlock(),e.createBlock(_,{key:1,value:he.permission,options:n.value,size:"small",onChange:Se=>_e(he.id,Se),style:{width:"100px"}},null,8,["value","options","onChange"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(_,{value:he.permission,options:n.value,size:"small",onChange:Se=>_e(he.id,Se),style:{width:"100px"}},null,8,["value","options","onChange"]),e.createVNode(ie,{variant:"text",size:"small",theme:"danger",onClick:Se=>Ne(he.id)},{icon:e.withCtx(()=>[e.createVNode(te,{name:"delete",size:"16px"})]),_:1},8,["onClick"])],64))])])}),128))])]}),_:1},8,["visible"]),e.createVNode(ae,{visible:le.value,"onUpdate:visible":d[23]||(d[23]=v=>le.value=v),header:"分享二维码",width:"400px",footer:!1,placement:"center",class:"cd-qrcode-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Hc,[J.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:J.value,alt:"分享二维码",class:"cd-qrcode-image"},null,8,Wc)):e.createCommentVNode("",!0),e.createElementVNode("div",jc,e.toDisplayString(r.value),1),d[56]||(d[56]=e.createElementVNode("div",{class:"cd-qrcode-tip"},"扫描二维码或复制链接分享",-1))])]),_:1},8,["visible"]),e.createVNode(ae,{visible:j.value,"onUpdate:visible":d[26]||(d[26]=v=>j.value=v),header:"设置链接密码",width:"450px",footer:!1,placement:"center",class:"cd-encrypt-dialog"},{default:e.withCtx(()=>[e.createElementVNode("div",Yc,[e.createElementVNode("div",Kc,[d[58]||(d[58]=e.createElementVNode("div",{class:"cd-encrypt-label"},"链接密码",-1)),e.createVNode(Y,{modelValue:k.value,"onUpdate:modelValue":d[24]||(d[24]=v=>k.value=v),placeholder:"6位数字和字母组合",maxlength:"6",disabled:C.value==="read",style:{width:"200px"}},{suffix:e.withCtx(()=>[e.createVNode(ie,{variant:"text",size:"small",disabled:C.value==="read",onClick:Z},{default:e.withCtx(()=>[...d[57]||(d[57]=[e.createTextVNode(" 重新生成 ",-1)])]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]),e.createElementVNode("div",Gc,[e.createVNode(te,{name:"info-circle",size:"14px",style:{color:"#999","margin-right":"4px"}}),d[59]||(d[59]=e.createTextVNode(" 密码仅对当前页面生效。组织外用户需要密码访问,组织内用户无需密码可直接访问 ",-1))]),e.createElementVNode("div",Xc,[e.createVNode(ie,{variant:"outline",disabled:C.value==="read",onClick:we},{icon:e.withCtx(()=>[e.createVNode(te,{name:"link"})]),default:e.withCtx(()=>[d[60]||(d[60]=e.createTextVNode(" 复制连接和密码 ",-1))]),_:1},8,["disabled"]),d[63]||(d[63]=e.createElementVNode("div",{style:{flex:"1"}},null,-1)),e.createVNode(ie,{variant:"outline",onClick:d[25]||(d[25]=v=>j.value=!1)},{default:e.withCtx(()=>[...d[61]||(d[61]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(ie,{theme:"primary",disabled:C.value==="read",onClick:M},{default:e.withCtx(()=>[...d[62]||(d[62]=[e.createTextVNode(" 确认 ",-1)])]),_:1},8,["disabled"])])])]),_:1},8,["visible"])],64)}}}),Qc=(t,U)=>{const o=t.__vccOpts||t;for(const[N,f]of U)o[N]=f;return o},wt=Qc(Jc,[["__scopeId","data-v-bd14b324"]]),Zc={class:"field-manage-header"},vc={class:"field-manage-content"},ed={class:"field-manage-toolbar"},Et=be(e.defineComponent({__name:"FieldManageDialog",props:{modelValue:{type:Boolean},fields:{}},emits:["update:modelValue","save","advanced-edit","advanced-design"],setup(t,{emit:U}){const o=t,N=U,f=e.computed({get:()=>o.modelValue,set:a=>N("update:modelValue",a)}),s=e.ref([]);e.watch(()=>o.fields,a=>{s.value=JSON.parse(JSON.stringify(a))},{immediate:!0,deep:!0});const r=[{label:"单行文本",value:"input"},{label:"多行文本",value:"textarea"},{label:"数字",value:"number"},{label:"下拉选择",value:"select"},{label:"日期",value:"date"},{label:"日期时间",value:"datetime"},{label:"开关",value:"switch"},{label:"评分",value:"rate"},{label:"图片上传",value:"uploadImg"}],p={border:!0,stripe:!0,round:!0,height:500,rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},cellConfig:{height:35},columnConfig:{resizable:!0}},b=[{field:"label",title:"字段名称",width:200,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入字段名称"}}},{field:"fieldName",title:"字段标识",width:180,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入字段标识"}}},{field:"type",title:"字段类型",width:150,slots:{edit:"fieldType_edit"}},{field:"required",title:"必填",width:80,align:"center",slots:{edit:"required_edit"}},{field:"placeholder",title:"提示文本",minWidth:150,editRender:{name:"input",props:{clearable:!0,placeholder:"请输入提示文本"}}},{field:"actions",title:"操作",width:150,fixed:"right",slots:{default:"actions"}}],E={trigger:"click",mode:"cell",showStatus:!0},u=()=>{const a=Math.max(...s.value.map(n=>n.id),0)+1,i={id:a,fieldName:`field_${a}`,label:`新字段${a}`,type:"input",required:!1,placeholder:"请输入",span:12,options:[]};s.value.push(i),re.MessagePlugin.success("字段已添加")},B=a=>{const i={__config__:{formId:a.id,visibility:["pc","app"],cdkey:a.type,noShow:!1,tipLabel:"",tableFixed:"none",dragDisabled:!1,className:[],label:a.label,trigger:a.type==="select"||a.type==="radio"||a.type==="checkbox"?"change":"blur",showLabel:!0,required:a.required,tableName:"",renderKey:Date.now(),layout:"colFormItem",tagIcon:`icon-ym icon-ym-generator-${a.type}`,tag:V(a.type),regList:[],tableAlign:"left",span:a.span||12},__vModel__:a.fieldName,placeholder:a.placeholder||`请输入${a.label}`,clearable:!0,disabled:!1,style:{width:"100%"}};switch(a.type){case"textarea":return{...i,rows:3,autosize:!0};case"number":return{...i,min:0,max:999999,step:1};case"select":case"radio":case"checkbox":return{...i,__config__:{...i.__config__,dataType:"static"},options:a.options||[],props:{label:"label",value:"value"},...a.type==="select"?{filterable:!1,multiple:!1}:{},...a.type==="checkbox"?{defaultValue:[]}:{}};case"date":return{...i,type:"date",format:"YYYY-MM-DD"};case"datetime":return{...i,type:"datetime",format:"YYYY-MM-DD HH:mm:ss"};case"switch":return{...i,__config__:{...i.__config__,defaultValue:!1}};case"rate":return{...i,__config__:{...i.__config__,defaultValue:0},max:5,allowHalf:!1,showText:!0,showScore:!1};case"uploadImg":return{...i,action:"/api/upload",listType:"image-card",multiple:!1,limit:1};default:return i}},V=a=>({input:"Input",textarea:"Textarea",number:"InputNumber",select:"Select",radio:"Radio",checkbox:"Checkbox",date:"DatePicker",datetime:"DatePicker",time:"TimePicker",switch:"Switch",rate:"Rate",slider:"Slider",uploadImg:"Upload",uploadFile:"Upload"})[a]||"Input",x=a=>{s.value.splice(a,1),re.MessagePlugin.success("字段已删除")},L=a=>{if(a>0){const i=s.value[a];s.value[a]=s.value[a-1],s.value[a-1]=i}},A=a=>{if(a<s.value.length-1){const i=s.value[a];s.value[a]=s.value[a+1],s.value[a+1]=i}},I=()=>{},le=()=>{const a=s.value.map(i=>i._originalConfig?{...i._originalConfig,__config__:{...i._originalConfig.__config__,label:i.label,required:i.required,span:i.span||12},__vModel__:i.fieldName,placeholder:i.placeholder||`请输入${i.label}`}:B(i));N("save",a),f.value=!1,re.MessagePlugin.success("字段配置已保存")},j=()=>{f.value=!1},k=()=>{N("advanced-edit")},S=()=>{N("advanced-design")};return(a,i)=>{const n=e.resolveComponent("t-button"),h=e.resolveComponent("t-space"),C=e.resolveComponent("t-select"),O=e.resolveComponent("t-switch"),J=e.resolveComponent("vxe-grid"),F=e.resolveComponent("t-dialog");return e.openBlock(),e.createBlock(F,{visible:f.value,"onUpdate:visible":i[0]||(i[0]=R=>f.value=R),header:"字段管理",width:"1200px",placement:"center",footer:!1,class:"field-manage-dialog",onClose:j},{header:e.withCtx(()=>[e.createElementVNode("div",Zc,[i[3]||(i[3]=e.createElementVNode("span",null,"字段管理",-1)),e.createVNode(n,{theme:"primary",variant:"outline",size:"small",onClick:k},{icon:e.withCtx(()=>[...i[1]||(i[1]=[e.createElementVNode("i",{class:"ri-code-box-line"},null,-1)])]),default:e.withCtx(()=>[i[2]||(i[2]=e.createTextVNode(" 高级编辑 ",-1))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",vc,[e.createElementVNode("div",ed,[e.createVNode(n,{theme:"primary",onClick:u,size:"small"},{icon:e.withCtx(()=>[...i[4]||(i[4]=[e.createElementVNode("i",{class:"ri-add-line"},null,-1)])]),default:e.withCtx(()=>[i[5]||(i[5]=e.createTextVNode(" 添加字段 ",-1))]),_:1}),e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(n,{onClick:S,theme:"warning",size:"small"},{icon:e.withCtx(()=>[...i[6]||(i[6]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[i[7]||(i[7]=e.createTextVNode(" 高级设计 ",-1))]),_:1}),e.createVNode(n,{onClick:le,size:"small"},{icon:e.withCtx(()=>[...i[8]||(i[8]=[e.createElementVNode("i",{class:"ri-save-line"},null,-1)])]),default:e.withCtx(()=>[i[9]||(i[9]=e.createTextVNode(" 保存 ",-1))]),_:1}),e.createVNode(n,{variant:"outline",onClick:j,size:"small"},{default:e.withCtx(()=>[...i[10]||(i[10]=[e.createTextVNode(" 取消 ",-1)])]),_:1})]),_:1})]),e.createVNode(J,e.mergeProps({ref:"gridRef"},p,{data:s.value,columns:b,"edit-config":E,onEditClosed:I}),{fieldType_edit:e.withCtx(({row:R})=>[e.createVNode(C,{modelValue:R.type,"onUpdate:modelValue":D=>R.type=D,options:r,size:"small",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue"])]),required_edit:e.withCtx(({row:R})=>[e.createVNode(O,{modelValue:R.required,"onUpdate:modelValue":D=>R.required=D,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),actions:e.withCtx(({rowIndex:R})=>[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(n,{variant:"text",size:"small",theme:"primary",onClick:D=>L(R),disabled:R===0},{icon:e.withCtx(()=>[...i[11]||(i[11]=[e.createElementVNode("i",{class:"ri-arrow-up-line"},null,-1)])]),_:1},8,["onClick","disabled"]),e.createVNode(n,{variant:"text",size:"small",theme:"primary",onClick:D=>A(R),disabled:R===s.value.length-1},{icon:e.withCtx(()=>[...i[12]||(i[12]=[e.createElementVNode("i",{class:"ri-arrow-down-line"},null,-1)])]),_:1},8,["onClick","disabled"]),e.createVNode(n,{variant:"text",size:"small",theme:"danger",onClick:D=>x(R)},{icon:e.withCtx(()=>[...i[13]||(i[13]=[e.createElementVNode("i",{class:"ri-delete-bin-line"},null,-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:1},16,["data"])])]),_:1},8,["visible"])}}}),[["__scopeId","data-v-6492ecb6"]]);function td(t){const{formModel:U,formConf:o,fields:N,formId:f="",formStatus:s="add",context:r={},onRefresh:p,onClose:b,onSave:E,httpClient:u}=t,B=new Map,V=(a,i)=>{!a||!Array.isArray(a)||a.forEach(n=>{var C;const h=n.__vModel__;if(h){const O=i?`${i}.${h}`:h;B.set(O,n)}(C=n.__config__)!=null&&C.children&&V(n.__config__.children,h)})};return V(N),{field:(a,i)=>{if(i!==void 0)return U[a]=i,i;const n=B.get(a);return{value:()=>U[a],empty:()=>{const h=U[a];return h==null||h===""||Array.isArray(h)&&h.length===0},lock:()=>{n&&(n.disabled=!0)},unlock:()=>{n&&(n.disabled=!1)},show:()=>{n!=null&&n.__config__&&(n.__config__.noShow=!1)},hide:()=>{n!=null&&n.__config__&&(n.__config__.noShow=!0)},required:h=>{n!=null&&n.__config__&&(n.__config__.required=h)}}},msg:{info:a=>re.MessagePlugin.info(a),success:a=>re.MessagePlugin.success(a),warning:a=>re.MessagePlugin.warning(a),error:a=>re.MessagePlugin.error(a),confirm:(a,i)=>new Promise(n=>{const h=re.DialogPlugin.confirm({header:(i==null?void 0:i.title)||"确认",body:a,confirmBtn:(i==null?void 0:i.yes)||"确定",cancelBtn:(i==null?void 0:i.no)||"取消",onConfirm:()=>{h.destroy(),n(!0)},onCancel:()=>{h.destroy(),n(!1)},onClose:()=>{h.destroy(),n(!1)}})})},form:{id:()=>f,title:()=>(o==null?void 0:o.title)||"",status:()=>s,refresh:()=>p==null?void 0:p(),lock:()=>{o&&(o.disabled=!0)},unlock:()=>{o&&(o.disabled=!1)},close:()=>b==null?void 0:b(),save:()=>E==null?void 0:E(),entry_row_count:a=>{const i=U[a];return Array.isArray(i)?i.length:0},entry_value:(a,i)=>{const n=i.split("."),h=n.length>1?n[0]:"",C=n.length>1?n[1]:i,O=h?U[h]:U;if(Array.isArray(O)&&O[a])return O[a][C]},entry_field_set:(a,i,n)=>{const h=i.split("."),C=h.length>1?h[0]:"",O=h.length>1?h[1]:i,J=C?U[C]:U;Array.isArray(J)&&J[a]&&(J[a][O]=n)},entry_add_row:a=>{U[a]||(U[a]=[]),U[a].push({})},entry_delete_row:(a,i)=>{Array.isArray(U[a])&&U[a].splice(i,1)},entry_clear:a=>{U[a]=[]}},context:r,date:{today:()=>{const a=new Date;return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`},now:()=>{const a=new Date;return`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")} ${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`},format:(a,i)=>{const n=new Date(a),h={YYYY:n.getFullYear(),MM:n.getMonth()+1,DD:n.getDate(),HH:n.getHours(),mm:n.getMinutes(),ss:n.getSeconds()};return i.replace(/YYYY|MM|DD|HH|mm|ss/g,C=>String(h[C]).padStart(2,"0"))}},util:{uuid:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const i=Math.random()*16|0;return(a==="x"?i:i&3|8).toString(16)}),format:(a,i)=>{const n=(i.split(".")[1]||"").length;return a.toFixed(n)},toChineseMoney:a=>{const i=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","拾","佰","仟","万","拾","佰","仟","亿"];if(a===0)return"零元整";const h=Math.floor(a),C=Math.round((a-h)*100);let O="";const J=h.toString();for(let F=0;F<J.length;F++){const R=parseInt(J[F]),D=n[J.length-1-F];R!==0?O+=i[R]+D:O.endsWith("零")||(O+="零")}if(O=O.replace(/零+$/,"")+"元",C===0)O+="整";else{const F=Math.floor(C/10),R=C%10;F>0&&(O+=i[F]+"角"),R>0&&(O+=i[R]+"分")}return O}},event:{cancelled:!1,cancel(){this.cancelled=!0}},db:{query:async(a,i)=>{if(!u)return console.warn("db.query: httpClient not configured"),[];try{return(await u.post("/api/script/query",{sql:a,params:i})).data}catch(n){return console.error("db.query error:",n),[]}},execute:async(a,i)=>{if(!u)return console.warn("db.execute: httpClient not configured"),{affected:0};try{return(await u.post("/api/script/execute",{sql:a,params:i})).data}catch(n){return console.error("db.execute error:",n),{affected:0}}}},api:{call:async(a,i)=>{if(!u)return console.warn("api.call: httpClient not configured"),null;try{return(await u.post(`/api/script/call/${a}`,i)).data}catch(n){return console.error("api.call error:",n),null}},get:async(a,i)=>{if(!u)return console.warn("api.get: httpClient not configured"),null;try{return(await u.get(a,{params:i})).data}catch(n){return console.error("api.get error:",n),null}},post:async(a,i)=>{if(!u)return console.warn("api.post: httpClient not configured"),null;try{return(await u.post(a,i)).data}catch(n){return console.error("api.post error:",n),null}}}}}async function ld(t,U,o){if(!t||!t.trim())return{success:!0};try{return await new Function("field","msg","form","context","date","util","event","db","api",...Object.keys(o||{}),`"use strict";
30
30
  return (async () => {
31
31
  ${t}
32
32
  })();`)(U.field,U.msg,U.form,U.context,U.date,U.util,U.event,U.db,U.api,...Object.values(o||{})),{success:!0}}catch(N){return console.error("Script execution error:",N),{success:!1,error:N.message}}}const ad={install(t){t.component("CdForm",Nt),t.component("CdFormCol",Le),t.component("FormRender",Ge),t.component("ShareDialog",wt),t.component("FieldManageDialog",Et)}};Ce.CdForm=Nt,Ce.CdFormCol=Le,Ce.FieldManageDialog=Et,Ce.FormRender=Ge,Ce.ShareDialog=wt,Ce.createScriptAPI=td,Ce.default=ad,Ce.executeScript=ld,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});