yxuse 3.0.50 → 3.0.51

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/README.md CHANGED
@@ -1,25 +1,39 @@
1
1
  <!--
2
2
  * @Author: WangXin
3
- * @Date: 2024-04-24 11:20:12
3
+ * @Date: 2025-04-27 10:42:12
4
4
  * @LastEditors: WangXin
5
- * @LastEditTime: 2025-05-12 10:57:21
5
+ * @LastEditTime: 2025-05-16 15:00:34
6
6
  * @FilePath: /yxuse/README.md
7
7
  * @Description:
8
8
  *
9
9
  * Copyright (c) ${2024} by YuXing, All Rights Reserved.
10
10
  -->
11
11
 
12
- # yxuse
13
-
14
12
  ## 更新日志
15
13
 
14
+ ## 2025-05-16
15
+
16
+ ### 3.0.51
17
+
18
+ #### Features
19
+
20
+ - Components:[YxForm](/component/yxtable.html)优化部分功能,新增 loadOptions 配置 [详见动态表单](/component/yxform.html#动态表单)
21
+ - Components:[YxTable] 新增 loadOptions 配置[详见](/component/yxtable.html#可编辑表格动态加载数据)
22
+ - utils[useConfirm] 新增 useConfirm 通用方法
23
+
24
+ #### Bug fixes
25
+
26
+ - Components:[YxDialog](/component/yxDialog.html)修复取消的回调不生效的 bug,beforeOpen 新增 Promise 回调的处理
27
+ - Components:[YxDrawer](/component/yxDrawer.html)修复取消的回调不生效的 bug,beforeOpen 新增 Promise 回调的处理
28
+ - Components:[YxUpload](/component/yxUpload.html)修复文件上传的列表和 limit 配置的数量不一致的 bug
29
+
16
30
  ## 2025-05-12
17
31
 
18
32
  ### 3.0.50
19
33
 
20
34
  #### Features
21
35
 
22
- - Components:[YxTable] 操作栏 render,参数新增 index
36
+ - Components:[YxTable](/component/yxtable.html) 操作栏 render,参数新增 index
23
37
 
24
38
  #### Bug fixes
25
39
 
@@ -42,11 +56,11 @@
42
56
 
43
57
  #### Features
44
58
 
45
- - Components:[LogoTitle] 新增系统 title、logo 组件
59
+ - Components:[LogoTitle](/component/logoTitle.html) 新增系统 title、logo 组件
46
60
 
47
61
  #### Bug fixes
48
62
 
49
- - utils:[http]修复去除国际化逻辑后,请求 401 后无法跳转登录页的 bug
63
+ - utils:[http](/utils/http.html)修复去除国际化逻辑后,请求 401 后无法跳转登录页的 bug
50
64
 
51
65
  ## 2025-04-27
52
66
 
@@ -54,21 +68,21 @@
54
68
 
55
69
  #### Features
56
70
 
57
- - Components:[YxForm] 新增表单分组样式的自定义
71
+ - Components:[YxForm](/component/yxform.html) 新增表单分组样式的自定义
58
72
 
59
73
  ### 3.0.44
60
74
 
61
75
  #### Features
62
76
 
63
- - Components:[YxTable]operate 操作栏新增自定义 className 配置
64
- - utils:[mqtt]新增 mqtt 的统一封装
65
- - utils:[websocket]新增 websocket 的封装
66
- - utils:[fecth]新增 fecth 请求的封装
77
+ - Components:[YxTable](/component/yxtable.html) operate 操作栏新增自定义 className 配置
78
+ - utils:[mqtt](/utils/mqtt.html)新增 mqtt 的统一封装
79
+ - utils:[websocket](/utils/socket.html)新增 websocket 的封装
80
+ - utils:[fecth](/utils/fecth.html)新增 fecth 请求的封装
67
81
  - docs:更新部分组件的文档
68
82
 
69
83
  #### Bug fixes
70
84
 
71
- - Components:[YxForm]修复在初始化时传入默认数据不生效的 bug
85
+ - Components:[YxForm][YxForm](/component/yxform.html)修复在初始化时传入默认数据不生效的 bug
72
86
  - Components:[YxForm]修复类型提示
73
87
  - Components:[YxTable]修复类型提示和排序的 bug
74
88
  - utils:[translate]修复翻译的 bug
package/lib/index.cjs2.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=Object.defineProperty,e=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,n=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,o=(t,o)=>{for(var r in o||(o={}))s.call(o,r)&&n(t,r,o[r]);if(e)for(var r of e(o))i.call(o,r)&&n(t,r,o[r]);return t},r=(t,e,s)=>n(t,"symbol"!=typeof e?e+"":e,s),a=(t,e,s)=>new Promise(((i,n)=>{var o=t=>{try{a(s.next(t))}catch(e){n(e)}},r=t=>{try{a(s.throw(t))}catch(e){n(e)}},a=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,r);a((s=s.apply(t,e)).next())}));const h=require("./index.cjs12.js"),c=require("./mqtt.min.cjs.js");function l(t,e,s){return a(this,arguments,(function*(t,e,s,i={}){const{headers:n={},responseType:r="json",signal:a,noAuth:c=!1}=i,l="GET"===e?`${t}${function(t){if(!t)return"";const e=new URLSearchParams;return Object.entries(t).forEach((([t,s])=>{null!=s&&e.append(t,String(s))})),`?${e.toString()}`}(s)}`:`${t}`,u=h.getToken();i.noLoading||h.showFullScreenLoading();const m=yield fetch(l,{method:e,headers:o(o({"Content-Type":"application/json"},u&&!c?{token:u}:""),n),body:"GET"!==e&&s?JSON.stringify(s):void 0,signal:a});if(h.hideFullScreenLoading(),!m.ok){let t="";try{const e=yield m.json();(null==e?void 0:e.resultMsg)&&(t=e.resultMsg)}catch(b){}throw h.checkStatus(m.status,t),new Error(t)}switch(r){case"text":return m.text();case"blob":return m.blob();default:return m.json()}}))}require("element-plus");const u={get:(t,e,s)=>l(t,"GET",e,s),post:(t,e,s)=>l(t,"POST",e,s),put:(t,e,s)=>l(t,"PUT",e,s),delete:(t,e,s)=>l(t,"DELETE",e,s)},m={mqttVersion:5,clean:!0,connectTimeout:4e3,keepAlive:60,clientId:"mqttjs_"+Date.now(),qos:1},b=new Map;class g{constructor(t,e){r(this,"client"),this.client=null,this.subscribe=this.subscribe,this.unsubscribe=this.unsubscribe,this.publish=this.publish,this.destroyed=this.destroyed,this.createClient(t,o(o({},m),e))}createClient(t,e){this.client=c.mqtt_minExports.connect(t,e),this.client.on("connect",this.onConnect),this.client.on("reconnect",this.onReconnect),this.client.on("error",this.onError),this.client.on("message",this.onMessage)}publish(t,e){this.client.publish(t,e,{qos:m.qos},(t=>{}))}subscribe(t,e){this.client.subscribe(t,(s=>{if(s)throw new Error(s);b.set(t,e)}))}unsubscribe(t){this.client.unsubscribe(t,{},(t=>{}))}onConnect(t){}onReconnect(t){}onError(t){}onMessage(t,e){const s=e.toString();b.get(t)(JSON.parse(s))}destroyed(){this.client.end&&this.client.end()}}class d{constructor(t,e){r(this,"url"),r(this,"protocols"),r(this,"webSocketState"),r(this,"isCustomClose"),r(this,"reconnectTime"),r(this,"heartBeatTime"),r(this,"waitBeatTime"),r(this,"callback"),r(this,"HEART_KEY"),r(this,"HEART_VALUE"),r(this,"ws"),r(this,"isReconnectionLoading"),r(this,"timeId"),r(this,"eventCenter"),r(this,"errorStack"),r(this,"heartMessage"),r(this,"msgDataPreHandler"),this.url=t.url,this.protocols=e,this.webSocketState=!1,this.isCustomClose=!0,this.reconnectTime=t.reconnectTime,this.heartBeatTime=t.heartBeatTime,this.waitBeatTime=t.waitBeatTime,this.callback=t.callback,t.msgDataPreHandler&&(this.msgDataPreHandler=t.msgDataPreHandler),this.onmessage=this.onmessage,this.heartMessage=t.heartMessage,this.HEART_KEY=t.HEART_KEY,this.HEART_VALUE=t.HEART_VALUE,this.ws=null,this.isReconnectionLoading=!1,this.createWs()}createWs(){"WebSocket"in window&&(this.ws=null,this.ws=new WebSocket(this.url,this.protocols),this.onopen(),this.onerror(),this.onclose(),this.onmessage())}onopen(){this.ws.onopen=()=>{this.webSocketState=!0,this.startHeartBeat(this.heartBeatTime)}}startHeartBeat(t){setTimeout((()=>{this.heartMessage&&(this.heartMessage.data=(new Date).getTime()+""),this.send(this.heartMessage?this.heartMessage:this.HEART_KEY),this.waitingServer()}),t)}waitingServer(){this.webSocketState=!1,setTimeout((()=>{if(this.webSocketState)this.startHeartBeat(this.heartBeatTime);else try{this.close(),this.ws&&this.start()}catch(t){}}),this.waitBeatTime)}onerror(){this.ws&&(this.ws.onerror=t=>{this.isCustomClose=!1,this.isReconnectionLoading=!1})}onclose(){this.ws&&(this.ws.onclose=()=>{this.isCustomClose||this.ws&&(this.reconnection(),this.isReconnectionLoading=!1)})}onmessage(){return a(this,null,(function*(){this.ws&&(this.ws.onmessage=t=>a(this,null,(function*(){try{let e=t.data;if(this.msgDataPreHandler&&(yield this.msgDataPreHandler(e)),e===this.HEART_VALUE)return void(this.webSocketState=!0);const s=JSON.parse(e);this.callback(s)}catch(e){this.callback(t.data)}})))}))}reconnection(){this.isReconnectionLoading||(this.isReconnectionLoading=!0,clearTimeout(this.timeId),this.timeId=null,this.timeId=setTimeout((()=>{this.createWs()}),this.reconnectTime))}send(t){this.webSocketState&&this.ws&&this.ws.send(t)}close(){var t;this.isCustomClose=!0,this.isReconnectionLoading=!1,this.ws&&this.ws.close&&(null==(t=this.ws)||t.close())}start(){this.isCustomClose=!1,this.reconnection()}subscribe(t,e){this.eventCenter.on(t,e)}unsubscribe(t,e){this.eventCenter.off(t,e)}destroy(){clearTimeout(this.timeId),this.close(),this.ws=null,this.errorStack=null,this.eventCenter=null,this.webSocketState=!1}}const w=Object.freeze(Object.defineProperty({__proto__:null,MQ:g,WS:d,areColorsSimilar:c.areColorsSimilar,copyText:c.copyText,enumToArray:c.enumToArray,getCownDownTime:c.getCownDownTime,getSelectOptions:c.getSelectOptions,http:h.http,isColorEqual:c.isColorEqual,isDarkColor:c.isDarkColor,isTabActive:c.isTabActive,notifyMessageToSystems:c.notifyMessageToSystems,receiveMessage:c.receiveMessage,yxFecth:u,yxMessage:c.yxMessage,yxSubscribe:c.yxSubscribe},Symbol.toStringTag,{value:"Module"}));exports.MQ=g,exports.Ws=d,exports.utils2=w,exports.yxFecth=u;
1
+ "use strict";var t=Object.defineProperty,e=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,n=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,o=(t,o)=>{for(var r in o||(o={}))s.call(o,r)&&n(t,r,o[r]);if(e)for(var r of e(o))i.call(o,r)&&n(t,r,o[r]);return t},r=(t,e,s)=>n(t,"symbol"!=typeof e?e+"":e,s),a=(t,e,s)=>new Promise(((i,n)=>{var o=t=>{try{a(s.next(t))}catch(e){n(e)}},r=t=>{try{a(s.throw(t))}catch(e){n(e)}},a=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,r);a((s=s.apply(t,e)).next())}));const h=require("./index.cjs12.js"),c=require("./mqtt.min.cjs.js");function l(t,e,s){return a(this,arguments,(function*(t,e,s,i={}){const{headers:n={},responseType:r="json",signal:a,noAuth:c=!1}=i,l="GET"===e?`${t}${function(t){if(!t)return"";const e=new URLSearchParams;return Object.entries(t).forEach((([t,s])=>{null!=s&&e.append(t,String(s))})),`?${e.toString()}`}(s)}`:`${t}`,u=h.getToken();i.noLoading||h.showFullScreenLoading();const m=yield fetch(l,{method:e,headers:o(o({"Content-Type":"application/json"},u&&!c?{token:u}:""),n),body:"GET"!==e&&s?JSON.stringify(s):void 0,signal:a});if(h.hideFullScreenLoading(),!m.ok){let t="";try{const e=yield m.json();(null==e?void 0:e.resultMsg)&&(t=e.resultMsg)}catch(b){}throw h.checkStatus(m.status,t),new Error(t)}switch(r){case"text":return m.text();case"blob":return m.blob();default:return m.json()}}))}require("element-plus");const u={get:(t,e,s)=>l(t,"GET",e,s),post:(t,e,s)=>l(t,"POST",e,s),put:(t,e,s)=>l(t,"PUT",e,s),delete:(t,e,s)=>l(t,"DELETE",e,s)},m={mqttVersion:5,clean:!0,connectTimeout:4e3,keepAlive:60,clientId:"mqttjs_"+Date.now(),qos:1},b=new Map;class g{constructor(t,e){r(this,"client"),this.client=null,this.subscribe=this.subscribe,this.unsubscribe=this.unsubscribe,this.publish=this.publish,this.destroyed=this.destroyed,this.createClient(t,o(o({},m),e))}createClient(t,e){this.client=c.mqtt_minExports.connect(t,e),this.client.on("connect",this.onConnect),this.client.on("reconnect",this.onReconnect),this.client.on("error",this.onError),this.client.on("message",this.onMessage)}publish(t,e){this.client.publish(t,e,{qos:m.qos},(t=>{}))}subscribe(t,e){this.client.subscribe(t,(s=>{if(s)throw new Error(s);b.set(t,e)}))}unsubscribe(t){this.client.unsubscribe(t,{},(t=>{}))}onConnect(t){}onReconnect(t){}onError(t){}onMessage(t,e){const s=e.toString();b.get(t)(JSON.parse(s))}destroyed(){this.client.end&&this.client.end()}}class d{constructor(t,e){r(this,"url"),r(this,"protocols"),r(this,"webSocketState"),r(this,"isCustomClose"),r(this,"reconnectTime"),r(this,"heartBeatTime"),r(this,"waitBeatTime"),r(this,"callback"),r(this,"HEART_KEY"),r(this,"HEART_VALUE"),r(this,"ws"),r(this,"isReconnectionLoading"),r(this,"timeId"),r(this,"eventCenter"),r(this,"errorStack"),r(this,"heartMessage"),r(this,"msgDataPreHandler"),this.url=t.url,this.protocols=e,this.webSocketState=!1,this.isCustomClose=!0,this.reconnectTime=t.reconnectTime,this.heartBeatTime=t.heartBeatTime,this.waitBeatTime=t.waitBeatTime,this.callback=t.callback,t.msgDataPreHandler&&(this.msgDataPreHandler=t.msgDataPreHandler),this.onmessage=this.onmessage,this.heartMessage=t.heartMessage,this.HEART_KEY=t.HEART_KEY,this.HEART_VALUE=t.HEART_VALUE,this.ws=null,this.isReconnectionLoading=!1,this.createWs()}createWs(){"WebSocket"in window&&(this.ws=null,this.ws=new WebSocket(this.url,this.protocols),this.onopen(),this.onerror(),this.onclose(),this.onmessage())}onopen(){this.ws.onopen=()=>{this.webSocketState=!0,this.startHeartBeat(this.heartBeatTime)}}startHeartBeat(t){setTimeout((()=>{this.heartMessage&&(this.heartMessage.data=(new Date).getTime()+""),this.send(this.heartMessage?this.heartMessage:this.HEART_KEY),this.waitingServer()}),t)}waitingServer(){this.webSocketState=!1,setTimeout((()=>{if(this.webSocketState)this.startHeartBeat(this.heartBeatTime);else try{this.close(),this.ws&&this.start()}catch(t){}}),this.waitBeatTime)}onerror(){this.ws&&(this.ws.onerror=t=>{this.isCustomClose=!1,this.isReconnectionLoading=!1})}onclose(){this.ws&&(this.ws.onclose=()=>{this.isCustomClose||this.ws&&(this.reconnection(),this.isReconnectionLoading=!1)})}onmessage(){return a(this,null,(function*(){this.ws&&(this.ws.onmessage=t=>a(this,null,(function*(){try{let e=t.data;if(this.msgDataPreHandler&&(yield this.msgDataPreHandler(e)),e===this.HEART_VALUE)return void(this.webSocketState=!0);const s=JSON.parse(e);this.callback(s)}catch(e){this.callback(t.data)}})))}))}reconnection(){this.isReconnectionLoading||(this.isReconnectionLoading=!0,clearTimeout(this.timeId),this.timeId=null,this.timeId=setTimeout((()=>{this.createWs()}),this.reconnectTime))}send(t){this.webSocketState&&this.ws&&this.ws.send(t)}close(){var t;this.isCustomClose=!0,this.isReconnectionLoading=!1,this.ws&&this.ws.close&&(null==(t=this.ws)||t.close())}start(){this.isCustomClose=!1,this.reconnection()}subscribe(t,e){this.eventCenter.on(t,e)}unsubscribe(t,e){this.eventCenter.off(t,e)}destroy(){clearTimeout(this.timeId),this.close(),this.ws=null,this.errorStack=null,this.eventCenter=null,this.webSocketState=!1}}const w=Object.freeze(Object.defineProperty({__proto__:null,MQ:g,WS:d,areColorsSimilar:c.areColorsSimilar,copyText:c.copyText,enumToArray:c.enumToArray,getCownDownTime:c.getCownDownTime,getSelectOptions:c.getSelectOptions,http:h.http,isColorEqual:c.isColorEqual,isDarkColor:c.isDarkColor,notifyMessageToSystems:c.notifyMessageToSystems,receiveMessage:c.receiveMessage,useConfirm:c.useConfirm,yxFecth:u,yxMessage:c.yxMessage,yxSubscribe:c.yxSubscribe},Symbol.toStringTag,{value:"Module"}));exports.MQ=g,exports.Ws=d,exports.utils2=w,exports.yxFecth=u;
2
2
  //# sourceMappingURL=index.cjs2.js.map