zy-react-library 2.0.13 → 2.0.15
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/components/Excel/index.d.ts +22 -22
- package/components/FormBuilder/FormItemsRenderer.js +1 -1
- package/components/Map/MapSelector.js +1 -1
- package/components/PreviewExcel/index.d.ts +18 -18
- package/components/PreviewWord/index.d.ts +18 -18
- package/components/SeamlessScroll/index.d.ts +1 -1
- package/components/SeamlessScroll/index.js +1 -1
- package/components/Select/Basic/index.js +1 -1
- package/components/SelectCreate/index.js +1 -1
- package/components/Word/index.d.ts +22 -22
- package/enum/uploadFile/aqd/index.d.ts +2 -0
- package/enum/uploadFile/aqd/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { FC } from "react";
|
|
2
|
-
|
|
3
|
-
export interface ExcelProps {
|
|
4
|
-
/** 是否显示弹窗 */
|
|
5
|
-
visible?: boolean;
|
|
6
|
-
/** 关闭回调 */
|
|
7
|
-
onCancel?: () => void;
|
|
8
|
-
/** xlsx 文件地址 */
|
|
9
|
-
file?: string;
|
|
10
|
-
/** xlsx 文件名 */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** 是否内联展示 */
|
|
13
|
-
inline?: boolean;
|
|
14
|
-
/** 弹窗标题 */
|
|
15
|
-
title?: string;
|
|
16
|
-
/** 内容样式 */
|
|
17
|
-
style?: Record<string, any>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare const Excel: FC<ExcelProps>;
|
|
21
|
-
|
|
22
|
-
export default Excel;
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export interface ExcelProps {
|
|
4
|
+
/** 是否显示弹窗 */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** 关闭回调 */
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
/** xlsx 文件地址 */
|
|
9
|
+
file?: string;
|
|
10
|
+
/** xlsx 文件名 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 是否内联展示 */
|
|
13
|
+
inline?: boolean;
|
|
14
|
+
/** 弹窗标题 */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** 内容样式 */
|
|
17
|
+
style?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const Excel: FC<ExcelProps>;
|
|
21
|
+
|
|
22
|
+
export default Excel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InfoCircleOutlined as e}from"@ant-design/icons";import{Input as r,DatePicker as t,Form as n,Col as l,Divider as o,Row as s,Button as a,Checkbox as i,Radio as d,Select as
|
|
1
|
+
import{InfoCircleOutlined as e}from"@ant-design/icons";import{Input as r,DatePicker as t,Form as n,Col as l,Divider as o,Row as s,Button as a,Checkbox as i,Radio as d,Select as p,InputNumber as u,Tooltip as c}from"antd";import m from"dayjs";import{FORM_ITEM_RENDER_ENUM as h}from"../../enum/formItemRender/index.js";import{getDataType as y}from"../../utils/index.js";import{jsx as f,Fragment as E,jsxs as T}from"react/jsx-runtime";const{TextArea:I}=r,{RangePicker:b}=t,v=({options:v,labelCol:A,gutter:R=24,span:w=12,collapse:Y=!1,useAutoGenerateRequired:D=!0,initialValues:C})=>{const M=n.useFormInstance(),N=()=>{const e=M.getFieldsValue();return 0===Object.keys(e).length&&C?C:e},x=e=>"function"==typeof e.componentProps?e.componentProps(N()):e.componentProps||{},P=e=>{const r="function"==typeof e.formItemProps?e.formItemProps(N()):e.formItemProps||{};return((e,r)=>{[h.DATE,h.DATE_MONTH,h.DATE_YEAR,h.DATETIME].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:e?m(e):void 0})),[h.DATE_WEEK].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:e?m(e,"YYYY-wo"):void 0})),[h.DATE_RANGE,h.DATETIME_RANGE].includes(e.render)&&(r.getValueFromEvent=(e,r)=>r,r.getValueProps=e=>({value:Array.isArray(e)?e.map(e=>e?m(e):void 0):void 0}))})(e,r),r},U=e=>"function"==typeof e?e(N()):e??!0,g=e=>{if(e.render===h.DIVIDER)return[];const r=[];switch(e.render||h.INPUT){case h.INPUT:!1!==e.useConstraints&&r.push({max:50,message:"最多输入50字符"});break;case h.TEXTAREA:!1!==e.useConstraints&&r.push({max:500,message:"最多输入500字符"});break;case h.INPUT_NUMBER:case h.NUMBER:!1!==e.useConstraints&&r.push({pattern:/^(\d+)(\.\d{1,2})?$/,message:"请输入正确的数字,最多保留两位小数"}),!1!==e.useConstraints&&r.push({validator:(e,r)=>r&&Math.abs(Number.parseFloat(r))>999999999?Promise.reject("输入数值超出安全范围"):Promise.resolve()});break;case h.INTEGER:!1!==e.useConstraints&&r.push({pattern:/^(\d+)$/,message:"请输入正确的整数"}),!1!==e.useConstraints&&r.push({validator:(e,r)=>r&&Math.abs(Number.parseFloat(r))>999999999?Promise.reject("输入数值超出安全范围"):Promise.resolve()})}if(!D)return e.rules?Array.isArray(e.rules)?[...e.rules,...r]:[e.rules,...r]:r;if(U(e.required)){const t=!e.render||[h.INPUT,h.TEXTAREA,h.INPUT_NUMBER,h.NUMBER,h.INTEGER].includes(e.render);r.push({required:!0,message:`${t?"请输入":"请选择"}${e.label}`})}return e.rules?Array.isArray(e.rules)?[...e.rules,...r]:[e.rules,...r]:r},_=e=>e.key||("Array"===y(e.name)?e.name.join("."):e.name),F=e=>{const r=e.render===h.DIVIDER?24:e.span??w,t=e.labelCol??(24===r?{span:A.span/2}:A);return{span:r,labelCol:t,wrapperCol:e.wrapperCol??{span:24-t.span}}},B=e=>"function"==typeof e.colStyle?e.colStyle(N()):e.colStyle,S=e=>"function"==typeof e.colTitle?e.colTitle(N()):e.colTitle,k=(e,r)=>(e.shouldUpdate??e.dependencies)||(r.shouldUpdate??r.dependencies),L=e=>"function"==typeof e?e(N()):e??!1,V=(e,r)=>({value:e[r.valueKey],label:"function"==typeof r.labelKey?r.labelKey(e):e[r.labelKey],disabled:e.disabled}),G=e=>{const n=x(e),o=(e=>({valueKey:e?.itemsField?.valueKey||"bianma",labelKey:e?.itemsField?.labelKey||"name"}))(e),a=e.render??h.INPUT,c=e.placeholder??`请${[h.INPUT,h.TEXTAREA,h.INPUT_NUMBER,h.NUMBER,h.INTEGER].includes(a)?"输入":"选择"}${e.label}`;switch(a){case h.INPUT:return f(r,{placeholder:c,maxLength:!1!==e.useConstraints?50:9999,...n});case h.TEXTAREA:return f(I,{placeholder:c,maxLength:!1!==e.useConstraints?500:9999,showCount:!0,rows:3,...n});case h.INPUT_NUMBER:case h.NUMBER:case h.INTEGER:return f(u,{placeholder:c,style:{width:"100%"},...n});case h.SELECT:return f(p,{placeholder:c,showSearch:{optionFilterProp:"label"},allowClear:!0,options:(e.items||[]).map(e=>V(e,o)),...n});case h.RADIO:return f(d.Group,{options:(e.items||[]).map(e=>V(e,o)),...n});case h.CHECKBOX:{const r=(e.items||[]).map(e=>V(e,o));return e.checkboxCol?f(i.Group,{...n,children:f(s,{children:r.map(({value:r,label:t,disabled:n})=>f(l,{span:e.checkboxCol,children:f(i,{value:r,disabled:n,children:t})},r))})}):f(i.Group,{options:r,...n})}case h.DATE:return f(t,{placeholder:c,format:"YYYY-MM-DD",style:{width:"100%"},...n});case h.DATE_MONTH:return f(t,{picker:"month",placeholder:c,format:"YYYY-MM",style:{width:"100%"},...n});case h.DATE_YEAR:return f(t,{picker:"year",placeholder:c,format:"YYYY",style:{width:"100%"},...n});case h.DATE_WEEK:return f(t,{picker:"week",placeholder:c,format:"YYYY-wo",style:{width:"100%"},...n});case h.DATE_RANGE:return f(b,{placeholder:[`请选择开始${e.label}`,`请选择结束${e.label}`],format:"YYYY-MM-DD",style:{width:"100%"},...n});case h.DATETIME:return f(t,{showTime:!0,placeholder:c,format:"YYYY-MM-DD HH:mm:ss",style:{width:"100%"},...n});case h.DATETIME_RANGE:return f(b,{showTime:!0,placeholder:[`请选择开始${e.label}`,`请选择结束${e.label}`],format:"YYYY-MM-DD HH:mm:ss",style:{width:"100%"},...n});case h.DIVIDER:return null;default:return a}},$=r=>r.tip?T(E,{children:[r.label,f(c,{title:r.tip,children:f(e,{style:{marginLeft:4,fontSize:12}})})]}):r.label,K=({option:e,style:r,col:t,index:o,preserve:s})=>{const a=P(e);return delete a.dependencies,delete a.shouldUpdate,L(e.hidden)?null:T(l,{span:t.span,style:{...r,...B(e)},children:[S(e),f(n.Item,{name:e.name,label:$(e),rules:g(e),labelCol:t.labelCol,wrapperCol:t.wrapperCol,preserve:s,required:!!D&&" "!==$(e)&&U(e.required),colon:" "!==$(e),...a,children:G(e)})]},_(e)||o)},q=({option:e,style:r,col:t,index:s,preserve:a})=>{const i=x(e);return L(e.hidden)?null:e.customizeRender?f(l,{span:t.span,style:r,children:e.render},_(e)||s):e.onlyForLabel?f(n.Item,{name:e.name,noStyle:!0,preserve:a,children:f("input",{type:"hidden"})},_(e)||s):e.render===h.DIVIDER?f(l,{span:t.span,style:r,children:f(o,{titlePlacement:"start",...i,children:e.label})},_(e)||s):null},O=({option:e,index:r,col:t,style:o})=>{const i=(e=>{const r={showAddButton:!0,showRemoveButton:!0,addButtonText:"添加",removeButtonText:"删除",options:[],addDefaultValue:{},addInsertIndex:void 0};return"function"==typeof e.formListUniqueProps?{...r,...e.formListUniqueProps(N())}:{...r,...e.formListUniqueProps||{}}})(e),d=x(e);return L(e.hidden)?null:T(l,{span:t.span,style:{...o,...B(e)},children:[S(e),f(n.List,{name:e.name,...d,children:(r,{add:t,remove:d,move:p})=>f(E,{children:r.map((r,u)=>{const c=((e,r,t,n,l,o)=>"function"==typeof e?e(r,t,{field:r,fieldIndex:t,add:n,remove:l,move:o}):e??[])(i.options,r,u,t,d,p),m=((e,r,t)=>"function"==typeof e.rowStyle?e.rowStyle(r,t):e.rowStyle)(e,r,u),y=((e,r,t)=>"function"==typeof e.rowTitle?e.rowTitle(r,t):e.rowTitle)(e,r,u);return T(s,{gutter:R,style:m,children:[y,c.map((e,s)=>{const p=F(e),m=P(e),y={option:e,style:o,col:p,index:`${u}_${s}`,preserve:!0};if(k(e,m))return j(y);const E=q(y);if(E)return E;if(e.render===h.FORM_LIST)return O(y);const I=e=>!L(e.hidden)&&!e.onlyForLabel,b=c[s+1],v=b&&b.render===h.FORM_LIST,A=b&&!I(b);return s===(()=>{for(let e=c.length-1;e>=0;e--){const r=c[e];if(r.render===h.FORM_LIST)return e;if(I(r))return e}return-1})()||v||A?(delete m.dependencies,delete m.shouldUpdate,T(l,{span:p.span,style:{...o,...B(e)},children:[S(e),f(n.Item,{label:$(e),labelCol:p.labelCol,wrapperCol:p.wrapperCol,preserve:!1,required:!!D&&" "!==$(e)&&U(e.required),colon:" "!==$(e),...m,children:T("div",{style:{display:"flex",gap:10,alignItems:"center",justifyContent:"space-between"},children:[f("div",{style:{flex:1,minWidth:0},children:f(n.Item,{noStyle:!0,rules:g(e),name:e.name,children:G(e)})}),u>=1?i.showRemoveButton&&f(a,{type:"primary",danger:!0,onClick:()=>d(r.name),children:i.removeButtonText}):i.showAddButton&&f(a,{type:"primary",onClick:()=>t(i.addDefaultValue,i.addInsertIndex),children:i.addButtonText})]})})]},_(e)||s)):K(y)})]},r.key)})})})]},_(e)||r)},j=({option:e,index:r,style:t,col:l,preserve:o})=>{const s=P(e);return f(n.Item,{noStyle:!0,preserve:o,shouldUpdate:e.shouldUpdate??s.shouldUpdate,dependencies:e.dependencies??s.dependencies,children:()=>q({option:e,style:t,col:l,index:r,preserve:o})||(e.render===h.FORM_LIST?O({option:e,index:r,col:l,style:t}):K({option:e,style:t,col:l,index:r,preserve:o}))},_(e)||r)};return f(E,{children:v.map((e,r)=>{const t=F(e),n=(e=>Y&&e>=3?{display:"none"}:void 0)(r),l=P(e),o={option:e,style:n,col:t,index:r,preserve:!1};if(k(e,l))return j(o);return q(o)||(e.render===h.FORM_LIST?O(o):K(o))})})};v.displayName="FormItemsRenderer";export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Modal as e,Form as i,Row as t,Col as
|
|
1
|
+
import{Modal as e,Form as i,Row as t,Col as a,Select as n,Input as r,Button as l,Spin as o}from"antd";import{useRef as d,useState as s,useEffect as c}from"react";import{dynamicLoadJs as u,dynamicLoadCss as p}from"../../utils/index.js";import w from"./CesiumMap.js";import"./index.less";import{jsxs as m,jsx as h}from"react/jsx-runtime";const g=g=>{const{visible:y,onClose:b,longitude:v,latitude:C,onConfirm:f,area:L="",showArea:M=!1,disable:B=!1,type:k="baidu"}=g,j=d(null),x=d(null),D=d(null),[G,I]=s(!1),[O,A]=s(v||""),[R,z]=s(C||""),[K,P]=s(""),[T,S]=s("");c(()=>{A(v||""),z(C||""),S(L||"")},[v,C,L]);const W=()=>{if(!window?.BMapGL?.Map)return void setTimeout(()=>{W()},50);const e=new window.BMapGL.Map(j.current);if(x.current=e,e.centerAndZoom(new window.BMapGL.Point(v||window.mapLongitude,C||window.mapLatitude),16),e.enableScrollWheelZoom(!0),v&&C){const i=new window.BMapGL.Point(v,C),t=new window.BMapGL.Marker(i);e.addOverlay(t)}B||e.addEventListener("click",i=>{e.clearOverlays();const t=new window.BMapGL.Point(i.latlng.lng,i.latlng.lat),a=new window.BMapGL.Marker(t);e.addOverlay(a),z(i.latlng.lat),A(i.latlng.lng)})},E=()=>{if(I(!0),j.current){if(!x.current){if("baidu"===k)return void W();"cesium"===k&&(()=>{const{init:e,flyTo:i,addMarkPoint:t,getLongitudeAndLatitude:a}=new w,{viewer:n}=e();x.current=n,i({longitude:v||window.mapLongitude,latitude:C||window.mapLatitude,height:9e5}),v&&C&&t({longitude:v,latitude:C}),B||a((e,i)=>{if(e)return;const{longitude:t,latitude:a}=i;z(a),A(t)})})()}I(!1)}},Z=()=>{P(""),x.current&&(x.current.destroy(),x.current=null),b&&b()};c(()=>{let e;return y&&(e=setTimeout(()=>{(()=>{if(window.mapLongitude||window.mapLatitude)return"baidu"===k?window.mapBaiDuKey?void(async()=>{window.BMapGL?E():window?.base?.loadDynamicResource?(await window.base.loadDynamicResource({url:`https://api.map.baidu.com/api?v=1.0&type=webgl&ak=${window.mapBaiDuKey}&callback=initialize`,type:"script",attr:{type:"text/javascript"}}),E()):(await u(`https://api.map.baidu.com/api?v=1.0&type=webgl&ak=${window.mapBaiDuKey}&callback=initialize`),E())})():void console.error("【Map】 请在window设置变量 mapBaiDuKey,以供地图初始化加载使用"):void("cesium"===k&&(async()=>{window.Cesium?E():window?.base?.loadDynamicResource?(await window.base.loadDynamicResource({url:"https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Cesium.js",type:"script",attr:{type:"text/javascript"}}),await window.base.loadDynamicResource({url:"https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Widgets/widgets.css",type:"link",attr:{rel:"stylesheet",type:"text/css"}}),E()):(await u("https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Cesium.js"),await p("https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Widgets/widgets.css"),E())})());console.error("【Map】 请在window设置变量 mapLongitude 和 mapLatitude,以供地图初始化坐标使用")})()},100)),()=>{e&&clearTimeout(e)}},[y]);const $=()=>{if(x.current){try{x.current.clearOverlays(),x.current.destroy(),x.current=null}catch(e){console.warn("Error destroying map on unmount:",e)}x.current=null}};return c(()=>()=>{$()},[]),m(e,{open:y,title:"坐标",onCancel:Z,width:1e3,destroyOnHidden:!1,mask:{closable:!1},afterClose:$,footer:[h(l,{onClick:Z,children:"取消"},"back"),!B&&h(l,{type:"primary",onClick:()=>{f&&f(O,R,{area:T}),Z()},children:"确定"},"submit")],children:[m(i,{labelAlign:"right",labelCol:{span:6},wrapperCol:{span:18},children:[M&&h(t,{gutter:24,children:h(a,{span:12,children:h(i.Item,{label:"所属区域",children:h(n,{value:T,onChange:e=>S(e),allowClear:!0,options:[{value:"1",label:"东港区"},{value:"2",label:"西港区"}]})})})}),!B&&"baidu"===k&&m(t,{gutter:24,children:[h(a,{span:12,children:h(i.Item,{label:"关键字搜索",children:h(r,{value:K,onChange:e=>P(e.target.value),allowClear:!0})})}),h(a,{span:12,children:m(i.Item,{label:" ",colon:!1,style:{textAlign:"right"},children:[h(l,{type:"primary",onClick:()=>{K&&x.current&&(D.current=new window.BMapGL.LocalSearch(x.current,{renderOptions:{map:x.current}}),D.current.search(K))},children:"搜索"}),h(l,{onClick:()=>{P(""),x.current&&D.current.search("")},style:{marginLeft:8},children:"重置"})]})})]}),m(t,{gutter:24,children:[h(a,{span:12,children:h(i.Item,{label:"经度",children:h(r,{disabled:!0,value:O})})}),h(a,{span:12,children:h(i.Item,{label:"纬度",children:h(r,{disabled:!0,value:R})})})]})]}),h("div",{ref:j,id:"map_container",style:{width:"100%",height:"500px",position:"relative"},children:h(o,{size:"large",tip:"地图正在加载中...",spinning:G,children:h("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e3}})})})]})};g.displayName="MapSelector";export{g as default};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { FC } from "react";
|
|
2
|
-
|
|
3
|
-
export interface PreviewExcelProps {
|
|
4
|
-
/** 文件列表,和 name、url 冲突 */
|
|
5
|
-
files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
|
|
6
|
-
/** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
|
|
7
|
-
nameKey?: string;
|
|
8
|
-
/** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
|
|
9
|
-
urlKey?: string;
|
|
10
|
-
/** 单个文件名,和 files 冲突 */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** 单个文件路径,和 files 冲突 */
|
|
13
|
-
url?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const PreviewExcel: FC<PreviewExcelProps>;
|
|
17
|
-
|
|
18
|
-
export default PreviewExcel;
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export interface PreviewExcelProps {
|
|
4
|
+
/** 文件列表,和 name、url 冲突 */
|
|
5
|
+
files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
|
|
6
|
+
/** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
|
|
7
|
+
nameKey?: string;
|
|
8
|
+
/** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
|
|
9
|
+
urlKey?: string;
|
|
10
|
+
/** 单个文件名,和 files 冲突 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 单个文件路径,和 files 冲突 */
|
|
13
|
+
url?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const PreviewExcel: FC<PreviewExcelProps>;
|
|
17
|
+
|
|
18
|
+
export default PreviewExcel;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { FC } from "react";
|
|
2
|
-
|
|
3
|
-
export interface PreviewWordProps {
|
|
4
|
-
/** 文件列表,和 name、url 冲突 */
|
|
5
|
-
files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
|
|
6
|
-
/** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
|
|
7
|
-
nameKey?: string;
|
|
8
|
-
/** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
|
|
9
|
-
urlKey?: string;
|
|
10
|
-
/** 单个文件名,和 files 冲突 */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** 单个文件路径,和 files 冲突 */
|
|
13
|
-
url?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const PreviewWord: FC<PreviewWordProps>;
|
|
17
|
-
|
|
18
|
-
export default PreviewWord;
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export interface PreviewWordProps {
|
|
4
|
+
/** 文件列表,和 name、url 冲突 */
|
|
5
|
+
files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
|
|
6
|
+
/** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
|
|
7
|
+
nameKey?: string;
|
|
8
|
+
/** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
|
|
9
|
+
urlKey?: string;
|
|
10
|
+
/** 单个文件名,和 files 冲突 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 单个文件路径,和 files 冲突 */
|
|
13
|
+
url?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const PreviewWord: FC<PreviewWordProps>;
|
|
17
|
+
|
|
18
|
+
export default PreviewWord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef as e,useRef as t,useState as r,useEffect as n,useImperativeHandle as l}from"react";import{throttle as o}from"throttle-debounce";import{jsx as i,jsxs as c,Fragment as u}from"react/jsx-runtime";const s=e((e,s)=>{const{
|
|
1
|
+
import{forwardRef as e,useRef as t,useState as r,useEffect as n,useImperativeHandle as l}from"react";import{throttle as o}from"throttle-debounce";import{jsx as i,jsxs as c,Fragment as u}from"react/jsx-runtime";const s=e((e,s)=>{const{isAutoScroll:a=!0,list:d=[],step:f=1,limitScrollNum:m=3,hover:h=!0,direction:p="up",singleHeight:y=0,singleWidth:g=0,singleWaitTime:w=1e3,isRemUnit:b=!1,isWatch:$=!0,delay:v=0,ease:x="ease-in",count:M=-1,copyNum:S=1,wheel:T=!1,singleLine:N=!1,children:A,className:W}=e,k=t(null),E=t(null),F=t(null),H=t(null),L=t(null),q=t(!1),[z,Y]=r(0),[j,C]=r(0),[I,R]=r(0),[U,B]=r(0),[D,G]=r(0),J=d.length>=m,K={width:z?`${z}px`:"auto",transform:`translate(${I}px,${U}px)`,transition:`all ${"string"==typeof x?x:`cubic-bezier(${x.x1}, ${x.y1}, ${x.x2}, ${x.y2})`} ${v}ms`,overflow:"hidden",display:N?"flex":"block"},O="left"===p||"right"===p,P=O?{float:"left",overflow:"hidden",display:N?"flex":"block",flexShrink:N?0:1}:{overflow:"hidden"},Q=b?Number.parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1,V=g*Q,X=y*Q;n(()=>{X>0&&X%f>0&&console.error("如果设置了单步滚动,step 需是单步大小的约数,否则无法保证单步滚动结束的位置是否准确。~~~~~")},[X,f]);const Z=()=>{H.current&&(cancelAnimationFrame(H.current),H.current=null)},_=(e,t,r)=>{H.current=requestAnimationFrame(()=>{const n=j/2,l=z/2;if(("up"===e||"down"===e)&&n<=0)return;if(("left"===e||"right"===e)&&l<=0)return;let o=U,i=I;"up"===e?B(e=>Math.abs(e)>=n?(G(e=>e+1),o=-t,-t):(o=e-t,e-t)):"down"===e?B(e=>e>=0?(G(e=>e+1),o=-1*n+t,-1*n+t):(o=e+t,e+t)):"left"===e?R(e=>Math.abs(e)>=l?(G(e=>e+1),i=-t,-t):(i=e-t,e-t)):"right"===e&&R(e=>e>=0?(G(e=>e+1),i=-1*l+t,-1*l+t):(i=e+t,e+t)),r||(L.current&&clearTimeout(L.current),X?Math.abs(o)%X<t?L.current=window.setTimeout(()=>{ee()},w):ee():V&&Math.abs(i)%V<t?L.current=window.setTimeout(()=>{ee()},w):ee())})},ee=()=>{Z(),!q.current&&J&&D!==M?_(p,f,!1):G(0)},te=()=>{if(d&&"boolean"!=typeof d&&d.length>100&&console.warn(`数据达到了${d.length}条有点多哦~,可能会造成部分老旧浏览器卡顿。`),O){let e=E.current?.offsetWidth||0;e=2*e+1,Y(e)}J?requestAnimationFrame(()=>{const e=F.current?.offsetHeight||0;e>0?C(e):setTimeout(()=>{const e=F.current?.offsetHeight||0;e>0&&C(e)},100)}):(Z(),R(0),B(0))},re=()=>{q.current=!1,ee()},ne=()=>{q.current=!0,L.current&&clearTimeout(L.current),Z()},le=h&&a&&J,oe=()=>{Z(),te()},ie=o(30,e=>{Z();const t=X||15;e.deltaY<0&&_("down",t,!0),e.deltaY>0&&_("up",t,!0)});l(s,()=>({reset:oe})),n(()=>{J&&te()},[J]),n(()=>{J&&a&&(j>0||z>0)&&!q.current&&ee()},[j,z]),n(()=>{a?re():ne()},[a]),n(()=>{0!==M&&re()},[M]),n(()=>{$&&oe()},[d,$]),n(()=>()=>{Z(),L.current&&clearTimeout(L.current)},[]);const ce=()=>c(u,{children:[i("div",{ref:E,style:P,children:A&&"function"==typeof A?A():A}),J?Array.from({length:S}).map((e,t)=>i("div",{style:P,children:A&&"function"==typeof A?A():A},`copy-${t}`)):null]});return i("div",{ref:k,className:W,children:i("div",T&&h?{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},onWheel:e=>{le&&ie(e)},children:ce()}:{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},children:ce()})})});s.displayName="SeamlessScroll";export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Select as e}from"antd";import{useEffect as
|
|
1
|
+
import{Select as e}from"antd";import{useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";function n(n){const{onGetData:t,onChange:r,onGetLabel:l,onGetOption:i,placeholder:s="",data:c=[],nameKey:p="name",idKey:d="id",labelRender:f,...h}=n;return a(()=>{t?.(c)},[c]),o(e,{placeholder:`请选择${s}`,showSearch:{optionFilterProp:"children"},allowClear:!0,onChange:(e,a)=>{if(l||i)if(Array.isArray(e))if(e.length>0){const a=[],o=[];e.forEach(e=>{const n=c.find(a=>a[d]===e);n&&(a.push(n),o.push(n[p]))}),l?.(o),i?.(a)}else l?.([]),i?.([]);else if(e){const a=c.find(a=>a[d]===e);l?.(a[p]),i?.(a)}else l?.(""),i?.({});r?.(e,a)},options:c.map(e=>({value:e[d],label:f?f(e):e[p]})),...h})}n.displayName="BasicSelect";export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CloseCircleOutlined as e}from"@ant-design/icons";import{Select as t}from"antd";import{jsx as n,jsxs as
|
|
1
|
+
import{CloseCircleOutlined as e}from"@ant-design/icons";import{Select as t}from"antd";import{jsx as n,jsxs as a}from"react/jsx-runtime";function o(o){const{items:i,showDelete:l=!0,label:r="",maxCount:s=1,onDelete:m,...p}=o;return n(t,{mode:"tags",maxCount:s,placeholder:`请选择${r},无对应选项可直接输入创建选项`,optionRender:t=>a("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[n("span",{children:t.label}),l&&n(e,{style:{marginRight:10},onClick:e=>{e.stopPropagation(),(e=>{m?.(e)})(t)}})]}),options:i.map(e=>({value:e.id,label:e.name})),...p})}o.displayName="SelectCreate";export{o as default};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { FC } from "react";
|
|
2
|
-
|
|
3
|
-
export interface WordProps {
|
|
4
|
-
/** 是否显示弹窗 */
|
|
5
|
-
visible?: boolean;
|
|
6
|
-
/** 关闭回调 */
|
|
7
|
-
onCancel?: () => void;
|
|
8
|
-
/** docx 文件地址 */
|
|
9
|
-
file?: string;
|
|
10
|
-
/** docx 文件名 */
|
|
11
|
-
name?: string;
|
|
12
|
-
/** 是否内联展示 */
|
|
13
|
-
inline?: boolean;
|
|
14
|
-
/** 弹窗标题 */
|
|
15
|
-
title?: string;
|
|
16
|
-
/** 内容样式 */
|
|
17
|
-
style?: Record<string, any>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare const Word: FC<WordProps>;
|
|
21
|
-
|
|
22
|
-
export default Word;
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export interface WordProps {
|
|
4
|
+
/** 是否显示弹窗 */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** 关闭回调 */
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
/** docx 文件地址 */
|
|
9
|
+
file?: string;
|
|
10
|
+
/** docx 文件名 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 是否内联展示 */
|
|
13
|
+
inline?: boolean;
|
|
14
|
+
/** 弹窗标题 */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** 内容样式 */
|
|
17
|
+
style?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const Word: FC<WordProps>;
|
|
21
|
+
|
|
22
|
+
export default Word;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const UPLOAD_FILE_TYPE_ENUM: {
|
|
5
5
|
1000: 1000; // template_task - 模板任务附件
|
|
6
|
+
1001: 1001; // task_fill - 任务填写附件
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -10,4 +11,5 @@ export declare const UPLOAD_FILE_TYPE_ENUM: {
|
|
|
10
11
|
*/
|
|
11
12
|
export declare const UPLOAD_FILE_PATH_ENUM: {
|
|
12
13
|
1000: "template_task";
|
|
14
|
+
1001: "task_fill";
|
|
13
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={1e3:1e3},t={1e3:"template_task"};export{t as UPLOAD_FILE_PATH_ENUM,e as UPLOAD_FILE_TYPE_ENUM};
|
|
1
|
+
const e={1e3:1e3,1001:1001},t={1e3:"template_task",1001:"task_fill"};export{t as UPLOAD_FILE_PATH_ENUM,e as UPLOAD_FILE_TYPE_ENUM};
|