@ganwei-web/gw-base-components-plus 1.0.0

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 (59) hide show
  1. package/echartList/barEchart/dist/index.es.js +152 -0
  2. package/echartList/barEchart/dist/index.umd.js +1 -0
  3. package/echartList/barEchart/dist/style.css +1 -0
  4. package/echartList/curve/dist/index.es.js +217 -0
  5. package/echartList/curve/dist/index.umd.js +1 -0
  6. package/echartList/curve/dist/style.css +1 -0
  7. package/echartList/historyEchart/dist/index.es.js +292 -0
  8. package/echartList/historyEchart/dist/index.umd.js +10 -0
  9. package/echartList/historyEchart/dist/style.css +1 -0
  10. package/echartList/solid-bar/dist/index.es.js +290 -0
  11. package/echartList/solid-bar/dist/index.umd.js +1 -0
  12. package/echartList/solid-bar/dist/style.css +1 -0
  13. package/echartList/solid-circle/dist/index.es.js +332 -0
  14. package/echartList/solid-circle/dist/index.umd.js +6 -0
  15. package/echartList/solid-circle/dist/style.css +1 -0
  16. package/echartList/solid-pie/dist/index.es.js +336 -0
  17. package/echartList/solid-pie/dist/index.umd.js +6 -0
  18. package/echartList/solid-pie/dist/style.css +1 -0
  19. package/element-plus-adapter/dist/ElementPlusAdapter.cjs +902 -0
  20. package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -0
  21. package/element-plus-adapter/dist/ElementPlusAdapter.css +789 -0
  22. package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +903 -0
  23. package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -0
  24. package/element-plus-adapter/dist/ElementPlusAdapter.js +902 -0
  25. package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -0
  26. package/equip-list-vue2/dist/index.es.js +1275 -0
  27. package/equip-list-vue2/dist/index.umd.js +1 -0
  28. package/equip-list-vue2/dist/style.css +1 -0
  29. package/equip-list-vue3/dist/index.es.js +1510 -0
  30. package/equip-list-vue3/dist/index.umd.js +1 -0
  31. package/equip-list-vue3/dist/style.css +1 -0
  32. package/equip-select-vue2/dist/index.es.js +231 -0
  33. package/equip-select-vue2/dist/index.umd.js +1 -0
  34. package/equip-select-vue2/dist/style.css +1 -0
  35. package/equip-select-vue3/dist/index.es.js +231 -0
  36. package/equip-select-vue3/dist/index.umd.js +1 -0
  37. package/equip-select-vue3/dist/style.css +1 -0
  38. package/equipProcessing/dist/index.es.js +203 -0
  39. package/equipProcessing/dist/index.umd.js +1 -0
  40. package/loadMore/dist/index.es.js +12 -0
  41. package/loadMore/dist/index.umd.js +1 -0
  42. package/loading/dist/index.es.js +25 -0
  43. package/loading/dist/index.umd.js +1 -0
  44. package/loading/dist/style.css +1 -0
  45. package/package.json +11 -0
  46. package/player/dist/index.es.js +1080 -0
  47. package/player/dist/index.umd.js +14 -0
  48. package/player/dist/style.css +1 -0
  49. package/selectV2/dist/index.es.js +190 -0
  50. package/selectV2/dist/index.umd.js +1 -0
  51. package/selectV2/dist/style.css +1 -0
  52. package/showPassword/dist/index.es.js +72 -0
  53. package/showPassword/dist/index.umd.js +1 -0
  54. package/table/dist/index.es.js +182 -0
  55. package/table/dist/index.umd.js +1 -0
  56. package/table/dist/style.css +1 -0
  57. package/widthSetting/dist/index.es.js +113 -0
  58. package/widthSetting/dist/index.umd.js +1 -0
  59. package/widthSetting/dist/style.css +1 -0
