vue-quokit 0.1.0 → 0.1.2
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/index.cjs +9 -8
- package/dist/index.mjs +2485 -0
- package/package.json +14 -16
- package/dist/index.js +0 -2538
- package/dist/style.css +0 -1
- package/src/components/vue-quokit/index.d.ts +0 -193
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ce=require("exceljs");function P(d,o){if(!d)return 0;const a=String(d).replace(/\s+/g,"");if(!a)return 0;let u=0;function f(){return a[u]}function m(){return a[u++]}function b(t){if(f()!==t)throw new Error("公式解析错误: 期望 "+t+" at "+u);u++}function g(){const t=f();if(t==="("){m();const n=s();return b(")"),n}if(t==="-")return m(),-g();if(t==="+")return m(),g();if(t>="0"&&t<="9"||t==="."){let n="";for(;u<a.length&&(a[u]>="0"&&a[u]<="9"||a[u]===".");)n+=a[u++];return parseFloat(n)}if(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"){let n="";for(;u<a.length&&(a[u]>="a"&&a[u]<="z"||a[u]>="A"&&a[u]<="Z"||a[u]==="_"||a[u]>="0"&&a[u]<="9");)n+=a[u++];return Number(o[n]||0)}throw new Error('公式解析错误: 非法字符 "'+t+'" at '+u)}function w(){let t=g();for(;u<a.length&&(f()==="*"||f()==="/");){const n=m(),p=g();t=n==="*"?t*p:p===0?0:t/p}return t}function s(){let t=w();for(;u<a.length&&(f()==="+"||f()==="-");){const n=m(),p=w();t=n==="+"?t+p:t-p}return t}try{const t=s();return Math.round(t*100)/100}catch{return 0}}function L(d){let o="";for(;d>=0;)o=String.fromCharCode(65+d%26)+o,d=Math.floor(d/26)-1;return o}function J(d){return typeof d=="string"?parseFloat(d)/100:0}const j={style:"thin",color:{argb:"FFDCDFE6"}},ue={top:j,left:j,right:j,bottom:j},Q={style:"medium",color:{argb:"FF606266"}},me=11;function oe(d){if(d==null)return 0;if(typeof d=="number")return String(d).length;const o=String(d);let a=0;for(const u of o)u!==`
|
|
2
|
-
|
|
3
|
-
`).length,b=oe(f),w=f.length===0?1:Math.ceil(b/12);a=Math.max(a,m,w)}return Math.max(28,a*(o+4)+6)}function K(d,o,a,u,f){for(let m=o;m<=a;m++)for(let b=u;b<=f;b++){const g=d.getCell(m,b);g.border=ue}}function ee(d,o,a,u,f){for(let m=u;m<=f;m++)d.getCell(o,m).border={...d.getCell(o,m).border||{},top:Q},d.getCell(a,m).border={...d.getCell(a,m).border||{},bottom:Q};for(let m=o;m<=a;m++)d.getCell(m,u).border={...d.getCell(m,u).border||{},left:Q},d.getCell(m,f).border={...d.getCell(m,f).border||{},right:Q}}async function pe(d,o,a={}){var h;const u=a.layout||"auto-wrap",f=u==="auto-wrap",m=new ce.Workbook,b=m.addWorksheet("报价单"),g=d.columns.length,w=L(g-1);let s=1;const t=()=>(d.columns||[]).find(c=>c.editor==="AUTO_CALC"),n=c=>{const r=t(),v=(r==null?void 0:r.formula)||"quantity * unit_price";return P(v,c)};if(d.header_sections){for(const c of d.header_sections)if(c.type==="title"){b.mergeCells(`A${s}:${w}${s}`);const r=b.getCell(`A${s}`);r.value=c.text;const v=c.style||{},V=v.fontSize||18;if(r.font={size:V,bold:v.bold!==!1,italic:v.italic===!0,name:"微软雅黑"},v.color){const y=v.color.replace("#","").toUpperCase();r.font.color={argb:y.length===6?"FF"+y:y}}r.alignment={horizontal:v.align||"center",vertical:"middle"},b.getRow(s).height=V*2+10,s++}else if(c.type==="divider")s++;else if(c.type==="text"){b.mergeCells(`A${s}:${w}${s}`);const r=b.getCell(`A${s}`);r.value=c.text;const v=c.style||{},V=v.fontSize||13;if(r.font={size:V,bold:v.bold===!0,italic:v.italic===!0,name:"微软雅黑"},v.color){const y=v.color.replace("#","").toUpperCase();r.font.color={argb:y.length===6?"FF"+y:y}}r.alignment={horizontal:v.align||c.align||"left",vertical:"middle"},b.getRow(s).height=V*2+10,s++}else if(c.type==="row"&&c.cells){const r=c.cells.map(y=>{var E;return J((E=y.style)==null?void 0:E.width)||1/c.cells.length});let v=0;const V=r.map(y=>{const E=Math.round(v*g);v+=y;const x=Math.round(v*g)-1;return{start:E,end:Math.max(x,E)}});for(let y=0;y<c.cells.length;y++){const E=c.cells[y],x=V[y],U=`${L(x.start)}${s}`,T=`${L(x.end)}${s}`;U!==T&&b.mergeCells(`${U}:${T}`);const C=b.getCell(U);C.value=E.type==="field"?`${E.label}:${E.value??""}`:E.text;const N=E.style||{},D=N.fontSize||11;if(C.font={size:D,bold:N.bold===!0,italic:N.italic===!0,name:"微软雅黑"},N.color){const A=N.color.replace("#","").toUpperCase();C.font.color={argb:A.length===6?"FF"+A:A}}C.alignment={horizontal:N.align||"left",vertical:"middle"}}b.getRow(s).height=22,s++}}const p=s,l=b.getRow(s);l.values=d.columns.map(c=>c.title),l.font={bold:!0,name:"微软雅黑",size:12},l.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFE0E0E0"}},l.alignment={horizontal:"center",vertical:"middle",wrapText:f},l.height=f?32:28,s++;const $=d.group_rules,i=$==null?void 0:$.merge_field,S=d.columns;if(i){let c=0,r=0;for(;c<o.length;){const v=[];let V=c;for(;V<o.length&&o[V][i]===o[c][i];)v.push(o[V]),V++;const y=s;for(let U=0;U<v.length;U++){r++;const T=v[U],C=S.map(D=>D.editor==="AUTO_SEQ"?r:D.editor==="AUTO_CALC"?n(T):T[D.field]??""),N=b.getRow(s);N.values=C,N.font={name:"微软雅黑",size:11},N.alignment={horizontal:"center",vertical:"middle",wrapText:f,indent:1},N.height=f?Y(C,11):28,s++}const E=s-1;for(let U=0;U<S.length;U++){const T=S[U];if(T.merge_on_group!==!0)continue;let C=y;for(let N=1;N<v.length;N++)v[N][T.field]!==v[N-1][T.field]&&(y+N-1>C&&b.mergeCells(`${L(U)}${C}:${L(U)}${y+N-1}`),C=y+N);E>C&&b.mergeCells(`${L(U)}${C}:${L(U)}${E}`)}if($.show_detail_subtotal!==!1&&o[c][i]!==void 0&&o[c][i]!==null&&o[c][i]!==""){const U=v.reduce((A,F)=>A+Number(n(F)||0),0),T=L(Math.max(0,g-2));b.mergeCells(`A${s}:${T}${s}`);const C=b.getCell(`A${s}`);C.value=`小计(${o[c][i]})`,C.alignment={horizontal:"right",vertical:"middle"},C.font={bold:!0,italic:!0,color:{argb:"FF409EFF"},name:"微软雅黑",size:11};const N=b.getCell(`${w}${s}`);N.value=U,N.numFmt="#,##0.00",N.alignment={horizontal:"right",vertical:"middle"},N.font={bold:!0,italic:!0,color:{argb:"FF409EFF"},name:"微软雅黑",size:11};const D=b.getRow(s);D.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0F9FF"}},D.alignment={horizontal:"right",vertical:"middle",wrapText:!0},D.height=26,s++}c=V}}else for(let c=0;c<o.length;c++){const r=o[c],v=S.map(y=>y.editor==="AUTO_SEQ"?c+1:y.editor==="AUTO_CALC"?n(r):r[y.field]??""),V=b.getRow(s);V.values=v,V.font={name:"微软雅黑",size:11},V.alignment={horizontal:"center",vertical:"middle",wrapText:f,indent:1},V.height=f?Y(v,11):28,s++}const k=s-1;if(d.summary_fields){s+=1;const c=L(Math.max(0,g-2)),r=L(g-1),v=o.reduce((E,x)=>E+Number(n(x)||0),0),V={group_total:v,quantity_sum:o.reduce((E,x)=>E+Number(x.quantity||0),0)};for(const E of d.summary_fields)E.type==="MANUAL_INPUT"&&(V[E.field]=Number(E.default??0));V.grand_total=v+d.summary_fields.filter(E=>E.type==="MANUAL_INPUT").reduce((E,x)=>E+V[x.field],0);for(const E of d.summary_fields)E.type==="AUTO_CALC"&&(V[E.field]=P(E.formula||"group_total",V));for(const E of d.summary_fields){let x;E.type==="AUTO_CALC"?x=P(E.formula||"group_total",V):E.type==="PLAIN_TEXT"?x=E.text||"":x=Number(E.default??0);const U=((h=E.style)==null?void 0:h.fontSize)||me,T=b.getCell(`${c}${s}`),C=b.getCell(`${r}${s}`);T.value=E.label,T.alignment={horizontal:"right",vertical:"middle"};const N=E.style||{},D=()=>{const A={name:"微软雅黑",size:U,bold:!!N.bold,italic:!!N.italic};if(N.color){const F=N.color.replace("#","").toUpperCase();A.color={argb:F.length===6?"FF"+F:F}}return A};T.font=D(),C.value=x,C.alignment={horizontal:"right",vertical:"middle"},C.font=D(),typeof x=="number"&&(C.numFmt="#,##0.00"),b.getRow(s).height=Math.max(22,U*2+6),s++}const y=s-1;K(b,p,y,1,g),ee(b,p,y,1,g)}else K(b,p,k,1,g),ee(b,p,k,1,g);if(d.footer_sections){s+=1;for(const c of d.footer_sections)if(c.type==="divider")s++;else if(c.type==="text"){b.mergeCells(`A${s}:${w}${s}`);const r=b.getCell(`A${s}`);r.value=c.text;const v=c.style||{},V=v.fontSize||13;if(r.font={size:V,bold:v.bold===!0,italic:v.italic===!0,name:"微软雅黑"},v.color){const y=v.color.replace("#","").toUpperCase();r.font.color={argb:y.length===6?"FF"+y:y}}r.alignment={horizontal:v.align||c.align||"left",vertical:"middle"},b.getRow(s).height=V*2+10,s++}else if(c.type==="row"&&c.cells){const r=c.cells.map(y=>{var E;return J((E=y.style)==null?void 0:E.width)||1/c.cells.length});let v=0;const V=r.map(y=>{const E=Math.round(v*g);v+=y;const x=Math.round(v*g)-1;return{start:E,end:Math.max(x,E)}});for(let y=0;y<c.cells.length;y++){const E=c.cells[y],x=V[y],U=`${L(x.start)}${s}`,T=`${L(x.end)}${s}`;U!==T&&b.mergeCells(`${U}:${T}`);const C=b.getCell(U);C.value=E.text;const N=E.style||{};C.alignment={horizontal:N.align||"left",vertical:"middle"};const D={name:"微软雅黑",size:N.fontSize||11,bold:N.bold===!0,italic:N.italic===!0};if(N.color){const A=N.color.replace("#","").toUpperCase();D.color={argb:A.length===6?"FF"+A:A}}C.font=D}b.getRow(s).height=22,s++}}const _=50,B=6;for(let c=0;c<g;c++){const r=d.columns[c],v=c+1;if(u==="auto-wrap")b.getColumn(v).width=r.width?Math.max(r.width/7,8):12;else{let V=0;for(let x=1;x<s;x++)V=Math.max(V,oe(b.getCell(x,v).value));const y=r.width?Math.max(r.width/7,10):12,E=Math.min(Math.max(V+2,B),_);b.getColumn(v).width=Math.max(E,y)}}const z=await m.xlsx.writeBuffer();return new Blob([z],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}const O=(d,o)=>{const a=d.__vccOpts||d;for(const[u,f]of o)a[u]=f;return a},fe={class:"quote-sheet"},ve={key:1,class:"q-divider"},be={key:3,class:"q-row"},ye={class:"q-label"},Ve={class:"q-value"},he={key:0,class:"q-table-wrap"},Ee={class:"q-table"},_e={key:0,class:"subtotal-row"},ge=["colspan"],ke={class:"subtotal-value"},Ne={key:1},we=["rowspan"],$e={key:0,class:"empty-row"},xe=["colspan"],Ce={key:1,class:"q-summary"},Be={class:"q-summary-label"},Ue={key:0,class:"q-divider"},Se={key:2,class:"q-row"},Te={__name:"QuokitSheet",props:{tpl:{type:Object,required:!0},data:{type:Array,default:()=>[]},placeholder:{type:String,default:"-"}},setup(d,{expose:o}){function a(h){const c=(h.header_sections||[]).flatMap(r=>r.cells||[]).find(r=>r.type==="field"&&r.value);return(c==null?void 0:c.value)||"untitled"}const u=d,f=e.computed(()=>u.data);function m(h){const c=h.style||{},r={width:c.width||"auto"};r.textAlign=c.align||"left",c.color&&(r.color=c.color),c.fontSize&&(r.fontSize=c.fontSize+"px"),c.bold&&(r.fontWeight="bold"),c.italic&&(r.fontStyle="italic");const v=c.border;if(v)for(const V of["top","bottom","left","right"]){const y=v[V];y&&y.style&&y.width>0&&(r["border-"+V]=`${y.width}px ${y.style} ${y.color||"#dcdfe6"}`)}return r}function b(h){return"¥ "+(Number(h)||0).toFixed(2)}const g=e.computed(()=>(u.tpl.columns||[]).find(h=>h.editor==="AUTO_CALC"));function w(h){var r;const c=((r=g.value)==null?void 0:r.formula)||"quantity * unit_price";return P(c,h)}const s=e.computed(()=>f.value.reduce((h,c)=>h+Number(w(c)||0),0)),t=e.computed(()=>f.value.reduce((h,c)=>h+Number(c.quantity||0),0));function n(){let h=s.value;if(u.tpl.summary_fields)for(const c of u.tpl.summary_fields)c.type==="MANUAL_INPUT"&&(h+=$(c));return h}function p(h){const c={},r=h.style||{};return r.color&&(c.color=r.color),r.fontSize&&(c.fontSize=r.fontSize+"px"),r.bold&&(c.fontWeight="bold"),r.italic&&(c.fontStyle="italic"),c}function l(h){const c={},r=h.style||{};return r.color&&(c.color=r.color),r.fontSize&&(c.fontSize=r.fontSize+"px"),r.bold&&(c.fontWeight="bold"),r.italic&&(c.fontStyle="italic"),r.align?c.textAlign=r.align:h.align&&(c.textAlign=h.align),c}function $(h){return Number(h.default??0)}function i(){const h={group_total:s.value,quantity_sum:t.value};if(u.tpl.summary_fields){for(const c of u.tpl.summary_fields)c.type==="MANUAL_INPUT"&&(h[c.field]=$(c));for(const c of u.tpl.summary_fields)c.type==="AUTO_CALC"&&(h[c.field]=P(c.formula||"group_total",h))}return h.grand_total=n(),h}function S(h){if(h.type==="PLAIN_TEXT")return h.text||"";if(h.type==="AUTO_CALC"){const c=i();return c[h.field]??P(h.formula||"group_total",c)}return $(h)}const k=e.computed(()=>{var y;const h=f.value.map(E=>({...E})),c=(y=u.tpl)==null?void 0:y.group_rules;if(!(c!=null&&c.merge_field))return h;const r=[],v=c.merge_field;let V=0;for(;V<h.length;){const E=[h[V]];let x=V+1;for(;x<h.length&&h[x][v]===h[V][v];)E.push(h[x]),x++;if(r.push(...E),(c.show_detail_subtotal??!0)&&h[V][v]!==void 0&&h[V][v]!==null&&h[V][v]!==""){const T=E.reduce((C,N)=>C+Number(w(N)||0),0);r.push({__is_subtotal:!0,__group_key:h[V][v],__group_sum:T})}V=x}return r});function _(h,c){var C,N,D,A;const r=k.value,v=r[h];if(!v||v.__is_subtotal)return 1;const V=(C=u.tpl)==null?void 0:C.group_rules,y=V==null?void 0:V.merge_field,E=u.tpl.columns.find(F=>F.field===c),x=y&&c===y,U=(E==null?void 0:E.merge_on_group)===!0;if(!x&&!U)return 1;const T=(()=>{var M,X;if(!y)return r.length;const F=v[y];let R=h+1;for(;R<r.length&&((M=r[R])==null?void 0:M[y])===F&&!((X=r[R])!=null&&X.__is_subtotal);)R++;return R})();if(x)return h>0&&((N=r[h-1])==null?void 0:N[y])===v[y]&&!((D=r[h-1])!=null&&D.__is_subtotal)?0:T-h;if(U){const F=v[c];if(h>0){const M=r[h-1];if((!y||(M==null?void 0:M[y])===v[y]&&!(M!=null&&M.__is_subtotal))&&(M==null?void 0:M[c])===F)return 0}let R=1;for(let M=h+1;M<T&&((A=r[M])==null?void 0:A[c])===F;M++)R++;return R}return 1}async function B(h=!1){const c=await pe(u.tpl,u.data,h?{layout:"auto-width"}:void 0),r=URL.createObjectURL(c),v=document.createElement("a");v.href=r,v.download=`报价单_${a(u.tpl)}_${new Date().toISOString().slice(0,10)}.xlsx`,v.click(),URL.revokeObjectURL(r)}function z(h=!1){const c=document.querySelector(".quote-sheet");if(!c)return;const r=h!==!0,v=window.open("","_blank",r?"width=1200,height=900":"width=900,height=1200");if(!v)return;const V=Array.from(document.styleSheets).map(E=>{try{return Array.from(E.cssRules).map(x=>x.cssText).join(`
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".qukt-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}.qukt-tip{color:#909399;font-size:13px;margin-right:auto}.qukt-tip code{background:#f5f7fa;padding:1px 6px;border-radius:3px}.qukt-btn-group-inline{display:flex;gap:6px}.qukt-btn{padding:6px 14px;border:1px solid #dcdfe6;border-radius:4px;background:#fff;cursor:pointer;font-size:13px}.qukt-btn:hover{border-color:#409eff;color:#409eff}.qukt-btn-primary{background:#409eff;border-color:#409eff;color:#fff}.qukt-btn-primary:hover{background:#66b1ff;color:#fff}.qukt-btn-ghost{background:transparent;border:1px dashed #dcdfe6;color:#909399;margin-top:8px}.qukt-mini-btn{background:transparent;border:1px solid #dcdfe6;border-radius:3px;padding:2px 8px;cursor:pointer;font-size:12px;margin-right:3px}.qukt-mini-btn:hover{border-color:#409eff;color:#409eff}.qukt-mini-btn:disabled{opacity:.3;cursor:not-allowed}.qukt-mini-btn.danger:hover{border-color:#f56c6c;color:#f56c6c}.qukt-muted{color:#c0c4cc;font-size:12px}.qukt-cell-input{flex:1;width:100%;border:1px solid #dcdfe6;border-radius:3px;padding:4px 8px;font-size:13px;outline:none;min-width:0;box-sizing:border-box}.qukt-cell-input:focus{border-color:#409eff}.qukt-cell-input.small{flex:0 0 160px;max-width:100%}.qukt-cell-input.tiny{width:56px;height:22px;font-size:11px;padding:0 4px;flex:none}.qukt-color-input{width:24px;height:22px;border:1px solid #dcdfe6;border-radius:3px;padding:0;cursor:pointer;background:#fff}.qukt-chk-label{font-size:12px;color:#606266;display:inline-flex;align-items:center;gap:3px;flex-shrink:0}.qukt-designer{padding:0;display:flex;flex-direction:column;height:100%;min-height:0}.qukt-tabs{display:flex;gap:0;border-bottom:2px solid #ebeef5;margin-bottom:16px;flex-shrink:0}.qukt-tab{padding:10px 20px;cursor:pointer;font-size:14px;color:#909399;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .2s}.qukt-tab:hover{color:#409eff}.qukt-tab.active{color:#409eff;border-bottom-color:#409eff;font-weight:600}.qukt-tab-content{padding:10px 0;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.qukt-tab-content>*{flex:1;min-height:0;display:flex;flex-direction:column}.qukt-tab-content-preview{overflow-y:auto}.qukt-tab-content-preview>*{flex:none;min-height:0}.qukt-page{padding:20px;background:#fff;border-radius:8px;height:100%;overflow-y:auto}.qukt-empty-tip{text-align:center;padding:60px 20px;background:#fafbfc;border:2px dashed #dcdfe6;border-radius:8px}.qukt-empty-icon{font-size:48px;margin-bottom:12px}.qukt-empty-text{color:#909399;font-size:14px;margin-bottom:16px}.qukt-data-table{border:1px solid #ebeef5;border-radius:6px;overflow:hidden;margin-bottom:16px}.qukt-main-table{width:100%;border-collapse:collapse;font-size:13px}.qukt-main-table th{background:#f5f7fa;padding:10px 12px;text-align:left;font-weight:600;color:#303133;border:1px solid #ebeef5}.qukt-main-table td{padding:10px 12px;border:1px solid #ebeef5;color:#606266}.qukt-main-table tbody tr{cursor:pointer;transition:background .15s}.qukt-main-table tbody tr:hover{background:#f5f7fa}.qukt-subtotal{color:#67c23a;font-weight:500;text-align:right;display:block}.qukt-op-cell{white-space:nowrap}.qukt-row-btn{background:none;border:none;cursor:pointer;font-size:13px;color:#409eff;margin-right:10px;padding:2px 4px;border-radius:3px}.qukt-row-btn:hover{text-decoration:underline}.qukt-row-btn.danger{color:#f56c6c}.qukt-de-mask,.qukt-gr-mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.qukt-de-dialog{background:#fff;border-radius:10px;width:420px;max-width:92vw;max-height:86vh;display:flex;flex-direction:column;box-shadow:0 10px 40px #00000040}.qukt-de-header{padding:16px 20px;border-bottom:1px solid #ebeef5;display:flex;justify-content:space-between;align-items:center;font-size:15px;font-weight:600;color:#303133;flex-shrink:0}.qukt-de-close{border:none;background:transparent;cursor:pointer;font-size:16px;color:#909399}.qukt-de-close:hover{color:#f56c6c}.qukt-de-content{padding:16px 20px;flex:1;overflow-y:auto}.qukt-de-footer{padding:12px 20px;border-top:1px solid #ebeef5;text-align:right;flex-shrink:0}.qukt-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.qukt-form-cell.full{grid-column:1 / -1}.qukt-form-cell-label{display:block;font-size:13px;color:#606266;margin-bottom:6px}.qukt-gr-dialog{width:380px;background:#fff;border-radius:8px;box-shadow:0 8px 28px #0003}.qukt-gr-header{padding:12px 16px;border-bottom:1px solid #ebeef5;display:flex;justify-content:space-between;align-items:center;font-size:15px;font-weight:600;color:#303133}.qukt-gr-close{border:none;background:transparent;cursor:pointer;font-size:16px;color:#909399}.qukt-gr-close:hover{color:#f56c6c}.qukt-gr-content{padding:14px 16px;max-height:70vh;overflow-y:auto}.qukt-gr-footer{padding:10px 16px;border-top:1px solid #ebeef5;text-align:right}.qukt-gr-tips{background:#ecf5ff;border:1px solid #d9ecff;border-radius:6px;padding:8px 10px;margin-bottom:14px}.qukt-gr-tips p{font-size:12px;color:#606266;margin:4px 0;line-height:1.6}.qukt-gr-tips code{background:#fff;padding:1px 6px;border-radius:3px;font-size:11px}.qukt-gr-form{display:flex;flex-direction:column;gap:10px}.qukt-gr-form-row{display:flex;align-items:center;gap:10px}.qukt-gr-form-label{width:80px;text-align:right;font-size:12px;color:#606266;flex-shrink:0}.qukt-table-wrap{width:100%;overflow:auto;flex:1;min-height:0}.qukt-table-wrap.is-narrow .qukt-design-table{min-width:900px}.qukt-design-table{width:100%;border-collapse:collapse;font-size:13px}.qukt-design-table th,.qukt-design-table td{border:1px solid #ebeef5;padding:6px 8px;text-align:left}.qukt-design-table th{background:#f5f7fa;font-weight:600;color:#303133}.qukt-design-table td.idx{text-align:center;color:#909399;background:#fafbfc;width:50px}.qukt-design-table tbody tr:hover{background:#fafbfc}.qukt-col-merge label{display:flex;align-items:center;gap:4px;font-size:12px;cursor:pointer}.qukt-quote-sheet{background:#fff;padding:32px 40px;border-radius:4px;box-shadow:0 2px 12px #0000000f}.qukt-q-title{margin:0 0 12px;font-size:18px;font-weight:700;color:#303133;text-align:center}.qukt-q-divider{border-top:1px solid #dcdfe6;margin:10px 0}.qukt-q-text{margin:4px 0;font-size:13px;color:#606266}.qukt-q-row{display:flex;margin-bottom:4px}.qukt-q-cell{padding:8px 12px;font-size:13px;background:#fff;box-sizing:border-box}.qukt-q-label{color:#909399}.qukt-q-value{color:#303133;font-weight:500}.qukt-q-table-wrap{margin-top:14px}.qukt-q-table{width:100%;border-collapse:collapse;font-size:13px}.qukt-q-table th{background:#f5f7fa;padding:10px 12px;border:1px solid #dcdfe6;text-align:center;font-weight:600;color:#303133}.qukt-q-table td{padding:9px 12px;border:1px solid #dcdfe6;color:#606266;text-align:center;vertical-align:middle}.qukt-q-table td.merged-cell{background:#fafbfc;font-weight:500}.qukt-q-table tr.subtotal-row td.subtotal-label{background:#f0f9ff;color:#409eff;font-weight:600;text-align:right;padding-right:16px;font-style:italic}.qukt-q-table tr.subtotal-row td.subtotal-value{background:#f0f9ff;color:#409eff;font-weight:600;text-align:right}.qukt-q-empty{text-align:center;padding:30px;color:#c0c4cc;font-size:14px}.qukt-q-summary{margin-top:12px;margin-left:auto;width:320px}.qukt-q-summary-row{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px dashed #ebeef5;font-size:13px}.qukt-q-summary-label{color:#606266}.qukt-q-summary-value{font-variant-numeric:tabular-nums}.qukt-help-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000073;z-index:9999;display:flex;align-items:center;justify-content:center}.qukt-help-dialog{background:#fff;border-radius:10px;width:780px;max-width:92vw;max-height:86vh;display:flex;flex-direction:column;box-shadow:0 10px 40px #00000040}.qukt-help-header{padding:16px 24px;border-bottom:1px solid #ebeef5;display:flex;justify-content:space-between;align-items:center}.qukt-help-header h3{margin:0;font-size:17px;color:#303133}.qukt-close-btn{background:transparent;border:none;font-size:20px;cursor:pointer;color:#909399;padding:4px 10px;border-radius:4px}.qukt-close-btn:hover{background:#f5f7fa;color:#303133}.qukt-help-body{padding:20px 28px 28px;overflow-y:auto;font-size:13px;color:#606266;line-height:1.7}.qukt-help-section{margin-bottom:24px}.qukt-help-section h4{font-size:15px;color:#409eff;margin:0 0 10px;padding-bottom:6px;border-bottom:1px dashed #dcdfe6}.qukt-help-section p{margin:6px 0}.qukt-help-section ul,.qukt-help-section ol{margin:6px 0 6px 22px;padding:0}.qukt-help-section li{margin:3px 0}.qukt-help-section code{background:#f0f2f5;color:#d63384;padding:1px 6px;border-radius:3px;font-size:12px;font-family:Consolas,monospace}.qukt-help-section pre.code{background:#f5f7fa;border:1px solid #ebeef5;border-radius:5px;padding:10px 14px;overflow-x:auto;font-size:12px;font-family:Consolas,Monaco,monospace;line-height:1.55;margin:8px 0;color:#495057}.qukt-help-table{width:100%;border-collapse:collapse;margin:10px 0;font-size:12.5px}.qukt-help-table th,.qukt-help-table td{border:1px solid #ebeef5;padding:7px 10px;text-align:left}.qukt-help-table th{background:#f5f7fa;font-weight:600;color:#303133}.qukt-help-table td:first-child{white-space:nowrap;font-weight:500}.qukt-tip-box{background:#ecf5ff;border-left:3px solid #409eff;padding:8px 14px;border-radius:3px;color:#606266;margin:10px 0;font-size:12.5px}.qukt-tip-box.final-tip{background:#f0f9eb;border-left-color:#67c23a;font-size:13px;padding:14px 18px}.qukt-steps{padding-left:22px}.qukt-steps li{margin-bottom:4px}.qukt-two-col{display:flex;gap:16px;flex:1;min-height:0;overflow:hidden}.qukt-col-left{flex:1;min-width:0;overflow-y:auto;padding-right:4px}.qukt-col-right{width:360px;flex-shrink:0;overflow-y:auto;max-height:100%}.qukt-two-col.is-narrow{flex-direction:column;overflow-y:auto}.qukt-two-col.is-narrow .qukt-col-right{width:100%;flex-shrink:0;overflow:visible}.qukt-two-col.is-narrow .qukt-col-left{overflow:visible}.qukt-two-col.is-narrow .qukt-preview-box{position:static}.qukt-sec-block{border:1px solid #ebeef5;border-radius:6px;padding:12px;margin-bottom:10px;background:#fafbfc}.qukt-sec-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.qukt-sec-type{font-size:13px;font-weight:600;color:#409eff;background:#ecf5ff;padding:2px 8px;border-radius:3px}.qukt-sec-actions{display:flex;gap:2px}.qukt-sec-row{display:flex;align-items:center;gap:6px;margin-bottom:6px;flex-wrap:wrap}.qukt-sec-row label,.qukt-sec-row .label{font-size:12px;color:#606266;min-width:54px;flex-shrink:0}.qukt-inline-group{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.qukt-cells-list{display:flex;flex-direction:column;gap:8px}.qukt-cell-block{border:1px dashed #dcdfe6;border-radius:4px;padding:8px;background:#fff}.qukt-cell-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:12px;color:#909399}.qukt-border-config{flex-wrap:wrap}.qukt-border-config>.label{width:100%;margin-bottom:4px}.qukt-border-group{display:flex;flex-wrap:wrap;gap:4px;flex:1}.qukt-border-item{display:flex;align-items:center;gap:2px;padding:2px 4px;background:#f8f9fb;border-radius:3px;font-size:11px;color:#606266}.qukt-border-item>span{min-width:12px;text-align:center}.qukt-border-config .qukt-mini-btn{margin-left:4px}.qukt-preview-box{border:1px solid #dcdfe6;border-radius:6px;overflow:hidden;background:#fff;position:sticky;top:20px}.qukt-preview-label{padding:8px 12px;background:#f5f7fa;font-size:13px;font-weight:600;color:#606266;border-bottom:1px solid #ebeef5}.qukt-preview-inner{padding:14px}.qukt-p-title{margin:6px 0 10px}.qukt-p-divider{height:1px;background:#dcdfe6;margin:8px 0}.qukt-p-text{margin:4px 0;font-size:13px;color:#606266}.qukt-p-row{display:flex;margin-bottom:6px}.qukt-p-cell{padding:6px 10px;font-size:12px;background:#fff}.qukt-p-label{color:#909399}.qukt-p-value{color:#409eff;font-weight:500}.qukt-empty-hint{text-align:center;padding:20px;color:#c0c4cc;font-size:13px}.qukt-preview-title{font-size:13px;font-weight:600;color:#606266;margin:0 0 10px}.qukt-summary-preview{border:1px solid #ebeef5;border-radius:6px;padding:12px;background:#fff}.qukt-sp-row{display:flex;justify-content:space-between;align-items:center;padding:6px 0;font-size:13px}.qukt-sp-label{color:#606266}.qukt-sp-value{font-weight:500;font-size:12px}.qukt-preview-help{margin-top:12px;padding:10px 12px;background:#f4f4f5;border-radius:6px;font-size:12px;color:#909399;line-height:1.8}.qukt-preview-help b{color:#606266}.qukt-preview-help code{background:#e9e9eb;padding:1px 5px;border-radius:3px;color:#606266;font-family:monospace}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
(function(z,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("exceljs")):typeof define=="function"&&define.amd?define(["exports","vue","exceljs"],e):(z=typeof globalThis<"u"?globalThis:z||self,e(z.VueQuokit={},z.Vue,z.ExcelJS))})(this,function(z,e,ce){"use strict";function P(i,o){if(!i)return 0;const l=String(i).replace(/\s+/g,"");if(!l)return 0;let r=0;function u(){return l[r]}function p(){return l[r++]}function f(t){if(u()!==t)throw new Error("公式解析错误: 期望 "+t+" at "+r);r++}function N(){const t=u();if(t==="("){p();const s=a();return f(")"),s}if(t==="-")return p(),-N();if(t==="+")return p(),N();if(t>="0"&&t<="9"||t==="."){let s="";for(;r<l.length&&(l[r]>="0"&&l[r]<="9"||l[r]===".");)s+=l[r++];return parseFloat(s)}if(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"){let s="";for(;r<l.length&&(l[r]>="a"&&l[r]<="z"||l[r]>="A"&&l[r]<="Z"||l[r]==="_"||l[r]>="0"&&l[r]<="9");)s+=l[r++];return Number(o[s]||0)}throw new Error('公式解析错误: 非法字符 "'+t+'" at '+r)}function $(){let t=N();for(;r<l.length&&(u()==="*"||u()==="/");){const s=p(),g=N();t=s==="*"?t*g:g===0?0:t/g}return t}function a(){let t=$();for(;r<l.length&&(u()==="+"||u()==="-");){const s=p(),g=$();t=s==="+"?t+g:t-g}return t}try{const t=a();return Math.round(t*100)/100}catch{return 0}}function F(i){let o="";for(;i>=0;)o=String.fromCharCode(65+i%26)+o,i=Math.floor(i/26)-1;return o}function Y(i){return typeof i=="string"?parseFloat(i)/100:0}const Q={style:"thin",color:{argb:"FFDCDFE6"}},me={top:Q,left:Q,right:Q,bottom:Q},W={style:"medium",color:{argb:"FF606266"}},pe=11;function K(i){if(i==null)return 0;if(typeof i=="number")return String(i).length;const o=String(i);let l=0;for(const r of o)r!==`
|
|
3
|
+
`&&(/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef\u2e80-\u2fdf\u31c0-\u31ef]/.test(r)?l+=2:l+=1);return l}function v(i,o=11){let l=1;for(const r of i){const u=String(r??""),p=u.split(`
|
|
4
|
+
`).length,f=K(u),$=u.length===0?1:Math.ceil(f/12);l=Math.max(l,p,$)}return Math.max(28,l*(o+4)+6)}function ee(i,o,l,r,u){for(let p=o;p<=l;p++)for(let f=r;f<=u;f++){const N=i.getCell(p,f);N.border=me}}function te(i,o,l,r,u){for(let p=r;p<=u;p++)i.getCell(o,p).border={...i.getCell(o,p).border||{},top:W},i.getCell(l,p).border={...i.getCell(l,p).border||{},bottom:W};for(let p=o;p<=l;p++)i.getCell(p,r).border={...i.getCell(p,r).border||{},left:W},i.getCell(p,u).border={...i.getCell(p,u).border||{},right:W}}async function ue(i,o,l={}){var V;const r=l.layout||"auto-wrap",u=r==="auto-wrap",p=new ce.Workbook,f=p.addWorksheet("报价单"),N=i.columns.length,$=F(N-1);let a=1;const t=()=>(i.columns||[]).find(c=>c.editor==="AUTO_CALC"),s=c=>{const d=t(),k=(d==null?void 0:d.formula)||"quantity * unit_price";return P(k,c)};if(i.header_sections){for(const c of i.header_sections)if(c.type==="title"){f.mergeCells(`A${a}:${$}${a}`);const d=f.getCell(`A${a}`);d.value=c.text;const k=c.style||{},y=k.fontSize||18;if(d.font={size:y,bold:k.bold!==!1,italic:k.italic===!0,name:"微软雅黑"},k.color){const b=k.color.replace("#","").toUpperCase();d.font.color={argb:b.length===6?"FF"+b:b}}d.alignment={horizontal:k.align||"center",vertical:"middle"},f.getRow(a).height=y*2+10,a++}else if(c.type==="divider")a++;else if(c.type==="text"){f.mergeCells(`A${a}:${$}${a}`);const d=f.getCell(`A${a}`);d.value=c.text;const k=c.style||{},y=k.fontSize||13;if(d.font={size:y,bold:k.bold===!0,italic:k.italic===!0,name:"微软雅黑"},k.color){const b=k.color.replace("#","").toUpperCase();d.font.color={argb:b.length===6?"FF"+b:b}}d.alignment={horizontal:k.align||c.align||"left",vertical:"middle"},f.getRow(a).height=y*2+10,a++}else if(c.type==="row"&&c.cells){const d=c.cells.map(b=>{var E;return Y((E=b.style)==null?void 0:E.width)||1/c.cells.length});let k=0;const y=d.map(b=>{const E=Math.round(k*N);k+=b;const w=Math.round(k*N)-1;return{start:E,end:Math.max(w,E)}});for(let b=0;b<c.cells.length;b++){const E=c.cells[b],w=y[b],B=`${F(w.start)}${a}`,T=`${F(w.end)}${a}`;B!==T&&f.mergeCells(`${B}:${T}`);const x=f.getCell(B);x.value=E.type==="field"?`${E.label}:${E.value??""}`:E.text;const _=E.style||{},D=_.fontSize||11;if(x.font={size:D,bold:_.bold===!0,italic:_.italic===!0,name:"微软雅黑"},_.color){const A=_.color.replace("#","").toUpperCase();x.font.color={argb:A.length===6?"FF"+A:A}}x.alignment={horizontal:_.align||"left",vertical:"middle"}}f.getRow(a).height=22,a++}}const g=a,n=f.getRow(a);n.values=i.columns.map(c=>c.title),n.font={bold:!0,name:"微软雅黑",size:12},n.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFE0E0E0"}},n.alignment={horizontal:"center",vertical:"middle",wrapText:u},n.height=u?32:28,a++;const S=i.group_rules,m=S==null?void 0:S.merge_field,U=i.columns;if(m){let c=0,d=0;for(;c<o.length;){const k=[];let y=c;for(;y<o.length&&o[y][m]===o[c][m];)k.push(o[y]),y++;const b=a;for(let B=0;B<k.length;B++){d++;const T=k[B],x=U.map(D=>D.editor==="AUTO_SEQ"?d:D.editor==="AUTO_CALC"?s(T):T[D.field]??""),_=f.getRow(a);_.values=x,_.font={name:"微软雅黑",size:11},_.alignment={horizontal:"center",vertical:"middle",wrapText:u,indent:1},_.height=u?v(x,11):28,a++}const E=a-1;for(let B=0;B<U.length;B++){const T=U[B];if(T.merge_on_group!==!0)continue;let x=b;for(let _=1;_<k.length;_++)k[_][T.field]!==k[_-1][T.field]&&(b+_-1>x&&f.mergeCells(`${F(B)}${x}:${F(B)}${b+_-1}`),x=b+_);E>x&&f.mergeCells(`${F(B)}${x}:${F(B)}${E}`)}if(S.show_detail_subtotal!==!1&&o[c][m]!==void 0&&o[c][m]!==null&&o[c][m]!==""){const B=k.reduce((A,O)=>A+Number(s(O)||0),0),T=F(Math.max(0,N-2));f.mergeCells(`A${a}:${T}${a}`);const x=f.getCell(`A${a}`);x.value=`小计(${o[c][m]})`,x.alignment={horizontal:"right",vertical:"middle"},x.font={bold:!0,italic:!0,color:{argb:"FF409EFF"},name:"微软雅黑",size:11};const _=f.getCell(`${$}${a}`);_.value=B,_.numFmt="#,##0.00",_.alignment={horizontal:"right",vertical:"middle"},_.font={bold:!0,italic:!0,color:{argb:"FF409EFF"},name:"微软雅黑",size:11};const D=f.getRow(a);D.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0F9FF"}},D.alignment={horizontal:"right",vertical:"middle",wrapText:!0},D.height=26,a++}c=y}}else for(let c=0;c<o.length;c++){const d=o[c],k=U.map(b=>b.editor==="AUTO_SEQ"?c+1:b.editor==="AUTO_CALC"?s(d):d[b.field]??""),y=f.getRow(a);y.values=k,y.font={name:"微软雅黑",size:11},y.alignment={horizontal:"center",vertical:"middle",wrapText:u,indent:1},y.height=u?v(k,11):28,a++}const q=a-1;if(i.summary_fields){a+=1;const c=F(Math.max(0,N-2)),d=F(N-1),k=o.reduce((E,w)=>E+Number(s(w)||0),0),y={group_total:k,quantity_sum:o.reduce((E,w)=>E+Number(w.quantity||0),0)};for(const E of i.summary_fields)E.type==="MANUAL_INPUT"&&(y[E.field]=Number(E.default??0));y.grand_total=k+i.summary_fields.filter(E=>E.type==="MANUAL_INPUT").reduce((E,w)=>E+y[w.field],0);for(const E of i.summary_fields)E.type==="AUTO_CALC"&&(y[E.field]=P(E.formula||"group_total",y));for(const E of i.summary_fields){let w;E.type==="AUTO_CALC"?w=P(E.formula||"group_total",y):E.type==="PLAIN_TEXT"?w=E.text||"":w=Number(E.default??0);const B=((V=E.style)==null?void 0:V.fontSize)||pe,T=f.getCell(`${c}${a}`),x=f.getCell(`${d}${a}`);T.value=E.label,T.alignment={horizontal:"right",vertical:"middle"};const _=E.style||{},D=()=>{const A={name:"微软雅黑",size:B,bold:!!_.bold,italic:!!_.italic};if(_.color){const O=_.color.replace("#","").toUpperCase();A.color={argb:O.length===6?"FF"+O:O}}return A};T.font=D(),x.value=w,x.alignment={horizontal:"right",vertical:"middle"},x.font=D(),typeof w=="number"&&(x.numFmt="#,##0.00"),f.getRow(a).height=Math.max(22,B*2+6),a++}const b=a-1;ee(f,g,b,1,N),te(f,g,b,1,N)}else ee(f,g,q,1,N),te(f,g,q,1,N);if(i.footer_sections){a+=1;for(const c of i.footer_sections)if(c.type==="divider")a++;else if(c.type==="text"){f.mergeCells(`A${a}:${$}${a}`);const d=f.getCell(`A${a}`);d.value=c.text;const k=c.style||{},y=k.fontSize||13;if(d.font={size:y,bold:k.bold===!0,italic:k.italic===!0,name:"微软雅黑"},k.color){const b=k.color.replace("#","").toUpperCase();d.font.color={argb:b.length===6?"FF"+b:b}}d.alignment={horizontal:k.align||c.align||"left",vertical:"middle"},f.getRow(a).height=y*2+10,a++}else if(c.type==="row"&&c.cells){const d=c.cells.map(b=>{var E;return Y((E=b.style)==null?void 0:E.width)||1/c.cells.length});let k=0;const y=d.map(b=>{const E=Math.round(k*N);k+=b;const w=Math.round(k*N)-1;return{start:E,end:Math.max(w,E)}});for(let b=0;b<c.cells.length;b++){const E=c.cells[b],w=y[b],B=`${F(w.start)}${a}`,T=`${F(w.end)}${a}`;B!==T&&f.mergeCells(`${B}:${T}`);const x=f.getCell(B);x.value=E.text;const _=E.style||{};x.alignment={horizontal:_.align||"left",vertical:"middle"};const D={name:"微软雅黑",size:_.fontSize||11,bold:_.bold===!0,italic:_.italic===!0};if(_.color){const A=_.color.replace("#","").toUpperCase();D.color={argb:A.length===6?"FF"+A:A}}x.font=D}f.getRow(a).height=22,a++}}const h=50,C=6;for(let c=0;c<N;c++){const d=i.columns[c],k=c+1;if(r==="auto-wrap")f.getColumn(k).width=d.width?Math.max(d.width/7,8):12;else{let y=0;for(let w=1;w<a;w++)y=Math.max(y,K(f.getCell(w,k).value));const b=d.width?Math.max(d.width/7,10):12,E=Math.min(Math.max(y+2,C),h);f.getColumn(k).width=Math.max(E,b)}}const L=await p.xlsx.writeBuffer();return new Blob([L],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}const ke={class:"qukt-quote-sheet"},fe={key:1,class:"qukt-q-divider"},be={key:3,class:"qukt-q-row"},ye={class:"qukt-q-label"},Ve={class:"qukt-q-value"},Ee={key:0,class:"qukt-q-table-wrap"},he={class:"qukt-q-table"},Ne={key:0,class:"subtotal-row"},ge=["colspan"],qe={class:"subtotal-value"},_e={key:1},we=["rowspan"],$e={key:0,class:"empty-row"},xe=["colspan"],Ce={key:1,class:"qukt-q-summary"},Be={class:"qukt-q-summary-label"},Se={key:0,class:"qukt-q-divider"},Ue={key:2,class:"qukt-q-row"},le={__name:"QuokitSheet",props:{tpl:{type:Object,required:!0},data:{type:Array,default:()=>[]},placeholder:{type:String,default:"-"}},setup(i,{expose:o}){function l(V){const c=(V.header_sections||[]).flatMap(d=>d.cells||[]).find(d=>d.type==="field"&&d.value);return(c==null?void 0:c.value)||"untitled"}const r=i,u=e.computed(()=>r.data);function p(V){const c=V.style||{},d={width:c.width||"auto"};d.textAlign=c.align||"left",c.color&&(d.color=c.color),c.fontSize&&(d.fontSize=c.fontSize+"px"),c.bold&&(d.fontWeight="bold"),c.italic&&(d.fontStyle="italic");const k=c.border;if(k)for(const y of["top","bottom","left","right"]){const b=k[y];b&&b.style&&b.width>0&&(d["border-"+y]=`${b.width}px ${b.style} ${b.color||"#dcdfe6"}`)}return d}function f(V){return"¥ "+(Number(V)||0).toFixed(2)}const N=e.computed(()=>(r.tpl.columns||[]).find(V=>V.editor==="AUTO_CALC"));function $(V){var d;const c=((d=N.value)==null?void 0:d.formula)||"quantity * unit_price";return P(c,V)}const a=e.computed(()=>u.value.reduce((V,c)=>V+Number($(c)||0),0)),t=e.computed(()=>u.value.reduce((V,c)=>V+Number(c.quantity||0),0));function s(){let V=a.value;if(r.tpl.summary_fields)for(const c of r.tpl.summary_fields)c.type==="MANUAL_INPUT"&&(V+=S(c));return V}function g(V){const c={},d=V.style||{};return d.color&&(c.color=d.color),d.fontSize&&(c.fontSize=d.fontSize+"px"),d.bold&&(c.fontWeight="bold"),d.italic&&(c.fontStyle="italic"),c}function n(V){const c={},d=V.style||{};return d.color&&(c.color=d.color),d.fontSize&&(c.fontSize=d.fontSize+"px"),d.bold&&(c.fontWeight="bold"),d.italic&&(c.fontStyle="italic"),d.align?c.textAlign=d.align:V.align&&(c.textAlign=V.align),c}function S(V){return Number(V.default??0)}function m(){const V={group_total:a.value,quantity_sum:t.value};if(r.tpl.summary_fields){for(const c of r.tpl.summary_fields)c.type==="MANUAL_INPUT"&&(V[c.field]=S(c));for(const c of r.tpl.summary_fields)c.type==="AUTO_CALC"&&(V[c.field]=P(c.formula||"group_total",V))}return V.grand_total=s(),V}function U(V){if(V.type==="PLAIN_TEXT")return V.text||"";if(V.type==="AUTO_CALC"){const c=m();return c[V.field]??P(V.formula||"group_total",c)}return S(V)}const q=e.computed(()=>{var b;const V=u.value.map(E=>({...E})),c=(b=r.tpl)==null?void 0:b.group_rules;if(!(c!=null&&c.merge_field))return V;const d=[],k=c.merge_field;let y=0;for(;y<V.length;){const E=[V[y]];let w=y+1;for(;w<V.length&&V[w][k]===V[y][k];)E.push(V[w]),w++;if(d.push(...E),(c.show_detail_subtotal??!0)&&V[y][k]!==void 0&&V[y][k]!==null&&V[y][k]!==""){const T=E.reduce((x,_)=>x+Number($(_)||0),0);d.push({__is_subtotal:!0,__group_key:V[y][k],__group_sum:T})}y=w}return d});function h(V,c){var x,_,D,A;const d=q.value,k=d[V];if(!k||k.__is_subtotal)return 1;const y=(x=r.tpl)==null?void 0:x.group_rules,b=y==null?void 0:y.merge_field,E=r.tpl.columns.find(O=>O.field===c),w=b&&c===b,B=(E==null?void 0:E.merge_on_group)===!0;if(!w&&!B)return 1;const T=(()=>{var M,J;if(!b)return d.length;const O=k[b];let I=V+1;for(;I<d.length&&((M=d[I])==null?void 0:M[b])===O&&!((J=d[I])!=null&&J.__is_subtotal);)I++;return I})();if(w)return V>0&&((_=d[V-1])==null?void 0:_[b])===k[b]&&!((D=d[V-1])!=null&&D.__is_subtotal)?0:T-V;if(B){const O=k[c];if(V>0){const M=d[V-1];if((!b||(M==null?void 0:M[b])===k[b]&&!(M!=null&&M.__is_subtotal))&&(M==null?void 0:M[c])===O)return 0}let I=1;for(let M=V+1;M<T&&((A=d[M])==null?void 0:A[c])===O;M++)I++;return I}return 1}async function C(V=!1){const c=await ue(r.tpl,r.data,V?{layout:"auto-width"}:void 0),d=URL.createObjectURL(c),k=document.createElement("a");k.href=d,k.download=`报价单_${l(r.tpl)}_${new Date().toISOString().slice(0,10)}.xlsx`,k.click(),URL.revokeObjectURL(d)}function L(V=!1){const c=document.querySelector(".qukt-quote-sheet");if(!c)return;const d=V!==!0,k=window.open("","_blank",d?"width=1200,height=900":"width=900,height=1200");if(!k)return;const y=Array.from(document.styleSheets).map(E=>{try{return Array.from(E.cssRules).map(w=>w.cssText).join(`
|
|
4
5
|
`)}catch{return""}}).join(`
|
|
5
|
-
`),
|
|
6
|
+
`),b=c.outerHTML;k.document.write(`<!doctype html>
|
|
6
7
|
<html><head><meta charset="utf-8"><title>报价单打印</title>
|
|
7
|
-
<style>${
|
|
8
|
-
@page { size: ${
|
|
8
|
+
<style>${y}
|
|
9
|
+
@page { size: ${d?"landscape":"portrait"}; margin: 15mm; }
|
|
9
10
|
body { margin: 0; padding: 20px; background: #fff; }
|
|
10
11
|
@media print { body { padding: 0; } }
|
|
11
|
-
</style></head><body>${y}</body></html>`),v.document.close(),v.onload=()=>{v.print()}}return o({print:z,exportExcel:B}),(h,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.tpl.header_sections,(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"h"+v},[r.type==="title"?(e.openBlock(),e.createElementBlock("h1",{key:0,class:"q-title",style:e.normalizeStyle(l(r))},e.toDisplayString(r.text),5)):r.type==="divider"?(e.openBlock(),e.createElementBlock("div",ve)):r.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"q-text",style:e.normalizeStyle(l(r))},e.toDisplayString(r.text),5)):r.type==="row"?(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.cells,(V,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"q-cell",style:e.normalizeStyle(m(V))},[V.type==="field"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",ye,e.toDisplayString(V.label)+":",1),e.createElementVNode("span",Ve,e.toDisplayString(V.value??d.placeholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(V.text),1)],64))],4))),128))])):e.createCommentVNode("",!0)],64))),128)),d.tpl.columns&&d.tpl.columns.length>0?(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("table",Ee,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.tpl.columns,r=>(e.openBlock(),e.createElementBlock("th",{key:r.field,style:e.normalizeStyle({width:r.width+"px"})},e.toDisplayString(r.title),5))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:v},[r.__is_subtotal?(e.openBlock(),e.createElementBlock("tr",_e,[e.createElementVNode("td",{colspan:d.tpl.columns.length-1,class:"subtotal-label"},"小计("+e.toDisplayString(r.__group_key)+")",9,ge),e.createElementVNode("td",ke,e.toDisplayString(b(r.__group_sum)),1)])):(e.openBlock(),e.createElementBlock("tr",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.tpl.columns,(V,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.field},[_(k.value.indexOf(r),V.field)>0?(e.openBlock(),e.createElementBlock("td",{key:0,rowspan:_(k.value.indexOf(r),V.field),class:e.normalizeClass({"merged-cell":_(k.value.indexOf(r),V.field)>1})},[V.editor==="AUTO_SEQ"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(v+1),1)],64)):V.editor==="AUTO_CALC"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(b(w(r))),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(r[V.field]??""),1)],64))],10,we)):e.createCommentVNode("",!0)],64))),128))]))],64))),128)),k.value.length===0?(e.openBlock(),e.createElementBlock("tr",$e,[e.createElementVNode("td",{colspan:d.tpl.columns.length,class:"q-empty"},"(暂无数据)",8,xe)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),d.tpl.summary_fields&&d.tpl.summary_fields.length>0?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.tpl.summary_fields,r=>(e.openBlock(),e.createElementBlock("div",{key:r.field,class:"q-summary-row"},[e.createElementVNode("span",Be,e.toDisplayString(r.label),1),e.createElementVNode("span",{class:"q-summary-value",style:e.normalizeStyle(p(r))},e.toDisplayString(r.type==="PLAIN_TEXT"?r.text:b(S(r))),5)]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.tpl.footer_sections,(r,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"f"+v},[r.type==="divider"?(e.openBlock(),e.createElementBlock("div",Ue)):r.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"q-text",style:e.normalizeStyle(l(r))},e.toDisplayString(r.text),5)):r.type==="row"?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.cells,(V,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"q-cell",style:e.normalizeStyle(m(V))},e.toDisplayString(V.text),5))),128))])):e.createCommentVNode("",!0)],64))),128))])]))}},ne=O(Te,[["__scopeId","data-v-b623c085"]]);function q(d){return JSON.parse(JSON.stringify(d))}function De(d,o){let a=null;const u=function(...f){clearTimeout(a),a=setTimeout(()=>d.apply(this,f),o)};return u.cancel=()=>{clearTimeout(a),a=null},Object.defineProperty(u,"timer",{get(){return a},configurable:!0}),u}function te(d=[]){return Array.isArray(d)?d.map(o=>{const a=Array.isArray(o.dict)?o.dict:[];return{...o,field:o.field||"",title:o.title||"",editor:o.editor||"INPUT",width:o.width??130,dictStr:a.length?a.join(","):o.dictStr||"",formula:o.formula||"",merge_on_group:o.merge_on_group??!1}}):[]}function Me(d){return d.map(o=>{const a={field:o.field,title:o.title,editor:o.editor,width:o.width};return o.editor==="SELECT_DICT"&&(a.dict=(o.dictStr||"").split(",").map(u=>u.trim()).filter(Boolean)),o.editor==="AUTO_CALC"&&(a.formula=o.formula||""),o.editor!=="AUTO_SEQ"&&o.editor!=="AUTO_CALC"&&(a.merge_on_group=!!o.merge_on_group),a})}function Ae(d,o,a){const u={INPUT:"文本",NUMBER:"数值",SELECT_DICT:"选项",TEXTAREA:"说明",AUTO_CALC:"计算值",AUTO_SEQ:"序号"},f={INPUT:130,NUMBER:100,SELECT_DICT:130,TEXTAREA:200,AUTO_CALC:120,AUTO_SEQ:60};return{field:o,title:u[d]||a||"新列",editor:d,width:f[d]||120,dictStr:"",formula:"",merge_on_group:!1}}function ae(d=[],o={}){const a=e.ref(te(q(d))),u=e.ref({merge_field:o.merge_field||"",show_detail_subtotal:o.show_detail_subtotal??!0}),f=e.computed(()=>({columns:Me(a.value),group_rules:(()=>{const g=u.value.merge_field;return g?{merge_field:g,show_detail_subtotal:u.value.show_detail_subtotal??!0}:null})()}));function m(g){a.value=te(q(g||[]))}function b(g){u.value={merge_field:g.merge_field||"",show_detail_subtotal:g.show_detail_subtotal??!0}}return e.reactive({columns:a,groupRules:u,tpl:f,setColumns:m,setGroupRules:b})}function de(){return{top:{style:"",width:1,color:"#dcdfe6"},bottom:{style:"",width:1,color:"#dcdfe6"},left:{style:"",width:1,color:"#dcdfe6"},right:{style:"",width:1,color:"#dcdfe6"}}}function I(d="auto"){return{width:d,color:"#303133",fontSize:13,bold:!1,italic:!1,align:"left",border:de()}}function W(d,o){d.style||(d.style=I());const a=o==="none"?{style:"",width:0,color:"#dcdfe6"}:{style:"solid",width:1,color:"#dcdfe6"};d.style.border={top:{...a},bottom:{...a},left:{...a},right:{...a}}}function ie(d){const o=d.style||{},a={width:o.width||"auto"};a.textAlign=o.align||"left",o.color&&(a.color=o.color),o.fontSize&&(a.fontSize=o.fontSize+"px"),o.bold&&(a.fontWeight="bold"),o.italic&&(a.fontStyle="italic");const u=o.border;if(u)for(const f of["top","bottom","left","right"]){const m=u[f];m&&m.style&&m.width>0&&(a["border-"+f]=`${m.width}px ${m.style} ${m.color||"#dcdfe6"}`)}return a}function ze(d=[]){for(const o of d)o.type==="title"&&(o.type="text",o.style=o.style||{color:"#303133",fontSize:18,bold:!0,italic:!1,align:"center"},o.align&&!o.style.align&&(o.style.align=o.align,delete o.align)),o.type==="text"&&(o.style=o.style||{},o.align&&!o.style.align&&(o.style.align=o.align,delete o.align),o.style.color===void 0&&(o.style.color="#303133"),o.style.fontSize===void 0&&(o.style.fontSize=14),o.style.bold===void 0&&(o.style.bold=!1),o.style.italic===void 0&&(o.style.italic=!1),o.style.align===void 0&&(o.style.align="left"))}function Fe(d=[]){for(const o of d)if(o.type==="row"&&o.cells)for(const a of o.cells)a.style||(a.style=I()),a.style.width===void 0&&(a.style.width="auto"),a.style.color===void 0&&(a.style.color="#303133"),a.style.fontSize===void 0&&(a.style.fontSize=13),a.style.bold===void 0&&(a.style.bold=!1),a.style.italic===void 0&&(a.style.italic=!1),a.style.align===void 0&&(a.style.align="left"),a.style.border===void 0&&(a.style.border=de())}function Le(){return[{type:"text",text:"报 价 单",style:{color:"#303133",fontSize:22,bold:!0,italic:!1,align:"center"}},{type:"divider"},{type:"row",cells:[{type:"field",label:"项目名称",bind:"projectName",style:I("50%")},{type:"field",label:"日期",bind:"quotationDate",style:I("50%")}]}]}function le(d,o=!1){if(!d||d.length===0)if(o)d=Le();else return[];return ze(d),Fe(d),d}function Z(d=[],o={}){const{isHeader:a=!1}=o,u=e.ref(q(le(d,a)));function f(b){u.value=q(le(b||[],a))}function m(){return q(u.value)}return e.reactive({sections:u,setSections:f,toTpl:m})}function G(d=[]){let o=0;for(const a of d)if(a.field){const u=/^field_(\d+)$/.exec(a.field);u&&(o=Math.max(o,parseInt(u[1],10)))}for(const a of d)a.field||(a.field="field_"+String(++o).padStart(4,"0")),a.type==="AUTO_CALC"&&!a.formula&&(a.formula="group_total"),a.style===void 0&&(a.style={color:"#606266",fontSize:13,bold:!1,italic:!1}),a.style.color===void 0&&(a.style.color="#606266"),a.style.fontSize===void 0&&(a.style.fontSize=13),a.style.bold===void 0&&(a.style.bold=!1),a.style.italic===void 0&&(a.style.italic=!1)}function se(d=[]){const o=e.ref(q(d||[]));G(o.value);const a=e.computed(()=>q(o.value));function u(m){o.value=q(m||[]),G(o.value)}function f(){return G(o.value),q(o.value)}return e.reactive({fields:o,tpl:a,setFields:u,toTpl:f})}const qe=["XXXX","YYYY","ZZZZ","WWWW"];function re(d,o=3){const a=[],u=qe;for(let f=0;f<o;f++){const m={};for(const b of d)if(!(b.editor==="AUTO_SEQ"||b.editor==="AUTO_CALC"))if(b.editor==="NUMBER")m[b.field]=Math.floor(Math.random()*900+100);else if(b.editor==="SELECT_DICT"){const g=(b.dictStr||(b.dict?b.dict.join(","):"")).split(",").map(w=>w.trim()).filter(Boolean);m[b.field]=g[f%Math.max(g.length,1)]||u[f%u.length]}else m[b.field]=u[f%u.length];a.push(m)}return a}function H(d=1100){const o=e.ref(!1);function a(){o.value=window.innerWidth<=d}return e.onMounted(()=>{a(),window.addEventListener("resize",a)}),e.onUnmounted(()=>{window.removeEventListener("resize",a)}),{isNarrow:o}}const Oe={class:"toolbar"},Re={class:"btn-group-inline"},Ie={class:"design-table"},Pe={class:"idx"},je=["onUpdate:modelValue"],Qe=["onUpdate:modelValue"],We=["onUpdate:modelValue"],He=["onUpdate:modelValue"],Xe=["onUpdate:modelValue"],Ge=["onUpdate:modelValue"],Ze={key:2,class:"muted"},Je={key:3,class:"muted"},Ye={class:"col-merge"},Ke={key:0},et=["onUpdate:modelValue"],tt={key:1,class:"muted"},lt=["disabled","onClick"],ot=["disabled","onClick"],nt=["onClick"],at={__name:"DesignCols",props:{columns:{type:Array,required:!0},groupRules:{type:Object,default:()=>({})},breakpoint:{type:Number,default:1100}},emits:["help","open-group"],setup(d){const o=d,{isNarrow:a}=H(o.breakpoint),u=e.computed(()=>!!o.groupRules.merge_field);function f(s,t){let n=s,p=2;for(;t.has(n);)n=s+"_"+p++;return n}function m(){let s=0;for(const t of o.columns){const n=/^custom_(\d+)$/.exec(t.field);n&&(s=Math.max(s,parseInt(n[1],10)))}return s+1}function b(s){const t=new Set([...o.columns.map(l=>l.field)]),n="custom_"+String(m()).padStart(4,"0"),p=Ae(s,f(n,t));o.columns.push(p)}function g(s){o.columns.splice(s,1)}function w(s,t){const n=s+t;n<0||n>=o.columns.length||([o.columns[s],o.columns[n]]=[o.columns[n],o.columns[s]])}return(s,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Oe,[t[3]||(t[3]=e.createElementVNode("span",{class:"tip"},[e.createTextVNode("拖动或点 ↑↓ 调整顺序;支持自动序号和公式计算列,公式里可直接引用其他字段名,如 "),e.createElementVNode("code",null,"quantity * unit_price * 0.9")],-1)),e.createElementVNode("div",Re,[e.createElementVNode("button",{class:e.normalizeClass(["btn",{"btn-primary":u.value}]),onClick:t[0]||(t[0]=n=>s.$emit("open-group"))},"分组 & 小计"+e.toDisplayString(u.value?" ✓":""),3),e.createElementVNode("button",{class:"btn btn-primary",onClick:t[1]||(t[1]=n=>b("INPUT"))},"+ 添加字段"),e.createElementVNode("button",{class:"btn",onClick:t[2]||(t[2]=n=>s.$emit("help"))},"帮助")])]),e.createElementVNode("div",{class:e.normalizeClass(["table-wrap",{"is-narrow":e.unref(a)}])},[e.createElementVNode("table",Ie,[t[6]||(t[6]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",{width:"50"},"#"),e.createElementVNode("th",{width:"150"},"字段名"),e.createElementVNode("th",{width:"150"},"列标题"),e.createElementVNode("th",{width:"160"},"类型"),e.createElementVNode("th",{width:"100"},"宽度"),e.createElementVNode("th",null,"专属配置"),e.createElementVNode("th",{width:"130"},"分组时合并"),e.createElementVNode("th",{width:"140"},"操作")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columns,(n,p)=>(e.openBlock(),e.createElementBlock("tr",{key:p},[e.createElementVNode("td",Pe,e.toDisplayString(p+1),1),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":l=>n.field=l},null,8,je),[[e.vModelText,n.field]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":l=>n.title=l},null,8,Qe),[[e.vModelText,n.title]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("select",{class:"cell-input","onUpdate:modelValue":l=>n.editor=l},[...t[4]||(t[4]=[e.createStaticVNode('<option value="AUTO_SEQ" data-v-e3cbb539>自动序号</option><option value="AUTO_CALC" data-v-e3cbb539>自动计算(公式)</option><option value="INPUT" data-v-e3cbb539>文本输入</option><option value="NUMBER" data-v-e3cbb539>数字输入</option><option value="TEXTAREA" data-v-e3cbb539>多行文本</option><option value="SELECT_DICT" data-v-e3cbb539>下拉选择</option>',6)])],8,We),[[e.vModelSelect,n.editor]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"cell-input",type:"number",min:"50",max:"500","onUpdate:modelValue":l=>n.width=l},null,8,He),[[e.vModelText,n.width,void 0,{number:!0}]])]),e.createElementVNode("td",null,[n.editor==="SELECT_DICT"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"cell-input","onUpdate:modelValue":l=>n.dictStr=l,placeholder:"下拉选项,逗号分隔 如:设备,材料,安装"},null,8,Xe)),[[e.vModelText,n.dictStr]]):n.editor==="AUTO_CALC"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"cell-input","onUpdate:modelValue":l=>n.formula=l,placeholder:"公式,如 quantity * unit_price + tax"},null,8,Ge)),[[e.vModelText,n.formula]]):n.editor==="AUTO_SEQ"?(e.openBlock(),e.createElementBlock("span",Ze,"自动生成序号,无需配置")):(e.openBlock(),e.createElementBlock("span",Je,"-"))]),e.createElementVNode("td",Ye,[n.editor!=="AUTO_SEQ"&&n.editor!=="AUTO_CALC"?(e.openBlock(),e.createElementBlock("label",Ke,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l=>n.merge_on_group=l},null,8,et),[[e.vModelCheckbox,n.merge_on_group]]),t[5]||(t[5]=e.createElementVNode("span",null,"相同值合并",-1))])):(e.openBlock(),e.createElementBlock("span",tt,"—"))]),e.createElementVNode("td",null,[e.createElementVNode("button",{class:"mini-btn",disabled:p===0,onClick:l=>w(p,-1)},"↑",8,lt),e.createElementVNode("button",{class:"mini-btn",disabled:p>=d.columns.length-1,onClick:l=>w(p,1)},"↓",8,ot),e.createElementVNode("button",{class:"mini-btn danger",onClick:l=>g(p)},"删",8,nt)])]))),128))])])],2)]))}},dt=O(at,[["__scopeId","data-v-e3cbb539"]]),it={class:"gr-dialog"},st={class:"gr-header"},rt={class:"gr-content"},ct={class:"gr-form"},ut={class:"gr-form-row"},mt=["value","disabled"],pt={class:"gr-form-row"},ft={class:"gr-checkbox",style:{flex:"1"}},vt={class:"gr-footer"},bt={__name:"GroupDialog",props:{visible:{type:Boolean,default:!1},columns:{type:Array,default:()=>[]},groupRules:{type:Object,required:!0}},setup(d){const o=d,a=e.reactive({merge_field:o.groupRules.merge_field||"",show_detail_subtotal:o.groupRules.show_detail_subtotal??!0});return e.watch(()=>o.groupRules,u=>{Object.assign(a,{merge_field:u.merge_field||"",show_detail_subtotal:u.show_detail_subtotal??!0})},{deep:!0}),e.watch(a,()=>{Object.assign(o.groupRules,{merge_field:a.merge_field,show_detail_subtotal:a.show_detail_subtotal})},{deep:!0}),(u,f)=>d.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gr-mask",onClick:f[4]||(f[4]=e.withModifiers(m=>u.$emit("close"),["self"]))},[e.createElementVNode("div",it,[e.createElementVNode("div",st,[f[5]||(f[5]=e.createElementVNode("span",null,"分组规则 & 小计配置",-1)),e.createElementVNode("button",{class:"gr-close",onClick:f[0]||(f[0]=m=>u.$emit("close"))},"✕")]),e.createElementVNode("div",rt,[f[10]||(f[10]=e.createElementVNode("div",{class:"gr-tips"},[e.createElementVNode("p",null,[e.createElementVNode("b",null,"分组是什么?"),e.createTextVNode(" 选择某一列后,相同值的行会自动合并单元格(比如按「系统名称」分组,同系统的多条明细会合并成一个单元格)。每组末尾自动显示一行小计。")])],-1)),e.createElementVNode("div",ct,[e.createElementVNode("div",ut,[f[7]||(f[7]=e.createElementVNode("label",{class:"gr-form-label"},"按哪一列分组",-1)),e.withDirectives(e.createElementVNode("select",{class:"cell-input","onUpdate:modelValue":f[1]||(f[1]=m=>d.groupRules.merge_field=m),style:{flex:"1"}},[f[6]||(f[6]=e.createElementVNode("option",{value:""},"— 不分组 —",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.columns,m=>(e.openBlock(),e.createElementBlock("option",{key:m.field,value:m.field,disabled:m.editor==="AUTO_SEQ"||m.editor==="AUTO_CALC"},e.toDisplayString(m.title)+"("+e.toDisplayString(m.field)+")",9,mt))),128))],512),[[e.vModelSelect,d.groupRules.merge_field]])]),e.createElementVNode("div",pt,[f[9]||(f[9]=e.createElementVNode("label",{class:"gr-form-label"},"明细小计",-1)),e.createElementVNode("label",ft,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":f[2]||(f[2]=m=>d.groupRules.show_detail_subtotal=m)},null,512),[[e.vModelCheckbox,d.groupRules.show_detail_subtotal]]),f[8]||(f[8]=e.createElementVNode("span",null,"分组末尾显示小计行",-1))])])])]),e.createElementVNode("div",vt,[e.createElementVNode("button",{class:"btn",onClick:f[3]||(f[3]=m=>u.$emit("close"))},"关闭")])])])):e.createCommentVNode("",!0)}},yt=O(bt,[["__scopeId","data-v-bd77a67d"]]),Vt={class:"toolbar"},ht={class:"col-left"},Et={class:"sec-header"},_t={class:"sec-type"},gt={class:"sec-actions"},kt=["disabled","onClick"],Nt=["disabled","onClick"],wt=["onClick"],$t={class:"sec-row"},xt=["onUpdate:modelValue"],Ct={class:"sec-row"},Bt=["onUpdate:modelValue"],Ut=["onUpdate:modelValue"],St={class:"chk-label"},Tt=["onUpdate:modelValue"],Dt={class:"chk-label"},Mt=["onUpdate:modelValue"],At={class:"sec-row"},zt=["onUpdate:modelValue"],Ft={class:"cells-list"},Lt={class:"cell-toolbar"},qt=["onClick"],Ot={class:"sec-row"},Rt=["onUpdate:modelValue"],It={key:0,class:"sec-row"},Pt=["onUpdate:modelValue"],jt={key:1,class:"sec-row"},Qt=["onUpdate:modelValue"],Wt={key:2,class:"sec-row"},Ht=["onUpdate:modelValue"],Xt={key:3,class:"sec-row"},Gt=["onUpdate:modelValue"],Zt={class:"sec-row"},Jt=["onUpdate:modelValue"],Yt={class:"inline-group"},Kt=["onUpdate:modelValue"],el={class:"sec-row"},tl=["onUpdate:modelValue"],ll=["onUpdate:modelValue"],ol={class:"chk-label"},nl=["onUpdate:modelValue"],al={class:"chk-label"},dl=["onUpdate:modelValue"],il={class:"sec-row border-config"},sl={class:"border-group"},rl={class:"border-item"},cl=["onUpdate:modelValue"],ul=["onUpdate:modelValue"],ml=["onUpdate:modelValue"],pl={class:"border-item"},fl=["onUpdate:modelValue"],vl=["onUpdate:modelValue"],bl=["onUpdate:modelValue"],yl={class:"border-item"},Vl=["onUpdate:modelValue"],hl=["onUpdate:modelValue"],El=["onUpdate:modelValue"],_l={class:"border-item"},gl=["onUpdate:modelValue"],kl=["onUpdate:modelValue"],Nl=["onUpdate:modelValue"],wl=["onClick"],$l=["onClick"],xl=["onClick"],Cl={class:"col-right"},Bl={class:"preview-box"},Ul={class:"preview-inner"},Sl={key:1,class:"p-divider"},Tl={key:3,class:"p-row"},Dl={class:"p-label"},Ml={class:"p-value"},Al={__name:"DesignHeader",props:{sections:{type:Array,required:!0},breakpoint:{type:Number,default:1100}},setup(d){const o=d,{isNarrow:a}=H(o.breakpoint);function u(s){s==="divider"?o.sections.push({type:s}):s==="text"?o.sections.push({type:s,text:"纯文本内容",style:{color:"#303133",fontSize:14,bold:!1,italic:!1,align:"left"}}):s==="row"&&o.sections.push({type:s,cells:[{type:"field",label:"字段",bind:"field1",style:I("50%")}]})}function f(s){o.sections.splice(s,1)}function m(s,t){const n=s+t;n<0||n>=o.sections.length||([o.sections[s],o.sections[n]]=[o.sections[n],o.sections[s]])}function b(s){s.cells||(s.cells=[]),s.cells.push({type:"field",label:"新字段",bind:"newField",style:I("33%")})}function g(s,t){s.cells.splice(t,1)}function w(s){const t={},n=s.style||{};return n.color&&(t.color=n.color),n.fontSize&&(t.fontSize=n.fontSize+"px"),n.bold&&(t.fontWeight="bold"),n.italic&&(t.fontStyle="italic"),n.align&&(t.textAlign=n.align),t}return(s,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Vt,[t[3]||(t[3]=e.createElementVNode("span",{class:"tip"},"这里定义报价单的大标题、项目信息行等,左侧是设计器,右侧实时预览",-1)),e.createElementVNode("button",{class:"btn",onClick:t[0]||(t[0]=n=>u("row"))},"+ 字段行"),e.createElementVNode("button",{class:"btn",onClick:t[1]||(t[1]=n=>u("divider"))},"+ 分隔线"),e.createElementVNode("button",{class:"btn",onClick:t[2]||(t[2]=n=>u("text"))},"+ 纯文本")]),e.createElementVNode("div",{class:e.normalizeClass(["two-col",{"is-narrow":e.unref(a)}])},[e.createElementVNode("div",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.sections,(n,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:"sec-block"},[e.createElementVNode("div",Et,[e.createElementVNode("span",_t,e.toDisplayString(n.type==="row"?"字段行":n.type==="divider"?"分隔线":"纯文本"),1),e.createElementVNode("div",gt,[e.createElementVNode("button",{class:"mini-btn",disabled:p===0,onClick:l=>m(p,-1)},"↑",8,kt),e.createElementVNode("button",{class:"mini-btn",disabled:p>=d.sections.length-1,onClick:l=>m(p,1)},"↓",8,Nt),e.createElementVNode("button",{class:"mini-btn danger",onClick:l=>f(p)},"删",8,wt)])]),n.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",$t,[t[4]||(t[4]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l=>n.text=l,class:"cell-input"},null,8,xt),[[e.vModelText,n.text]])]),e.createElementVNode("div",Ct,[t[7]||(t[7]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":l=>n.style.color=l,class:"color-input"},null,8,Bt),[[e.vModelText,n.style.color]]),t[8]||(t[8]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l=>n.style.fontSize=l,type:"number",class:"cell-input tiny",min:"10",max:"48"},null,8,Ut),[[e.vModelText,n.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",St,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l=>n.style.bold=l},null,8,Tt),[[e.vModelCheckbox,n.style.bold]]),t[5]||(t[5]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",Dt,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l=>n.style.italic=l},null,8,Mt),[[e.vModelCheckbox,n.style.italic]]),t[6]||(t[6]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",At,[t[10]||(t[10]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l=>n.style.align=l,class:"cell-input small"},[...t[9]||(t[9]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,zt),[[e.vModelSelect,n.style.align]])])],64)):n.type==="row"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.cells,(l,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"cell-block"},[e.createElementVNode("div",Lt,[e.createElementVNode("strong",null,e.toDisplayString($+1),1),e.createElementVNode("button",{class:"mini-btn danger",onClick:i=>g(n,$)},"×",8,qt)]),e.createElementVNode("div",Ot,[t[12]||(t[12]=e.createElementVNode("label",null,"类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.type=i,class:"cell-input small"},[...t[11]||(t[11]=[e.createElementVNode("option",{value:"field"},"字段(可编辑)",-1),e.createElementVNode("option",{value:"text"},"纯文本",-1)])],8,Rt),[[e.vModelSelect,l.type]])]),l.type==="field"?(e.openBlock(),e.createElementBlock("div",It,[t[13]||(t[13]=e.createElementVNode("label",null,"标签",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.label=i,class:"cell-input"},null,8,Pt),[[e.vModelText,l.label]])])):e.createCommentVNode("",!0),l.type==="field"?(e.openBlock(),e.createElementBlock("div",jt,[t[14]||(t[14]=e.createElementVNode("label",null,"值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.value=i,class:"cell-input",placeholder:"字段的值"},null,8,Qt),[[e.vModelText,l.value]])])):e.createCommentVNode("",!0),l.type==="field"?(e.openBlock(),e.createElementBlock("div",Wt,[t[15]||(t[15]=e.createElementVNode("label",null,"绑定字段",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.bind=i,class:"cell-input",placeholder:"如 projectName"},null,8,Ht),[[e.vModelText,l.bind]])])):e.createCommentVNode("",!0),l.type==="text"?(e.openBlock(),e.createElementBlock("div",Xt,[t[16]||(t[16]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.text=i,class:"cell-input"},null,8,Gt),[[e.vModelText,l.text]])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zt,[t[19]||(t[19]=e.createElementVNode("label",null,"宽度",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.style.width=i,class:"cell-input small",placeholder:"如 33%"},null,8,Jt),[[e.vModelText,l.style.width]]),e.createElementVNode("div",Yt,[t[18]||(t[18]=e.createElementVNode("label",{class:"muted"},"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.align=i,class:"cell-input small"},[...t[17]||(t[17]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Kt),[[e.vModelSelect,l.style.align]])])]),e.createElementVNode("div",el,[t[22]||(t[22]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.color=i,class:"color-input"},null,8,tl),[[e.vModelText,l.style.color]]),t[23]||(t[23]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.style.fontSize=i,type:"number",class:"cell-input tiny",min:"10",max:"48"},null,8,ll),[[e.vModelText,l.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",ol,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.bold=i},null,8,nl),[[e.vModelCheckbox,l.style.bold]]),t[20]||(t[20]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",al,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.italic=i},null,8,dl),[[e.vModelCheckbox,l.style.italic]]),t[21]||(t[21]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",il,[t[32]||(t[32]=e.createElementVNode("label",null,"边框",-1)),e.createElementVNode("div",sl,[e.createElementVNode("div",rl,[t[25]||(t[25]=e.createElementVNode("span",null,"上",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.top.style=i,class:"cell-input tiny"},[...t[24]||(t[24]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,cl),[[e.vModelSelect,l.style.border.top.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.top.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,ul),[[e.vModelText,l.style.border.top.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.top.color=i,class:"color-input"},null,8,ml),[[e.vModelText,l.style.border.top.color]])]),e.createElementVNode("div",pl,[t[27]||(t[27]=e.createElementVNode("span",null,"下",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.bottom.style=i,class:"cell-input tiny"},[...t[26]||(t[26]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,fl),[[e.vModelSelect,l.style.border.bottom.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.bottom.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,vl),[[e.vModelText,l.style.border.bottom.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.bottom.color=i,class:"color-input"},null,8,bl),[[e.vModelText,l.style.border.bottom.color]])]),e.createElementVNode("div",yl,[t[29]||(t[29]=e.createElementVNode("span",null,"左",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.left.style=i,class:"cell-input tiny"},[...t[28]||(t[28]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,Vl),[[e.vModelSelect,l.style.border.left.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.left.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,hl),[[e.vModelText,l.style.border.left.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.left.color=i,class:"color-input"},null,8,El),[[e.vModelText,l.style.border.left.color]])]),e.createElementVNode("div",_l,[t[31]||(t[31]=e.createElementVNode("span",null,"右",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.right.style=i,class:"cell-input tiny"},[...t[30]||(t[30]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,gl),[[e.vModelSelect,l.style.border.right.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.right.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,kl),[[e.vModelText,l.style.border.right.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.right.color=i,class:"color-input"},null,8,Nl),[[e.vModelText,l.style.border.right.color]])])]),e.createElementVNode("button",{class:"mini-btn",onClick:i=>e.unref(W)(l,"all")},"全",8,wl),e.createElementVNode("button",{class:"mini-btn",onClick:i=>e.unref(W)(l,"none")},"无",8,$l)])]))),128))]),e.createElementVNode("button",{class:"btn btn-ghost",onClick:l=>b(n)},"+ 添加一个单元格",8,xl)],64)):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",Cl,[e.createElementVNode("div",Bl,[t[33]||(t[33]=e.createElementVNode("div",{class:"preview-label"},"实时预览",-1)),e.createElementVNode("div",Ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.sections,(n,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[n.type==="title"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"p-title",style:e.normalizeStyle(w(n))},e.toDisplayString(n.text||"大标题"),5)):n.type==="divider"?(e.openBlock(),e.createElementBlock("div",Sl)):n.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"p-text",style:e.normalizeStyle(w(n))},e.toDisplayString(n.text||"纯文本"),5)):n.type==="row"?(e.openBlock(),e.createElementBlock("div",Tl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.cells,(l,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"p-cell",style:e.normalizeStyle(e.unref(ie)(l))},[l.type==="field"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Dl,e.toDisplayString(l.label)+":",1),e.createElementVNode("span",Ml,e.toDisplayString(l.value||"字段值"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.text||"纯文本"),1)],64))],4))),128))])):e.createCommentVNode("",!0)],64))),128))])])])],2)]))}},zl=O(Al,[["__scopeId","data-v-197b51e4"]]),Fl={class:"toolbar"},Ll={class:"col-left"},ql={class:"sec-header"},Ol={class:"sec-type"},Rl={class:"sec-actions"},Il=["disabled","onClick"],Pl=["disabled","onClick"],jl=["onClick"],Ql={class:"cells-list"},Wl={class:"cell-toolbar"},Hl=["onClick"],Xl={class:"sec-row"},Gl=["onUpdate:modelValue"],Zl={class:"sec-row"},Jl=["onUpdate:modelValue"],Yl={class:"sec-row"},Kl=["onUpdate:modelValue"],eo={class:"inline-group"},to=["onUpdate:modelValue"],lo={class:"sec-row"},oo=["onUpdate:modelValue"],no=["onUpdate:modelValue"],ao={class:"chk-label"},io=["onUpdate:modelValue"],so={class:"chk-label"},ro=["onUpdate:modelValue"],co={class:"sec-row border-config"},uo={class:"border-group"},mo={class:"border-item"},po=["onUpdate:modelValue"],fo=["onUpdate:modelValue"],vo=["onUpdate:modelValue"],bo={class:"border-item"},yo=["onUpdate:modelValue"],Vo=["onUpdate:modelValue"],ho=["onUpdate:modelValue"],Eo={class:"border-item"},_o=["onUpdate:modelValue"],go=["onUpdate:modelValue"],ko=["onUpdate:modelValue"],No={class:"border-item"},wo=["onUpdate:modelValue"],$o=["onUpdate:modelValue"],xo=["onUpdate:modelValue"],Co=["onClick"],Bo=["onClick"],Uo=["onClick"],So={class:"sec-row"},To=["onUpdate:modelValue"],Do={class:"sec-row"},Mo=["onUpdate:modelValue"],Ao=["onUpdate:modelValue"],zo={class:"chk-label"},Fo=["onUpdate:modelValue"],Lo={class:"chk-label"},qo=["onUpdate:modelValue"],Oo={class:"sec-row"},Ro=["onUpdate:modelValue"],Io={class:"col-right"},Po={class:"preview-box"},jo={class:"preview-inner"},Qo={key:0,class:"p-divider"},Wo={key:2,class:"p-row"},Ho={__name:"DesignFooter",props:{sections:{type:Array,required:!0},breakpoint:{type:Number,default:1100}},setup(d){const o=d,{isNarrow:a}=H(o.breakpoint);function u(s){s==="divider"?o.sections.push({type:s}):s==="text"?o.sections.push({type:s,text:"纯文本",style:{color:"#303133",fontSize:14,bold:!1,italic:!1,align:"left"}}):s==="row"&&o.sections.push({type:s,cells:[{type:"text",text:"客户签字:",style:I("50%")}]})}function f(s){o.sections.splice(s,1)}function m(s,t){const n=s+t;n<0||n>=o.sections.length||([o.sections[s],o.sections[n]]=[o.sections[n],o.sections[s]])}function b(s){s.cells||(s.cells=[]),s.cells.push({type:"text",text:"签字:",style:I("50%")})}function g(s,t){s.cells.splice(t,1)}function w(s){const t={},n=s.style||{};return n.color&&(t.color=n.color),n.fontSize&&(t.fontSize=n.fontSize+"px"),n.bold&&(t.fontWeight="bold"),n.italic&&(t.fontStyle="italic"),n.align&&(t.textAlign=n.align),t}return(s,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Fl,[t[3]||(t[3]=e.createElementVNode("span",{class:"tip"},"💡 页面底部显示签字栏、盖章区等,结构和页面头部一样",-1)),e.createElementVNode("button",{class:"btn",onClick:t[0]||(t[0]=n=>u("divider"))},"+ 分隔线"),e.createElementVNode("button",{class:"btn",onClick:t[1]||(t[1]=n=>u("row"))},"+ 字段行"),e.createElementVNode("button",{class:"btn",onClick:t[2]||(t[2]=n=>u("text"))},"+ 纯文本")]),e.createElementVNode("div",{class:e.normalizeClass(["two-col",{"is-narrow":e.unref(a)}])},[e.createElementVNode("div",Ll,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.sections,(n,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:"sec-block"},[e.createElementVNode("div",ql,[e.createElementVNode("span",Ol,e.toDisplayString(n.type==="row"?"字段行":n.type==="divider"?"分隔线":"纯文本"),1),e.createElementVNode("div",Rl,[e.createElementVNode("button",{class:"mini-btn",disabled:p===0,onClick:l=>m(p,-1)},"↑",8,Il),e.createElementVNode("button",{class:"mini-btn",disabled:p>=d.sections.length-1,onClick:l=>m(p,1)},"↓",8,Pl),e.createElementVNode("button",{class:"mini-btn danger",onClick:l=>f(p)},"删",8,jl)])]),n.type==="row"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Ql,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.cells,(l,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"cell-block"},[e.createElementVNode("div",Wl,[e.createElementVNode("strong",null,e.toDisplayString($+1),1),e.createElementVNode("button",{class:"mini-btn danger",onClick:i=>g(n,$)},"×",8,Hl)]),e.createElementVNode("div",Xl,[t[5]||(t[5]=e.createElementVNode("label",null,"类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.type=i,class:"cell-input small"},[...t[4]||(t[4]=[e.createElementVNode("option",{value:"text"},"纯文本",-1)])],8,Gl),[[e.vModelSelect,l.type]])]),e.createElementVNode("div",Zl,[t[6]||(t[6]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.text=i,class:"cell-input"},null,8,Jl),[[e.vModelText,l.text]])]),e.createElementVNode("div",Yl,[t[9]||(t[9]=e.createElementVNode("label",null,"宽度",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.style.width=i,class:"cell-input small",placeholder:"如 50%"},null,8,Kl),[[e.vModelText,l.style.width]]),e.createElementVNode("div",eo,[t[8]||(t[8]=e.createElementVNode("label",{class:"muted"},"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.align=i,class:"cell-input small"},[...t[7]||(t[7]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,to),[[e.vModelSelect,l.style.align]])])]),e.createElementVNode("div",lo,[t[12]||(t[12]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.color=i,class:"color-input"},null,8,oo),[[e.vModelText,l.style.color]]),t[13]||(t[13]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":i=>l.style.fontSize=i,type:"number",class:"cell-input tiny",min:"10",max:"48"},null,8,no),[[e.vModelText,l.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",ao,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.bold=i},null,8,io),[[e.vModelCheckbox,l.style.bold]]),t[10]||(t[10]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",so,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.italic=i},null,8,ro),[[e.vModelCheckbox,l.style.italic]]),t[11]||(t[11]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",co,[t[22]||(t[22]=e.createElementVNode("label",null,"边框",-1)),e.createElementVNode("div",uo,[e.createElementVNode("div",mo,[t[15]||(t[15]=e.createElementVNode("span",null,"上",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.top.style=i,class:"cell-input tiny"},[...t[14]||(t[14]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,po),[[e.vModelSelect,l.style.border.top.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.top.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,fo),[[e.vModelText,l.style.border.top.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.top.color=i,class:"color-input"},null,8,vo),[[e.vModelText,l.style.border.top.color]])]),e.createElementVNode("div",bo,[t[17]||(t[17]=e.createElementVNode("span",null,"下",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.bottom.style=i,class:"cell-input tiny"},[...t[16]||(t[16]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,yo),[[e.vModelSelect,l.style.border.bottom.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.bottom.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,Vo),[[e.vModelText,l.style.border.bottom.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.bottom.color=i,class:"color-input"},null,8,ho),[[e.vModelText,l.style.border.bottom.color]])]),e.createElementVNode("div",Eo,[t[19]||(t[19]=e.createElementVNode("span",null,"左",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.left.style=i,class:"cell-input tiny"},[...t[18]||(t[18]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,_o),[[e.vModelSelect,l.style.border.left.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.left.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,go),[[e.vModelText,l.style.border.left.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.left.color=i,class:"color-input"},null,8,ko),[[e.vModelText,l.style.border.left.color]])]),e.createElementVNode("div",No,[t[21]||(t[21]=e.createElementVNode("span",null,"右",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i=>l.style.border.right.style=i,class:"cell-input tiny"},[...t[20]||(t[20]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,wo),[[e.vModelSelect,l.style.border.right.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":i=>l.style.border.right.width=i,class:"cell-input tiny",min:"0",max:"20",step:"1"},null,8,$o),[[e.vModelText,l.style.border.right.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.border.right.color=i,class:"color-input"},null,8,xo),[[e.vModelText,l.style.border.right.color]])])]),e.createElementVNode("button",{class:"mini-btn",onClick:i=>e.unref(W)(l,"all")},"全",8,Co),e.createElementVNode("button",{class:"mini-btn",onClick:i=>e.unref(W)(l,"none")},"无",8,Bo)])]))),128))]),e.createElementVNode("button",{class:"btn btn-ghost",onClick:l=>b(n)},"+ 添加一个单元格",8,Uo)],64)):n.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",So,[t[23]||(t[23]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l=>n.text=l,class:"cell-input"},null,8,To),[[e.vModelText,n.text]])]),e.createElementVNode("div",Do,[t[26]||(t[26]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":l=>n.style.color=l,class:"color-input"},null,8,Mo),[[e.vModelText,n.style.color]]),t[27]||(t[27]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l=>n.style.fontSize=l,type:"number",class:"cell-input tiny",min:"10",max:"48"},null,8,Ao),[[e.vModelText,n.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",zo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l=>n.style.bold=l},null,8,Fo),[[e.vModelCheckbox,n.style.bold]]),t[24]||(t[24]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l=>n.style.italic=l},null,8,qo),[[e.vModelCheckbox,n.style.italic]]),t[25]||(t[25]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",Oo,[t[29]||(t[29]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l=>n.style.align=l,class:"cell-input small"},[...t[28]||(t[28]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Ro),[[e.vModelSelect,n.style.align]])])],64)):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",Io,[e.createElementVNode("div",Po,[t[30]||(t[30]=e.createElementVNode("div",{class:"preview-label"},"底部预览",-1)),e.createElementVNode("div",jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.sections,(n,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[n.type==="divider"?(e.openBlock(),e.createElementBlock("div",Qo)):n.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"p-text",style:e.normalizeStyle(w(n))},e.toDisplayString(n.text||"纯文本"),5)):n.type==="row"?(e.openBlock(),e.createElementBlock("div",Wo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.cells,(l,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"p-cell",style:e.normalizeStyle(e.unref(ie)(l))},e.toDisplayString(l.text),5))),128))])):e.createCommentVNode("",!0)],64))),128))])])])],2)]))}},Xo=O(Ho,[["__scopeId","data-v-3b5d8a7a"]]),Go={class:"col-left"},Zo={class:"sec-header"},Jo={class:"sec-type"},Yo={class:"sec-actions"},Ko=["disabled","onClick"],en=["disabled","onClick"],tn=["onClick"],ln={class:"sec-row"},on=["onUpdate:modelValue"],nn=["onUpdate:modelValue"],an={class:"sec-row"},dn=["onUpdate:modelValue"],sn={key:0,class:"sec-row"},rn=["onUpdate:modelValue"],cn={key:1,class:"sec-row"},un=["onUpdate:modelValue"],mn={key:2,class:"sec-row"},pn=["onUpdate:modelValue"],fn={class:"sec-row"},vn=["onUpdate:modelValue"],bn=["onUpdate:modelValue"],yn={class:"chk-label"},Vn=["onUpdate:modelValue"],hn={class:"chk-label"},En=["onUpdate:modelValue"],_n={key:0,class:"empty-hint"},gn={class:"col-right"},kn={class:"summary-preview"},Nn={class:"sp-label"},wn={key:0,class:"empty-hint"},$n={__name:"DesignSummary",props:{fields:{type:Array,required:!0},breakpoint:{type:Number,default:1100}},setup(d){const o=d,{isNarrow:a}=H(o.breakpoint);function u(n){return n==="MANUAL_INPUT"?"手动输入":n==="AUTO_CALC"?"自动计算":"纯文本"}function f(n,p){let l=n,$=2;for(;p.has(l);)l=n+"_"+$++;return l}function m(){let n=0;for(const p of o.fields){const l=/^field_(\d+)$/.exec(p.field);l&&(n=Math.max(n,parseInt(l[1],10)))}return n+1}function b(){const n=new Set([...o.fields.map(l=>l.field)]),p="field_"+String(m()).padStart(4,"0");o.fields.push({field:f(p,n),label:"新款项",type:"MANUAL_INPUT",default:0,formula:"",style:{color:"#606266",fontSize:13,bold:!1,italic:!1}})}function g(n){o.fields.splice(n,1)}function w(n,p){const l=n+p;l<0||l>=o.fields.length||([o.fields[n],o.fields[l]]=[o.fields[l],o.fields[n]])}function s(n){const p={},l=n.style||{};return l.color&&(p.color=l.color),l.fontSize&&(p.fontSize=l.fontSize+"px"),l.bold&&(p.fontWeight="bold"),l.italic&&(p.fontStyle="italic"),p}function t(n){return n.type==="AUTO_CALC"?n.formula||"group_total":n.type==="PLAIN_TEXT"?n.text||"(未填写文字)":n.default??0}return(n,p)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"toolbar"},[p[0]||(p[0]=e.createElementVNode("span",{class:"tip"},"💡 汇总区域显示在表格底部,支持手动输入、公式自动计算和纯文本展示",-1)),e.createElementVNode("button",{class:"btn",onClick:b},"+ 添加字段")]),e.createElementVNode("div",{class:e.normalizeClass(["two-col",{"is-narrow":e.unref(a)}])},[e.createElementVNode("div",Go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.fields,(l,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:"sec-block"},[e.createElementVNode("div",Zo,[e.createElementVNode("span",Jo,e.toDisplayString(u(l.type)),1),e.createElementVNode("div",Yo,[e.createElementVNode("button",{class:"mini-btn",disabled:$===0,onClick:i=>w($,-1)},"↑",8,Ko),e.createElementVNode("button",{class:"mini-btn",disabled:$>=d.fields.length-1,onClick:i=>w($,1)},"↓",8,en),e.createElementVNode("button",{class:"mini-btn danger",onClick:i=>g($)},"删",8,tn)])]),e.createElementVNode("div",ln,[p[1]||(p[1]=e.createElementVNode("label",null,"字段名",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":i=>l.field=i},null,8,on),[[e.vModelText,l.field]]),p[2]||(p[2]=e.createElementVNode("label",null,"显示标签",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":i=>l.label=i},null,8,nn),[[e.vModelText,l.label]])]),e.createElementVNode("div",an,[p[4]||(p[4]=e.createElementVNode("label",null,"类型",-1)),e.withDirectives(e.createElementVNode("select",{class:"cell-input","onUpdate:modelValue":i=>l.type=i},[...p[3]||(p[3]=[e.createElementVNode("option",{value:"MANUAL_INPUT"},"手动输入(自定义金额)",-1),e.createElementVNode("option",{value:"AUTO_CALC"},"自动计算(公式)",-1),e.createElementVNode("option",{value:"PLAIN_TEXT"},"纯文本(固定文字)",-1)])],8,dn),[[e.vModelSelect,l.type]])]),l.type==="MANUAL_INPUT"?(e.openBlock(),e.createElementBlock("div",sn,[p[5]||(p[5]=e.createElementVNode("label",null,"默认值",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input",type:"number","onUpdate:modelValue":i=>l.default=i,placeholder:"可选,切换模板时自动填充"},null,8,rn),[[e.vModelText,l.default,void 0,{number:!0}]])])):e.createCommentVNode("",!0),l.type==="AUTO_CALC"?(e.openBlock(),e.createElementBlock("div",cn,[p[6]||(p[6]=e.createElementVNode("label",null,"公式",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":i=>l.formula=i,placeholder:"如 group_total + service_fee 或 group_total * 0.06"},null,8,un),[[e.vModelText,l.formula]])])):e.createCommentVNode("",!0),l.type==="PLAIN_TEXT"?(e.openBlock(),e.createElementBlock("div",mn,[p[7]||(p[7]=e.createElementVNode("label",null,"文字内容",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input","onUpdate:modelValue":i=>l.text=i,placeholder:"如:税率 1%"},null,8,pn),[[e.vModelText,l.text]])])):e.createCommentVNode("",!0),e.createElementVNode("div",fn,[p[10]||(p[10]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i=>l.style.color=i,class:"color-input"},null,8,vn),[[e.vModelText,l.style.color]]),p[11]||(p[11]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{class:"cell-input tiny",type:"number","onUpdate:modelValue":i=>l.style.fontSize=i,min:"10",max:"48",placeholder:"14"},null,8,bn),[[e.vModelText,l.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",yn,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.bold=i},null,8,Vn),[[e.vModelCheckbox,l.style.bold]]),p[8]||(p[8]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",hn,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":i=>l.style.italic=i},null,8,En),[[e.vModelCheckbox,l.style.italic]]),p[9]||(p[9]=e.createTextVNode(" 斜体 ",-1))])])]))),128)),d.fields.length===0?(e.openBlock(),e.createElementBlock("div",_n,"还没有汇总项,点右上角按钮添加")):e.createCommentVNode("",!0)]),e.createElementVNode("div",gn,[p[12]||(p[12]=e.createElementVNode("h4",{class:"preview-title"},"实时预览",-1)),e.createElementVNode("div",kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.fields,(l,$)=>(e.openBlock(),e.createElementBlock("div",{class:"sp-row",key:$},[e.createElementVNode("span",Nn,e.toDisplayString(l.label||"标签"),1),e.createElementVNode("span",{class:"sp-value",style:e.normalizeStyle(s(l))},e.toDisplayString(t(l)),5)]))),128)),d.fields.length===0?(e.openBlock(),e.createElementBlock("div",wn,"暂无汇总项")):e.createCommentVNode("",!0)]),p[13]||(p[13]=e.createStaticVNode('<div class="preview-help" data-v-8464c396><p data-v-8464c396><b data-v-8464c396>可用变量:</b></p><p data-v-8464c396><code data-v-8464c396>group_total</code> 明细小计合计</p><p data-v-8464c396><code data-v-8464c396>quantity_sum</code> 数量总和(需字段名为 quantity)</p><p data-v-8464c396><code data-v-8464c396>grand_total</code> 报价总额</p><p data-v-8464c396><code data-v-8464c396>各手动输入项字段名</code> 互相引用</p><p style="margin-top:6px;color:#909399;font-size:12px;" data-v-8464c396>完整列表请看使用教程</p></div>',1))])],2)]))}},xn=O($n,[["__scopeId","data-v-8464c396"]]),Cn={class:"help-dialog"},Bn={class:"help-header"},Un={__name:"HelpModal",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(d){return(o,a)=>d.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"help-modal",onClick:a[1]||(a[1]=e.withModifiers(u=>o.$emit("close"),["self"]))},[e.createElementVNode("div",Cn,[e.createElementVNode("div",Bn,[a[2]||(a[2]=e.createElementVNode("h3",null,"📖 报价单生成器 — 使用教程",-1)),e.createElementVNode("button",{class:"close-btn",onClick:a[0]||(a[0]=u=>o.$emit("close"))},"✕")]),a[3]||(a[3]=e.createStaticVNode(`<div class="help-body" data-v-9af33ede><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>🔁 整体三步流程</h4><p data-v-9af33ede>顶部导航栏有三个步骤,按顺序操作即可生成一份完整报价单:</p><ol class="steps" data-v-9af33ede><li data-v-9af33ede><b data-v-9af33ede>① 设计模板</b> — 定义表头列、页面头部信息、汇总区域、底部签字栏等</li><li data-v-9af33ede><b data-v-9af33ede>② 填写数据</b> — 根据模板录入每条明细,自动分组、自动算小计</li><li data-v-9af33ede><b data-v-9af33ede>③ 预览导出</b> — 查看最终效果,一键导出 Excel 或打印</li></ol><p class="tip-box" data-v-9af33ede>💡 也可以从第 ② 步开始,系统已内置 3 个示例模板可直接使用</p></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>① 表头列 — 定义表格里有哪些列</h4><p data-v-9af33ede>点击顶部工具栏的 <b data-v-9af33ede>+ 添加字段</b> 按钮可以新增一列,然后在表格中把「类型」改成你想要的:</p><table class="help-table" data-v-9af33ede><thead data-v-9af33ede><tr data-v-9af33ede><th data-v-9af33ede>按钮</th><th data-v-9af33ede>字段类型</th><th data-v-9af33ede>说明</th></tr></thead><tbody data-v-9af33ede><tr data-v-9af33ede><td data-v-9af33ede>文本列</td><td data-v-9af33ede>INPUT</td><td data-v-9af33ede>普通文字输入,用于名称、描述等</td></tr><tr data-v-9af33ede><td data-v-9af33ede>数字列</td><td data-v-9af33ede>NUMBER</td><td data-v-9af33ede>只能填数字,用于数量、单价等</td></tr><tr data-v-9af33ede><td data-v-9af33ede>下拉列</td><td data-v-9af33ede>SELECT_DICT</td><td data-v-9af33ede>固定选项,点击列中的"下拉选项"输入选项,用逗号分隔,如 <code data-v-9af33ede>设备,材料,安装</code></td></tr><tr data-v-9af33ede><td data-v-9af33ede>多行文本列</td><td data-v-9af33ede>TEXTAREA</td><td data-v-9af33ede>可输入较长文字,用于备注、说明等</td></tr></tbody></table><p data-v-9af33ede><b data-v-9af33ede>特殊类型列:</b></p><ul data-v-9af33ede><li data-v-9af33ede><b data-v-9af33ede>自动序号</b> — 自动从 1 开始递增,字段名随便改(建议叫 <code data-v-9af33ede>seq</code>)</li><li data-v-9af33ede><b data-v-9af33ede>自动计算(公式)</b> — 用任意公式算值,公式里可引用<b data-v-9af33ede>同一行其他列的字段名</b>,如 <code data-v-9af33ede>quantity * unit_price</code>。字段名必须和你在表头里设置的一致,比如数量列叫 <code data-v-9af33ede>qty</code> 就要写 <code data-v-9af33ede>qty * unit_price</code></li></ul><p data-v-9af33ede><b data-v-9af33ede>列顺序:</b>点行末的 ↑ ↓ 按钮上下移动,或拖动行来调整</p><p data-v-9af33ede><b data-v-9af33ede>列宽度:</b>单位是像素(px),在"宽度"列填数字</p><p class="tip-box" data-v-9af33ede>💡 下拉列的选项是写在逗号分隔的输入框里,保存后切换到「填写数据」页面时会变成下拉选择框</p></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>② 页面头部 — 报价单的标题和项目信息</h4><p data-v-9af33ede>头部由多个"段落"顺序组成,每个段落可以是以下 4 种类型:</p><table class="help-table" data-v-9af33ede><thead data-v-9af33ede><tr data-v-9af33ede><th data-v-9af33ede>类型</th><th data-v-9af33ede>说明</th><th data-v-9af33ede>配置项</th></tr></thead><tbody data-v-9af33ede><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>大标题</b></td><td data-v-9af33ede>最顶部的报价单标题</td><td data-v-9af33ede>文字、字号、粗体、对齐方式</td></tr><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>字段行</b></td><td data-v-9af33ede>一行可以放多个单元格,每个单元格要么是可编辑字段,要么是固定文字</td><td data-v-9af33ede>每个单元格单独配置</td></tr><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>分隔线</b></td><td data-v-9af33ede>画一条灰色横线</td><td data-v-9af33ede>无配置</td></tr><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>纯文本</b></td><td data-v-9af33ede>一段固定文字,如"此报价单有效期30天"</td><td data-v-9af33ede>文字内容、对齐方式</td></tr></tbody></table><p data-v-9af33ede><b data-v-9af33ede>字段行详解:</b></p><ul data-v-9af33ede><li data-v-9af33ede>点"➕ 添加一个单元格"来增加这一行里的格子数量</li><li data-v-9af33ede>每个格子选"类型":<b data-v-9af33ede>字段(可编辑)</b> 或 <b data-v-9af33ede>纯文本</b></li><li data-v-9af33ede>字段类型要填 <b data-v-9af33ede>标签</b>(如"项目名称")和 <b data-v-9af33ede>绑定字段</b>(如 <code data-v-9af33ede>projectName</code>)</li><li data-v-9af33ede>绑定字段是关键!同一个绑定字段名在整个模板中要保持一致,后续数据填写和导出都靠它</li><li data-v-9af33ede>宽度用百分比,如 <code data-v-9af33ede>50%</code>、<code data-v-9af33ede>33%</code>,一行所有格子宽度加起来建议 = 100%</li></ul><p class="tip-box" data-v-9af33ede>💡 右侧"实时预览"区域会随着你的编辑即时变化,所见即所得</p></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>③ 汇总区域 — 表格底部的费用合计</h4><p data-v-9af33ede>汇总项显示在明细表格的下方(导出 Excel 时会自动排在表格右侧底部)。</p><table class="help-table" data-v-9af33ede><thead data-v-9af33ede><tr data-v-9af33ede><th data-v-9af33ede>类型</th><th data-v-9af33ede>说明</th></tr></thead><tbody data-v-9af33ede><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>手动输入(自定义金额)</b></td><td data-v-9af33ede>任意需要手工填写的金额项:人工费、服务费、运费、税费、折扣、其他费用等。可以在"默认值"里预设一个初始值</td></tr><tr data-v-9af33ede><td data-v-9af33ede><b data-v-9af33ede>自动计算(公式)</b></td><td data-v-9af33ede>系统自动算好的值,需要写公式。<code data-v-9af33ede>grand_total</code> 会自动把所有手动输入项加进去</td></tr></tbody></table><p data-v-9af33ede><b data-v-9af33ede>自动计算公式里的可用变量(固定):</b></p><table class="help-table" data-v-9af33ede><thead data-v-9af33ede><tr data-v-9af33ede><th data-v-9af33ede>变量名</th><th data-v-9af33ede>含义</th><th data-v-9af33ede>说明</th></tr></thead><tbody data-v-9af33ede><tr data-v-9af33ede><td data-v-9af33ede><code data-v-9af33ede>group_total</code></td><td data-v-9af33ede>明细小计合计</td><td data-v-9af33ede>所有行的自动计算列(小计列)求和</td></tr><tr data-v-9af33ede><td data-v-9af33ede><code data-v-9af33ede>grand_total</code></td><td data-v-9af33ede>报价总额</td><td data-v-9af33ede>group_total + 所有手动输入项之和</td></tr><tr data-v-9af33ede><td data-v-9af33ede><code data-v-9af33ede>quantity_sum</code></td><td data-v-9af33ede>数量总和</td><td data-v-9af33ede>所有行 <b data-v-9af33ede>字段名为 quantity</b> 的列求和。如果表头数量列不叫 quantity,这个值就是 0</td></tr></tbody></table><p data-v-9af33ede><b data-v-9af33ede>动态可用变量(随你的模板定义):</b></p><p data-v-9af33ede>你在汇总区域里定义的<b data-v-9af33ede>每一个手动输入项的字段名</b>,都会自动成为可用变量,它们之间也能互相引用。</p><p data-v-9af33ede>举个例子:如果你定义了 <code data-v-9af33ede>labor_cost</code>、<code data-v-9af33ede>service_fee</code>、<code data-v-9af33ede>discount</code> 三个手动项,那么自动计算公式里可以写:</p><pre class="code" data-v-9af33ede>group_total + labor_cost + service_fee - discount</pre><p data-v-9af33ede><b data-v-9af33ede>字段名命名建议:</b></p><ul data-v-9af33ede><li data-v-9af33ede><code data-v-9af33ede>grand_total</code> — 报价总额(特殊字段,系统会把所有手动项加进去)</li><li data-v-9af33ede><code data-v-9af33ede>group_total</code> — 明细小计(建议不要手动改成别的,公式里会用到)</li><li data-v-9af33ede><code data-v-9af33ede>quantity</code> — 表头里的数量列字段名(如果想用 <code data-v-9af33ede>quantity_sum</code> 变量,必须叫这个)</li><li data-v-9af33ede>其他手动项随意,如 <code data-v-9af33ede>service_fee</code>、<code data-v-9af33ede>freight</code>、<code data-v-9af33ede>tax_amount</code>、<code data-v-9af33ede>discount</code> 等</li></ul></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>④ 页面底部 — 签字栏、盖章区</h4><p data-v-9af33ede>结构和"页面头部"完全一样,支持:分隔线、字段行、纯文本。</p><p data-v-9af33ede>常见用法:</p><ul data-v-9af33ede><li data-v-9af33ede>分隔线 → 分隔表格和签字区</li><li data-v-9af33ede>字段行 → 左边"客户签字:________",右边"业务员签字:________"</li><li data-v-9af33ede>纯文本 → 居中写"公司盖章:"</li></ul></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>💾 保存与模板管理</h4><ul data-v-9af33ede><li data-v-9af33ede><b data-v-9af33ede>💾 保存修改</b> — 直接更新当前选中的模板</li><li data-v-9af33ede><b data-v-9af33ede>➕ 另存为新模板</b> — 输入一个新名字,基于当前模板复制出一个全新的模板</li><li data-v-9af33ede>顶部的下拉框可以在已有的模板之间切换,切换后下方所有配置会自动加载</li></ul><p class="tip-box" data-v-9af33ede>⚠️ 目前模板数据保存在浏览器内存中(刷新后会恢复默认),如果要持久化存储,需要把模板同步到后端接口</p></section><section class="help-section" data-v-9af33ede><h4 data-v-9af33ede>🔢 分组与计算规则(高级)</h4><p data-v-9af33ede>在「表头列」tab 的列表下方,有一个<b data-v-9af33ede>分组规则</b>配置框:</p><ul data-v-9af33ede><li data-v-9af33ede><b data-v-9af33ede>按哪一列分组</b> — 选择一列后,相同值的行会自动合并单元格,每组末尾自动生成小计行。选「不分组」则不分组、不显示小计,但列上勾选了「相同值合并」的列仍然会对相邻相同值做合并</li></ul><p data-v-9af33ede>对应模板数据结构:</p><pre class="code" data-v-9af33ede>{
|
|
12
|
+
</style></head><body>${b}</body></html>`),k.document.close(),k.onload=()=>{k.print()}}return o({print:L,exportExcel:C}),(V,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tpl.header_sections,(d,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"h"+k},[d.type==="title"?(e.openBlock(),e.createElementBlock("h1",{key:0,class:"qukt-q-title",style:e.normalizeStyle(n(d))},e.toDisplayString(d.text),5)):d.type==="divider"?(e.openBlock(),e.createElementBlock("div",fe)):d.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"qukt-q-text",style:e.normalizeStyle(n(d))},e.toDisplayString(d.text),5)):d.type==="row"?(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.cells,(y,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"qukt-q-cell",style:e.normalizeStyle(p(y))},[y.type==="field"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",ye,e.toDisplayString(y.label)+":",1),e.createElementVNode("span",Ve,e.toDisplayString(y.value??i.placeholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(y.text),1)],64))],4))),128))])):e.createCommentVNode("",!0)],64))),128)),i.tpl.columns&&i.tpl.columns.length>0?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("table",he,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tpl.columns,d=>(e.openBlock(),e.createElementBlock("th",{key:d.field,style:e.normalizeStyle({width:d.width+"px"})},e.toDisplayString(d.title),5))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(d,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k},[d.__is_subtotal?(e.openBlock(),e.createElementBlock("tr",Ne,[e.createElementVNode("td",{colspan:i.tpl.columns.length-1,class:"subtotal-label"},"小计("+e.toDisplayString(d.__group_key)+")",9,ge),e.createElementVNode("td",qe,e.toDisplayString(f(d.__group_sum)),1)])):(e.openBlock(),e.createElementBlock("tr",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tpl.columns,(y,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.field},[h(q.value.indexOf(d),y.field)>0?(e.openBlock(),e.createElementBlock("td",{key:0,rowspan:h(q.value.indexOf(d),y.field),class:e.normalizeClass({"merged-cell":h(q.value.indexOf(d),y.field)>1})},[y.editor==="AUTO_SEQ"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(k+1),1)],64)):y.editor==="AUTO_CALC"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(f($(d))),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(d[y.field]??""),1)],64))],10,we)):e.createCommentVNode("",!0)],64))),128))]))],64))),128)),q.value.length===0?(e.openBlock(),e.createElementBlock("tr",$e,[e.createElementVNode("td",{colspan:i.tpl.columns.length,class:"qukt-q-empty"},"(暂无数据)",8,xe)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),i.tpl.summary_fields&&i.tpl.summary_fields.length>0?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tpl.summary_fields,d=>(e.openBlock(),e.createElementBlock("div",{key:d.field,class:"qukt-q-summary-row"},[e.createElementVNode("span",Be,e.toDisplayString(d.label),1),e.createElementVNode("span",{class:"qukt-q-summary-value",style:e.normalizeStyle(g(d))},e.toDisplayString(d.type==="PLAIN_TEXT"?d.text:f(U(d))),5)]))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.tpl.footer_sections,(d,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"f"+k},[d.type==="divider"?(e.openBlock(),e.createElementBlock("div",Se)):d.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qukt-q-text",style:e.normalizeStyle(n(d))},e.toDisplayString(d.text),5)):d.type==="row"?(e.openBlock(),e.createElementBlock("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.cells,(y,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"qukt-q-cell",style:e.normalizeStyle(p(y))},e.toDisplayString(y.text),5))),128))])):e.createCommentVNode("",!0)],64))),128))])]))}};function R(i){return JSON.parse(JSON.stringify(i))}function Te(i,o){let l=null;const r=function(...u){clearTimeout(l),l=setTimeout(()=>i.apply(this,u),o)};return r.cancel=()=>{clearTimeout(l),l=null},Object.defineProperty(r,"timer",{get(){return l},configurable:!0}),r}function oe(i=[]){return Array.isArray(i)?i.map(o=>{const l=Array.isArray(o.dict)?o.dict:[];return{...o,field:o.field||"",title:o.title||"",editor:o.editor||"INPUT",width:o.width??130,dictStr:l.length?l.join(","):o.dictStr||"",formula:o.formula||"",merge_on_group:o.merge_on_group??!1}}):[]}function De(i){return i.map(o=>{const l={field:o.field,title:o.title,editor:o.editor,width:o.width};return o.editor==="SELECT_DICT"&&(l.dict=(o.dictStr||"").split(",").map(r=>r.trim()).filter(Boolean)),o.editor==="AUTO_CALC"&&(l.formula=o.formula||""),o.editor!=="AUTO_SEQ"&&o.editor!=="AUTO_CALC"&&(l.merge_on_group=!!o.merge_on_group),l})}function Me(i,o,l){const r={INPUT:"文本",NUMBER:"数值",SELECT_DICT:"选项",TEXTAREA:"说明",AUTO_CALC:"计算值",AUTO_SEQ:"序号"},u={INPUT:130,NUMBER:100,SELECT_DICT:130,TEXTAREA:200,AUTO_CALC:120,AUTO_SEQ:60};return{field:o,title:r[i]||l||"新列",editor:i,width:u[i]||120,dictStr:"",formula:"",merge_on_group:!1}}function ne(i=[],o={}){const l=e.ref(oe(R(i))),r=e.ref({merge_field:o.merge_field||"",show_detail_subtotal:o.show_detail_subtotal??!0}),u=e.computed(()=>({columns:De(l.value),group_rules:(()=>{const N=r.value.merge_field;return N?{merge_field:N,show_detail_subtotal:r.value.show_detail_subtotal??!0}:null})()}));function p(N){l.value=oe(R(N||[]))}function f(N){r.value={merge_field:N.merge_field||"",show_detail_subtotal:N.show_detail_subtotal??!0}}return e.reactive({columns:l,groupRules:r,tpl:u,setColumns:p,setGroupRules:f})}function ie(){return{top:{style:"",width:1,color:"#dcdfe6"},bottom:{style:"",width:1,color:"#dcdfe6"},left:{style:"",width:1,color:"#dcdfe6"},right:{style:"",width:1,color:"#dcdfe6"}}}function j(i="auto"){return{width:i,color:"#303133",fontSize:13,bold:!1,italic:!1,align:"left",border:ie()}}function H(i,o){i.style||(i.style=j());const l=o==="none"?{style:"",width:0,color:"#dcdfe6"}:{style:"solid",width:1,color:"#dcdfe6"};i.style.border={top:{...l},bottom:{...l},left:{...l},right:{...l}}}function se(i){const o=i.style||{},l={width:o.width||"auto"};l.textAlign=o.align||"left",o.color&&(l.color=o.color),o.fontSize&&(l.fontSize=o.fontSize+"px"),o.bold&&(l.fontWeight="bold"),o.italic&&(l.fontStyle="italic");const r=o.border;if(r)for(const u of["top","bottom","left","right"]){const p=r[u];p&&p.style&&p.width>0&&(l["border-"+u]=`${p.width}px ${p.style} ${p.color||"#dcdfe6"}`)}return l}function Ae(i=[]){for(const o of i)o.type==="title"&&(o.type="text",o.style=o.style||{color:"#303133",fontSize:18,bold:!0,italic:!1,align:"center"},o.align&&!o.style.align&&(o.style.align=o.align,delete o.align)),o.type==="text"&&(o.style=o.style||{},o.align&&!o.style.align&&(o.style.align=o.align,delete o.align),o.style.color===void 0&&(o.style.color="#303133"),o.style.fontSize===void 0&&(o.style.fontSize=14),o.style.bold===void 0&&(o.style.bold=!1),o.style.italic===void 0&&(o.style.italic=!1),o.style.align===void 0&&(o.style.align="left"))}function ze(i=[]){for(const o of i)if(o.type==="row"&&o.cells)for(const l of o.cells)l.style||(l.style=j()),l.style.width===void 0&&(l.style.width="auto"),l.style.color===void 0&&(l.style.color="#303133"),l.style.fontSize===void 0&&(l.style.fontSize=13),l.style.bold===void 0&&(l.style.bold=!1),l.style.italic===void 0&&(l.style.italic=!1),l.style.align===void 0&&(l.style.align="left"),l.style.border===void 0&&(l.style.border=ie())}function Fe(){return[{type:"text",text:"报 价 单",style:{color:"#303133",fontSize:22,bold:!0,italic:!1,align:"center"}},{type:"divider"},{type:"row",cells:[{type:"field",label:"项目名称",bind:"projectName",style:j("50%")},{type:"field",label:"日期",bind:"quotationDate",style:j("50%")}]}]}function re(i,o=!1){if(!i||i.length===0)if(o)i=Fe();else return[];return Ae(i),ze(i),i}function X(i=[],o={}){const{isHeader:l=!1}=o,r=e.ref(R(re(i,l)));function u(f){r.value=R(re(f||[],l))}function p(){return R(r.value)}return e.reactive({sections:r,setSections:u,toTpl:p})}function G(i=[]){let o=0;for(const l of i)if(l.field){const r=/^field_(\d+)$/.exec(l.field);r&&(o=Math.max(o,parseInt(r[1],10)))}for(const l of i)l.field||(l.field="field_"+String(++o).padStart(4,"0")),l.type==="AUTO_CALC"&&!l.formula&&(l.formula="group_total"),l.style===void 0&&(l.style={color:"#606266",fontSize:13,bold:!1,italic:!1}),l.style.color===void 0&&(l.style.color="#606266"),l.style.fontSize===void 0&&(l.style.fontSize=13),l.style.bold===void 0&&(l.style.bold=!1),l.style.italic===void 0&&(l.style.italic=!1)}function ae(i=[]){const o=e.ref(R(i||[]));G(o.value);const l=e.computed(()=>R(o.value));function r(p){o.value=R(p||[]),G(o.value)}function u(){return G(o.value),R(o.value)}return e.reactive({fields:o,tpl:l,setFields:r,toTpl:u})}const Le=["XXXX","YYYY","ZZZZ","WWWW"];function de(i,o=3){const l=[],r=Le;for(let u=0;u<o;u++){const p={};for(const f of i)if(!(f.editor==="AUTO_SEQ"||f.editor==="AUTO_CALC"))if(f.editor==="NUMBER")p[f.field]=Math.floor(Math.random()*900+100);else if(f.editor==="SELECT_DICT"){const N=(f.dictStr||(f.dict?f.dict.join(","):"")).split(",").map($=>$.trim()).filter(Boolean);p[f.field]=N[u%Math.max(N.length,1)]||r[u%r.length]}else p[f.field]=r[u%r.length];l.push(p)}return l}function Z(i=1100){const o=e.ref(!1);function l(){o.value=window.innerWidth<=i}return e.onMounted(()=>{l(),window.addEventListener("resize",l)}),e.onUnmounted(()=>{window.removeEventListener("resize",l)}),{isNarrow:o}}const Oe={class:"qukt-toolbar"},Re={class:"qukt-btn-group-inline"},je={class:"qukt-design-table"},Ie={class:"idx"},Pe=["onUpdate:modelValue"],Qe=["onUpdate:modelValue"],We=["onUpdate:modelValue"],He=["onUpdate:modelValue"],Xe=["onUpdate:modelValue"],Ge=["onUpdate:modelValue"],Ze={key:2,class:"qukt-muted"},Je={key:3,class:"qukt-muted"},Ye={class:"qukt-col-merge"},Ke={key:0},ve=["onUpdate:modelValue"],et={key:1,class:"qukt-muted"},tt=["disabled","onClick"],lt=["disabled","onClick"],ot=["onClick"],nt={__name:"DesignCols",props:{columns:{type:Array,required:!0},groupRules:{type:Object,default:()=>({})},breakpoint:{type:Number,default:1100}},emits:["help","open-group"],setup(i){const o=i,{isNarrow:l}=Z(o.breakpoint),r=e.computed(()=>!!o.groupRules.merge_field);function u(a,t){let s=a,g=2;for(;t.has(s);)s=a+"_"+g++;return s}function p(){let a=0;for(const t of o.columns){const s=/^custom_(\d+)$/.exec(t.field);s&&(a=Math.max(a,parseInt(s[1],10)))}return a+1}function f(a){const t=new Set([...o.columns.map(n=>n.field)]),s="custom_"+String(p()).padStart(4,"0"),g=Me(a,u(s,t));o.columns.push(g)}function N(a){o.columns.splice(a,1)}function $(a,t){const s=a+t;s<0||s>=o.columns.length||([o.columns[a],o.columns[s]]=[o.columns[s],o.columns[a]])}return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Oe,[t[3]||(t[3]=e.createElementVNode("span",{class:"qukt-tip"},[e.createTextVNode("拖动或点 ↑↓ 调整顺序;支持自动序号和公式计算列,公式里可直接引用其他字段名,如 "),e.createElementVNode("code",null,"quantity * unit_price * 0.9")],-1)),e.createElementVNode("div",Re,[e.createElementVNode("button",{class:e.normalizeClass(["qukt-btn",{"qukt-btn-primary":r.value}]),onClick:t[0]||(t[0]=s=>a.$emit("open-group"))},"分组 & 小计"+e.toDisplayString(r.value?" ✓":""),3),e.createElementVNode("button",{class:"qukt-btn qukt-btn-primary",onClick:t[1]||(t[1]=s=>f("INPUT"))},"+ 添加字段"),e.createElementVNode("button",{class:"qukt-btn",onClick:t[2]||(t[2]=s=>a.$emit("help"))},"帮助")])]),e.createElementVNode("div",{class:e.normalizeClass(["qukt-table-wrap",{"is-narrow":e.unref(l)}])},[e.createElementVNode("table",je,[t[6]||(t[6]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",{width:"50"},"#"),e.createElementVNode("th",{width:"150"},"字段名"),e.createElementVNode("th",{width:"150"},"列标题"),e.createElementVNode("th",{width:"160"},"类型"),e.createElementVNode("th",{width:"100"},"宽度"),e.createElementVNode("th",null,"专属配置"),e.createElementVNode("th",{width:"130"},"分组时合并"),e.createElementVNode("th",{width:"140"},"操作")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.columns,(s,g)=>(e.openBlock(),e.createElementBlock("tr",{key:g},[e.createElementVNode("td",Ie,e.toDisplayString(g+1),1),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"qukt-cell-input","onUpdate:modelValue":n=>s.field=n},null,8,Pe),[[e.vModelText,s.field]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"qukt-cell-input","onUpdate:modelValue":n=>s.title=n},null,8,Qe),[[e.vModelText,s.title]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("select",{class:"qukt-cell-input","onUpdate:modelValue":n=>s.editor=n},[...t[4]||(t[4]=[e.createStaticVNode('<option value="AUTO_SEQ">自动序号</option><option value="AUTO_CALC">自动计算(公式)</option><option value="INPUT">文本输入</option><option value="NUMBER">数字输入</option><option value="TEXTAREA">多行文本</option><option value="SELECT_DICT">下拉选择</option>',6)])],8,We),[[e.vModelSelect,s.editor]])]),e.createElementVNode("td",null,[e.withDirectives(e.createElementVNode("input",{class:"qukt-cell-input",type:"number",min:"50",max:"500","onUpdate:modelValue":n=>s.width=n},null,8,He),[[e.vModelText,s.width,void 0,{number:!0}]])]),e.createElementVNode("td",null,[s.editor==="SELECT_DICT"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"qukt-cell-input","onUpdate:modelValue":n=>s.dictStr=n,placeholder:"下拉选项,逗号分隔 如:设备,材料,安装"},null,8,Xe)),[[e.vModelText,s.dictStr]]):s.editor==="AUTO_CALC"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"qukt-cell-input","onUpdate:modelValue":n=>s.formula=n,placeholder:"公式,如 quantity * unit_price + tax"},null,8,Ge)),[[e.vModelText,s.formula]]):s.editor==="AUTO_SEQ"?(e.openBlock(),e.createElementBlock("span",Ze,"自动生成序号,无需配置")):(e.openBlock(),e.createElementBlock("span",Je,"-"))]),e.createElementVNode("td",Ye,[s.editor!=="AUTO_SEQ"&&s.editor!=="AUTO_CALC"?(e.openBlock(),e.createElementBlock("label",Ke,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n=>s.merge_on_group=n},null,8,ve),[[e.vModelCheckbox,s.merge_on_group]]),t[5]||(t[5]=e.createElementVNode("span",null,"相同值合并",-1))])):(e.openBlock(),e.createElementBlock("span",et,"—"))]),e.createElementVNode("td",null,[e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g===0,onClick:n=>$(g,-1)},"↑",8,tt),e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g>=i.columns.length-1,onClick:n=>$(g,1)},"↓",8,lt),e.createElementVNode("button",{class:"qukt-mini-btn danger",onClick:n=>N(g)},"删",8,ot)])]))),128))])])],2)]))}},it={class:"qukt-gr-dialog"},st={class:"qukt-gr-header"},rt={class:"qukt-gr-content"},at={class:"qukt-gr-form"},dt={class:"qukt-gr-form-row"},ct=["value","disabled"],mt={class:"qukt-gr-form-row"},pt={class:"qukt-gr-checkbox",style:{flex:"1"}},ut={class:"qukt-gr-footer"},kt={__name:"GroupDialog",props:{visible:{type:Boolean,default:!1},columns:{type:Array,default:()=>[]},groupRules:{type:Object,required:!0}},setup(i){const o=i,l=e.reactive({merge_field:o.groupRules.merge_field||"",show_detail_subtotal:o.groupRules.show_detail_subtotal??!0});return e.watch(()=>o.groupRules,r=>{Object.assign(l,{merge_field:r.merge_field||"",show_detail_subtotal:r.show_detail_subtotal??!0})},{deep:!0}),e.watch(l,()=>{Object.assign(o.groupRules,{merge_field:l.merge_field,show_detail_subtotal:l.show_detail_subtotal})},{deep:!0}),(r,u)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qukt-gr-mask",onClick:u[4]||(u[4]=e.withModifiers(p=>r.$emit("close"),["self"]))},[e.createElementVNode("div",it,[e.createElementVNode("div",st,[u[5]||(u[5]=e.createElementVNode("span",null,"分组规则 & 小计配置",-1)),e.createElementVNode("button",{class:"qukt-gr-close",onClick:u[0]||(u[0]=p=>r.$emit("close"))},"✕")]),e.createElementVNode("div",rt,[u[10]||(u[10]=e.createElementVNode("div",{class:"qukt-gr-tips"},[e.createElementVNode("p",null,[e.createElementVNode("b",null,"分组是什么?"),e.createTextVNode(" 选择某一列后,相同值的行会自动合并单元格(比如按「系统名称」分组,同系统的多条明细会合并成一个单元格)。每组末尾自动显示一行小计。")])],-1)),e.createElementVNode("div",at,[e.createElementVNode("div",dt,[u[7]||(u[7]=e.createElementVNode("label",{class:"qukt-gr-form-label"},"按哪一列分组",-1)),e.withDirectives(e.createElementVNode("select",{class:"qukt-cell-input","onUpdate:modelValue":u[1]||(u[1]=p=>i.groupRules.merge_field=p),style:{flex:"1"}},[u[6]||(u[6]=e.createElementVNode("option",{value:""},"— 不分组 —",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.columns,p=>(e.openBlock(),e.createElementBlock("option",{key:p.field,value:p.field,disabled:p.editor==="AUTO_SEQ"||p.editor==="AUTO_CALC"},e.toDisplayString(p.title)+"("+e.toDisplayString(p.field)+")",9,ct))),128))],512),[[e.vModelSelect,i.groupRules.merge_field]])]),e.createElementVNode("div",mt,[u[9]||(u[9]=e.createElementVNode("label",{class:"qukt-gr-form-label"},"明细小计",-1)),e.createElementVNode("label",pt,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":u[2]||(u[2]=p=>i.groupRules.show_detail_subtotal=p)},null,512),[[e.vModelCheckbox,i.groupRules.show_detail_subtotal]]),u[8]||(u[8]=e.createElementVNode("span",null,"分组末尾显示小计行",-1))])])])]),e.createElementVNode("div",ut,[e.createElementVNode("button",{class:"qukt-btn",onClick:u[3]||(u[3]=p=>r.$emit("close"))},"关闭")])])])):e.createCommentVNode("",!0)}},ft={class:"qukt-toolbar"},bt={class:"qukt-col-left"},yt={class:"qukt-sec-header"},Vt={class:"qukt-sec-type"},Et={class:"qukt-sec-actions"},ht=["disabled","onClick"],Nt=["disabled","onClick"],gt=["onClick"],qt={class:"qukt-sec-row"},_t=["onUpdate:modelValue"],wt={class:"qukt-sec-row"},$t=["onUpdate:modelValue"],xt=["onUpdate:modelValue"],Ct={class:"qukt-chk-label"},Bt=["onUpdate:modelValue"],St={class:"qukt-chk-label"},Ut=["onUpdate:modelValue"],Tt={class:"qukt-sec-row"},Dt=["onUpdate:modelValue"],Mt={class:"qukt-cells-list"},At={class:"qukt-cell-toolbar"},zt=["onClick"],Ft={class:"qukt-sec-row"},Lt=["onUpdate:modelValue"],Ot={key:0,class:"qukt-sec-row"},Rt=["onUpdate:modelValue"],jt={key:1,class:"qukt-sec-row"},It=["onUpdate:modelValue"],Pt={key:2,class:"qukt-sec-row"},Qt=["onUpdate:modelValue"],Wt={key:3,class:"qukt-sec-row"},Ht=["onUpdate:modelValue"],Xt={class:"qukt-sec-row"},Gt=["onUpdate:modelValue"],Zt={class:"qukt-inline-group"},Jt=["onUpdate:modelValue"],Yt={class:"qukt-sec-row"},Kt=["onUpdate:modelValue"],vt=["onUpdate:modelValue"],el={class:"qukt-chk-label"},tl=["onUpdate:modelValue"],ll={class:"qukt-chk-label"},ol=["onUpdate:modelValue"],nl={class:"qukt-sec-row qukt-border-config"},il={class:"qukt-border-group"},sl={class:"qukt-border-item"},rl=["onUpdate:modelValue"],al=["onUpdate:modelValue"],dl=["onUpdate:modelValue"],cl={class:"qukt-border-item"},ml=["onUpdate:modelValue"],pl=["onUpdate:modelValue"],ul=["onUpdate:modelValue"],kl={class:"qukt-border-item"},fl=["onUpdate:modelValue"],bl=["onUpdate:modelValue"],yl=["onUpdate:modelValue"],Vl={class:"qukt-border-item"},El=["onUpdate:modelValue"],hl=["onUpdate:modelValue"],Nl=["onUpdate:modelValue"],gl=["onClick"],ql=["onClick"],_l=["onClick"],wl={class:"qukt-col-right"},$l={class:"qukt-preview-box"},xl={class:"qukt-preview-inner"},Cl={key:1,class:"qukt-p-divider"},Bl={key:3,class:"qukt-p-row"},Sl={class:"qukt-p-label"},Ul={class:"qukt-p-value"},Tl={__name:"DesignHeader",props:{sections:{type:Array,required:!0},breakpoint:{type:Number,default:1100}},setup(i){const o=i,{isNarrow:l}=Z(o.breakpoint);function r(a){a==="divider"?o.sections.push({type:a}):a==="text"?o.sections.push({type:a,text:"纯文本内容",style:{color:"#303133",fontSize:14,bold:!1,italic:!1,align:"left"}}):a==="row"&&o.sections.push({type:a,cells:[{type:"field",label:"字段",bind:"field1",style:j("50%")}]})}function u(a){o.sections.splice(a,1)}function p(a,t){const s=a+t;s<0||s>=o.sections.length||([o.sections[a],o.sections[s]]=[o.sections[s],o.sections[a]])}function f(a){a.cells||(a.cells=[]),a.cells.push({type:"field",label:"新字段",bind:"newField",style:j("33%")})}function N(a,t){a.cells.splice(t,1)}function $(a){const t={},s=a.style||{};return s.color&&(t.color=s.color),s.fontSize&&(t.fontSize=s.fontSize+"px"),s.bold&&(t.fontWeight="bold"),s.italic&&(t.fontStyle="italic"),s.align&&(t.textAlign=s.align),t}return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ft,[t[3]||(t[3]=e.createElementVNode("span",{class:"qukt-tip"},"这里定义报价单的大标题、项目信息行等,左侧是设计器,右侧实时预览",-1)),e.createElementVNode("button",{class:"qukt-btn",onClick:t[0]||(t[0]=s=>r("row"))},"+ 字段行"),e.createElementVNode("button",{class:"qukt-btn",onClick:t[1]||(t[1]=s=>r("divider"))},"+ 分隔线"),e.createElementVNode("button",{class:"qukt-btn",onClick:t[2]||(t[2]=s=>r("text"))},"+ 纯文本")]),e.createElementVNode("div",{class:e.normalizeClass(["qukt-two-col",{"is-narrow":e.unref(l)}])},[e.createElementVNode("div",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.sections,(s,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"qukt-sec-block"},[e.createElementVNode("div",yt,[e.createElementVNode("span",Vt,e.toDisplayString(s.type==="row"?"字段行":s.type==="divider"?"分隔线":"纯文本"),1),e.createElementVNode("div",Et,[e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g===0,onClick:n=>p(g,-1)},"↑",8,ht),e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g>=i.sections.length-1,onClick:n=>p(g,1)},"↓",8,Nt),e.createElementVNode("button",{class:"qukt-mini-btn danger",onClick:n=>u(g)},"删",8,gt)])]),s.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",qt,[t[4]||(t[4]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n=>s.text=n,class:"qukt-cell-input"},null,8,_t),[[e.vModelText,s.text]])]),e.createElementVNode("div",wt,[t[7]||(t[7]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":n=>s.style.color=n,class:"qukt-color-input"},null,8,$t),[[e.vModelText,s.style.color]]),t[8]||(t[8]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n=>s.style.fontSize=n,type:"number",class:"qukt-cell-input tiny",min:"10",max:"48"},null,8,xt),[[e.vModelText,s.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",Ct,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n=>s.style.bold=n},null,8,Bt),[[e.vModelCheckbox,s.style.bold]]),t[5]||(t[5]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",St,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n=>s.style.italic=n},null,8,Ut),[[e.vModelCheckbox,s.style.italic]]),t[6]||(t[6]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",Tt,[t[10]||(t[10]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":n=>s.style.align=n,class:"qukt-cell-input small"},[...t[9]||(t[9]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Dt),[[e.vModelSelect,s.style.align]])])],64)):s.type==="row"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.cells,(n,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"qukt-cell-block"},[e.createElementVNode("div",At,[e.createElementVNode("strong",null,e.toDisplayString(S+1),1),e.createElementVNode("button",{class:"qukt-mini-btn danger",onClick:m=>N(s,S)},"×",8,zt)]),e.createElementVNode("div",Ft,[t[12]||(t[12]=e.createElementVNode("label",null,"类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.type=m,class:"qukt-cell-input small"},[...t[11]||(t[11]=[e.createElementVNode("option",{value:"field"},"字段(可编辑)",-1),e.createElementVNode("option",{value:"text"},"纯文本",-1)])],8,Lt),[[e.vModelSelect,n.type]])]),n.type==="field"?(e.openBlock(),e.createElementBlock("div",Ot,[t[13]||(t[13]=e.createElementVNode("label",null,"标签",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.label=m,class:"qukt-cell-input"},null,8,Rt),[[e.vModelText,n.label]])])):e.createCommentVNode("",!0),n.type==="field"?(e.openBlock(),e.createElementBlock("div",jt,[t[14]||(t[14]=e.createElementVNode("label",null,"值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.value=m,class:"qukt-cell-input",placeholder:"字段的值"},null,8,It),[[e.vModelText,n.value]])])):e.createCommentVNode("",!0),n.type==="field"?(e.openBlock(),e.createElementBlock("div",Pt,[t[15]||(t[15]=e.createElementVNode("label",null,"绑定字段",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.bind=m,class:"qukt-cell-input",placeholder:"如 projectName"},null,8,Qt),[[e.vModelText,n.bind]])])):e.createCommentVNode("",!0),n.type==="text"?(e.openBlock(),e.createElementBlock("div",Wt,[t[16]||(t[16]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.text=m,class:"qukt-cell-input"},null,8,Ht),[[e.vModelText,n.text]])])):e.createCommentVNode("",!0),e.createElementVNode("div",Xt,[t[19]||(t[19]=e.createElementVNode("label",null,"宽度",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.style.width=m,class:"qukt-cell-input small",placeholder:"如 33%"},null,8,Gt),[[e.vModelText,n.style.width]]),e.createElementVNode("div",Zt,[t[18]||(t[18]=e.createElementVNode("label",{class:"qukt-muted"},"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.align=m,class:"qukt-cell-input small"},[...t[17]||(t[17]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Jt),[[e.vModelSelect,n.style.align]])])]),e.createElementVNode("div",Yt,[t[22]||(t[22]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.color=m,class:"qukt-color-input"},null,8,Kt),[[e.vModelText,n.style.color]]),t[23]||(t[23]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.style.fontSize=m,type:"number",class:"qukt-cell-input tiny",min:"10",max:"48"},null,8,vt),[[e.vModelText,n.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",el,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m=>n.style.bold=m},null,8,tl),[[e.vModelCheckbox,n.style.bold]]),t[20]||(t[20]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",ll,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m=>n.style.italic=m},null,8,ol),[[e.vModelCheckbox,n.style.italic]]),t[21]||(t[21]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",nl,[t[32]||(t[32]=e.createElementVNode("label",null,"边框",-1)),e.createElementVNode("div",il,[e.createElementVNode("div",sl,[t[25]||(t[25]=e.createElementVNode("span",null,"上",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.top.style=m,class:"qukt-cell-input tiny"},[...t[24]||(t[24]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,rl),[[e.vModelSelect,n.style.border.top.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.top.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,al),[[e.vModelText,n.style.border.top.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.top.color=m,class:"qukt-color-input"},null,8,dl),[[e.vModelText,n.style.border.top.color]])]),e.createElementVNode("div",cl,[t[27]||(t[27]=e.createElementVNode("span",null,"下",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.bottom.style=m,class:"qukt-cell-input tiny"},[...t[26]||(t[26]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,ml),[[e.vModelSelect,n.style.border.bottom.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.bottom.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,pl),[[e.vModelText,n.style.border.bottom.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.bottom.color=m,class:"qukt-color-input"},null,8,ul),[[e.vModelText,n.style.border.bottom.color]])]),e.createElementVNode("div",kl,[t[29]||(t[29]=e.createElementVNode("span",null,"左",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.left.style=m,class:"qukt-cell-input tiny"},[...t[28]||(t[28]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,fl),[[e.vModelSelect,n.style.border.left.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.left.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,bl),[[e.vModelText,n.style.border.left.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.left.color=m,class:"qukt-color-input"},null,8,yl),[[e.vModelText,n.style.border.left.color]])]),e.createElementVNode("div",Vl,[t[31]||(t[31]=e.createElementVNode("span",null,"右",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.right.style=m,class:"qukt-cell-input tiny"},[...t[30]||(t[30]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,El),[[e.vModelSelect,n.style.border.right.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.right.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,hl),[[e.vModelText,n.style.border.right.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.right.color=m,class:"qukt-color-input"},null,8,Nl),[[e.vModelText,n.style.border.right.color]])])]),e.createElementVNode("button",{class:"qukt-mini-btn",onClick:m=>e.unref(H)(n,"all")},"全",8,gl),e.createElementVNode("button",{class:"qukt-mini-btn",onClick:m=>e.unref(H)(n,"none")},"无",8,ql)])]))),128))]),e.createElementVNode("button",{class:"qukt-btn qukt-btn-ghost",onClick:n=>f(s)},"+ 添加一个单元格",8,_l)],64)):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",wl,[e.createElementVNode("div",$l,[t[33]||(t[33]=e.createElementVNode("div",{class:"qukt-preview-label"},"实时预览",-1)),e.createElementVNode("div",xl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.sections,(s,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[s.type==="title"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qukt-p-title",style:e.normalizeStyle($(s))},e.toDisplayString(s.text||"大标题"),5)):s.type==="divider"?(e.openBlock(),e.createElementBlock("div",Cl)):s.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"qukt-p-text",style:e.normalizeStyle($(s))},e.toDisplayString(s.text||"纯文本"),5)):s.type==="row"?(e.openBlock(),e.createElementBlock("div",Bl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.cells,(n,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"qukt-p-cell",style:e.normalizeStyle(e.unref(se)(n))},[n.type==="field"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Sl,e.toDisplayString(n.label)+":",1),e.createElementVNode("span",Ul,e.toDisplayString(n.value||"字段值"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.text||"纯文本"),1)],64))],4))),128))])):e.createCommentVNode("",!0)],64))),128))])])])],2)]))}},Dl={class:"qukt-toolbar"},Ml={class:"qukt-col-left"},Al={class:"qukt-sec-header"},zl={class:"qukt-sec-type"},Fl={class:"qukt-sec-actions"},Ll=["disabled","onClick"],Ol=["disabled","onClick"],Rl=["onClick"],jl={class:"qukt-cells-list"},Il={class:"qukt-cell-toolbar"},Pl=["onClick"],Ql={class:"qukt-sec-row"},Wl=["onUpdate:modelValue"],Hl={class:"qukt-sec-row"},Xl=["onUpdate:modelValue"],Gl={class:"qukt-sec-row"},Zl=["onUpdate:modelValue"],Jl={class:"qukt-inline-group"},Yl=["onUpdate:modelValue"],Kl={class:"qukt-sec-row"},vl=["onUpdate:modelValue"],eo=["onUpdate:modelValue"],to={class:"qukt-chk-label"},lo=["onUpdate:modelValue"],oo={class:"qukt-chk-label"},no=["onUpdate:modelValue"],io={class:"qukt-sec-row qukt-border-config"},so={class:"qukt-border-group"},ro={class:"qukt-border-item"},ao=["onUpdate:modelValue"],co=["onUpdate:modelValue"],mo=["onUpdate:modelValue"],po={class:"qukt-border-item"},uo=["onUpdate:modelValue"],ko=["onUpdate:modelValue"],fo=["onUpdate:modelValue"],bo={class:"qukt-border-item"},yo=["onUpdate:modelValue"],Vo=["onUpdate:modelValue"],Eo=["onUpdate:modelValue"],ho={class:"qukt-border-item"},No=["onUpdate:modelValue"],go=["onUpdate:modelValue"],qo=["onUpdate:modelValue"],_o=["onClick"],wo=["onClick"],$o=["onClick"],xo={class:"qukt-sec-row"},Co=["onUpdate:modelValue"],Bo={class:"qukt-sec-row"},So=["onUpdate:modelValue"],Uo=["onUpdate:modelValue"],To={class:"qukt-chk-label"},Do=["onUpdate:modelValue"],Mo={class:"qukt-chk-label"},Ao=["onUpdate:modelValue"],zo={class:"qukt-sec-row"},Fo=["onUpdate:modelValue"],Lo={class:"qukt-col-right"},Oo={class:"qukt-preview-box"},Ro={class:"qukt-preview-inner"},jo={key:0,class:"qukt-p-divider"},Io={key:2,class:"qukt-p-row"},Po={__name:"DesignFooter",props:{sections:{type:Array,required:!0},breakpoint:{type:Number,default:1100}},setup(i){const o=i,{isNarrow:l}=Z(o.breakpoint);function r(a){a==="divider"?o.sections.push({type:a}):a==="text"?o.sections.push({type:a,text:"纯文本",style:{color:"#303133",fontSize:14,bold:!1,italic:!1,align:"left"}}):a==="row"&&o.sections.push({type:a,cells:[{type:"text",text:"客户签字:",style:j("50%")}]})}function u(a){o.sections.splice(a,1)}function p(a,t){const s=a+t;s<0||s>=o.sections.length||([o.sections[a],o.sections[s]]=[o.sections[s],o.sections[a]])}function f(a){a.cells||(a.cells=[]),a.cells.push({type:"text",text:"签字:",style:j("50%")})}function N(a,t){a.cells.splice(t,1)}function $(a){const t={},s=a.style||{};return s.color&&(t.color=s.color),s.fontSize&&(t.fontSize=s.fontSize+"px"),s.bold&&(t.fontWeight="bold"),s.italic&&(t.fontStyle="italic"),s.align&&(t.textAlign=s.align),t}return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Dl,[t[3]||(t[3]=e.createElementVNode("span",{class:"qukt-tip"},"💡 页面底部显示签字栏、盖章区等,结构和页面头部一样",-1)),e.createElementVNode("button",{class:"qukt-btn",onClick:t[0]||(t[0]=s=>r("divider"))},"+ 分隔线"),e.createElementVNode("button",{class:"qukt-btn",onClick:t[1]||(t[1]=s=>r("row"))},"+ 字段行"),e.createElementVNode("button",{class:"qukt-btn",onClick:t[2]||(t[2]=s=>r("text"))},"+ 纯文本")]),e.createElementVNode("div",{class:e.normalizeClass(["qukt-two-col",{"is-narrow":e.unref(l)}])},[e.createElementVNode("div",Ml,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.sections,(s,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"qukt-sec-block"},[e.createElementVNode("div",Al,[e.createElementVNode("span",zl,e.toDisplayString(s.type==="row"?"字段行":s.type==="divider"?"分隔线":"纯文本"),1),e.createElementVNode("div",Fl,[e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g===0,onClick:n=>p(g,-1)},"↑",8,Ll),e.createElementVNode("button",{class:"qukt-mini-btn",disabled:g>=i.sections.length-1,onClick:n=>p(g,1)},"↓",8,Ol),e.createElementVNode("button",{class:"qukt-mini-btn danger",onClick:n=>u(g)},"删",8,Rl)])]),s.type==="row"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",jl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.cells,(n,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"qukt-cell-block"},[e.createElementVNode("div",Il,[e.createElementVNode("strong",null,e.toDisplayString(S+1),1),e.createElementVNode("button",{class:"qukt-mini-btn danger",onClick:m=>N(s,S)},"×",8,Pl)]),e.createElementVNode("div",Ql,[t[5]||(t[5]=e.createElementVNode("label",null,"类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.type=m,class:"qukt-cell-input small"},[...t[4]||(t[4]=[e.createElementVNode("option",{value:"text"},"纯文本",-1)])],8,Wl),[[e.vModelSelect,n.type]])]),e.createElementVNode("div",Hl,[t[6]||(t[6]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.text=m,class:"qukt-cell-input"},null,8,Xl),[[e.vModelText,n.text]])]),e.createElementVNode("div",Gl,[t[9]||(t[9]=e.createElementVNode("label",null,"宽度",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.style.width=m,class:"qukt-cell-input small",placeholder:"如 50%"},null,8,Zl),[[e.vModelText,n.style.width]]),e.createElementVNode("div",Jl,[t[8]||(t[8]=e.createElementVNode("label",{class:"qukt-muted"},"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.align=m,class:"qukt-cell-input small"},[...t[7]||(t[7]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Yl),[[e.vModelSelect,n.style.align]])])]),e.createElementVNode("div",Kl,[t[12]||(t[12]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.color=m,class:"qukt-color-input"},null,8,vl),[[e.vModelText,n.style.color]]),t[13]||(t[13]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m=>n.style.fontSize=m,type:"number",class:"qukt-cell-input tiny",min:"10",max:"48"},null,8,eo),[[e.vModelText,n.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",to,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m=>n.style.bold=m},null,8,lo),[[e.vModelCheckbox,n.style.bold]]),t[10]||(t[10]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",oo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m=>n.style.italic=m},null,8,no),[[e.vModelCheckbox,n.style.italic]]),t[11]||(t[11]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",io,[t[22]||(t[22]=e.createElementVNode("label",null,"边框",-1)),e.createElementVNode("div",so,[e.createElementVNode("div",ro,[t[15]||(t[15]=e.createElementVNode("span",null,"上",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.top.style=m,class:"qukt-cell-input tiny"},[...t[14]||(t[14]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,ao),[[e.vModelSelect,n.style.border.top.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.top.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,co),[[e.vModelText,n.style.border.top.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.top.color=m,class:"qukt-color-input"},null,8,mo),[[e.vModelText,n.style.border.top.color]])]),e.createElementVNode("div",po,[t[17]||(t[17]=e.createElementVNode("span",null,"下",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.bottom.style=m,class:"qukt-cell-input tiny"},[...t[16]||(t[16]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,uo),[[e.vModelSelect,n.style.border.bottom.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.bottom.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,ko),[[e.vModelText,n.style.border.bottom.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.bottom.color=m,class:"qukt-color-input"},null,8,fo),[[e.vModelText,n.style.border.bottom.color]])]),e.createElementVNode("div",bo,[t[19]||(t[19]=e.createElementVNode("span",null,"左",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.left.style=m,class:"qukt-cell-input tiny"},[...t[18]||(t[18]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,yo),[[e.vModelSelect,n.style.border.left.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.left.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,Vo),[[e.vModelText,n.style.border.left.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.left.color=m,class:"qukt-color-input"},null,8,Eo),[[e.vModelText,n.style.border.left.color]])]),e.createElementVNode("div",ho,[t[21]||(t[21]=e.createElementVNode("span",null,"右",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m=>n.style.border.right.style=m,class:"qukt-cell-input tiny"},[...t[20]||(t[20]=[e.createElementVNode("option",{value:""},"无",-1),e.createElementVNode("option",{value:"solid"},"实线",-1),e.createElementVNode("option",{value:"dashed"},"虚线",-1),e.createElementVNode("option",{value:"dotted"},"点线",-1)])],8,No),[[e.vModelSelect,n.style.border.right.style]]),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":m=>n.style.border.right.width=m,class:"qukt-cell-input tiny",min:"0",max:"20",step:"1"},null,8,go),[[e.vModelText,n.style.border.right.width,void 0,{number:!0}]]),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":m=>n.style.border.right.color=m,class:"qukt-color-input"},null,8,qo),[[e.vModelText,n.style.border.right.color]])])]),e.createElementVNode("button",{class:"qukt-mini-btn",onClick:m=>e.unref(H)(n,"all")},"全",8,_o),e.createElementVNode("button",{class:"qukt-mini-btn",onClick:m=>e.unref(H)(n,"none")},"无",8,wo)])]))),128))]),e.createElementVNode("button",{class:"qukt-btn qukt-btn-ghost",onClick:n=>f(s)},"+ 添加一个单元格",8,$o)],64)):s.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",xo,[t[23]||(t[23]=e.createElementVNode("label",null,"文字",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n=>s.text=n,class:"qukt-cell-input"},null,8,Co),[[e.vModelText,s.text]])]),e.createElementVNode("div",Bo,[t[26]||(t[26]=e.createElementVNode("label",null,"颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":n=>s.style.color=n,class:"qukt-color-input"},null,8,So),[[e.vModelText,s.style.color]]),t[27]||(t[27]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n=>s.style.fontSize=n,type:"number",class:"qukt-cell-input tiny",min:"10",max:"48"},null,8,Uo),[[e.vModelText,s.style.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",To,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n=>s.style.bold=n},null,8,Do),[[e.vModelCheckbox,s.style.bold]]),t[24]||(t[24]=e.createTextVNode(" 加粗 ",-1))]),e.createElementVNode("label",Mo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":n=>s.style.italic=n},null,8,Ao),[[e.vModelCheckbox,s.style.italic]]),t[25]||(t[25]=e.createTextVNode(" 斜体 ",-1))])]),e.createElementVNode("div",zo,[t[29]||(t[29]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":n=>s.style.align=n,class:"qukt-cell-input small"},[...t[28]||(t[28]=[e.createElementVNode("option",{value:"left"},"左",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"right"},"右",-1)])],8,Fo),[[e.vModelSelect,s.style.align]])])],64)):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",Lo,[e.createElementVNode("div",Oo,[t[30]||(t[30]=e.createElementVNode("div",{class:"qukt-preview-label"},"底部预览",-1)),e.createElementVNode("div",Ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.sections,(s,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[s.type==="divider"?(e.openBlock(),e.createElementBlock("div",jo)):s.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qukt-p-text",style:e.normalizeStyle($(s))},e.toDisplayString(s.text||"纯文本"),5)):s.type==="row"?(e.openBlock(),e.createElementBlock("div",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.cells,(n,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"qukt-p-cell",style:e.normalizeStyle(e.unref(se)(n))},e.toDisplayString(n.text),5))),128))])):e.createCommentVNode("",!0)],64))),128))])])])],2)]))}},Qo={class:"qukt-summary-editor"},Wo={class:"qukt-sec-block"},Ho={class:"qukt-sec-row"},Xo={class:"qukt-sec-row"},Go={class:"qukt-chk-label"},Zo={class:"qukt-chk-label"},Jo={class:"qukt-sec-row"},Yo={class:"qukt-sec-block"},Ko={class:"qukt-sec-row"},vo={class:"qukt-sec-row"},en={class:"qukt-chk-label"},tn={class:"qukt-sec-row"},ln={class:"qukt-sec-block"},on={class:"qukt-sec-row"},nn={class:"qukt-chk-label"},sn={key:0,class:"qukt-sec-row"},rn={__name:"DesignSummary",props:{summary:{type:Object,required:!0}},setup(i){return(o,l)=>(e.openBlock(),e.createElementBlock("div",Qo,[l[33]||(l[33]=e.createElementVNode("div",{class:"qukt-toolbar"},[e.createElementVNode("span",{class:"qukt-tip"},"设置小计、合计行的标题文字和显示方式")],-1)),e.createElementVNode("div",Wo,[l[20]||(l[20]=e.createElementVNode("div",{class:"qukt-sec-header"},[e.createElementVNode("span",{class:"qukt-sec-type"},"合计行")],-1)),e.createElementVNode("div",Ho,[l[14]||(l[14]=e.createElementVNode("label",null,"标题",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=r=>i.summary.total.label=r),class:"qukt-cell-input",placeholder:"如:合计(含税)"},null,512),[[e.vModelText,i.summary.total.label]]),l[15]||(l[15]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l[1]||(l[1]=r=>i.summary.total.align=r),class:"qukt-cell-input small"},[...l[13]||(l[13]=[e.createElementVNode("option",{value:"right"},"右",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"left"},"左",-1)])],512),[[e.vModelSelect,i.summary.total.align]])]),e.createElementVNode("div",Xo,[l[18]||(l[18]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[2]||(l[2]=r=>i.summary.total.fontSize=r),type:"number",min:"10",max:"48",class:"qukt-cell-input tiny"},null,512),[[e.vModelText,i.summary.total.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",Go,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[3]||(l[3]=r=>i.summary.total.bold=r)},null,512),[[e.vModelCheckbox,i.summary.total.bold]]),l[16]||(l[16]=e.createTextVNode(" 加粗",-1))]),e.createElementVNode("label",Zo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[4]||(l[4]=r=>i.summary.total.show_border=r)},null,512),[[e.vModelCheckbox,i.summary.total.show_border]]),l[17]||(l[17]=e.createTextVNode(" 金额框上下加粗边框",-1))])]),e.createElementVNode("div",Jo,[l[19]||(l[19]=e.createElementVNode("label",null,"背景色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":l[5]||(l[5]=r=>i.summary.total.bg=r)},null,512),[[e.vModelText,i.summary.total.bg]])])]),e.createElementVNode("div",Yo,[l[27]||(l[27]=e.createElementVNode("div",{class:"qukt-sec-header"},[e.createElementVNode("span",{class:"qukt-sec-type"},"分组小计行(仅分组模式有效)")],-1)),e.createElementVNode("div",Ko,[l[22]||(l[22]=e.createElementVNode("label",null,"标题前缀",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[6]||(l[6]=r=>i.summary.subtotal.label=r),class:"qukt-cell-input",placeholder:"如:小计"},null,512),[[e.vModelText,i.summary.subtotal.label]]),l[23]||(l[23]=e.createElementVNode("label",null,"对齐",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":l[7]||(l[7]=r=>i.summary.subtotal.align=r),class:"qukt-cell-input small"},[...l[21]||(l[21]=[e.createElementVNode("option",{value:"right"},"右",-1),e.createElementVNode("option",{value:"center"},"中",-1),e.createElementVNode("option",{value:"left"},"左",-1)])],512),[[e.vModelSelect,i.summary.subtotal.align]])]),e.createElementVNode("div",vo,[l[25]||(l[25]=e.createElementVNode("label",null,"字号",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[8]||(l[8]=r=>i.summary.subtotal.fontSize=r),type:"number",min:"10",max:"48",class:"qukt-cell-input tiny"},null,512),[[e.vModelText,i.summary.subtotal.fontSize,void 0,{number:!0}]]),e.createElementVNode("label",en,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[9]||(l[9]=r=>i.summary.subtotal.bold=r)},null,512),[[e.vModelCheckbox,i.summary.subtotal.bold]]),l[24]||(l[24]=e.createTextVNode(" 加粗",-1))])]),e.createElementVNode("div",tn,[l[26]||(l[26]=e.createElementVNode("label",null,"背景色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":l[10]||(l[10]=r=>i.summary.subtotal.bg=r)},null,512),[[e.vModelText,i.summary.subtotal.bg]])])]),e.createElementVNode("div",ln,[l[32]||(l[32]=e.createElementVNode("div",{class:"qukt-sec-header"},[e.createElementVNode("span",{class:"qukt-sec-type"},"税额 / 折扣(可选)")],-1)),e.createElementVNode("div",on,[l[29]||(l[29]=e.createElementVNode("label",null,"显示税额",-1)),e.createElementVNode("label",nn,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":l[11]||(l[11]=r=>i.summary.show_tax=r)},null,512),[[e.vModelCheckbox,i.summary.show_tax]]),l[28]||(l[28]=e.createTextVNode(" 合计下显示税额行",-1))])]),i.summary.show_tax?(e.openBlock(),e.createElementBlock("div",sn,[l[30]||(l[30]=e.createElementVNode("label",null,"税率",-1)),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":l[12]||(l[12]=r=>i.summary.tax_rate=r),min:"0",max:"100",step:"0.01",class:"qukt-cell-input small"},null,512),[[e.vModelText,i.summary.tax_rate,void 0,{number:!0}]]),l[31]||(l[31]=e.createElementVNode("span",{class:"qukt-muted"},"%",-1))])):e.createCommentVNode("",!0)])]))}},an={class:"qukt-help-dialog"},dn={class:"qukt-help-header"},cn={__name:"HelpModal",props:{visible:{type:Boolean,default:!1}},emits:["close"],setup(i){return(o,l)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qukt-help-modal",onClick:l[1]||(l[1]=e.withModifiers(r=>o.$emit("close"),["self"]))},[e.createElementVNode("div",an,[e.createElementVNode("div",dn,[l[2]||(l[2]=e.createElementVNode("h3",null,"📖 报价单生成器 — 使用教程",-1)),e.createElementVNode("button",{class:"qukt-close-btn",onClick:l[0]||(l[0]=r=>o.$emit("close"))},"✕")]),l[3]||(l[3]=e.createStaticVNode(`<div class="qukt-help-body"><section class="qukt-help-section"><h4>🔁 整体三步流程</h4><p>顶部导航栏有三个步骤,按顺序操作即可生成一份完整报价单:</p><ol class="qukt-steps"><li><b>① 设计模板</b> — 定义表头列、页面头部信息、汇总区域、底部签字栏等</li><li><b>② 填写数据</b> — 根据模板录入每条明细,自动分组、自动算小计</li><li><b>③ 预览导出</b> — 查看最终效果,一键导出 Excel 或打印</li></ol><p class="qukt-tip-box">💡 也可以从第 ② 步开始,系统已内置 3 个示例模板可直接使用</p></section><section class="qukt-help-section"><h4>① 表头列 — 定义表格里有哪些列</h4><p>点击顶部工具栏的 <b>+ 添加字段</b> 按钮可以新增一列,然后在表格中把「类型」改成你想要的:</p><table class="qukt-help-table"><thead><tr><th>按钮</th><th>字段类型</th><th>说明</th></tr></thead><tbody><tr><td>文本列</td><td>INPUT</td><td>普通文字输入,用于名称、描述等</td></tr><tr><td>数字列</td><td>NUMBER</td><td>只能填数字,用于数量、单价等</td></tr><tr><td>下拉列</td><td>SELECT_DICT</td><td>固定选项,点击列中的"下拉选项"输入选项,用逗号分隔,如 <code>设备,材料,安装</code></td></tr><tr><td>多行文本列</td><td>TEXTAREA</td><td>可输入较长文字,用于备注、说明等</td></tr></tbody></table><p><b>特殊类型列:</b></p><ul><li><b>自动序号</b> — 自动从 1 开始递增,字段名随便改(建议叫 <code>seq</code>)</li><li><b>自动计算(公式)</b> — 用任意公式算值,公式里可引用<b>同一行其他列的字段名</b>,如 <code>quantity * unit_price</code>。字段名必须和你在表头里设置的一致,比如数量列叫 <code>qty</code> 就要写 <code>qty * unit_price</code></li></ul><p><b>列顺序:</b>点行末的 ↑ ↓ 按钮上下移动,或拖动行来调整</p><p><b>列宽度:</b>单位是像素(px),在"宽度"列填数字</p><p class="qukt-tip-box">💡 下拉列的选项是写在逗号分隔的输入框里,保存后切换到「填写数据」页面时会变成下拉选择框</p></section><section class="qukt-help-section"><h4>② 页面头部 — 报价单的标题和项目信息</h4><p>头部由多个"段落"顺序组成,每个段落可以是以下 4 种类型:</p><table class="qukt-help-table"><thead><tr><th>类型</th><th>说明</th><th>配置项</th></tr></thead><tbody><tr><td><b>大标题</b></td><td>最顶部的报价单标题</td><td>文字、字号、粗体、对齐方式</td></tr><tr><td><b>字段行</b></td><td>一行可以放多个单元格,每个单元格要么是可编辑字段,要么是固定文字</td><td>每个单元格单独配置</td></tr><tr><td><b>分隔线</b></td><td>画一条灰色横线</td><td>无配置</td></tr><tr><td><b>纯文本</b></td><td>一段固定文字,如"此报价单有效期30天"</td><td>文字内容、对齐方式</td></tr></tbody></table><p><b>字段行详解:</b></p><ul><li>点"➕ 添加一个单元格"来增加这一行里的格子数量</li><li>每个格子选"类型":<b>字段(可编辑)</b> 或 <b>纯文本</b></li><li>字段类型要填 <b>标签</b>(如"项目名称")和 <b>绑定字段</b>(如 <code>projectName</code>)</li><li>绑定字段是关键!同一个绑定字段名在整个模板中要保持一致,后续数据填写和导出都靠它</li><li>宽度用百分比,如 <code>50%</code>、<code>33%</code>,一行所有格子宽度加起来建议 = 100%</li></ul><p class="qukt-tip-box">💡 右侧"实时预览"区域会随着你的编辑即时变化,所见即所得</p></section><section class="qukt-help-section"><h4>③ 汇总区域 — 表格底部的费用合计</h4><p>汇总项显示在明细表格的下方(导出 Excel 时会自动排在表格右侧底部)。</p><table class="qukt-help-table"><thead><tr><th>类型</th><th>说明</th></tr></thead><tbody><tr><td><b>手动输入(自定义金额)</b></td><td>任意需要手工填写的金额项:人工费、服务费、运费、税费、折扣、其他费用等。可以在"默认值"里预设一个初始值</td></tr><tr><td><b>自动计算(公式)</b></td><td>系统自动算好的值,需要写公式。<code>grand_total</code> 会自动把所有手动输入项加进去</td></tr></tbody></table><p><b>自动计算公式里的可用变量(固定):</b></p><table class="qukt-help-table"><thead><tr><th>变量名</th><th>含义</th><th>说明</th></tr></thead><tbody><tr><td><code>group_total</code></td><td>明细小计合计</td><td>所有行的自动计算列(小计列)求和</td></tr><tr><td><code>grand_total</code></td><td>报价总额</td><td>group_total + 所有手动输入项之和</td></tr><tr><td><code>quantity_sum</code></td><td>数量总和</td><td>所有行 <b>字段名为 quantity</b> 的列求和。如果表头数量列不叫 quantity,这个值就是 0</td></tr></tbody></table><p><b>动态可用变量(随你的模板定义):</b></p><p>你在汇总区域里定义的<b>每一个手动输入项的字段名</b>,都会自动成为可用变量,它们之间也能互相引用。</p><p>举个例子:如果你定义了 <code>labor_cost</code>、<code>service_fee</code>、<code>discount</code> 三个手动项,那么自动计算公式里可以写:</p><pre class="code">group_total + labor_cost + service_fee - discount</pre><p><b>字段名命名建议:</b></p><ul><li><code>grand_total</code> — 报价总额(特殊字段,系统会把所有手动项加进去)</li><li><code>group_total</code> — 明细小计(建议不要手动改成别的,公式里会用到)</li><li><code>quantity</code> — 表头里的数量列字段名(如果想用 <code>quantity_sum</code> 变量,必须叫这个)</li><li>其他手动项随意,如 <code>service_fee</code>、<code>freight</code>、<code>tax_amount</code>、<code>discount</code> 等</li></ul></section><section class="qukt-help-section"><h4>④ 页面底部 — 签字栏、盖章区</h4><p>结构和"页面头部"完全一样,支持:分隔线、字段行、纯文本。</p><p>常见用法:</p><ul><li>分隔线 → 分隔表格和签字区</li><li>字段行 → 左边"客户签字:________",右边"业务员签字:________"</li><li>纯文本 → 居中写"公司盖章:"</li></ul></section><section class="qukt-help-section"><h4>💾 保存与模板管理</h4><ul><li><b>💾 保存修改</b> — 直接更新当前选中的模板</li><li><b>➕ 另存为新模板</b> — 输入一个新名字,基于当前模板复制出一个全新的模板</li><li>顶部的下拉框可以在已有的模板之间切换,切换后下方所有配置会自动加载</li></ul><p class="qukt-tip-box">⚠️ 目前模板数据保存在浏览器内存中(刷新后会恢复默认),如果要持久化存储,需要把模板同步到后端接口</p></section><section class="qukt-help-section"><h4>🔢 分组与计算规则(高级)</h4><p>在「表头列」tab 的列表下方,有一个<b>分组规则</b>配置框:</p><ul><li><b>按哪一列分组</b> — 选择一列后,相同值的行会自动合并单元格,每组末尾自动生成小计行。选「不分组」则不分组、不显示小计,但列上勾选了「相同值合并」的列仍然会对相邻相同值做合并</li></ul><p>对应模板数据结构:</p><pre class="code">{
|
|
12
13
|
group_rules: { merge_field: 'system_name' },
|
|
13
14
|
// 不分组时 group_rules 为 null 或 { merge_field: '' }
|
|
14
|
-
}</pre><p
|
|
15
|
+
}</pre><p>例如模板 TPL-001 按 <code>system_name</code>(系统名称)分组,相同系统名称的多条明细会自动合并成一个单元格,每组末尾自动生成小计行。</p></section><section class="qukt-help-section"><h4>📝 切换到「填写数据」</h4><p>模板设计好后,点顶部的"下一步"进入填写数据页面,注意:</p><ul><li>点 ➕ 添加新条目,会弹出表单,表单字段完全根据你的模板表头列生成</li><li>分组字段(如 <code>system_name</code>)会自动继承上一行的值,让同组合并不间断</li><li>右侧"实时汇总"卡片会根据汇总区域配置动态显示</li></ul></section><section class="qukt-help-section qukt-tip-box final-tip"> 🎯 <b>推荐操作顺序:</b>选一个最接近的示例模板 → 点"另存为新模板"复制一份 → 按需要改表头列 / 头部信息 / 汇总项 → 保存 → 下一步填写数据 → 导出 Excel </section></div>`,1))])])):e.createCommentVNode("",!0)}},mn={class:"qukt-designer"},pn={class:"qukt-tabs"},un={key:0,class:"qukt-tab-content"},kn={key:1,class:"qukt-tab-content"},fn={key:2,class:"qukt-tab-content"},bn={key:3,class:"qukt-tab-content"},yn={key:4,class:"qukt-tab-content qukt-tab-content-preview"},Vn={__name:"QuokitTemplate",props:{tpl:{type:Object,required:!0},breakpoint:{type:Number,default:1100}},emits:["update:tpl"],setup(i,{expose:o,emit:l}){const r=i,u=l,p=e.ref("cols"),f=e.ref(!1),N=e.ref(!1),$=ne([],{}),a=X([],{isHeader:!0}),t=X([],{isHeader:!1}),s=ae([]);let g=!1;e.watch(()=>r.tpl,()=>{if(g)return;g=!0;const q=r.tpl||{};$.setColumns(q.columns||[]),$.setGroupRules(q.group_rules||{}),a.setSections(q.header_sections||[]),t.setSections(q.footer_sections||[]),s.setFields(q.summary_fields||[])},{immediate:!0});const n=Te(q=>{u("update:tpl",q)},200),S=e.computed(()=>({...$.tpl,header_sections:a.toTpl(),footer_sections:t.toTpl(),summary_fields:s.toTpl()}));e.watch(S,()=>{if(g){g=!1;return}n(S.value)},{deep:!0}),e.onBeforeUnmount(()=>{n.cancel()});const m=e.computed(()=>S.value),U=e.computed(()=>de($.tpl.columns,3));return o({getTemplateJSON(){return S.value},showHelp(){f.value=!0}}),(q,h)=>(e.openBlock(),e.createElementBlock("div",mn,[e.createElementVNode("div",pn,[e.createElementVNode("div",{class:e.normalizeClass(["qukt-tab",{active:p.value==="cols"}]),onClick:h[0]||(h[0]=C=>p.value="cols")},"① 表头列",2),e.createElementVNode("div",{class:e.normalizeClass(["qukt-tab",{active:p.value==="header"}]),onClick:h[1]||(h[1]=C=>p.value="header")},"② 页面头部",2),e.createElementVNode("div",{class:e.normalizeClass(["qukt-tab",{active:p.value==="summary"}]),onClick:h[2]||(h[2]=C=>p.value="summary")},"③ 汇总区域",2),e.createElementVNode("div",{class:e.normalizeClass(["qukt-tab",{active:p.value==="footer"}]),onClick:h[3]||(h[3]=C=>p.value="footer")},"④ 页面底部",2),e.createElementVNode("div",{class:e.normalizeClass(["qukt-tab",{active:p.value==="preview"}]),onClick:h[4]||(h[4]=C=>p.value="preview")},"⑤ 总体预览",2)]),p.value==="cols"?(e.openBlock(),e.createElementBlock("div",un,[e.createVNode(nt,{columns:e.unref($).columns,"group-rules":e.unref($).groupRules,breakpoint:i.breakpoint,onHelp:h[5]||(h[5]=C=>f.value=!0),onOpenGroup:h[6]||(h[6]=C=>N.value=!0)},null,8,["columns","group-rules","breakpoint"])])):e.createCommentVNode("",!0),p.value==="header"?(e.openBlock(),e.createElementBlock("div",kn,[e.createVNode(Tl,{sections:e.unref(a).sections,breakpoint:i.breakpoint},null,8,["sections","breakpoint"])])):e.createCommentVNode("",!0),p.value==="summary"?(e.openBlock(),e.createElementBlock("div",fn,[e.createVNode(rn,{fields:e.unref(s).fields,breakpoint:i.breakpoint},null,8,["fields","breakpoint"])])):e.createCommentVNode("",!0),p.value==="footer"?(e.openBlock(),e.createElementBlock("div",bn,[e.createVNode(Po,{sections:e.unref(t).sections,breakpoint:i.breakpoint},null,8,["sections","breakpoint"])])):e.createCommentVNode("",!0),p.value==="preview"?(e.openBlock(),e.createElementBlock("div",yn,[e.createVNode(le,{tpl:m.value,data:U.value},null,8,["tpl","data"])])):e.createCommentVNode("",!0),e.createVNode(cn,{visible:f.value,onClose:h[7]||(h[7]=C=>f.value=!1)},null,8,["visible"]),e.createVNode(kt,{visible:N.value,columns:e.unref($).columns,"group-rules":e.unref($).groupRules,onClose:h[8]||(h[8]=C=>N.value=!1)},null,8,["visible","columns","group-rules"])]))}},En={class:"qukt-page"},hn={key:0,class:"qukt-empty-tip"},Nn={key:1,class:"qukt-data-table"},gn={class:"qukt-main-table"},qn=["onClick"],_n={key:1,class:"qukt-subtotal"},wn=["onClick"],$n=["onClick"],xn={class:"qukt-de-dialog"},Cn={class:"qukt-de-header"},Bn={class:"qukt-de-content"},Sn={class:"qukt-form-grid"},Un={class:"qukt-form-cell-label"},Tn=["onUpdate:modelValue","placeholder"],Dn=["step","min","max","onUpdate:modelValue"],Mn=["onUpdate:modelValue","placeholder"],An=["onUpdate:modelValue"],zn=["value"],Fn={class:"qukt-de-footer"},Ln={__name:"QuokitData",props:{tpl:{type:Object,required:!0},data:{type:Array,default:()=>[]}},emits:["update:data"],setup(i,{emit:o}){const l=i,r=o,u=e.computed(()=>l.data),p=e.computed(()=>{var U;return((U=l.tpl)==null?void 0:U.columns)||[]}),f=e.computed(()=>p.value.filter(U=>U.editor!=="AUTO_SEQ"&&U.editor!=="AUTO_CALC")),N=e.ref(!1),$=e.ref("add"),a=e.ref(-1),t=e.ref({});function s(){const U={};for(const q of f.value)q.editor==="NUMBER"?U[q.field]=q.default??q.min??0:U[q.field]=q.default??"";return U}function g(){$.value="add",a.value=-1,t.value=s(),N.value=!0}function n(U){$.value="edit",a.value=U,t.value={...u.value[U]},N.value=!0}function S(U){if(!confirm("确定删除这条明细?"))return;const q=[...u.value];q.splice(U,1),r("update:data",q)}function m(){if($.value==="edit"){const U=[...u.value];U[a.value]={...t.value},r("update:data",U)}else r("update:data",[...u.value,{...t.value}]);N.value=!1}return(U,q)=>(e.openBlock(),e.createElementBlock("div",En,[e.createElementVNode("div",{class:"qukt-toolbar"},[q[4]||(q[4]=e.createElementVNode("span",{class:"qukt-tip"},"点击行可快速编辑,预估总价会自动计算",-1)),e.createElementVNode("div",{class:"qukt-btn-group-inline"},[e.createElementVNode("button",{class:"qukt-btn",onClick:g},"+ 添加新条目")])]),u.value.length===0?(e.openBlock(),e.createElementBlock("div",hn,[...q[5]||(q[5]=[e.createElementVNode("div",{class:"qukt-empty-icon"},"📋",-1),e.createElementVNode("div",{class:"qukt-empty-text"},"暂无数据,点击下方按钮添加第一条明细",-1)])])):e.createCommentVNode("",!0),u.value.length>0?(e.openBlock(),e.createElementBlock("div",Nn,[e.createElementVNode("table",gn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,h=>(e.openBlock(),e.createElementBlock("th",{key:h.field,style:e.normalizeStyle({width:h.width+"px"})},e.toDisplayString(h.title),5))),128)),q[6]||(q[6]=e.createElementVNode("th",{width:"140"},"操作",-1))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(h,C)=>(e.openBlock(),e.createElementBlock("tr",{key:C,onClick:L=>n(C)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,L=>(e.openBlock(),e.createElementBlock("td",{key:L.field},[L.editor==="AUTO_SEQ"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(C+1),1)],64)):L.editor==="AUTO_CALC"?(e.openBlock(),e.createElementBlock("span",_n,"¥ "+e.toDisplayString(e.unref(P)(L.formula||"0",h).toFixed(2)),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(h[L.field]),1)],64))]))),128)),e.createElementVNode("td",{class:"qukt-op-cell",onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{class:"qukt-row-btn",onClick:L=>n(C)},"编辑",8,wn),e.createElementVNode("button",{class:"qukt-row-btn danger",onClick:L=>S(C)},"删除",8,$n)])],8,qn))),128))])])])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"qukt-de-mask",onClick:q[3]||(q[3]=e.withModifiers(h=>N.value=!1,["self"]))},[e.createElementVNode("div",xn,[e.createElementVNode("div",Cn,[e.createElementVNode("span",null,e.toDisplayString($.value==="edit"?"编辑明细":"添加明细"),1),e.createElementVNode("button",{class:"qukt-de-close",onClick:q[1]||(q[1]=h=>N.value=!1)},"✕")]),e.createElementVNode("div",Bn,[e.createElementVNode("div",Sn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.field,class:e.normalizeClass(["qukt-form-cell",{full:h.editor==="TEXTAREA"}])},[e.createElementVNode("label",Un,e.toDisplayString(h.title),1),h.editor==="INPUT"||h.editor===void 0?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,class:"qukt-cell-input","onUpdate:modelValue":C=>t.value[h.field]=C,placeholder:h.title},null,8,Tn)),[[e.vModelText,t.value[h.field]]]):h.editor==="NUMBER"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,class:"qukt-cell-input",type:"number",step:h.step??(h.min??0)<1?"0.01":"1",min:h.min,max:h.max,"onUpdate:modelValue":C=>t.value[h.field]=C},null,8,Dn)),[[e.vModelText,t.value[h.field],void 0,{number:!0}]]):h.editor==="TEXTAREA"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:2,class:"qukt-cell-input",rows:"3","onUpdate:modelValue":C=>t.value[h.field]=C,placeholder:h.title},null,8,Mn)),[[e.vModelText,t.value[h.field]]]):h.editor==="SELECT_DICT"?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:3,class:"qukt-cell-input","onUpdate:modelValue":C=>t.value[h.field]=C},[q[7]||(q[7]=e.createElementVNode("option",{value:""},"-- 请选择 --",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.dict||[],C=>(e.openBlock(),e.createElementBlock("option",{key:C,value:C},e.toDisplayString(C),9,zn))),128))],8,An)),[[e.vModelSelect,t.value[h.field]]]):e.createCommentVNode("",!0)],2))),128))])]),e.createElementVNode("div",Fn,[e.createElementVNode("button",{class:"qukt-btn",onClick:q[2]||(q[2]=h=>N.value=!1)},"取消"),e.createElementVNode("button",{class:"qukt-btn qukt-btn-primary",onClick:m},"确定")])])])):e.createCommentVNode("",!0)]))}};z.QuokitData=Ln,z.QuokitSheet=le,z.QuokitTemplate=Vn,z.generateMockRows=de,z.useColumns=ne,z.useSections=X,z.useSummary=ae,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|