yxuse 3.0.50 → 3.0.52

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.
Files changed (42) hide show
  1. package/README.md +27 -13
  2. package/lib/components.cjs.js +1 -1
  3. package/lib/components.es.js +5 -6
  4. package/lib/index.cjs2.js +1 -1
  5. package/lib/index.cjs5.js +1 -1
  6. package/lib/index.cjs5.js.gz +0 -0
  7. package/lib/index.cjs5.js.map +1 -1
  8. package/lib/index.cjs6.js +3 -3
  9. package/lib/index.cjs6.js.gz +0 -0
  10. package/lib/index.cjs6.js.map +1 -1
  11. package/lib/index.es2.js +2 -2
  12. package/lib/index.es5.js +2 -2
  13. package/lib/index.es5.js.gz +0 -0
  14. package/lib/index.es6.js +201 -201
  15. package/lib/index.es6.js.gz +0 -0
  16. package/lib/index.es6.js.map +1 -1
  17. package/lib/mqtt.min.cjs.js +1 -1
  18. package/lib/mqtt.min.cjs.js.gz +0 -0
  19. package/lib/mqtt.min.cjs.js.map +1 -1
  20. package/lib/mqtt.min.es.js +14 -7
  21. package/lib/mqtt.min.es.js.gz +0 -0
  22. package/lib/mqtt.min.es.js.map +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.css.gz +0 -0
  25. package/lib/theme.cjs.js +1 -1
  26. package/lib/theme.es.js +1 -1
  27. package/lib/translate.cjs.js +1 -1
  28. package/lib/translate.es.js +1 -1
  29. package/lib/utils.cjs.js +1 -1
  30. package/lib/utils.es.js +3 -3
  31. package/package.json +3 -3
  32. package/types/components/YxDialog/index.vue.d.ts +1 -1
  33. package/types/components/YxDrawer/index.vue.d.ts +1 -1
  34. package/types/components/YxForm/index.vue.d.ts +5 -3
  35. package/types/components/YxForm/type.d.ts +5 -5
  36. package/types/components/YxTable/index.vue.d.ts +3 -2
  37. package/types/components/YxTable/type.d.ts +2 -1
  38. package/types/components/YxUpload/index.vue.d.ts +4 -1
  39. package/types/components/index.d.ts +0 -1
  40. package/types/components/type.d.ts +0 -1
  41. package/types/utils/common/index.d.ts +6 -3
  42. package/lib/index.es2.js.gz +0 -0
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
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs6.js"),o=require("./index.cjs5.js");exports.LogoTitle=e.LogoTitle,exports.LogoTitleRender=e.LogoTitleRender,exports.Update=e.Update,exports.YxDialog=e._sfc_main,exports.YxDrawer=e._sfc_main$1,exports.YxForm=e.index$1,exports.YxIcon=e.index$2,exports.YxSearchForm=e.index,exports.YxTable=e._sfc_main$2,exports.YxUpload=e._sfc_main$3,exports.Toolbar=o.Toolbar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs6.js"),o=require("./index.cjs5.js");exports.LogoTitle=e.LogoTitle,exports.LogoTitleRender=e.LogoTitleRender,exports.Update=e.Update,exports.YxDialog=e._sfc_main,exports.YxDrawer=e._sfc_main$1,exports.YxForm=e.index,exports.YxIcon=e.index$1,exports.YxTable=e._sfc_main$2,exports.YxUpload=e._sfc_main$3,exports.Toolbar=o.Toolbar;
2
2
  //# sourceMappingURL=components.cjs.js.map
@@ -1,16 +1,15 @@
1
- import { g, L, U, _, a, d, e, i, b, f } from "./index.es6.js";
1
+ import { f, L, U, _, a, i, d, b, e } from "./index.es6.js";
2
2
  import { T } from "./index.es5.js";
3
3
  export {
4
- g as LogoTitle,
4
+ f as LogoTitle,
5
5
  L as LogoTitleRender,
6
6
  T as Toolbar,
7
7
  U as Update,
8
8
  _ as YxDialog,
9
9
  a as YxDrawer,
10
- d as YxForm,
11
- e as YxIcon,
12
- i as YxSearchForm,
10
+ i as YxForm,
11
+ d as YxIcon,
13
12
  b as YxTable,
14
- f as YxUpload
13
+ e as YxUpload
15
14
  };
16
15
  //# sourceMappingURL=components.es.js.map
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