bi-sdk-react 0.0.12 → 0.0.14
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/es/js/bi-sdk.es.js
CHANGED
|
@@ -927,7 +927,7 @@ import*as e from"react";import t,{css as l}from"styled-components";import{AlignC
|
|
|
927
927
|
background: transparent;
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
`,ls=e=>{let{open:t,onCancel:l,onOk:n}=e,[r,a]=(0,eO.useState)(JSON.stringify({info:{},datasources:[],scripts:[],variables:[],items:[]}));return(0,eN.jsx)(q,{title:"导入页面",open:t,width:800,onCancel:l,onOk:()=>null==n?void 0:n(JSON.parse(r)),okText:"导入",cancelText:"取消",styles:{body:{height:"calc(100vh - 250px)",overflow:"auto"}},children:(0,eN.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex",height:"100%"},children:(0,eN.jsx)(eh,{height:"100%",defaultLanguage:"json",value:r,options:{minimap:{enabled:!1}},onChange:e=>a(e||"")})})})},ld=eO.default.forwardRef((e,t)=>{var l;let n,{pageId:r,agentList:a=[],plugins:i=[],headerExtra:o,datasourceEnable:d=!0,scriptEnable:c=!0,datasetPanel:p,datasetSelector:h,fetch:f,onSave:v,loading:j=!1}=e,y=(0,eO.useRef)(null),b=(0,eO.useRef)(null),[C,S]=(0,eO.useState)(1),[k,N]=(0,eO.useState)([]),[O,D]=(0,eO.useState)([]),[R,L]=(0,eO.useState)(!1),[M,P]=(0,eO.useState)("desktop"),[$,F]=(0,eO.useState)("component"),[Y,W]=(0,eO.useState)((null==f?void 0:f.ai)?"ai":"props"),[K,U]=(0,eO.useState)(!0),[J,q]=(0,eO.useState)(!0),[X,V]=(0,eO.useState)(null),[Q,ee]=(0,eO.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[et,el]=(0,eO.useState)(!0),[er,ea]=(0,eO.useState)(!1),[ei,eo]=(0,eO.useState)(!1),ed=(0,eO.useMemo)(()=>{let e=K?"250px":"",t=J?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[K,J]),ec=(0,eO.useMemo)(()=>({display:K?"flex":"none"}),[K]),eu=(0,eO.useMemo)(()=>({display:J?"flex":"none"}),[J]);l=[Q],(n=(0,eO.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{R||(N(e=>e.length?[...e,JSON.parse(JSON.stringify(Q))].slice(-50):[JSON.parse(JSON.stringify(Q))]),D([]))})()),(0,eO.useImperativeHandle)(t,()=>({handleOpen(e){L(!0),ep(e.items),ee(e),N([JSON.parse(JSON.stringify(e))]),D([]),setTimeout(()=>L(!1),0)}}));let ep=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?ep(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&ep(e.children[t],Math.random().toString(36).slice(2,10))})})},ex=e=>{var t,l,n;if((null==(t=e.datasets)?void 0:t.length)&&(null==b||null==(l=b.current)?void 0:l.reload)&&b.current.reload(),e.schema)ee(e.schema);else if(null==(n=e.pageItems)?void 0:n.length){let t=new Map(e.pageItems.map(e=>[e.id,e])),l=JSON.parse(JSON.stringify(Q)),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{t.has(e.id)&&(Object.keys(e).forEach(t=>{"id"!==t&&delete e[t]}),Object.assign(e,t.get(e.id))),Array.isArray(e.children)?n(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&n(e.children[t])})})};n(l.items),ee(l)}},em=(0,eO.useMemo)(()=>"cascade"!==Y||(null==X?void 0:X.cascadeIds)?Y:"props",[X,Y]);return(0,eN.jsxs)(tp,{pageId:r,designable:et,plugins:i,schema:Q,selectedItem:X,setSchema:ee,setSelectedItem:V,datasetSelector:h,fetch:f,children:[(0,eN.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,eN.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,eN.jsxs)(en,{children:[(0,eN.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"保存",children:(0,eN.jsx)(_,{type:"link",className:"toolbar",onClick:()=>{null==v||v(Q)},loading:j,children:(0,eN.jsx)(I,{})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"撤销",children:(0,eN.jsx)("a",{className:`toolbar ${k.length>1?"active":""}`,onClick:()=>{N(e=>{if(e.length<=1)return e;L(!0);let t=e[e.length-2];return D(e=>[...e,JSON.parse(JSON.stringify(Q))]),ee(t),V(null),setTimeout(()=>L(!1),0),e.slice(0,-1)})},children:(0,eN.jsx)(E,{})})}),(0,eN.jsx)(es,{title:"重做",children:(0,eN.jsx)("a",{className:`toolbar ${O.length>0?"active":""}`,onClick:()=>{D(e=>e.length?(L(!0),N(e=>[...e,JSON.parse(JSON.stringify(Q))]),ee(e[e.length-1]),V(null),setTimeout(()=>L(!1),0),e.slice(0,-1)):e)},children:(0,eN.jsx)(z,{})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"导入JSON",children:(0,eN.jsx)("a",{className:`toolbar ${O.length>0?"active":""}`,onClick:()=>{ea(!0)},children:(0,eN.jsx)(g,{})})})]}),(0,eN.jsxs)(en,{children:[(0,eN.jsx)(es,{title:"缩小",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(parseFloat(Math.max(C-.1,.5).toFixed(1))),children:(0,eN.jsx)(B,{})})}),(0,eN.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*C).toFixed(0),"%"]}),(0,eN.jsx)(es,{title:"放大",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(parseFloat(Math.min(C+.1,2).toFixed(1))),children:(0,eN.jsx)(A,{})})}),(0,eN.jsx)(es,{title:"重置缩放",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(1),children:(0,eN.jsx)(tS,{type:"icon-zoom-reset"})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"切换左侧栏",children:(0,eN.jsx)("a",{className:`toolbar ${K?"active":""}`,onClick:()=>{U(e=>!e),setTimeout(()=>{var e,t;return null==(t=y.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,eN.jsx)(tS,{type:"icon-sider-l"})})}),(0,eN.jsx)(es,{title:"切换右侧栏",children:(0,eN.jsx)("a",{className:`toolbar ${J?"active":""}`,onClick:()=>{q(e=>!e),setTimeout(()=>{var e,t;return null==(t=y.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,eN.jsx)(tS,{type:"icon-sider-r"})})}),o]})]}),(0,eN.jsxs)(lo,{style:ed,children:[(0,eN.jsxs)("div",{className:"left",style:ec,children:[(0,eN.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,eN.jsxs)(Z.Group,{value:$,onChange:e=>F(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,eN.jsx)(Z.Button,{value:"component",children:(0,eN.jsx)(es,{title:"组件",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-puzzle"})})}),(0,eN.jsx)(Z.Button,{value:"layer",children:(0,eN.jsx)(es,{title:"图层",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-outline"})})}),!!p&&(0,eN.jsx)(Z.Button,{value:"dataset",children:(0,eN.jsx)(es,{title:"数据集",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-dataset"})})}),d&&(0,eN.jsx)(Z.Button,{value:"datasource",title:"数据源",children:(0,eN.jsx)(es,{title:"数据源",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-datasource"})})}),c&&(0,eN.jsx)(Z.Button,{value:"script",children:(0,eN.jsx)(es,{title:"脚本",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-js"})})}),(0,eN.jsx)(Z.Button,{value:"env",children:(0,eN.jsx)(es,{title:"环境变量",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-variable"})})}),(0,eN.jsx)(Z.Button,{value:"code",children:(0,eN.jsx)(es,{title:"源码",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-json"})})})]})}),(0,eN.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===$&&(0,eN.jsx)(t1,{}),"layer"===$&&(0,eN.jsx)(t9,{}),d&&"datasource"===$&&(0,eN.jsx)(t4,{}),c&&"script"===$&&(0,eN.jsx)(ll,{}),"env"===$&&(0,eN.jsx)(lr,{}),"code"===$&&(0,eN.jsx)(tQ,{}),!!p&&"dataset"===$&&(0,eN.jsx)(li,{ref:b,renderNode:p})]})]}),(0,eN.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,eN.jsx)(tM,{title:"页面",extra:(0,eN.jsxs)(en,{children:[(0,eN.jsx)(_,{size:"small",type:et?"default":"primary",icon:et?(0,eN.jsx)(x,{}):(0,eN.jsx)(m,{}),onClick:()=>el(!et)}),(0,eN.jsxs)(Z.Group,{value:M,onChange:e=>P(e.target.value),size:"small",buttonStyle:"outline",children:[(0,eN.jsx)(Z.Button,{value:"desktop",title:"桌面",children:(0,eN.jsx)(u,{})}),(0,eN.jsx)(Z.Button,{value:"mobile",title:"移动设备",children:(0,eN.jsx)(w,{})}),(0,eN.jsx)(Z.Button,{value:"tablet",title:"平板设备",children:(0,eN.jsx)(T,{})})]})]})}),(0,eN.jsx)("div",{className:["body beautified_scrollbar",M].join(" "),children:(0,eN.jsx)("div",{style:{transform:`scale(${C})`,transformOrigin:"top center"},children:(0,eN.jsx)(tb,{ref:y,device:M,fetch:f})})})]}),(0,eN.jsxs)("div",{className:"right",style:eu,children:[(0,eN.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:[(0,eN.jsx)(tY,{agentList:a,onEffect:ex,style:{display:"ai"===em&&(null==f?void 0:f.ai)?void 0:"none"}}),"props"===em&&(0,eN.jsx)(t7,{datasourceEnable:d}),"cascade"===em&&(null==X?void 0:X.cascadeIds)&&(0,eN.jsx)(tq,{})]}),(0,eN.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:(0,eN.jsxs)(Z.Group,{value:em,onChange:e=>W(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(null==f?void 0:f.ai)&&(0,eN.jsx)(Z.Button,{value:"ai",children:(0,eN.jsx)(es,{title:"智能助理",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-assistant"})})}),(0,eN.jsx)(Z.Button,{value:"props",children:(0,eN.jsx)(es,{title:"属性",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-info"})})}),(null==X?void 0:X.cascadeIds)&&(0,eN.jsx)(Z.Button,{value:"cascade",children:(0,eN.jsx)(es,{title:"联动",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-cascade"})})})]})})]})]})]}),(0,eN.jsx)(ls,{open:er,onOk:e=>{ea(!1),ee(e)},onCancel:()=>ea(!1)}),(0,eN.jsx)(G,{open:ei,size:400,mask:!1,title:null,closable:!1,styles:{body:{padding:0}},onClose:()=>eo(!1),children:(0,eN.jsx)(tY,{agentList:a,headExtra:(0,eN.jsx)(_,{type:"link",icon:(0,eN.jsx)(s,{}),onClick:()=>eo(!1)}),onEffect:ex})})]})});var lc=((ez={}).STRING="STRING",ez.NUMBER="NUMBER",ez.BOOLEAN="BOOLEAN",ez.OBJECT="OBJECT",ez.ARRAY="ARRAY",ez);let lu=t(j)`
|
|
930
|
+
`,ls=e=>{let{open:t,onCancel:l,onOk:n}=e,[r,a]=(0,eO.useState)(JSON.stringify({info:{},datasources:[],scripts:[],variables:[],items:[]}));return(0,eN.jsx)(q,{title:"导入页面",open:t,width:800,onCancel:l,onOk:()=>null==n?void 0:n(JSON.parse(r)),okText:"导入",cancelText:"取消",styles:{body:{height:"calc(100vh - 250px)",overflow:"auto"}},children:(0,eN.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex",height:"100%"},children:(0,eN.jsx)(eh,{height:"100%",defaultLanguage:"json",value:r,options:{minimap:{enabled:!1}},onChange:e=>a(e||"")})})})},ld=eO.default.forwardRef((e,t)=>{var l;let n,{pageId:r,agentList:a=[],plugins:i=[],headerExtra:o,datasourceEnable:d=!0,scriptEnable:c=!0,datasetPanel:p,datasetSelector:h,fetch:f,onSave:v,loading:j=!1}=e,y=(0,eO.useRef)(null),b=(0,eO.useRef)(null),[C,S]=(0,eO.useState)(1),[k,N]=(0,eO.useState)([]),[O,D]=(0,eO.useState)([]),[R,L]=(0,eO.useState)(!1),[M,P]=(0,eO.useState)("desktop"),[$,F]=(0,eO.useState)("component"),[Y,W]=(0,eO.useState)((null==f?void 0:f.ai)?"ai":"props"),[K,U]=(0,eO.useState)(!0),[J,q]=(0,eO.useState)(!0),[X,V]=(0,eO.useState)(null),[Q,ee]=(0,eO.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[et,el]=(0,eO.useState)(!0),[er,ea]=(0,eO.useState)(!1),[ei,eo]=(0,eO.useState)(!1),ed=(0,eO.useMemo)(()=>{let e=K?"250px":"",t=J?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[K,J]),ec=(0,eO.useMemo)(()=>({display:K?"flex":"none"}),[K]),eu=(0,eO.useMemo)(()=>({display:J?"flex":"none"}),[J]);l=[Q],(n=(0,eO.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{R||(N(e=>e.length?[...e,JSON.parse(JSON.stringify(Q))].slice(-50):[JSON.parse(JSON.stringify(Q))]),D([]))})()),(0,eO.useImperativeHandle)(t,()=>({handleOpen(e){L(!0),ep(e.items),ee(e),N([JSON.parse(JSON.stringify(e))]),D([]),setTimeout(()=>L(!1),0)}}));let ep=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?ep(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&ep(e.children[t],Math.random().toString(36).slice(2,10))})})},ex=e=>{var t,l,n;if((null==(t=e.datasets)?void 0:t.length)&&(null==b||null==(l=b.current)?void 0:l.reload)&&b.current.reload(),e.schema)ee(t=>({...e.schema}));else if(null==(n=e.pageItems)?void 0:n.length){let t=new Map(e.pageItems.map(e=>[e.id,e])),l=JSON.parse(JSON.stringify(Q)),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{t.has(e.id)&&(Object.keys(e).forEach(t=>{"id"!==t&&delete e[t]}),Object.assign(e,t.get(e.id))),Array.isArray(e.children)?n(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&n(e.children[t])})})};n(l.items),ee(l)}},em=(0,eO.useMemo)(()=>"cascade"!==Y||(null==X?void 0:X.cascadeIds)?Y:"props",[X,Y]);return(0,eN.jsxs)(tp,{pageId:r,designable:et,plugins:i,schema:Q,selectedItem:X,setSchema:ee,setSelectedItem:V,datasetSelector:h,fetch:f,children:[(0,eN.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,eN.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,eN.jsxs)(en,{children:[(0,eN.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"保存",children:(0,eN.jsx)(_,{type:"link",className:"toolbar",onClick:()=>{null==v||v(Q)},loading:j,children:(0,eN.jsx)(I,{})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"撤销",children:(0,eN.jsx)("a",{className:`toolbar ${k.length>1?"active":""}`,onClick:()=>{N(e=>{if(e.length<=1)return e;L(!0);let t=e[e.length-2];return D(e=>[...e,JSON.parse(JSON.stringify(Q))]),ee(t),V(null),setTimeout(()=>L(!1),0),e.slice(0,-1)})},children:(0,eN.jsx)(E,{})})}),(0,eN.jsx)(es,{title:"重做",children:(0,eN.jsx)("a",{className:`toolbar ${O.length>0?"active":""}`,onClick:()=>{D(e=>e.length?(L(!0),N(e=>[...e,JSON.parse(JSON.stringify(Q))]),ee(e[e.length-1]),V(null),setTimeout(()=>L(!1),0),e.slice(0,-1)):e)},children:(0,eN.jsx)(z,{})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"导入JSON",children:(0,eN.jsx)("a",{className:`toolbar ${O.length>0?"active":""}`,onClick:()=>{ea(!0)},children:(0,eN.jsx)(g,{})})})]}),(0,eN.jsxs)(en,{children:[(0,eN.jsx)(es,{title:"缩小",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(parseFloat(Math.max(C-.1,.5).toFixed(1))),children:(0,eN.jsx)(B,{})})}),(0,eN.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*C).toFixed(0),"%"]}),(0,eN.jsx)(es,{title:"放大",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(parseFloat(Math.min(C+.1,2).toFixed(1))),children:(0,eN.jsx)(A,{})})}),(0,eN.jsx)(es,{title:"重置缩放",children:(0,eN.jsx)("a",{className:"toolbar",onClick:()=>S(1),children:(0,eN.jsx)(tS,{type:"icon-zoom-reset"})})}),(0,eN.jsx)(H,{orientation:"vertical"}),(0,eN.jsx)(es,{title:"切换左侧栏",children:(0,eN.jsx)("a",{className:`toolbar ${K?"active":""}`,onClick:()=>{U(e=>!e),setTimeout(()=>{var e,t;return null==(t=y.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,eN.jsx)(tS,{type:"icon-sider-l"})})}),(0,eN.jsx)(es,{title:"切换右侧栏",children:(0,eN.jsx)("a",{className:`toolbar ${J?"active":""}`,onClick:()=>{q(e=>!e),setTimeout(()=>{var e,t;return null==(t=y.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,eN.jsx)(tS,{type:"icon-sider-r"})})}),o]})]}),(0,eN.jsxs)(lo,{style:ed,children:[(0,eN.jsxs)("div",{className:"left",style:ec,children:[(0,eN.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,eN.jsxs)(Z.Group,{value:$,onChange:e=>F(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,eN.jsx)(Z.Button,{value:"component",children:(0,eN.jsx)(es,{title:"组件",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-puzzle"})})}),(0,eN.jsx)(Z.Button,{value:"layer",children:(0,eN.jsx)(es,{title:"图层",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-outline"})})}),!!p&&(0,eN.jsx)(Z.Button,{value:"dataset",children:(0,eN.jsx)(es,{title:"数据集",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-dataset"})})}),d&&(0,eN.jsx)(Z.Button,{value:"datasource",title:"数据源",children:(0,eN.jsx)(es,{title:"数据源",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-datasource"})})}),c&&(0,eN.jsx)(Z.Button,{value:"script",children:(0,eN.jsx)(es,{title:"脚本",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-js"})})}),(0,eN.jsx)(Z.Button,{value:"env",children:(0,eN.jsx)(es,{title:"环境变量",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-variable"})})}),(0,eN.jsx)(Z.Button,{value:"code",children:(0,eN.jsx)(es,{title:"源码",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-json"})})})]})}),(0,eN.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===$&&(0,eN.jsx)(t1,{}),"layer"===$&&(0,eN.jsx)(t9,{}),d&&"datasource"===$&&(0,eN.jsx)(t4,{}),c&&"script"===$&&(0,eN.jsx)(ll,{}),"env"===$&&(0,eN.jsx)(lr,{}),"code"===$&&(0,eN.jsx)(tQ,{}),!!p&&"dataset"===$&&(0,eN.jsx)(li,{ref:b,renderNode:p})]})]}),(0,eN.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,eN.jsx)(tM,{title:"页面",extra:(0,eN.jsxs)(en,{children:[(0,eN.jsx)(_,{size:"small",type:et?"default":"primary",icon:et?(0,eN.jsx)(x,{}):(0,eN.jsx)(m,{}),onClick:()=>el(!et)}),(0,eN.jsxs)(Z.Group,{value:M,onChange:e=>P(e.target.value),size:"small",buttonStyle:"outline",children:[(0,eN.jsx)(Z.Button,{value:"desktop",title:"桌面",children:(0,eN.jsx)(u,{})}),(0,eN.jsx)(Z.Button,{value:"mobile",title:"移动设备",children:(0,eN.jsx)(w,{})}),(0,eN.jsx)(Z.Button,{value:"tablet",title:"平板设备",children:(0,eN.jsx)(T,{})})]})]})}),(0,eN.jsx)("div",{className:["body beautified_scrollbar",M].join(" "),children:(0,eN.jsx)("div",{style:{transform:`scale(${C})`,transformOrigin:"top center"},children:(0,eN.jsx)(tb,{ref:y,device:M,fetch:f})})})]}),(0,eN.jsxs)("div",{className:"right",style:eu,children:[(0,eN.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:[(0,eN.jsx)(tY,{agentList:a,onEffect:ex,style:{display:"ai"===em&&(null==f?void 0:f.ai)?void 0:"none"}}),"props"===em&&(0,eN.jsx)(t7,{datasourceEnable:d}),"cascade"===em&&(null==X?void 0:X.cascadeIds)&&(0,eN.jsx)(tq,{})]}),(0,eN.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:(0,eN.jsxs)(Z.Group,{value:em,onChange:e=>W(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(null==f?void 0:f.ai)&&(0,eN.jsx)(Z.Button,{value:"ai",children:(0,eN.jsx)(es,{title:"智能助理",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-assistant"})})}),(0,eN.jsx)(Z.Button,{value:"props",children:(0,eN.jsx)(es,{title:"属性",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-info"})})}),(null==X?void 0:X.cascadeIds)&&(0,eN.jsx)(Z.Button,{value:"cascade",children:(0,eN.jsx)(es,{title:"联动",placement:"right",children:(0,eN.jsx)(tS,{type:"icon-cascade"})})})]})})]})]})]}),(0,eN.jsx)(ls,{open:er,onOk:e=>{ea(!1),ee(e)},onCancel:()=>ea(!1)}),(0,eN.jsx)(G,{open:ei,size:400,mask:!1,title:null,closable:!1,styles:{body:{padding:0}},onClose:()=>eo(!1),children:(0,eN.jsx)(tY,{agentList:a,headExtra:(0,eN.jsx)(_,{type:"link",icon:(0,eN.jsx)(s,{}),onClick:()=>eo(!1)}),onEffect:ex})})]})});var lc=((ez={}).STRING="STRING",ez.NUMBER="NUMBER",ez.BOOLEAN="BOOLEAN",ez.OBJECT="OBJECT",ez.ARRAY="ARRAY",ez);let lu=t(j)`
|
|
931
931
|
vertical-align: middle;
|
|
932
932
|
margin-left: 2px;
|
|
933
933
|
color: var(--ant-color-text-description);
|
|
@@ -1048,7 +1048,7 @@ import*as e from"react";import t,{css as l}from"styled-components";import{AlignC
|
|
|
1048
1048
|
const module = undefined;
|
|
1049
1049
|
const exports = undefined;
|
|
1050
1050
|
${e}
|
|
1051
|
-
`)(eg,console,Math,Date,Array,Object,String,Number,Boolean,p)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);c&&e&&(c.setOption(e),setTimeout(()=>c.resize(),50))},[c,l]),(0,eN.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,eN.jsx)("div",{ref:d,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,eO.useRef)(null);return(0,eN.jsxs)(K,{children:[(0,eN.jsx)(K.Item,{name:"height",label:"高度",labelCol:{span:6},wrapperCol:{span:18},children:(0,eN.jsx)(J,{size:"small",min:10,max:1e3,suffix:"px",onChange:e=>l&&l({...t,height:e})})}),(0,eN.jsx)(K.Item,{layout:"vertical",label:(0,eN.jsxs)(eN.Fragment,{children:["Echarts 渲染脚本"," ",(0,eN.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,eN.jsx)(tS,{type:"icon-formate"})," 格式化"]})]}),className:"ant-form-item-label-space",children:(0,eN.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,eN.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,eN.jsx)(em,{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,eN.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
|
|
1051
|
+
`)(eg,console,Math,Date,Array,Object,String,Number,Boolean,p)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);c&&e&&(c.setOption(e),setTimeout(()=>c.resize(),50))},[c,l]),(0,eN.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,eN.jsx)("div",{ref:d,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,eO.useRef)(null);return(0,eN.jsxs)(K,{children:[(0,eN.jsx)(K.Item,{name:"height",label:"高度",labelCol:{span:6},wrapperCol:{span:18},children:(0,eN.jsx)(J,{value:t.height,size:"small",min:10,max:1e3,suffix:"px",onChange:e=>l&&l({...t,height:e})})}),(0,eN.jsx)(K.Item,{layout:"vertical",label:(0,eN.jsxs)(eN.Fragment,{children:["Echarts 渲染脚本"," ",(0,eN.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,eN.jsx)(tS,{type:"icon-formate"})," 格式化"]})]}),className:"ant-form-item-label-space",children:(0,eN.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,eN.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,eN.jsx)(em,{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,eN.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
|
|
1052
1052
|
return {
|
|
1053
1053
|
xAxis: { type: 'category', data: data.map(i => i.name) },
|
|
1054
1054
|
yAxis: { type: 'value' },
|
|
@@ -927,7 +927,7 @@
|
|
|
927
927
|
background: transparent;
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
`,tc=e=>{let{open:t,onCancel:l,onOk:n}=e,[r,a]=(0,p.useState)(JSON.stringify({info:{},datasources:[],scripts:[],variables:[],items:[]}));return(0,d.jsx)(ey.Modal,{title:"导入页面",open:t,width:800,onCancel:l,onOk:()=>null==n?void 0:n(JSON.parse(r)),okText:"导入",cancelText:"取消",styles:{body:{height:"calc(100vh - 250px)",overflow:"auto"}},children:(0,d.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex",height:"100%"},children:(0,d.jsx)(eX.Editor,{height:"100%",defaultLanguage:"json",value:r,options:{minimap:{enabled:!1}},onChange:e=>a(e||"")})})})},tu=m().forwardRef((e,t)=>{var l;let n,{pageId:r,agentList:a=[],plugins:i=[],headerExtra:o,datasourceEnable:s=!0,scriptEnable:c=!0,datasetPanel:u,datasetSelector:m,fetch:x,onSave:h,loading:f=!1}=e,g=(0,p.useRef)(null),v=(0,p.useRef)(null),[j,y]=(0,p.useState)(1),[b,w]=(0,p.useState)([]),[C,S]=(0,p.useState)([]),[I,z]=(0,p.useState)(!1),[k,O]=(0,p.useState)("desktop"),[N,T]=(0,p.useState)("component"),[R,F]=(0,p.useState)((null==x?void 0:x.ai)?"ai":"props"),[D,E]=(0,p.useState)(!0),[A,B]=(0,p.useState)(!0),[M,L]=(0,p.useState)(null),[P,$]=(0,p.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[Y,H]=(0,p.useState)(!0),[_,q]=(0,p.useState)(!1),[G,U]=(0,p.useState)(!1),K=(0,p.useMemo)(()=>{let e=D?"250px":"",t=A?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[D,A]),W=(0,p.useMemo)(()=>({display:D?"flex":"none"}),[D]),J=(0,p.useMemo)(()=>({display:A?"flex":"none"}),[A]);l=[P],(n=(0,p.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{I||(w(e=>e.length?[...e,JSON.parse(JSON.stringify(P))].slice(-50):[JSON.parse(JSON.stringify(P))]),S([]))})()),(0,p.useImperativeHandle)(t,()=>({handleOpen(e){z(!0),X(e.items),$(e),w([JSON.parse(JSON.stringify(e))]),S([]),setTimeout(()=>z(!1),0)}}));let X=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?X(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&X(e.children[t],Math.random().toString(36).slice(2,10))})})},V=e=>{var t,l,n;if((null==(t=e.datasets)?void 0:t.length)&&(null==v||null==(l=v.current)?void 0:l.reload)&&v.current.reload(),e.schema)$(e.schema);else if(null==(n=e.pageItems)?void 0:n.length){let t=new Map(e.pageItems.map(e=>[e.id,e])),l=JSON.parse(JSON.stringify(P)),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{t.has(e.id)&&(Object.keys(e).forEach(t=>{"id"!==t&&delete e[t]}),Object.assign(e,t.get(e.id))),Array.isArray(e.children)?n(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&n(e.children[t])})})};n(l.items),$(l)}},Q=(0,p.useMemo)(()=>"cascade"!==R||(null==M?void 0:M.cascadeIds)?R:"props",[M,R]);return(0,d.jsxs)(es,{pageId:r,designable:Y,plugins:i,schema:P,selectedItem:M,setSchema:$,setSelectedItem:L,datasetSelector:m,fetch:x,children:[(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"保存",children:(0,d.jsx)(ey.Button,{type:"link",className:"toolbar",onClick:()=>{null==h||h(P)},loading:f,children:(0,d.jsx)(ej.SaveOutlined,{})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"撤销",children:(0,d.jsx)("a",{className:`toolbar ${b.length>1?"active":""}`,onClick:()=>{w(e=>{if(e.length<=1)return e;z(!0);let t=e[e.length-2];return S(e=>[...e,JSON.parse(JSON.stringify(P))]),$(t),L(null),setTimeout(()=>z(!1),0),e.slice(0,-1)})},children:(0,d.jsx)(ej.UndoOutlined,{})})}),(0,d.jsx)(ey.Tooltip,{title:"重做",children:(0,d.jsx)("a",{className:`toolbar ${C.length>0?"active":""}`,onClick:()=>{S(e=>e.length?(z(!0),w(e=>[...e,JSON.parse(JSON.stringify(P))]),$(e[e.length-1]),L(null),setTimeout(()=>z(!1),0),e.slice(0,-1)):e)},children:(0,d.jsx)(ej.RedoOutlined,{})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"导入JSON",children:(0,d.jsx)("a",{className:`toolbar ${C.length>0?"active":""}`,onClick:()=>{q(!0)},children:(0,d.jsx)(ej.ImportOutlined,{})})})]}),(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)(ey.Tooltip,{title:"缩小",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(parseFloat(Math.max(j-.1,.5).toFixed(1))),children:(0,d.jsx)(ej.ZoomOutOutlined,{})})}),(0,d.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*j).toFixed(0),"%"]}),(0,d.jsx)(ey.Tooltip,{title:"放大",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(parseFloat(Math.min(j+.1,2).toFixed(1))),children:(0,d.jsx)(ej.ZoomInOutlined,{})})}),(0,d.jsx)(ey.Tooltip,{title:"重置缩放",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(1),children:(0,d.jsx)(ew,{type:"icon-zoom-reset"})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"切换左侧栏",children:(0,d.jsx)("a",{className:`toolbar ${D?"active":""}`,onClick:()=>{E(e=>!e),setTimeout(()=>{var e,t;return null==(t=g.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,d.jsx)(ew,{type:"icon-sider-l"})})}),(0,d.jsx)(ey.Tooltip,{title:"切换右侧栏",children:(0,d.jsx)("a",{className:`toolbar ${A?"active":""}`,onClick:()=>{B(e=>!e),setTimeout(()=>{var e,t;return null==(t=g.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,d.jsx)(ew,{type:"icon-sider-r"})})}),o]})]}),(0,d.jsxs)(td,{style:K,children:[(0,d.jsxs)("div",{className:"left",style:W,children:[(0,d.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,d.jsxs)(ey.Radio.Group,{value:N,onChange:e=>T(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,d.jsx)(ey.Radio.Button,{value:"component",children:(0,d.jsx)(ey.Tooltip,{title:"组件",placement:"right",children:(0,d.jsx)(ew,{type:"icon-puzzle"})})}),(0,d.jsx)(ey.Radio.Button,{value:"layer",children:(0,d.jsx)(ey.Tooltip,{title:"图层",placement:"right",children:(0,d.jsx)(ew,{type:"icon-outline"})})}),!!u&&(0,d.jsx)(ey.Radio.Button,{value:"dataset",children:(0,d.jsx)(ey.Tooltip,{title:"数据集",placement:"right",children:(0,d.jsx)(ew,{type:"icon-dataset"})})}),s&&(0,d.jsx)(ey.Radio.Button,{value:"datasource",title:"数据源",children:(0,d.jsx)(ey.Tooltip,{title:"数据源",placement:"right",children:(0,d.jsx)(ew,{type:"icon-datasource"})})}),c&&(0,d.jsx)(ey.Radio.Button,{value:"script",children:(0,d.jsx)(ey.Tooltip,{title:"脚本",placement:"right",children:(0,d.jsx)(ew,{type:"icon-js"})})}),(0,d.jsx)(ey.Radio.Button,{value:"env",children:(0,d.jsx)(ey.Tooltip,{title:"环境变量",placement:"right",children:(0,d.jsx)(ew,{type:"icon-variable"})})}),(0,d.jsx)(ey.Radio.Button,{value:"code",children:(0,d.jsx)(ey.Tooltip,{title:"源码",placement:"right",children:(0,d.jsx)(ew,{type:"icon-json"})})})]})}),(0,d.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===N&&(0,d.jsx)(e4,{}),"layer"===N&&(0,d.jsx)(e3,{}),s&&"datasource"===N&&(0,d.jsx)(e5,{}),c&&"script"===N&&(0,d.jsx)(tr,{}),"env"===N&&(0,d.jsx)(ti,{}),"code"===N&&(0,d.jsx)(e0,{}),!!u&&"dataset"===N&&(0,d.jsx)(ts,{ref:v,renderNode:u})]})]}),(0,d.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,d.jsx)(eL,{title:"页面",extra:(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)(ey.Button,{size:"small",type:Y?"default":"primary",icon:Y?(0,d.jsx)(ej.EyeInvisibleOutlined,{}):(0,d.jsx)(ej.EyeOutlined,{}),onClick:()=>H(!Y)}),(0,d.jsxs)(ey.Radio.Group,{value:k,onChange:e=>O(e.target.value),size:"small",buttonStyle:"outline",children:[(0,d.jsx)(ey.Radio.Button,{value:"desktop",title:"桌面",children:(0,d.jsx)(ej.DesktopOutlined,{})}),(0,d.jsx)(ey.Radio.Button,{value:"mobile",title:"移动设备",children:(0,d.jsx)(ej.MobileOutlined,{})}),(0,d.jsx)(ey.Radio.Button,{value:"tablet",title:"平板设备",children:(0,d.jsx)(ej.TabletOutlined,{})})]})]})}),(0,d.jsx)("div",{className:["body beautified_scrollbar",k].join(" "),children:(0,d.jsx)("div",{style:{transform:`scale(${j})`,transformOrigin:"top center"},children:(0,d.jsx)(eg,{ref:g,device:k,fetch:x})})})]}),(0,d.jsxs)("div",{className:"right",style:J,children:[(0,d.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:[(0,d.jsx)(eH,{agentList:a,onEffect:V,style:{display:"ai"===Q&&(null==x?void 0:x.ai)?void 0:"none"}}),"props"===Q&&(0,d.jsx)(tt,{datasourceEnable:s}),"cascade"===Q&&(null==M?void 0:M.cascadeIds)&&(0,d.jsx)(eJ,{})]}),(0,d.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:(0,d.jsxs)(ey.Radio.Group,{value:Q,onChange:e=>F(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(null==x?void 0:x.ai)&&(0,d.jsx)(ey.Radio.Button,{value:"ai",children:(0,d.jsx)(ey.Tooltip,{title:"智能助理",placement:"right",children:(0,d.jsx)(ew,{type:"icon-assistant"})})}),(0,d.jsx)(ey.Radio.Button,{value:"props",children:(0,d.jsx)(ey.Tooltip,{title:"属性",placement:"right",children:(0,d.jsx)(ew,{type:"icon-info"})})}),(null==M?void 0:M.cascadeIds)&&(0,d.jsx)(ey.Radio.Button,{value:"cascade",children:(0,d.jsx)(ey.Tooltip,{title:"联动",placement:"right",children:(0,d.jsx)(ew,{type:"icon-cascade"})})})]})})]})]})]}),(0,d.jsx)(tc,{open:_,onOk:e=>{q(!1),$(e)},onCancel:()=>q(!1)}),(0,d.jsx)(ey.Drawer,{open:G,size:400,mask:!1,title:null,closable:!1,styles:{body:{padding:0}},onClose:()=>U(!1),children:(0,d.jsx)(eH,{agentList:a,headExtra:(0,d.jsx)(ey.Button,{type:"link",icon:(0,d.jsx)(ej.CloseOutlined,{}),onClick:()=>U(!1)}),onEffect:V})})]})});var tp=((i={}).STRING="STRING",i.NUMBER="NUMBER",i.BOOLEAN="BOOLEAN",i.OBJECT="OBJECT",i.ARRAY="ARRAY",i);let tm=h()(ej.InfoCircleOutlined)`
|
|
930
|
+
`,tc=e=>{let{open:t,onCancel:l,onOk:n}=e,[r,a]=(0,p.useState)(JSON.stringify({info:{},datasources:[],scripts:[],variables:[],items:[]}));return(0,d.jsx)(ey.Modal,{title:"导入页面",open:t,width:800,onCancel:l,onOk:()=>null==n?void 0:n(JSON.parse(r)),okText:"导入",cancelText:"取消",styles:{body:{height:"calc(100vh - 250px)",overflow:"auto"}},children:(0,d.jsx)("div",{className:"body",style:{flex:"1 1 auto",display:"flex",height:"100%"},children:(0,d.jsx)(eX.Editor,{height:"100%",defaultLanguage:"json",value:r,options:{minimap:{enabled:!1}},onChange:e=>a(e||"")})})})},tu=m().forwardRef((e,t)=>{var l;let n,{pageId:r,agentList:a=[],plugins:i=[],headerExtra:o,datasourceEnable:s=!0,scriptEnable:c=!0,datasetPanel:u,datasetSelector:m,fetch:x,onSave:h,loading:f=!1}=e,g=(0,p.useRef)(null),v=(0,p.useRef)(null),[j,y]=(0,p.useState)(1),[b,w]=(0,p.useState)([]),[C,S]=(0,p.useState)([]),[I,z]=(0,p.useState)(!1),[k,O]=(0,p.useState)("desktop"),[N,T]=(0,p.useState)("component"),[R,F]=(0,p.useState)((null==x?void 0:x.ai)?"ai":"props"),[D,E]=(0,p.useState)(!0),[A,B]=(0,p.useState)(!0),[M,L]=(0,p.useState)(null),[P,$]=(0,p.useState)({info:{},datasources:[],scripts:[],variables:[],items:[]}),[Y,H]=(0,p.useState)(!0),[_,q]=(0,p.useState)(!1),[G,U]=(0,p.useState)(!1),K=(0,p.useMemo)(()=>{let e=D?"250px":"",t=A?"400px":"";return{gridTemplateColumns:`${e} 1fr ${t}`}},[D,A]),W=(0,p.useMemo)(()=>({display:D?"flex":"none"}),[D]),J=(0,p.useMemo)(()=>({display:A?"flex":"none"}),[A]);l=[P],(n=(0,p.useRef)()).current===JSON.stringify(l)&&n.current||(n.current=JSON.stringify(l),(()=>{I||(w(e=>e.length?[...e,JSON.parse(JSON.stringify(P))].slice(-50):[JSON.parse(JSON.stringify(P))]),S([]))})()),(0,p.useImperativeHandle)(t,()=>({handleOpen(e){z(!0),X(e.items),$(e),w([JSON.parse(JSON.stringify(e))]),S([]),setTimeout(()=>z(!1),0)}}));let X=(e,t)=>{e&&e.forEach(e=>{e.id||(e.id=t||Math.random().toString(36).slice(2,10)),Array.isArray(e.children)?X(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&X(e.children[t],Math.random().toString(36).slice(2,10))})})},V=e=>{var t,l,n;if((null==(t=e.datasets)?void 0:t.length)&&(null==v||null==(l=v.current)?void 0:l.reload)&&v.current.reload(),e.schema)$(t=>({...e.schema}));else if(null==(n=e.pageItems)?void 0:n.length){let t=new Map(e.pageItems.map(e=>[e.id,e])),l=JSON.parse(JSON.stringify(P)),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach(e=>{t.has(e.id)&&(Object.keys(e).forEach(t=>{"id"!==t&&delete e[t]}),Object.assign(e,t.get(e.id))),Array.isArray(e.children)?n(e.children):"object"==typeof e.children&&e.children&&Object.keys(e.children).forEach(t=>{Array.isArray(e.children[t])&&n(e.children[t])})})};n(l.items),$(l)}},Q=(0,p.useMemo)(()=>"cascade"!==R||(null==M?void 0:M.cascadeIds)?R:"props",[M,R]);return(0,d.jsxs)(es,{pageId:r,designable:Y,plugins:i,schema:P,selectedItem:M,setSchema:$,setSelectedItem:L,datasetSelector:m,fetch:x,children:[(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 24px",borderBottom:"solid 1px #e8e8e8"},children:[(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)("span",{style:{fontSize:16,fontWeight:500},children:"创建数据报表"}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"保存",children:(0,d.jsx)(ey.Button,{type:"link",className:"toolbar",onClick:()=>{null==h||h(P)},loading:f,children:(0,d.jsx)(ej.SaveOutlined,{})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"撤销",children:(0,d.jsx)("a",{className:`toolbar ${b.length>1?"active":""}`,onClick:()=>{w(e=>{if(e.length<=1)return e;z(!0);let t=e[e.length-2];return S(e=>[...e,JSON.parse(JSON.stringify(P))]),$(t),L(null),setTimeout(()=>z(!1),0),e.slice(0,-1)})},children:(0,d.jsx)(ej.UndoOutlined,{})})}),(0,d.jsx)(ey.Tooltip,{title:"重做",children:(0,d.jsx)("a",{className:`toolbar ${C.length>0?"active":""}`,onClick:()=>{S(e=>e.length?(z(!0),w(e=>[...e,JSON.parse(JSON.stringify(P))]),$(e[e.length-1]),L(null),setTimeout(()=>z(!1),0),e.slice(0,-1)):e)},children:(0,d.jsx)(ej.RedoOutlined,{})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"导入JSON",children:(0,d.jsx)("a",{className:`toolbar ${C.length>0?"active":""}`,onClick:()=>{q(!0)},children:(0,d.jsx)(ej.ImportOutlined,{})})})]}),(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)(ey.Tooltip,{title:"缩小",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(parseFloat(Math.max(j-.1,.5).toFixed(1))),children:(0,d.jsx)(ej.ZoomOutOutlined,{})})}),(0,d.jsxs)("div",{style:{fontSize:12,color:"#999",userSelect:"none"},children:[(100*j).toFixed(0),"%"]}),(0,d.jsx)(ey.Tooltip,{title:"放大",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(parseFloat(Math.min(j+.1,2).toFixed(1))),children:(0,d.jsx)(ej.ZoomInOutlined,{})})}),(0,d.jsx)(ey.Tooltip,{title:"重置缩放",children:(0,d.jsx)("a",{className:"toolbar",onClick:()=>y(1),children:(0,d.jsx)(ew,{type:"icon-zoom-reset"})})}),(0,d.jsx)(ey.Divider,{orientation:"vertical"}),(0,d.jsx)(ey.Tooltip,{title:"切换左侧栏",children:(0,d.jsx)("a",{className:`toolbar ${D?"active":""}`,onClick:()=>{E(e=>!e),setTimeout(()=>{var e,t;return null==(t=g.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,d.jsx)(ew,{type:"icon-sider-l"})})}),(0,d.jsx)(ey.Tooltip,{title:"切换右侧栏",children:(0,d.jsx)("a",{className:`toolbar ${A?"active":""}`,onClick:()=>{B(e=>!e),setTimeout(()=>{var e,t;return null==(t=g.current)||null==(e=t.handleResize)?void 0:e.call(t)},0)},children:(0,d.jsx)(ew,{type:"icon-sider-r"})})}),o]})]}),(0,d.jsxs)(td,{style:K,children:[(0,d.jsxs)("div",{className:"left",style:W,children:[(0,d.jsx)("div",{style:{padding:"22px 1px 22px 0",borderRight:"solid 1px #e8e8e8"},children:(0,d.jsxs)(ey.Radio.Group,{value:N,onChange:e=>T(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"left-pane-tabs",children:[(0,d.jsx)(ey.Radio.Button,{value:"component",children:(0,d.jsx)(ey.Tooltip,{title:"组件",placement:"right",children:(0,d.jsx)(ew,{type:"icon-puzzle"})})}),(0,d.jsx)(ey.Radio.Button,{value:"layer",children:(0,d.jsx)(ey.Tooltip,{title:"图层",placement:"right",children:(0,d.jsx)(ew,{type:"icon-outline"})})}),!!u&&(0,d.jsx)(ey.Radio.Button,{value:"dataset",children:(0,d.jsx)(ey.Tooltip,{title:"数据集",placement:"right",children:(0,d.jsx)(ew,{type:"icon-dataset"})})}),s&&(0,d.jsx)(ey.Radio.Button,{value:"datasource",title:"数据源",children:(0,d.jsx)(ey.Tooltip,{title:"数据源",placement:"right",children:(0,d.jsx)(ew,{type:"icon-datasource"})})}),c&&(0,d.jsx)(ey.Radio.Button,{value:"script",children:(0,d.jsx)(ey.Tooltip,{title:"脚本",placement:"right",children:(0,d.jsx)(ew,{type:"icon-js"})})}),(0,d.jsx)(ey.Radio.Button,{value:"env",children:(0,d.jsx)(ey.Tooltip,{title:"环境变量",placement:"right",children:(0,d.jsx)(ew,{type:"icon-variable"})})}),(0,d.jsx)(ey.Radio.Button,{value:"code",children:(0,d.jsx)(ey.Tooltip,{title:"源码",placement:"right",children:(0,d.jsx)(ew,{type:"icon-json"})})})]})}),(0,d.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:["component"===N&&(0,d.jsx)(e4,{}),"layer"===N&&(0,d.jsx)(e3,{}),s&&"datasource"===N&&(0,d.jsx)(e5,{}),c&&"script"===N&&(0,d.jsx)(tr,{}),"env"===N&&(0,d.jsx)(ti,{}),"code"===N&&(0,d.jsx)(e0,{}),!!u&&"dataset"===N&&(0,d.jsx)(ts,{ref:v,renderNode:u})]})]}),(0,d.jsxs)("div",{className:"center",style:{flex:"1 1 auto"},children:[(0,d.jsx)(eL,{title:"页面",extra:(0,d.jsxs)(ey.Space,{children:[(0,d.jsx)(ey.Button,{size:"small",type:Y?"default":"primary",icon:Y?(0,d.jsx)(ej.EyeInvisibleOutlined,{}):(0,d.jsx)(ej.EyeOutlined,{}),onClick:()=>H(!Y)}),(0,d.jsxs)(ey.Radio.Group,{value:k,onChange:e=>O(e.target.value),size:"small",buttonStyle:"outline",children:[(0,d.jsx)(ey.Radio.Button,{value:"desktop",title:"桌面",children:(0,d.jsx)(ej.DesktopOutlined,{})}),(0,d.jsx)(ey.Radio.Button,{value:"mobile",title:"移动设备",children:(0,d.jsx)(ej.MobileOutlined,{})}),(0,d.jsx)(ey.Radio.Button,{value:"tablet",title:"平板设备",children:(0,d.jsx)(ej.TabletOutlined,{})})]})]})}),(0,d.jsx)("div",{className:["body beautified_scrollbar",k].join(" "),children:(0,d.jsx)("div",{style:{transform:`scale(${j})`,transformOrigin:"top center"},children:(0,d.jsx)(eg,{ref:g,device:k,fetch:x})})})]}),(0,d.jsxs)("div",{className:"right",style:J,children:[(0,d.jsxs)("div",{style:{flex:"1 1 auto",display:"flex",flexDirection:"column",width:"calc(100% - 47px)"},children:[(0,d.jsx)(eH,{agentList:a,onEffect:V,style:{display:"ai"===Q&&(null==x?void 0:x.ai)?void 0:"none"}}),"props"===Q&&(0,d.jsx)(tt,{datasourceEnable:s}),"cascade"===Q&&(null==M?void 0:M.cascadeIds)&&(0,d.jsx)(eJ,{})]}),(0,d.jsx)("div",{style:{padding:"22px 0",borderLeft:"solid 1px #e8e8e8",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:(0,d.jsxs)(ey.Radio.Group,{value:Q,onChange:e=>F(e.target.value),buttonStyle:"outline",style:{fontWeight:"normal",display:"inline-flex",flexDirection:"column",gap:14},className:"right-pane-tabs",children:[(null==x?void 0:x.ai)&&(0,d.jsx)(ey.Radio.Button,{value:"ai",children:(0,d.jsx)(ey.Tooltip,{title:"智能助理",placement:"right",children:(0,d.jsx)(ew,{type:"icon-assistant"})})}),(0,d.jsx)(ey.Radio.Button,{value:"props",children:(0,d.jsx)(ey.Tooltip,{title:"属性",placement:"right",children:(0,d.jsx)(ew,{type:"icon-info"})})}),(null==M?void 0:M.cascadeIds)&&(0,d.jsx)(ey.Radio.Button,{value:"cascade",children:(0,d.jsx)(ey.Tooltip,{title:"联动",placement:"right",children:(0,d.jsx)(ew,{type:"icon-cascade"})})})]})})]})]})]}),(0,d.jsx)(tc,{open:_,onOk:e=>{q(!1),$(e)},onCancel:()=>q(!1)}),(0,d.jsx)(ey.Drawer,{open:G,size:400,mask:!1,title:null,closable:!1,styles:{body:{padding:0}},onClose:()=>U(!1),children:(0,d.jsx)(eH,{agentList:a,headExtra:(0,d.jsx)(ey.Button,{type:"link",icon:(0,d.jsx)(ej.CloseOutlined,{}),onClick:()=>U(!1)}),onEffect:V})})]})});var tp=((i={}).STRING="STRING",i.NUMBER="NUMBER",i.BOOLEAN="BOOLEAN",i.OBJECT="OBJECT",i.ARRAY="ARRAY",i);let tm=h()(ej.InfoCircleOutlined)`
|
|
931
931
|
vertical-align: middle;
|
|
932
932
|
margin-left: 2px;
|
|
933
933
|
color: var(--ant-color-text-description);
|
|
@@ -1048,7 +1048,7 @@
|
|
|
1048
1048
|
const module = undefined;
|
|
1049
1049
|
const exports = undefined;
|
|
1050
1050
|
${e}
|
|
1051
|
-
`)(tI,console,Math,Date,Array,Object,String,Number,Boolean,x)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);u&&e&&(u.setOption(e),setTimeout(()=>u.resize(),50))},[u,l]),(0,d.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,d.jsx)("div",{ref:c,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,p.useRef)(null);return(0,d.jsxs)(ey.Form,{children:[(0,d.jsx)(ey.Form.Item,{name:"height",label:"高度",labelCol:{span:6},wrapperCol:{span:18},children:(0,d.jsx)(ey.InputNumber,{size:"small",min:10,max:1e3,suffix:"px",onChange:e=>l&&l({...t,height:e})})}),(0,d.jsx)(ey.Form.Item,{layout:"vertical",label:(0,d.jsxs)(d.Fragment,{children:["Echarts 渲染脚本"," ",(0,d.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,d.jsx)(ew,{type:"icon-formate"})," 格式化"]})]}),className:"ant-form-item-label-space",children:(0,d.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,d.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,d.jsx)(eV(),{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,d.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
|
|
1051
|
+
`)(tI,console,Math,Date,Array,Object,String,Number,Boolean,x)}catch(e){return console.error("ECharts 配置解析失败:",e),null}}})(l);u&&e&&(u.setOption(e),setTimeout(()=>u.resize(),50))},[u,l]),(0,d.jsx)("div",{id:t,style:{width:"100%",height:r,...a},className:i,children:(0,d.jsx)("div",{ref:c,style:{width:"100%",height:r,...a}})})},formComponent:e=>{let{model:t,onChange:l}=e,n=(0,p.useRef)(null);return(0,d.jsxs)(ey.Form,{children:[(0,d.jsx)(ey.Form.Item,{name:"height",label:"高度",labelCol:{span:6},wrapperCol:{span:18},children:(0,d.jsx)(ey.InputNumber,{value:t.height,size:"small",min:10,max:1e3,suffix:"px",onChange:e=>l&&l({...t,height:e})})}),(0,d.jsx)(ey.Form.Item,{layout:"vertical",label:(0,d.jsxs)(d.Fragment,{children:["Echarts 渲染脚本"," ",(0,d.jsxs)("a",{onClick:()=>{var e,t;let l=null==(e=n.current)?void 0:e.editor;null==l||null==(t=l.getAction("editor.action.formatDocument"))||t.run()},children:[(0,d.jsx)(ew,{type:"icon-formate"})," 格式化"]})]}),className:"ant-form-item-label-space",children:(0,d.jsxs)("div",{style:{border:"1px solid #d9d9d9",borderRadius:4,textAlign:"left"},children:[(0,d.jsxs)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:["function getOptions(data) ","{"," "]}),(0,d.jsx)(eV(),{onMount:e=>{n.current={editor:e}},height:"400px",defaultLanguage:"javascript",value:t.script,onChange:e=>{let n;return n=e||"",l&&l({...t,script:n||""})},options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}}),(0,d.jsx)("div",{style:{color:"#0000ff",fontSize:14,padding:"0 50px"},children:"}"})]})})]})},defaultOptions:{datasource:{source:"custom",datasourceId:null,scriptId:null,custom:'[{"name":"Mon","value":150},{"name":"Tue","value":230},{"name":"Wed","value":224},{"name":"Thu","value":218},{"name":"Fri","value":135},{"name":"Sat","value":147},{"name":"Sun","value":260}]'},props:{script:`
|
|
1052
1052
|
return {
|
|
1053
1053
|
xAxis: { type: 'category', data: data.map(i => i.name) },
|
|
1054
1054
|
yAxis: { type: 'value' },
|
package/package.json
CHANGED
|
@@ -395,7 +395,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
|
|
|
395
395
|
datasetPanelRef.current.reload();
|
|
396
396
|
}
|
|
397
397
|
if (effect.schema) {
|
|
398
|
-
setSchema(effect.schema);
|
|
398
|
+
setSchema(prev => ({ ...effect.schema } as PageSchema));
|
|
399
399
|
} else if (effect.pageItems?.length) {
|
|
400
400
|
const effectItemMap = new Map(
|
|
401
401
|
effect.pageItems.map((item) => [item.id, item]),
|
|
@@ -22,8 +22,20 @@ export const EchartsProps: React.FC<PropEditorProps<EchartsModel>> = ({
|
|
|
22
22
|
};
|
|
23
23
|
return (
|
|
24
24
|
<Form>
|
|
25
|
-
<Form.Item
|
|
26
|
-
|
|
25
|
+
<Form.Item
|
|
26
|
+
name="height"
|
|
27
|
+
label="高度"
|
|
28
|
+
labelCol={{ span: 6 }}
|
|
29
|
+
wrapperCol={{ span: 18 }}
|
|
30
|
+
>
|
|
31
|
+
<InputNumber
|
|
32
|
+
value={model.height}
|
|
33
|
+
size="small"
|
|
34
|
+
min={10}
|
|
35
|
+
max={1000}
|
|
36
|
+
suffix="px"
|
|
37
|
+
onChange={(v) => triggerModel("height", v)}
|
|
38
|
+
/>
|
|
27
39
|
</Form.Item>
|
|
28
40
|
<Form.Item
|
|
29
41
|
layout="vertical"
|
package/src/example.tsx
CHANGED
|
@@ -148,7 +148,34 @@ export const Example: React.FC = () => {
|
|
|
148
148
|
chat: async (bizType, bizId, conversationId, request) =>
|
|
149
149
|
new Promise((resolve) => {
|
|
150
150
|
setTimeout(() => {
|
|
151
|
-
resolve({
|
|
151
|
+
resolve({
|
|
152
|
+
...example.chatResponse,
|
|
153
|
+
answer: {
|
|
154
|
+
...example.chatResponse.answer,
|
|
155
|
+
effect: {
|
|
156
|
+
schema: {
|
|
157
|
+
info: {
|
|
158
|
+
name: "数据报表",
|
|
159
|
+
description: "数据报表",
|
|
160
|
+
},
|
|
161
|
+
datasources: [],
|
|
162
|
+
scripts: [],
|
|
163
|
+
variables: [],
|
|
164
|
+
items: [
|
|
165
|
+
{
|
|
166
|
+
id: "1",
|
|
167
|
+
type: "b-text",
|
|
168
|
+
name: "数据报表名称",
|
|
169
|
+
props: {
|
|
170
|
+
text: "text: " + uuid(),
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
id: uuid(),
|
|
178
|
+
});
|
|
152
179
|
}, 5000);
|
|
153
180
|
}),
|
|
154
181
|
conversationList: async (bizType, bizId) =>
|
|
@@ -156,8 +183,8 @@ export const Example: React.FC = () => {
|
|
|
156
183
|
messageList: async (bizType, bizId, conversationId) =>
|
|
157
184
|
Promise.resolve(
|
|
158
185
|
example.messageList.filter(
|
|
159
|
-
(m) => m.conversationId === conversationId
|
|
160
|
-
)
|
|
186
|
+
(m) => m.conversationId === conversationId,
|
|
187
|
+
),
|
|
161
188
|
),
|
|
162
189
|
removeConversation: async (bizType, bizId, conversationId) =>
|
|
163
190
|
Promise.resolve(true),
|
|
@@ -367,9 +394,7 @@ const example = {
|
|
|
367
394
|
answer: {
|
|
368
395
|
answer:
|
|
369
396
|
"已生成草稿:曲线展示出勤率,环形占比呈现迟到与请假,卡片列出异常班级与提醒事项。",
|
|
370
|
-
plans: [
|
|
371
|
-
{ name: "计划4", description: "计划4描述" },
|
|
372
|
-
],
|
|
397
|
+
plans: [{ name: "计划4", description: "计划4描述" }],
|
|
373
398
|
extra: [
|
|
374
399
|
{ id: "e8", element: "出勤率走势", action: "新增", area: "中间左侧" },
|
|
375
400
|
{
|
|
@@ -399,9 +424,7 @@ const example = {
|
|
|
399
424
|
answer: {
|
|
400
425
|
answer:
|
|
401
426
|
"已生成草稿:评分分布清晰,热门意见词语聚合展示,建议清单分组呈现,便于教学改进。",
|
|
402
|
-
plans: [
|
|
403
|
-
{ name: "计划5", description: "计划5描述" },
|
|
404
|
-
],
|
|
427
|
+
plans: [{ name: "计划5", description: "计划5描述" }],
|
|
405
428
|
extra: [
|
|
406
429
|
{ id: "e11", element: "评分分布", action: "新增", area: "中间" },
|
|
407
430
|
{ id: "e12", element: "意见词语聚合", action: "新增", area: "中间" },
|
|
@@ -426,9 +449,7 @@ const example = {
|
|
|
426
449
|
answer: {
|
|
427
450
|
answer:
|
|
428
451
|
"已生成草稿:时长条形展示、覆盖范围统计、及时率仪表与反馈质量等级卡片,顶部总览卡片汇总核心信息。",
|
|
429
|
-
plans: [
|
|
430
|
-
{ name: "计划6", description: "计划6描述" },
|
|
431
|
-
],
|
|
452
|
+
plans: [{ name: "计划6", description: "计划6描述" }],
|
|
432
453
|
extra: [
|
|
433
454
|
{ id: "e14", element: "授课时长", action: "新增", area: "左侧" },
|
|
434
455
|
{ id: "e15", element: "班级覆盖", action: "新增", area: "左侧" },
|
|
@@ -453,9 +474,7 @@ const example = {
|
|
|
453
474
|
answer: {
|
|
454
475
|
answer:
|
|
455
476
|
"已更新草稿:加入人数与及格率标签,底部提醒区高亮近一周波动,便于快速关注。",
|
|
456
|
-
plans: [
|
|
457
|
-
{ name: "计划3", description: "计划3描述" },
|
|
458
|
-
],
|
|
477
|
+
plans: [{ name: "计划3", description: "计划3描述" }],
|
|
459
478
|
extra: [
|
|
460
479
|
{ id: "e1", element: "学生总人数标签", action: "新增", area: "顶部" },
|
|
461
480
|
{ id: "e2", element: "及格率标签", action: "新增", area: "顶部" },
|