@@ -0,0 +1 @@
1
+ (function(d,f){typeof exports=="object"&&typeof module<"u"?module.exports=f(require("vue-virtual-scroll-list"),require("@aspnet/signalr")):typeof define=="function"&&define.amd?define(["vue-virtual-scroll-list","@aspnet/signalr"],f):(d=typeof globalThis<"u"?globalThis:d||self,d.index=f(d.VirtualList,d.SignalR))})(this,function(d,f){"use strict";const w=o=>o&&typeof o=="object"&&"default"in o?o:{default:o};function N(o){if(o&&o.__esModule)return o;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const E=w(d),O=N(f),Y="";class k{constructor(t,e,s){this.groupNodeObject=t,this.nodesMap=e,this.controlObject=s}addNodesMap(t){t&&t.forEach(e=>{this.nodesMap[e.key]=e})}removeNodesMap(t){t&&t.forEach(e=>{delete this.nodesMap[e.key]})}recycleAllNodeCache(t){for(let e in this.groupNodeObject)this.groupNodeObject[e].expand=!1,this.groupNodeObject[e].count=0,this.recycleGroupCache(this.groupNodeObject[e].key),t&&delete this.groupNodeObject[e]}recycleGroupCache(t){if(this.groupNodeObject[t]){this.groupNodeObject[t].children=[],this.removeNodesMap(this.groupNodeObject[t].equips),this.groupNodeObject[t].equips=[],this.groupNodeObject[t].equips.length=0,this.groupNodeObject[t].expand=!1;for(let e in this.groupNodeObject)this.groupNodeObject[e].groupId==t&&this.recycleGroupCache(this.groupNodeObject[e].key)}}closeBrotherNode(t){if(!!t&&this.groupNodeObject[t]){let e=this.groupNodeObject[t].groupId;for(let s in this.groupNodeObject)this.groupNodeObject[s].groupId==e&&this.groupNodeObject[s].key!=t&&this.groupNodeObject[s].expand&&(this.groupNodeObject[s].expand=!1,this.recycleGroupCache(this.groupNodeObject[s].key))}}}class j{constructor(t,e,s,i,u,r){this.equipControllObject=s,this.groupNodeObject=t,this.nodesMap=e,this.controlObject=i,this.equipCheckObject=u,this.isSearchStatus=!1,this.searchStatusGroupObject={},this.aliasName=r}resetCheckedStatus(){Object.values(this.nodesMap).forEach(t=>{this.setCheckStatus(t.key,!1,!1),t.isGroup&&!t.isEquip&&(this.clearCheckedEquips(t.key),this.updateEquipSelectCount(t.key,!0)),t.halfCheckedEquips&&(t.halfCheckedEquips=[])}),Object.keys(this.equipCheckObject).forEach(t=>{this.setEquipCheckObject(t,!1,!1,this.equipCheckObject[t].groupId)})}reComputedCheckNum(t){this.isSearchStatus=t,this.isSearchStatus?(Object.values(this.groupNodeObject).forEach(e=>{this.searchStatusGroupObject[e.key]={groupId:e.groupId,equipSelectCount:e.equipSelectCount,halfCheckedEquips:e.halfCheckedEquips,...this.searchStatusGroupObject[e.key]}}),Object.values(this.groupNodeObject).forEach(e=>{this.updateEquipSelectCount(e.key,!0),e.halfCheckedEquips=[]}),Object.values(this.groupNodeObject).forEach(e=>{(window.top[`group-${e.key}-search`]||[]).forEach(i=>{this.equipCheckObject[i.equipNo]&&this.equipCheckObject[i.equipNo].checked?this.updateEquipSelectCount(e.key,!1,1):this.equipCheckObject[i.equipNo]&&this.equipCheckObject[i.equipNo].indeterminate&&e.halfCheckedEquips.push(i.equipNo)})})):(Object.values(this.groupNodeObject).forEach(e=>{let s=this.searchStatusGroupObject[e.key];s&&(e.equipSelectCount=s.equipSelectCount,e.halfCheckedEquips=[...s.halfCheckedEquips,...e.halfCheckedEquips],e.halfCheckedEquips=[...new Set(e.halfCheckedEquips)])}),this.searchStatusGroupObject={})}updateCheckedStatusWithEquips(t){window.setTimeout(()=>{for(let e=0,s=t.length;e<s;e++){let i=window.top.equipCache&&window.top.equipCache[t[e]];i&&i.groupId&&(this.setEquipCheckObject(t[e],!0,!1,i.groupId),this.setCheckStatus(`${i.groupId}-${t[e]}`,!0,!1),this.updateEquipSelectCount(i.groupId,!1,1),this.updateExpandControlCheckStatus(i.groupId,t[e]))}this.updateGroupCheckStatus()},200)}updateExpandControlCheckStatus(t,e){let s=this.nodesMap[`${t}-${e}`];s&&s.settings&&s.settings.length&&s.settings.forEach(i=>{this.nodesMap[`${t}-${e}-${i.setNo}`]&&this.setCheckStatus(`${t}-${e}-${i.setNo}`,!0,!1)})}updateCheckedStatusWithControls(t){window.setTimeout(()=>{for(let e=0,s=t.length;e<s;e++){let i=t[e].split("."),u=i[0],r=i[1];if(this.equipControllObject[u]||(this.equipControllObject[u]=[]),this.equipControllObject[u].push(Number(r)),window.top.equipCache&&window.top.equipCache[u]){let p=window.top.equipCache[u].groupId,a=`${p}-${u}-${r}`;this.nodesMap[a]&&this.setCheckStatus(a,!0,!1),this.nodesMap[`${p}-${u}`]&&this.setCheckStatus(`${p}-${u}`,!1,!0),this.nodesMap[`${p}`].halfCheckedEquips&&this.nodesMap[`${p}`].halfCheckedEquips.push(u),this.setEquipCheckObject(u,!1,!0,p)}}this.updateGroupCheckStatus()},100)}updateGroupCheckStatus(){Object.values(this.groupNodeObject).forEach(t=>{t.count>0&&t.count==t.equipSelectCount?this.setCheckStatus(t.key,!0,!1):t.count&&t.equipSelectCount&&t.count>t.equipSelectCount||t.halfCheckedEquips.length?this.setGroupHalfChecked(t.key):this.setCheckStatus(t.key,!1,!1)})}setGroupHalfChecked(t){this.nodesMap[t]&&this.setCheckStatus(t,!1,!0),this.nodesMap[t].groupId&&this.setGroupHalfChecked(this.nodesMap[t].groupId)}setControlStatus(t,e,s,i){t&&t.forEach(u=>{this.nodesMap[`${e}-${s}-${u.setNo}`]&&this.setCheckStatus(`${e}-${s}-${u.setNo}`,i,!1)})}updateControlCheckStatus(){Object.keys(this.controlObject).forEach(t=>{let e=this.nodesMap[`${this.controlObject[t].groupId}-${t}`];if(e)if(e.checked){let s=e.settings;this.setControlStatus(s,this.controlObject[t].groupId,t,!0)}else if(!e.checked&&!e.indeterminate){let s=e.settings;this.setControlStatus(s,this.controlObject[t].groupId,t,!1)}else this.equipControllObject[t]&&this.equipControllObject[t].forEach(s=>{let i=`${this.controlObject[t].groupId}-${t}-${s}`;this.nodesMap[i]&&this.setCheckStatus(i,!0,!1)})})}getGroupChecked(){let t=[];return Object.keys(this.groupNodeObject).forEach(e=>{this.groupNodeObject[e].checked&&t.push(e)}),t}getEquipSelectd(){let t=[];return Object.keys(this.equipCheckObject).forEach(e=>{this.equipCheckObject[e].checked&&t.push(Number(e))}),t}getControlSelected(){let t=[];return Object.keys(this.equipControllObject).forEach(e=>{t.push(...this.equipControllObject[e].map(s=>`${e}.${s}`))}),t}onChecked(t,e){this.isSearchStatus=e||!1,t.isGroup&&!t.isEquip?this.selectGroup(t):t.isEquip?this.selectEquip(t):t.isSetting&&this.selectControl(t)}setCheckStatus(t,e,s){this.nodesMap[t]&&(this.nodesMap[t].checked=e,this.nodesMap[t].isGroup&&(this.nodesMap[t].indeterminate=s))}clearCheckedEquips(t){this.groupNodeObject[t]&&(this.groupNodeObject[t].equipSelectCount=0,this.groupNodeObject[t].halfCheckedEquips&&this.groupNodeObject[t].halfCheckedEquips.forEach(e=>{this.equipControllObject[e]&&this.equipControllObject[e].forEach(s=>{this.setCheckStatus(`${t}-${e}-${s}`,!1,!1)})}),this.groupNodeObject[t].halfCheckedEquips=[],this.groupNodeObject[t].groupId&&this.clearCheckedEquips(this.groupNodeObject[t].groupId))}updateSearchStatusObject(t,e){this.searchStatusGroupObject[t]&&(this.searchStatusGroupObject[t].equipSelectCount=this.searchStatusGroupObject[t].equipSelectCount+e,this.searchStatusGroupObject[t].groupId&&this.updateSearchStatusObject(this.searchStatusGroupObject[t].groupId,e))}updateEquipSelectCount(t,e,s){this.nodesMap[t]&&(e?this.nodesMap[t].equipSelectCount=0:this.nodesMap[t].equipSelectCount=this.nodesMap[t].equipSelectCount+s,this.nodesMap[t].groupId&&this.updateEquipSelectCount(this.nodesMap[t].groupId,e,s))}setEquipCheckObject(t,e,s,i){this.equipCheckObject[t]||(this.equipCheckObject[t]={}),this.equipCheckObject[t].checked=e,this.equipCheckObject[t].indeterminate=s,this.equipCheckObject[t].groupId=i}updateEquipSelect(t,e,s,i){this.nodesMap[t]&&e.length&&e.forEach(u=>{s?(this.setEquipCheckObject(u.equipNo,!0,!1,t),this.nodesMap[`${t}-${u.equipNo}`]&&this.setCheckStatus(`${t}-${u.equipNo}`,!0,!1)):(this.setEquipCheckObject(u.equipNo,!1,!1,t),this.nodesMap[`${t}-${u.equipNo}`]&&this.setCheckStatus(`${t}-${u.equipNo}`,!1,!1)),this.equipControllObject[u.equipNo]&&delete this.equipControllObject[u.equipNo],this.nodesMap[t].halfCheckedEquips.includes(u.equipNo)&&(this.nodesMap[t].halfCheckedEquips=this.nodesMap[t].halfCheckedEquips.filter(r=>r!=u.equipNo),this.searchStatusGroupObject[t]&&(this.searchStatusGroupObject[t].halfCheckedEquips=this.nodesMap[t].halfCheckedEquips))})}updateGroupSelect(t,e){t.forEach(s=>{if(this.groupNodeObject[s]){this.groupNodeObject[s].groups&&this.groupNodeObject[s].groups.length>0&&this.updateGroupSelect(this.groupNodeObject[s].groups.map(a=>a.key),e);let i=window.top[`group-${s}${this.aliasName}`]||[];this.isSearchStatus&&(i=window.top[`group-${s}-search`]||[]);let u=0,r=0;i.forEach(a=>{let h=this.equipCheckObject[a.equipNo];!h||!h.checked?u++:r--});let p=e?u:r;this.updateEquipSelect(s,i,e,p),this.updateEquipSelectCount(s,!1,p),this.updateSearchStatusObject(s,p)}})}clearHalfCheckedEquips(t){t.forEach(e=>{this.groupNodeObject[e].halfCheckedEquips&&this.groupNodeObject[e].halfCheckedEquips.forEach(s=>{this.equipControllObject[s]&&this.equipControllObject[s].forEach(i=>{this.setCheckStatus(`${e}-${s}-${i}`,!1,!1)})}),this.groupNodeObject[e].halfCheckedEquips=[],this.groupNodeObject[e].groups&&this.groupNodeObject[e].groups.length>0&&this.clearHalfCheckedEquips(this.groupNodeObject[e].groups.map(s=>s.key))})}selectGroup(t){this.clearHalfCheckedEquips([t.key]),this.updateGroupSelect([t.key],t.checked),this.updateControlCheckStatus(),this.updateGroupCheckStatus()}selectEquip(t){if(this.nodesMap[t.groupId]){let e=[{equipNo:t.equipNo}],s=(t.checked?1:-1)*e.length;this.updateEquipSelect(t.groupId,e,t.checked,s),this.updateEquipSelectCount(t.groupId,!1,s),this.updateSearchStatusObject(t.groupId,s),this.updateControlCheckStatus(),this.updateGroupCheckStatus()}}updateEquipControl(t,e,s){this.equipControllObject[t]||(this.equipControllObject[t]=[]),s?this.equipControllObject[t].push(e):this.equipControllObject[t]=this.equipControllObject[t].filter(i=>i!=e)}selectControl(t){let e=this.nodesMap[`${t.groupId}-${t.equipNo}`];e&&(this.updateEquipControl(t.equipNo,t.setNo,t.checked),t.checked?e.settings&&e.settings.length==this.equipControllObject[t.equipNo].length?(delete this.equipControllObject[t.equipNo],this.updateEquipSelectCount(t.groupId,!1,1),this.updateSearchStatusObject(t.groupId,1),this.nodesMap[t.groupId].halfCheckedEquips=this.nodesMap[t.groupId].halfCheckedEquips.filter(s=>s!=t.equipNo),this.setEquipCheckObject(t.equipNo,!0,!1,t.groupId),this.setCheckStatus(`${t.groupId}-${t.equipNo}`,!0,!1)):e&&!e.indeterminate&&(this.nodesMap[`${t.groupId}`].halfCheckedEquips.push(t.equipNo),this.setCheckStatus(`${t.groupId}-${t.equipNo}`,!1,!0),this.setEquipCheckObject(t.equipNo,!1,!0,t.groupId)):e.checked?(this.updateEquipSelectCount(t.groupId,!1,-1),this.updateSearchStatusObject(t.groupId,-1),e.settings.length>1?(this.nodesMap[t.groupId].halfCheckedEquips.push(t.equipNo),e.settings.map(i=>i.setNo).filter(i=>i!=t.setNo).forEach(i=>{this.updateEquipControl(t.equipNo,i,!0)}),this.setEquipCheckObject(t.equipNo,!1,!0,t.groupId),this.setCheckStatus(`${t.groupId}-${t.equipNo}`,!1,!0)):(this.setEquipCheckObject(t.equipNo,!1,!1,t.groupId),this.setCheckStatus(`${t.groupId}-${t.equipNo}`,!1,!1))):e.indeterminate&&this.equipControllObject[t.equipNo]&&!this.equipControllObject[t.equipNo].length&&(this.nodesMap[t.groupId].halfCheckedEquips=this.nodesMap[t.groupId].halfCheckedEquips.filter(s=>s!=t.equipNo),this.setEquipCheckObject(t.equipNo,!1,!1,t.groupId),this.setCheckStatus(`${t.groupId}-${t.equipNo}`,!1,!1)),this.updateGroupCheckStatus())}}class M{constructor(t,e){this.aliasName=e,this.groupNodeObject=t}resetGroupNum(t){this.clearAllEquipNum();for(let e in this.groupNodeObject){let s=[];t?s=window.top[`group-${e}-search`]:s=window.top[`group-${e}${this.aliasName}`];let i=s?s.length:0;i&&(this.groupNodeObject[e].equipCount=i,this.setGroupNum(e,i))}}clearAllEquipNum(){for(let t in this.groupNodeObject)this.groupNodeObject[t].equipCount=0,this.groupNodeObject[t].count=0}setGroupNum(t,e){this.groupNodeObject[t]&&(this.groupNodeObject[t].count=Number(this.groupNodeObject[t].count)+Number(e),this.setGroupNum(this.groupNodeObject[t].groupId,e))}getAllEquipsNum(){let t=0;for(let e in this.groupNodeObject)window.top[`group-${this.groupNodeObject[e].key}${this.aliasName}`]&&(t=t+window.top[`group-${this.groupNodeObject[e].key}${this.aliasName}`].length);return t}}class S{constructor(t,e,s){this.url=t,this.connectionId=e,this.equipNo=s,this.signalr=null}openConnect(){return this.signalr&&(this.signalr.stop(),this.signalr=null),this.signalr=new O.HubConnectionBuilder().withUrl(this.url).build(),this.signalr.serverTimeoutInMilliseconds=5e8,this.signalr.keepaliveintervalinmilliseconds=5e8,new Promise(t=>{this.signalr.start().then(()=>{this.connectionId&&this.send(),t(this.signalr)}).catch(e=>{console.log(e)})})}async send(){try{await this.signalr.invoke(this.connectionId,this.equipNo).catch(t=>{console.log("send \u53D1\u9001\u5931\u8D25"+t)})}catch(t){console.log("connectHub \u8FDE\u63A5\u5931\u8D25"+t)}}}class G{constructor(t,e,s,i,u){this.equipStatusObject=e,this.groupNodeObject=s,this.aleadyUpdateStatus={},this.isGetAllEquipStatus=!1,this.nodesMap=t,this.statusChange=i,this.openSignlr(),this.aliasName=u,this.statusMap={0:"noComCounts",1:"normalCounts",2:"alarmCounts",3:"lsSetCounts",4:"initializeCounts",5:"withdrawCounts",6:"backUpCounts"},this.reverseStatusMap={noComCounts:0,normalCounts:1,alarmCounts:2,lsSetCounts:3,initializeCounts:4,withdrawCounts:5,backUpCounts:6}}openSignlr(){this.equipStatusSignlr=new S("/equipStatusMonitor","",""),this.equipStatusSignlr.openConnect().then(t=>{try{t.invoke("GetAllEquipStatus")}catch(e){console.log(e)}this.subscribeTo(t,"GetAllEquipStatus"),t.onclose(()=>{this.openSignlr()})})}subscribeTo(t,e){t.off(e),t.on(e,s=>{if(s&&s.isSuccess&&s.data&&(this[e]?this[e](s.data):this.notice({func:e,data:s.data,key:s.groupId}),e==="GetAllEquipStatus")){try{t.invoke("GetEquipChangeStatus")}catch(i){console.log(i)}this.subscribeTo(t,"GetEquipChangeStatus")}})}GetAllEquipStatus(t){this.isGetAllEquipStatus=!0,this.resetGroupStatusCounts(),Object.keys(t).forEach(e=>{this.equipStatusObject[e]=t[e]}),Object.keys(this.groupNodeObject).forEach(e=>{this.updateByGroup(e)}),this.updateAllGroupStatus()}reRenderGroupStatus(){this.resetGroupStatusCounts(),Object.keys(this.aleadyUpdateStatus).forEach(t=>{this.aleadyUpdateStatus[t]=!1}),Object.keys(this.groupNodeObject).forEach(t=>{this.updateByGroup(t)}),this.updateAllGroupStatus()}updateStatusCounts(t,e,s){if(this.groupNodeObject[t]){this.groupNodeObject[t][e]=this.groupNodeObject[t][e]+s;let i=this.groupNodeObject[t].groupId;i&&this.updateStatusCounts(i,e,s)}}updateByGroup(t){if(!this.aleadyUpdateStatus[t]){let e=window.top[`group-${t}${this.aliasName}`]||[],s=e.length;s&&(this.aleadyUpdateStatus[t]=!0,this.updateStatusCounts(t,this.statusMap[1],s),e.forEach(i=>{this.updateGroupStatusCounts(t,this.equipStatusObject[i.equipNo],1),this.nodesMap[`${t}-${i.equipNo}`]&&(this.nodesMap[`${t}-${i.equipNo}`].status=this.equipStatusObject[i.equipNo])}))}}updateGroupStatusCounts(t,e,s){if(this.nodesMap[t]&&this.statusMap[e]&&this.statusMap[s]){let i=this.statusMap[e],u=this.statusMap[s];this.updateStatusCounts(t,i,1),this.updateStatusCounts(t,u,-1)}}updateGroupStatusByKey(t){this.isGetAllEquipStatus&&(this.updateByGroup(t),this.updateAllGroupStatus())}updateAllGroupStatus(){Object.keys(this.groupNodeObject).forEach(t=>{let e=this.groupNodeObject[t],s=this.getSingleStatus(e);if(s!==-1)this.nodesMap[e.key].status=s;else if(e.alarmCounts>0)this.nodesMap[e.key].status=2;else if(e.noComCounts>0&&(e.normalCounts>0||e.lsSetCounts>0||e.initializeCounts>0||e.withdrawCounts>0||e.backUpCounts>0))this.nodesMap[e.key].status=2;else if(e.backUpCounts>0&&(e.normalCounts>0||e.lsSetCounts>0||e.initializeCounts>0||e.withdrawCounts>0)){let i=this.getStatusArray(e).filter(u=>u.statusMap!="backUpCounts"&&u.value>0);i.length>0?this.nodesMap[e.key].status=i.pop().status:this.nodesMap[e.key].status=6}else if(e.normalCounts>0||e.lsSetCounts>0||e.initializeCounts>0||e.withdrawCounts>0){let i=this.getStatusArray(e).filter(u=>u.value>0);i.length>0?this.nodesMap[e.key].status=i.pop().status:this.nodesMap[e.key].status=1}})}getStatusArray(t){let e=[],s=Object.values(this.statusMap);return Object.keys(t).forEach(i=>{s.includes(i)&&e.push({statusMap:i,status:this.reverseStatusMap[i],value:t[i]})}),e}getSingleStatus(t){let e=this.getStatusArray(t),s=e.filter(i=>i.value==0);if(s.length==e.length)return 1;if(s.length==6){let i=e.find(u=>u.value>0);if(i)return i.status}return-1}GetEquipChangeStatus(t){this.setStatus(t),this.updateAllGroupStatus()}setStatus(t){let e=this.equipStatusObject[t.equipNo],s=window.top.equipCache&&window.top.equipCache[t.equipNo]&&window.top.equipCache[t.equipNo].groupId;if(t.status!=3&&s&&e!=t.status){this.updateGroupStatusCounts(s,t.status,e),this.equipStatusObject[t.equipNo]=t.status;let i=`${s}-${t.equipNo}`;this.nodesMap[i]&&(this.nodesMap[i].status=t.status),this.statusChange(s,t.equipNo,t.status),this.updateAllGroupStatus()}}resetGroupStatusCounts(){for(let t in this.groupNodeObject)Object.values(this.statusMap).forEach(e=>{this.groupNodeObject[t][e]=0})}countGroupStatus(t){this.resetGroupStatusCounts();for(let e in this.groupNodeObject){let s=[];if(t?s=window.top[`group-${e}-search`]:s=window.top[`group-${e}${this.aliasName}`],s?s.length:0)for(let u of s){const r=this.equipStatusObject[u.equipNo];this.setGroupNum(u.groupId,r)}}}setGroupNum(t,e){!this.groupNodeObject[t]||(this.groupNodeObject[t][this.statusMap[e]]+=1,this.setGroupNum(this.groupNodeObject[t].groupId,e))}}const $=Object.assign({},{getSetParm(o){if(window.axios)return window.axios({method:"post",url:"/IoT/api/v3/EquipList/GetSetParmByEquipNo",params:o,data:o})}});class y{constructor(t,e){this.nodesMap=t,this.equipControllObject=e}async getSetting(t,e,s,i){let[u,r]=String(t).split("-"),p={equipNo:r};await $.getSetParm(p).then(a=>{if(a.data.code==200){let h=a&&a.data&&a.data.data&&a.data.data.rows||[];this.nodesMap[t].settings||(this.nodesMap[t].settings=[]),h&&h.length>0&&this.nodesMap[t]&&(h.forEach(n=>{n.title=n.setNm,n.key=`${u}-${r}-${n.setNo}`,n.level=Number(s)+1,n.checked=i||this.equipControllObject[r]&&this.equipControllObject[r].includes(n.setNo),n.isSetting=!0,n.equipNo=r,n.groupId=u,n.equipName=e}),this.nodesMap[t].settings=[...h])}})}}class l{static formateList(t,e){let s=[];for(const i of t){let u={};u.count=0,u.equipSelectCount=0,u.controlSelectCount=0,u.equipCount=i.equipCount||0,u.title=i.name,u.key=i.id,u.isGroup=!0,u.children=[],u.status=1,u.level=e||1,u.expand=!e,u.equips=[],u.groupId=i.parentId,u.groups=[],u.alarmCounts=0,u.backUpCounts=0,u.noComCounts=0,u.normalCounts=0,u.lsSetCounts=0,u.initializeCounts=0,u.withdrawCounts=0,u.indeterminate=!1,u.checked=!1,u.visible=!0,u.nodeEquipSelectCount=0,u.checkedEquips=[],u.halfCheckedEquips=[],u.selectControlCount=0,i.children&&i.children.length>0&&(u.groups=[...this.formateList(i.children,e?e+1:2)]),s.push(u)}return s}static deepClone(t,e,s,i,u,r){let p=[];if(t)for(let a=0,h=t.length;a<h;a++)p.push({isGroup:s,key:`${i}-${t[a].id}`,status:r[t[a].id]||0,title:t[a].title,level:e,expand:!1,isEquip:!0,loading:!1,indeterminate:u[t[a].equipNo]&&u[t[a].equipNo].indeterminate||!1,checked:u[t[a].equipNo]&&u[t[a].equipNo].checked||!1,groupId:i,equipNo:t[a].id,visible:!0,settings:[]});return p}static copyOrigin(t){let e=[];return t.forEach(s=>{e.push({...s})}),e}static getPosition(t,e){let s=0;for(let i=0,u=e.length;i<u;i++)if(e[i].key==t){s=i-30;break}return s}static flattern(t,e){t.forEach(s=>{s.isGroup&&(e[`${s.key}`]=null,e[`${s.key}`]=s),s.groups&&s.groups.length&&this.flattern(s.groups,e)})}static generateUUID(){let t=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){let i=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(s==="x"?i:i&3|8).toString(16)})}static listToTreeList(t){const e=t,s=[],i={};return e.forEach(u=>{i[u.id]=u}),e.forEach(u=>{const r=i[u.parentId];r?(r.children||(r.children=[])).push(u):s.push(u)}),s}}class m{constructor(t,e,s){this.showSettings=e,this.groupNodeObject=t,this.aliasName=s}filterMethod(t){for(let e in this.groupNodeObject)t&&this.updateBySearch(e,t)}updateBySearch(t,e){let s=window.top[`group-${this.groupNodeObject[t].key}${this.aliasName}`];s&&(s=s.filter(i=>i.title.includes(e)),window.top[`group-${this.groupNodeObject[t].key}-search`]=l.copyOrigin(s))}}function g(o,t,e,s,i,u,r,p){var a=typeof o=="function"?o.options:o;t&&(a.render=t,a.staticRenderFns=e,a._compiled=!0),s&&(a.functional=!0),u&&(a._scopeId="data-v-"+u);var h;if(r?(h=function(c){c=c||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!c&&typeof __VUE_SSR_CONTEXT__<"u"&&(c=__VUE_SSR_CONTEXT__),i&&i.call(this,c),c&&c._registeredComponents&&c._registeredComponents.add(r)},a._ssrRegister=h):i&&(h=p?function(){i.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:i),h)if(a.functional){a._injectStyles=h;var n=a.render;a.render=function(X,b){return h.call(b),n(X,b)}}else{var q=a.beforeCreate;a.beforeCreate=q?[].concat(q,h):[h]}return{exports:o,options:a}}const _={props:{source:{type:Object},groupEditAndNew:{type:Function},deleteGroup:{type:Function}}};var I=function(){var t=this,e=t._self._c;return e("div",{staticClass:"operates"},[e("el-popover",{attrs:{placement:"bottom",trigger:"hover"},scopedSlots:t._u([{key:"reference",fn:function(){return[e("i",{staticClass:"el-icon-more"})]},proxy:!0}])},[e("el-button-group",{staticClass:"new-button-group setModule"},[e("el-button",{staticClass:"elBtn",attrs:{type:"text",size:"small",icon:" iconfont icon-tubiao20_bianji"},on:{click:function(s){return s.stopPropagation(),t.groupEditAndNew(!1,t.source)}}},[t._v(" "+t._s(t.$t("equipInfo.poverTips.rename"))+" ")]),e("el-button",{staticClass:"elBtn",attrs:{type:"text",size:"small",icon:" iconfont icon-gw-icon-tianjia1"},on:{click:function(s){return t.groupEditAndNew(!0,t.source)}}},[t._v(" "+t._s(t.$t("equipInfo.poverTips.newChildGroup"))+" ")]),t.source.level!=1?e("el-button",{attrs:{type:"danger",size:"small",icon:" iconfont icon-tubiao20_shanchu"},on:{click:function(s){return s.stopPropagation(),t.deleteGroup(t.source)}}},[t._v(" "+t._s(t.$t("publics.button.deletes"))+" ")]):t._e()],1)],1)],1)},v=[],x=g(_,I,v,!1,null,null,null,null);const T=x.exports,L={name:"ElTreeVirtualNode",componentName:"ElTreeVirtualNode",props:{isSearchStatus:{type:Boolean,default:!1},searchName:{type:String,default:""},expanding:{type:Boolean,default:!1},aleadyLoadAll:{type:Boolean,default:!1},groupLoading:{type:Boolean,default:!1},source:{default(){return{}}},showCheckbox:{type:Boolean,default:!1},showStatus:{type:Boolean,default:!1},showOperate:{type:Boolean,default:!1},currentSelect:{type:Number|String,default:-1},nodeClick:{type:Function},onChecked:{type:Function},groupEditAndNew:{type:Function},deleteGroup:{type:Function},colorConfig:{type:Object},index:{type:Number,default:-1}},components:{oparate:T},computed:{getColor(){return function(o){let t;switch(o){case 0:t=this.colorConfig.noComm;break;case 1:t=this.colorConfig.normal;break;case 2:t=this.colorConfig.alarm;break;case 3:t=this.colorConfig.lsSet;break;case 4:t=this.colorConfig.initialize;break;case 5:t=this.colorConfig.withdraw;break;case 6:t=this.colorConfig.BackUp;break;default:t=this.colorConfig.noComm;break}return t}}},data(){return{indent:13}},methods:{clickFunction(){this.source.expand=!this.source.expand,this.nodeClick(this.source,this.index,this.source.level,this.source.checked)},checkedChange(o){this.onChecked(this.source)}}};var A=function(){var t=this,e=t._self._c;return e("div",{staticClass:"el-tree-node",class:{parent_tag:t.source.isGroup,child_tags:!t.source.isGroup,selectedColor:t.currentSelect===t.source.key&&!t.source.isGroup},on:{click:t.clickFunction}},[e("div",{staticClass:"el-tree-node__content"},[e("span",{staticClass:"el-tree__indent",style:{width:(t.source.level-1)*t.indent+"px"},attrs:{"aria-hidden":"true"}}),t.source.isGroup?e("span",{class:[{"is-leaf":!t.source.isGroup,expanded:t.source.isGroup&&t.source.expand},"el-tree-node__expand-icon","el-icon-arrow-right"]}):t._e(),e("div",{staticClass:"nodeContent"},[t.showCheckbox?e("el-checkbox",{attrs:{indeterminate:t.source.indeterminate},on:{change:t.checkedChange},model:{value:t.source.checked,callback:function(s){t.$set(t.source,"checked",s)},expression:"source.checked"}}):t._e(),t.showStatus?e("span",{staticClass:"circle"},[t.source.status!=6?e("span",{staticClass:"yd",style:{backgroundColor:t.getColor(t.source.status)}}):e("i",{staticClass:"iconfont icon-gw-icon-beiji2",style:{color:t.colorConfig.BackUp}})]):t._e(),e("span",{staticClass:"label"},[t._v(" "+t._s(t.source.title))]),t.source.isGroup&&!t.source.isEquip?e("span",{staticClass:"equipNumber"},[t._v(" "+t._s(t.source.count)+" ")]):t._e(),t.source.isGroup&&t.showOperate?e("oparate",{attrs:{source:t.source,groupEditAndNew:t.groupEditAndNew,deleteGroup:t.deleteGroup}}):t._e(),t.source.loading?e("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):t._e()],1)])])},B=[],U=g(L,A,B,!1,null,null,null,null);const R=U.exports,W={components:{VirtualList:E.default},data(){return{itemComponent:R,visibleList:[],currentSelect:-1,equipStatusManage:null,cacheManage:null,searchManage:null,equipNumManage:null,requestManage:null,checkStatusManage:null,groupNodeObject:{},nodesMap:{},equipCheckObject:{},equipStatusObject:{},controlObject:{},isSearchStatus:!1,equipControllObject:{},expandGroup:[],updateJob:null}},props:{data:{type:Array},selectEquips:{type:Array,default:()=>[]},controllList:{type:Array,default:()=>[]},showSettings:{type:Boolean,default:!1},showSelectNum:{type:Boolean,default(){return!1}},showCheckbox:{type:Boolean,default:!1},showStatus:{type:Boolean,default:!1},showOperate:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!1},currentNodeKey:[String,Number],colorConfig:{type:Object,default:()=>({noComm:"#a0a0a0",normal:"#63e03f",alarm:"#f22433",lsSet:"#bebcaa",initialize:"#289ac0",withdraw:"#ffc0cb",BackUp:"#f8901c"})},treeType:{type:String,default:""},buildTree:{type:Function},filterData:{type:Function},alias:{type:String,default:""}},watch:{data(o){o&&o.length&&(l.flattern(this.data,this.groupNodeObject),this.cacheManage.addNodesMap(Object.values(this.groupNodeObject).map(t=>t)),this.init())},controllList(o){this.updateCheckedStatusWithControls()},selectEquips(o){this.updateCheckedStatusWithEquips()}},computed:{aliasName(){return this.alias?`-${this.alias}`:""}},created(){this.showCheckbox&&(this.checkStatusManage=new j(this.groupNodeObject,this.nodesMap,this.equipControllObject,this.controlObject,this.equipCheckObject,this.aliasName)),this.cacheManage=new k(this.groupNodeObject,this.nodesMap,this.controlObject,this.equipCheckObject),this.searchManage=new m(this.groupNodeObject,this.showSettings,this.aliasName),this.equipNumManage=new M(this.groupNodeObject,this.aliasName),this.requestManage=new y(this.nodesMap,this.equipControllObject)},mounted(){this.updateCheckedStatusWithControls(),this.updateCheckedStatusWithEquips(),window.addEventListener("message",o=>{o.data.type&&this[o.data.type]&&this[o.data.type](o.data.data)})},methods:{init(){this.data[0].expand=!0,this.updateTreeList(),setTimeout(()=>{Object.values(this.groupNodeObject).forEach(o=>{!o.expand&&this.expandGroup.includes(o.key)&&(o.expand=!0),this.filterWithAlias(o.key),this.updateGroupEquips(o.key,!0)}),this.equipNumManage.resetGroupNum(this.isSearchStatus),this.showStatus&&!this.equipStatusManage&&(this.equipStatusManage=new G(this.nodesMap,this.equipStatusObject,this.groupNodeObject,this.statusChange,this.aliasName)),this.filterEmptyGroup()},100)},filterEmptyGroup(){if(this.isSearchStatus){let o=[];Object.values(this.groupNodeObject).forEach(t=>{t.isGroup&&!t.isEquip&&!t.count&&o.push(t.key)}),this.visibleList=this.visibleList.filter(t=>!o.includes(t.key))}},filterWithAlias(o){if(this.aliasName){let t=window.top[`group-${o}`]||[];window.top[`group-${o}${this.aliasName}`]=this.filterData(t)}},updateCurrentSelect(){window.top.equipCache&&window.top.equipCache[this.currentNodeKey]&&(this.currentSelect=`${window.top.equipCache[this.currentNodeKey].groupId}-${this.currentNodeKey}`)},statusChange(o,t,e){this.currentSelect==`${o}-${t}`&&this.$emit("statusChange",t,e)},updateCheckWidthJob(){this.showCheckbox&&(this.checkStatusManage.resetCheckedStatus(),this.updateCheckedStatusWithControls(),this.updateCheckedStatusWithEquips())},updateGroupEquips(o,t){if(!this.isSearchStatus&&this.groupNodeObject[o]){let e=this.equipNumManage.getAllEquipsNum();this.$emit("getTotal",e)}if(t){let e=window.top[`group-${o}${this.aliasName}`]||[];this.equipNumManage.setGroupNum(o,e.length)}this.groupNodeObject[o].expand&&this.updateList(o,this.groupNodeObject[o].level,null,!1),this.showStatus&&this.equipStatusManage&&this.equipStatusManage.updateGroupStatusByKey(o)},updateList(o){if(this.groupNodeObject[o]){let t=[];this.isSearchStatus?(t=window.top[`group-${o}-search`],this.groupNodeObject[o].equips=[...l.deepClone(t,Number(this.groupNodeObject[o].level)+1,this.showSettings,o,this.equipCheckObject,this.equipStatusObject)]):(t=window.top[`group-${o}${this.aliasName}`],this.groupNodeObject[o].equips=[...l.deepClone(t,Number(this.groupNodeObject[o].level)+1,this.showSettings,o,this.equipCheckObject,this.equipStatusObject)]),this.cacheManage.addNodesMap(this.groupNodeObject[o].equips),this.cacheManage.closeBrotherNode(o),this.visibleList=[],this.updateTreeList(this.data),this.updateCurrentSelect()}},updateTreeList(o){o&&o.forEach(t=>{this.visibleList.push(t),t.expand?t.isEquip?(t.children||(t.children=[]),t.settings&&(t.children=[...t.settings||[]])):t.children=[...t.equips||[],...t.groups||[]]:t.children=[],this.updateTreeList(t.children||[])})},nodeClick(o,t,e,s){this.$emit("node-click",{...o,key:o.isEquip?o.equipNo:o.key}),o.isGroup?o.isEquip?this.equipClick(o,t,s):this.groupClick(o,t,s):this.currentSelect=o.key},groupClick(o,t,e){o.expand?this.updateList(o.key,o.level,t,e):(this.cacheManage.recycleGroupCache(o.key),this.visibleList=[],this.updateTreeList(this.data)),this.isSearchStatus&&this.filterEmptyGroup()},async equipClick(o,t,e){this.showSettings&&(o.expand?(o.loading=!0,await this.requestManage.getSetting(o.key,o.title,o.level,e),this.controlObject[o.equipNo]={groupId:o.groupId},o.loading=!1,this.visibleList.splice(t+1,0,...this.nodesMap[o.key].settings),this.cacheManage.addNodesMap(this.nodesMap[o.key].settings)):(this.visibleList.splice(t+1,this.nodesMap[o.key].settings.length),this.cacheManage.removeNodesMap(this.nodesMap[o.key].settings),this.nodesMap[o.key].settings=[],delete this.controlObject[o.equipNo]))},onChecked(o){this.checkStatusManage&&this.checkStatusManage.onChecked(o,this.isSearchStatus),this.$emit("onCheck",o)},groupEditAndNew(o,t){this.$emit("groupEditAndNew",{isGroupNew:o,node:t})},deleteGroup(o){this.$emit("deleteGroup",o)},updateCheckedStatusWithControls(){this.controllList&&this.controllList.length&&this.checkStatusManage&&this.checkStatusManage&&this.checkStatusManage.updateCheckedStatusWithControls(this.controllList)},updateCheckedStatusWithEquips(){this.selectEquips&&this.selectEquips.length&&this.checkStatusManage&&this.checkStatusManage&&this.checkStatusManage.updateCheckedStatusWithEquips(this.selectEquips)},resetCheckedStatus(){this.checkStatusManage&&this.checkStatusManage.resetCheckedStatus()},getEquipSelectd(){return this.checkStatusManage&&this.checkStatusManage.getEquipSelectd()},getControlSelected(){return this.checkStatusManage&&this.checkStatusManage.getControlSelected()},recordExpandGroup(){this.expandGroup=[],Object.values(this.groupNodeObject).forEach(o=>{o.expand&&this.expandGroup.push(o.key)})},removeExpandGroup(){this.$nextTick(()=>{this.expandGroup=[]})},filterMethod(o){this.visibleList=[],this.cacheManage.recycleAllNodeCache(),o?(this.isSearchStatus=!0,this.searchManage.filterMethod(o)):this.isSearchStatus=!1,this.init(),this.$nextTick(()=>{this.$refs.virtualList.scrollToIndex(0)}),this.equipNumManage.resetGroupNum(this.isSearchStatus),this.equipStatusManage&&this.equipStatusManage.countGroupStatus(this.isSearchStatus),this.showCheckbox&&(this.checkStatusManage&&this.checkStatusManage.reComputedCheckNum(this.isSearchStatus),this.checkStatusManage&&this.checkStatusManage.updateGroupCheckStatus())},rebuildTree(){this.recordExpandGroup(),this.checkStatusManage&&this.checkStatusManage.resetCheckedStatus(),this.cacheManage.recycleAllNodeCache(!0),this.$nextTick(()=>{this.buildTree(),this.removeExpandGroup()})},destroyTree(){this.cacheManage.recycleAllNodeCache(!0),this.visibleList=[],this.updateTreeList(this.data)},GetGroupEquips(o){o.groupId&&this.groupNodeObject[o.groupId]&&!this.isSearchStatus&&(this.updateGroupEquips(o.groupId,!0),this.updateJob&&clearTimeout(this.updateJob),this.updateJob=setTimeout(()=>{this.updateCheckWidthJob()},500))},DeleteEquip(o){const{groupId:t,equips:e}=o||{};t&&this.groupNodeObject[t]&&(this.updateGroupEquips(o.groupId),this.equipNumManage.resetGroupNum(),this.checkStatusManage&&this.checkStatusManage.resetCheckedStatus()),e.length&&e.forEach(s=>{let i=this.nodesMap[`${t}-${s.id}`];i&&(this.currentSelect.toString().includes(s.id)&&this.$emit("currentDelete"),this.showStatus&&(i.status==2||i.status==0?this.equipStatusManage.setGroupStatus(t,!1,2):i.status==6&&this.equipStatusManage.setGroupStatus(t,!1,6)),delete this.nodesMap[`${t}-${s.id}`],delete this.equipCheckObject[s.id]),delete this.equipStatusObject[s.id]}),this.equipStatusManage&&this.equipStatusManage.reRenderGroupStatus()},moveEquips(o){const{updateGroups:t,buildTree:e}=o||{};!e&&t?t.forEach(s=>{s&&this.groupNodeObject[s]&&(this.updateGroupEquips(s),this.equipNumManage.resetGroupNum(),this.checkStatusManage&&this.checkStatusManage.resetCheckedStatus())}):e&&this.rebuildTree(),this.equipStatusManage&&this.equipStatusManage.reRenderGroupStatus()},DeleteEquipGroup(o){o.forEach(t=>{t.groupId&&this.nodesMap[t.groupId]&&(this.isSearchStatus||this.rebuildTree())}),this.equipStatusManage&&this.equipStatusManage.reRenderGroupStatus()},AddEquipGroup(o){const{parentGroupId:t,groupId:e}=o||{};e&&this.nodesMap[t]&&this.treeType&&(this.isSearchStatus||this.rebuildTree())},EditEquipGroup(o){const{groupId:t,groupName:e}=o;this.nodesMap[t]&&(this.nodesMap[t].title=e)},AddEquip(o){const{groupId:t}=o||{};t&&(this.isSearchStatus||this.rebuildTree(),this.equipStatusManage&&this.equipStatusManage.reRenderGroupStatus())},EditEquip(o){const{equipNo:t,groupId:e,equipName:s}=o||{};this.nodesMap[`${e}-${t}`]&&(this.isSearchStatus||(this.nodesMap[`${e}-${t}`].title=s))}}};var K=function(){var t=this,e=t._self._c;return e("div",{staticClass:"gw-tree",style:{height:"100%"}},[e("div",{staticClass:"tree",style:{height:"100%"}},[e("virtual-list",{ref:"virtualList",staticClass:"virtualList",attrs:{"data-key":"key","data-sources":t.visibleList,"data-component":t.itemComponent,keeps:40,"extra-props":{currentSelect:t.currentSelect,nodeClick:t.nodeClick,showStatus:t.showStatus,showSettings:t.showSettings,showCheckbox:t.showCheckbox,onChecked:t.onChecked,showOperate:t.showOperate,groupEditAndNew:t.groupEditAndNew,deleteGroup:t.deleteGroup,colorConfig:t.colorConfig,isSearchStatus:t.isSearchStatus}}})],1)])},D=[],F=g(W,K,D,!1,null,null,null,null);const z=F.exports;class P{constructor(){this.eGroupNotify=new S("/eGroupNotify","",""),this.alreadyUpdate={},this.notify=null}stop(){this.notify&&this.notify.stop()}Init(){this.eGroupNotify.openConnect().then(t=>{this.notify=t;try{t.invoke("GetEquipGroupTree"),t.invoke("GetAllEquipGroupTree")}catch(e){console.log(e)}this.subscribeTo(t,"GetEquipGroupTree"),this.subscribeTo(t,"AddEquipGroup"),this.subscribeTo(t,"EditEquipGroup"),this.subscribeTo(t,"DeleteEquipGroup");try{t.invoke("GetGroupEquips")}catch(e){console.log(e)}this.subscribeTo(t,"GetGroupEquips"),this.subscribeTo(t,"AddEquip"),this.subscribeTo(t,"DeleteEquip"),this.subscribeTo(t,"EditEquip"),this.subscribeTo(t,"moveEquips"),this.subscribeTo(t,"GetAllEquipGroupTree"),t.onclose(e=>{try{this.Init()}catch(s){console.log(s)}console.log("\u91CD\u8FDE",e)})}).catch(t=>{console.error(t)})}subscribeTo(t,e){t.off(e),t.on(e,s=>{s&&s.isSuccess&&(this[e]?this[e](s.data):this.notice({func:e,data:s.data,key:s.groupId}))})}GetEquipGroupTree(t){window.top.groupList||(window.top.groupList=t,this.notice({type:"GetEquipGroupTree"}))}GetAllEquipGroupTree(t){console.log(8899,t),window.top.groupList_manageMent||(window.top.groupList_manageMent=t,this.notice({type:"GetEquipGroupTreeWidthTreeType"}))}AddEquipGroup(t){const{parentGroupId:e,groupId:s,groupName:i}=t||{};s&&(window.top.groupList_manageMent||(window.top.groupList_manageMent=[]),window.top.groupList_manageMent.push({parentId:e,id:s,name:i,equipCount:0}),this.notice({type:"AddEquipGroup",data:t}))}EditEquipGroup(t){const{groupId:e,groupName:s}=t;window.top.groupList&&window.groupList.forEach(i=>{i.id==e&&(i.name=s)}),window.top.groupList_manageMent&&window.groupList_manageMent.forEach(i=>{i.id==e&&(i.name=s)}),this.notice({type:"EditEquipGroup",data:t})}deleteChildGroup(t,e){let s=[];e.forEach(i=>{i.parentId==t&&s.push(i.id)}),s.forEach(i=>{let u=e.findIndex(r=>r.id==i);u>-1&&e.splice(u,1),this.deleteChildGroup(i,e)})}DeleteEquipGroup(t){t.forEach(e=>{if(window.top.groupList){let s=window.top.groupList.findIndex(i=>i.id==e.groupId);s>-1&&window.top.groupList.splice(s,1),this.deleteChildGroup(e.groupId,window.top.groupList)}if(window.top.groupList_manageMent){let s=window.top.groupList_manageMent.findIndex(i=>i.id==e.groupId);s>-1&&window.top.groupList_manageMent.splice(s,1),this.deleteChildGroup(e.groupId,window.top.groupList_manageMent)}}),this.notice({type:"DeleteEquipGroup",data:t})}GetGroupEquips(t){const{groupId:e,equips:s}=t||{};console.log(this.alreadyUpdate[e]),this.alreadyUpdate[e]||(window.top.groupCache||(window.top.groupCache={}),window.top.groupCache[e]={},e&&s&&s instanceof Array&&(s.forEach(i=>{i.title=i.name,i.groupId=e,i.equipNo=i.id,delete i.name,window.equipCache||(window.top.equipCache={}),window.top.equipCache[i.id]=i,window.top.groupCache[e][i.id]=i}),window.top[`group-${e}`]=s,this.notice({type:"GetGroupEquips",data:{groupId:e}}),this.alreadyUpdate[e]=!0))}AddEquip(t){const{groupId:e,equips:s}=t||{};window.top[`group-${e}`]||(window.top[`group-${e}`]=[]),window.top.groupCache||(window.top.groupCache={}),window.top.groupCache[e]||(window.top.groupCache[e]={}),window.top.equipCache||(window.top.equipCache={});let i=window.top[`group-${e}`].length;if(e&&s){if(s.forEach((u,r)=>{window.top[`group-${e}`].push({equipNo:u.id,groupId:e,id:u.id,title:u.name}),window.top.equipCache[u.id]=window.top[`group-${e}`][i+r],window.top.groupCache[e][u.id]=window.top[`group-${e}`][i+r]}),!this.exist(e,window.top.groupList)){let u=this.findParentList(e,window.top.groupList_manageMent);window.top.groupList.push(...u)}this.notice({type:"AddEquip",data:t})}}moveEquips(t){let e=[],s=!0,i=[];const{sourceGroup:u,targetGroupId:r}=t||{};r&&e.push(r),u.forEach(p=>{if(e.push(p.groupId),(!window.top[`group-${r}`]||!window.top[`group-${r}`].length)&&(window.top[`group-${r}`]=[],i.push(r)),window.top.groupCache||(window.top.groupCache={}),window.top.groupCache[r]||(window.top.groupCache[r]={}),p.equips.forEach(a=>{if(a.title=a.name,a.groupId=r,a.equipNo=a.id,window.top[`group-${p.groupId}`]){let h=window.top[`group-${p.groupId}`].findIndex(n=>n.id==a.id);h>-1&&window.top[`group-${p.groupId}`].splice(h,1)}window.equipCache||(window.top.equipCache={}),window.top.equipCache[a.id]=a,window.top.groupCache[r][a.id]=a,window.top[`group-${r}`].push(a)}),!window.top[`group-${p.groupId}`].length){let a=window.top.groupList.findIndex(h=>h.id==p.groupId);a>-1&&window.top.groupList.splice(a,1),this.deleteChildGroup(p.groupId,window.top.groupList)}}),i.forEach(p=>{if(!this.exist(p,window.top.groupList)){let a=this.findParentList(p,window.top.groupList_manageMent);window.top.groupList.push(...a)}}),this.notice({type:"moveEquips",data:{updateGroups:e,buildTree:s}})}exist(t,e){return e?e.some(s=>s.id==t):!1}findParentList(t,e){let s=[];if(e){let i=e.findIndex(u=>u.id==t);i>-1&&s.push({...e[i]}),e[i].parentId&&!this.exist(e[i].parentId,window.top.groupList)&&s.push(...this.findParentList(e[i].parentId,window.top.groupList_manageMent))}return s}DeleteEquip(t){const{groupId:e,equips:s}=t||{};if(e&&s&&s instanceof Array){if(window.top[`group-${e}`])for(let i=0,u=s.length;i<u;i++){let r=window.top[`group-${e}`].findIndex(p=>p.id==s[i].id);r>-1&&window.top[`group-${e}`].splice(r,1),delete window.top.equipCache[s[i].id],delete window.top.groupCache[e][s[i].id]}this.notice({type:"DeleteEquip",data:t})}}EditEquip(t){const{equipNo:e,groupId:s,equipName:i}=t||{};s&&e&&(window[`group-${s}`]&&(window.top.equipCache[e]=i),this.notice({type:"EditEquip",data:t}))}notice(t){if(window.top.hasIframe){let e=document.getElementsByTagName("iframe");for(let s of e)s.contentWindow.postMessage(t)}else window.postMessage(t,"*")}}const J={name:"treeV2",components:{tree:z},data(){return{list:[],refId:l.generateUUID(),treeKey:null,listKey:null,hasBuildTree:!1}},props:{treeType:{type:String,default:""}},mounted(){this.treeKey=`equipGroup${this.treeType}`,this.listKey=`groupList${this.treeType}`,window.top[this.treeKey]?this.list=l.formateList(JSON.parse(JSON.stringify(window.top[this.treeKey]))):window.top[this.listKey]&&this.buildTree(),window.executeQueue||(window.executeQueues={}),window.executeQueues[this.refId]=this.destroyTree,window.addEventListener("message",o=>{o&&o.data&&o.data.type&&this[o.data.type]&&this[o.data.type]()});try{window.top.hasIframe||this.selfRequest()}catch{this.selfRequest()}},methods:{selfRequest(){new P().Init()},GetEquipGroupTreeWidthTreeType(){this.treeType&&window.top[this.listKey]&&this.buildTree()},GetEquipGroupTree(){!this.treeType&&window.top[this.listKey]&&this.buildTree()},buildTree(){if(window.top[this.listKey]){let o=l.listToTreeList(JSON.parse(JSON.stringify(window.top[this.listKey])));this.list=l.formateList(JSON.parse(JSON.stringify(o))),window.top[`equipGroup${this.treeType}`]=o,this.hasBuildTree=!0}},filterMethod(o){this.$refs[this.refId].filterMethod(o)},resetCheckedStatus(){this.$refs[this.refId].resetCheckedStatus()},getEquipSelectd(){return this.$refs[this.refId].getEquipSelectd()},getControlSelected(){return this.$refs[this.refId].getControlSelected()},destroyTree(){this.$refs[this.refId].destroyTree()}}};var V=function(){var t=this,e=t._self._c;return e("tree",t._g(t._b({ref:t.refId,attrs:{data:t.list,buildTree:t.buildTree}},"tree",{...t.$attrs,...t.$props},!1),t.$listeners))},H=[],Q=g(J,V,H,!1,null,null,null,null);const C=Q.exports;return C.install=function(o){o.component(C.name,C)},C});
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.gw-tree{height:100%;font-size:14px;color:var(--con-textColor1)}.gw-tree .el-icon-more{transform:rotate(90deg)}.gw-tree .el-tree__indent{flex-shrink:0}.gw-tree .nodeContent{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 30px)}.gw-tree .nodeContent .label{line-height:30px;flex:1;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gw-tree .el-tree-node__expand-icon{padding:0!important}.gw-tree .hover-add-width{width:calc(100% + 8px)!important}.gw-tree .hover-add-width .el-tree-node{width:calc(100% - 12px)!important;position:relative}.gw-tree .notAllow{cursor:not-allowed!important}.gw-tree .el-tree-node{height:36px;position:relative}.gw-tree .el-tree-node .block{width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:10;cursor:not-allowed}.gw-tree .virtualList{height:100%;overflow-y:auto;overflow-x:hidden}.gw-tree .el-loading-mask{visibility:visible!important}.gw-tree .el-tree__empty-block .el-tree__empty-text{color:var(--con-textColor4);display:flex;justify-content:center;align-items:center;font-size:18px}.gw-tree .selectNum{height:36px;line-height:36px;padding-left:20px;color:var(--tree-txColor1);font-size:14px}.gw-tree .el-checkbox{margin-right:10px!important}.gw-tree .circle{width:14px;height:14px;display:flex;justify-content:center;align-items:center;margin-right:5px}.gw-tree .circle .yd{width:10px;height:10px;border-radius:50%;display:inline-block}.gw-tree .circle .iconfont{font-size:14px}.gw-tree .el-tree{background-color:transparent!important}.gw-tree .el-tree .el-tree-node__label{margin-left:10px;line-height:20px}.gw-tree .el-tree .icondian{font-size:10px!important}.gw-tree .el-tree .el-tree-node__loading-icon{margin-left:10px;margin-right:0}.gw-tree .el-tree>div .el-tree-node{margin-top:0!important}.gw-tree .el-tree>div .el-tree-node .el-tree-node__content{background:transparent!important}.gw-tree .el-tree .nodeContent,.gw-tree .el-tree .el-tree-node__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gw-tree .el-tree .parent_tag{position:relative;display:flex;flex-direction:row;justify-content:flex-start;align-items:center;width:100%;height:36px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-top:4px;border-left:4px solid transparent}.gw-tree .el-tree .parent_tag .operates{padding-right:8px;display:flex;justify-content:center;align-items:center}.gw-tree .el-tree .parent_tag .operates svg{height:22px;width:22px}[data-theme=dark] .gw-tree .el-tree .parent_tag .operates svg{fill:#fff}[data-theme=light] .gw-tree .el-tree .parent_tag .operates svg{fill:#606266}.gw-tree .el-tree .parent_tag .operates .iconfont{font-size:20px}.gw-tree .el-tree .parent_tag .operates .iconfont:first-child{margin-right:8px}.gw-tree .el-tree .parent_tag .operates .el-icon-more{transform:rotate(90deg)}.gw-tree .el-tree .parent_tag .nodeContent{padding-right:8px}.gw-tree .el-tree .parent_tag .arrow{pointer-events:none;position:relative;top:1px;padding-left:3px;float:left;width:25px;height:100%}.gw-tree .el-tree .parent_tag .arrow i{display:block;position:absolute;font-size:14px}.gw-tree .el-tree .parent_tag .arrow .arrowHide{display:block}.gw-tree .el-tree .parent_tag .arrow .arrowShow{display:none}.gw-tree .el-tree .parent_tag .icondian{font-size:.8rem;pointer-events:none}.gw-tree .el-tree .parent_tag a{pointer-events:none;font-size:14px;height:40px;line-height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:66%}.gw-tree .el-tree .parent_tag .operation{position:absolute;right:10px;display:flex;justify-content:space-between;align-items:center;height:100%;cursor:pointer}.gw-tree .el-tree .parent_tag .operation span{display:flex;justify-content:center;align-items:center}.gw-tree .el-tree .parent_tag .operation .iconfont{font-size:20px}.gw-tree .el-tree .parent_tag .operation .el-icon-more,.gw-tree .el-tree .parent_tag .operation .icon16_tianjia{width:20px;height:20px;display:flex;justify-content:center;align-items:center;transform:rotate(90deg)}.gw-tree .el-tree .parent_tag .operation .icon16_tianjia:before{width:20px;height:20px;display:flex;justify-content:center;align-items:center}.gw-tree .el-tree>div .selectedColor{background-color:var(--tree-selBgColor)}.gw-tree .el-tree-node__content:hover{background-color:unset!important}.gw-tree>div .el-tree-node:hover{background-color:var(--tree-bgColor8);border-top-right-radius:3px;border-bottom-right-radius:3px}.gw-tree>div .el-tree-node:hover>.el-tree-node__content>.nodeContent .el-tree-node__label{color:#3875ff}.gw-tree .el-tree-node.selectedColor{border-left:4px solid #3875FF;background-color:var(--tree-selBgColor)}.gw-tree .el-tree-node.selectedColor .nodeContent .el-tree-node__label{color:#3875ff}.gw-tree .el-tree-node{user-select:none}.gw-tree .el-tree-node__content{width:100%;height:100%!important;display:flex}.gw-tree .el-tree-node__content .nodeContent{flex:1;height:100%;display:flex;align-items:center;border-radius:3px}.gw-tree .el-tree-node__content .nodeContent .equipNumber{margin:0 12px}.gw-tree .el-tree-node__content .nodeContent .icon-gw-icon-yijian{width:16px;height:16px;margin-right:18px;opacity:0}.gw-tree .el-tree-node__content .nodeContent .icon-gw-icon-yijian path{fill:var(--tree-txColor1)}.gw-tree .el-tree-node__content .nodeContent:hover .icon-gw-icon-yijian{opacity:1}.gw-tree .el-tree-node__content .nodeContent .el-tree-node__label{flex:1}.gw-tree .el-tree-node__content .nodeContent .expanded,.gw-tree .el-tree-node__content .nodeContent .el-tree-node__expand-icon{color:var(--tree-txColor1)}.gw-tree .el-tree-node:focus>.el-tree-node__content{background-color:unset!important}.gw-tree .el-tree-node__expand-icon{margin:10px}.gw-tree .child_tags{position:relative;width:auto;height:36px;display:flex;flex-direction:row;justify-content:flex-start;align-items:center;line-height:30px;white-space:nowrap;text-overflow:ellipsis;color:var(--con-textColor1)!important;cursor:pointer;border-left:4px solid transparent}.gw-tree .child_tags .nodeContent{padding-left:18px;background-size:.5px 12px;background-repeat:repeat-y;background-position:left}[data-theme=light] .gw-tree .child_tags .nodeContent{background-image:linear-gradient(to bottom,#979797 50%,#979797 50%,transparent 50%)}[data-theme=dark] .gw-tree .child_tags .nodeContent{background-image:linear-gradient(to bottom,#494D57 50%,#494D57 50%,transparent 50%)}.gw-tree .child_tags>label{margin-left:10px}.gw-tree .child_tags .icondian{font-size:.8rem;color:#8c8c8c;pointer-events:none}.gw-tree .child_tags a{font-size:14px;height:40px;line-height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:72%}