egova-urbanpro-web 0.0.1
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 +134 -0
- package/es/_plugin-vue_export-helper-BwmSBgGG.js +9 -0
- package/es/act-menu-refresh-3YeQne1X.js +77 -0
- package/es/async-select-modal-lRKCEMBM.js +316 -0
- package/es/bulletin-add-Dt1Xi_oL.js +1251 -0
- package/es/bulletin-config-Ber1L1T2.js +297 -0
- package/es/bulletin-detail-Ce7riX6X.js +1430 -0
- package/es/bulletin-detail-file-2Ij39UlM.js +187 -0
- package/es/bulletin-drawer-DmwW23ng.js +461 -0
- package/es/bulletin-level-Cz_6Mg2x.js +501 -0
- package/es/bulletin-manage-JMjvzUhg.js +1526 -0
- package/es/bulletin-notify-info-drawer-vR3KSaRS.js +487 -0
- package/es/bulletin-property-CvohCK8q.js +656 -0
- package/es/bulletin-type-CQS6_MYv.js +675 -0
- package/es/bulletin-view-DcdZrV19.js +870 -0
- package/es/business-collection-and-repair-B2DfBAsx.js +109 -0
- package/es/cascader-filter-DOg-iNnE.js +68 -0
- package/es/cascader-multiple-filter-C-cKxmkk.js +103 -0
- package/es/chat-BB8_LIT6.js +4634 -0
- package/es/checkbox-filter-DC1VaGo9.js +39 -0
- package/es/chunk-CHb_fpD5.js +29 -0
- package/es/condition-search-criteria-B_HnHQBy.js +190 -0
- package/es/constant-CYnp-Cj8.js +4925 -0
- package/es/constants-BijBPSuc.js +480 -0
- package/es/constants-DQ6XzzDS.js +137 -0
- package/es/contact-DxLrJ_f_.js +339 -0
- package/es/contact-unit-BvCPmyNK.js +708 -0
- package/es/department-radio-filter-BbrntEcc.js +72 -0
- package/es/downtime-timer-repair-D_SuN4fE.js +255 -0
- package/es/dynamic-form-input-10ce5824-Cju2XHEl.js +60 -0
- package/es/dynamic-form-input-number-c60b4ff5-gYvoAgss.js +61 -0
- package/es/dynamic-form-login-type-6c9d78bf-CxtLGfA6.js +175 -0
- package/es/dynamic-form-multiple-select-3e2bd885-CrD_ALk8.js +77 -0
- package/es/dynamic-form-password-57dc81c4-CcmoNfq0.js +84 -0
- package/es/dynamic-form-region-tree-b2c57d1c-BRm2M8Er.js +133 -0
- package/es/dynamic-form-select-cdbf49ad-C0eLS2zd.js +76 -0
- package/es/dynamic-form-upload-768a0d32-ClHw2ZkO.js +116 -0
- package/es/egova-urbanpro-web.css +10907 -0
- package/es/egova-urbanpro-web.d.ts +79 -0
- package/es/egova-urbanpro-web.js +9223 -0
- package/es/field-cell-PNcIBk8w.js +93 -0
- package/es/field-icon-cell-BQvkUM-O.js +65 -0
- package/es/file-cell-ClyA9XoC.js +147 -0
- package/es/hooks-CuXq9j8q.js +324 -0
- package/es/icon-cell-BF-Nf-QP.js +78 -0
- package/es/im-conversation-06-TFmZZ.js +158 -0
- package/es/image-cell-cu9ezfsV.js +92 -0
- package/es/image-gray-surS1IZ2.js +5 -0
- package/es/index-15d85366-BVTMMFAV.js +97 -0
- package/es/index-lib-23bd328c-DtcJvHvJ.js +42122 -0
- package/es/info-card-DgYedeWN.js +30 -0
- package/es/localforage-B_66fZyP.js +1798 -0
- package/es/number-filter-SyfJaaIG.js +55 -0
- package/es/operation-selector-TEcr5s2w.js +157 -0
- package/es/option-style-BTFl4VQj.js +32 -0
- package/es/package.json +46 -0
- package/es/query-CiRQQsE1.js +11 -0
- package/es/radio-filter-t5QSYiRY.js +68 -0
- package/es/rec-delete-DBvqRiKp.js +74 -0
- package/es/rec-timer-refresh-Dfd6hH2t.js +74 -0
- package/es/region-radio-filter-CoybNPaj.js +271 -0
- package/es/render-cell-BI9mUiTe.js +45 -0
- package/es/select-checkbox-filter-B89vKdLG.js +60 -0
- package/es/select-multiple-tree-filter-BEYUKg7q.js +298 -0
- package/es/select-radio-filter-BW2P3uwp.js +58 -0
- package/es/select-single-tree-filter-CKYo3kV1.js +94 -0
- package/es/service-BabEdPB2.js +100 -0
- package/es/service-fs3hJh7w.js +126 -0
- package/es/text-filter-B80UB8KG.js +66 -0
- package/es/time-filter-Nc-cflut.js +211 -0
- package/es/types-DjDPFQk1.js +44 -0
- package/es/use-file-D_9JbApO.js +58 -0
- package/es/user-radio-filter-T79Kp2jW.js +72 -0
- package/es/utils-4fqWDxwG.js +2643 -0
- package/es/utils-BlJtAQle.js +161 -0
- package/es/utils-Cn_7yZzr.js +355 -0
- package/es/utils-D-E5UJPP.js +14 -0
- package/es/version.json +33 -0
- package/package.json +165 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
import { d as BulletinStatusOptions, r as BULLETIN_NOTIFICATION_METHOD_IDS, x as BulletinNoticeInfoType, y as BulletinExpiredStatus } from "./constants-BijBPSuc.js";
|
|
3
|
+
import "@kyjian/libs/utils";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
//#region ../egova-urbanpro-extend/src/views/bulletin/utils.ts
|
|
6
|
+
function assignBulletinNoticeType(item, type) {
|
|
7
|
+
if (item.bulletinNoticeInfoRelationType === type) return true;
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
var getNoticeInfoItemUid = (item) => {
|
|
11
|
+
if (assignBulletinNoticeType(item, BulletinNoticeInfoType.HUMAN)) return item.mainInfo.uid;
|
|
12
|
+
else if (assignBulletinNoticeType(item, BulletinNoticeInfoType.GROUP)) return item?.id;
|
|
13
|
+
else return item.uid;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* 统一各种类型的通告对象选中数据,返回统一的格式
|
|
17
|
+
* @param item
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
var getUnifyNoticeInfoItem = (item) => {
|
|
21
|
+
if (assignBulletinNoticeType(item, BulletinNoticeInfoType.HUMAN)) return {
|
|
22
|
+
relationName: item.mainInfo.name,
|
|
23
|
+
relationType: BulletinNoticeInfoType.HUMAN,
|
|
24
|
+
relationId: item.mainInfo.uid,
|
|
25
|
+
unitId: item.extendInfo?.sysUnit?.uid ?? "",
|
|
26
|
+
unitName: item.extendInfo?.sysUnit?.name ?? "",
|
|
27
|
+
name: item.mainInfo.name,
|
|
28
|
+
uid: item.mainInfo.uid,
|
|
29
|
+
bulletinNoticeInfoDisplayOrder: item.bulletinNoticeInfoDisplayOrder
|
|
30
|
+
};
|
|
31
|
+
else if (assignBulletinNoticeType(item, BulletinNoticeInfoType.GROUP)) return {
|
|
32
|
+
relationName: item?.name ?? "",
|
|
33
|
+
relationType: item.bulletinNoticeInfoRelationType,
|
|
34
|
+
relationId: item?.id ?? "",
|
|
35
|
+
unitId: "",
|
|
36
|
+
unitName: item.unitName ?? "",
|
|
37
|
+
name: item?.name ?? "",
|
|
38
|
+
uid: item?.id ?? "",
|
|
39
|
+
bulletinNoticeInfoDisplayOrder: item.bulletinNoticeInfoDisplayOrder
|
|
40
|
+
};
|
|
41
|
+
else return {
|
|
42
|
+
relationName: item.name ?? "",
|
|
43
|
+
relationType: item.bulletinNoticeInfoRelationType,
|
|
44
|
+
relationId: item.uid ?? "",
|
|
45
|
+
unitId: item.uid ?? "",
|
|
46
|
+
unitName: item.unitName ?? "",
|
|
47
|
+
name: item.name ?? "",
|
|
48
|
+
uid: item.uid ?? "",
|
|
49
|
+
bulletinNoticeInfoDisplayOrder: item.bulletinNoticeInfoDisplayOrder
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 安全的转换一个字符串至number,如果转换失败,则返回原字符串,特殊处理数值越界问题
|
|
54
|
+
* @param num
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
function safeToNumber(num) {
|
|
58
|
+
const value = Number(num);
|
|
59
|
+
if (!Number.isFinite(value) || value.toString() !== num.toString()) return num;
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 将通告详情中的数据转换为unit-tree组件需要的格式,注意这里不处理noticeInfoDisplayOrder的生成,由hooks统一生成
|
|
64
|
+
* @param bulletinNoticeInfo
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
function bulletinNoticeInfoTransToInstance(bulletinNoticeInfo) {
|
|
68
|
+
const list = [];
|
|
69
|
+
let bulletinNoticeInfoDisplayOrder = bulletinNoticeInfo.length;
|
|
70
|
+
for (const item of bulletinNoticeInfo) if (item.relationType === BulletinNoticeInfoType.HUMAN) list.push({
|
|
71
|
+
mainInfo: {
|
|
72
|
+
uid: safeToNumber(item.relationId),
|
|
73
|
+
name: item.relationName
|
|
74
|
+
},
|
|
75
|
+
extendInfo: { sysUnit: {
|
|
76
|
+
name: item.unitName,
|
|
77
|
+
uid: item.unitId
|
|
78
|
+
} },
|
|
79
|
+
bulletinNoticeInfoRelationType: BulletinNoticeInfoType.HUMAN,
|
|
80
|
+
bulletinNoticeInfoDisplayOrder: bulletinNoticeInfoDisplayOrder--
|
|
81
|
+
});
|
|
82
|
+
else if (item.relationType === BulletinNoticeInfoType.ROLE) list.push({
|
|
83
|
+
name: item.relationName,
|
|
84
|
+
uid: safeToNumber(item.relationId),
|
|
85
|
+
unitName: item.unitName,
|
|
86
|
+
bulletinNoticeInfoRelationType: BulletinNoticeInfoType.ROLE,
|
|
87
|
+
bulletinNoticeInfoDisplayOrder: bulletinNoticeInfoDisplayOrder--
|
|
88
|
+
});
|
|
89
|
+
else if (item.relationType === BulletinNoticeInfoType.UNIT) list.push({
|
|
90
|
+
name: item.relationName,
|
|
91
|
+
uid: safeToNumber(item.relationId),
|
|
92
|
+
bulletinNoticeInfoRelationType: BulletinNoticeInfoType.UNIT,
|
|
93
|
+
bulletinNoticeInfoDisplayOrder: bulletinNoticeInfoDisplayOrder--
|
|
94
|
+
});
|
|
95
|
+
else if (item.relationType === BulletinNoticeInfoType.GROUP) list.push({
|
|
96
|
+
name: item.relationName,
|
|
97
|
+
id: safeToNumber(item.relationId),
|
|
98
|
+
unitId: item.unitId,
|
|
99
|
+
bulletinNoticeInfoRelationType: BulletinNoticeInfoType.GROUP,
|
|
100
|
+
bulletinNoticeInfoDisplayOrder: bulletinNoticeInfoDisplayOrder--
|
|
101
|
+
});
|
|
102
|
+
return list;
|
|
103
|
+
}
|
|
104
|
+
function getBulletinLevelStyle(levelList, id) {
|
|
105
|
+
const level = levelList.find((item) => item.id === id);
|
|
106
|
+
const color = level?.color;
|
|
107
|
+
let background = "";
|
|
108
|
+
if (color?.startsWith("#")) background = `${color}1a`;
|
|
109
|
+
else if (color?.startsWith("rgb(")) background = color.replace("rgb(", "rgba(").replace(")", ",0.1)");
|
|
110
|
+
return {
|
|
111
|
+
background,
|
|
112
|
+
color,
|
|
113
|
+
name: level?.name ?? "-"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function formatNum(num) {
|
|
117
|
+
const value = Number(num);
|
|
118
|
+
if (!Number.isFinite(value)) return "";
|
|
119
|
+
if (value > 99) return "99+";
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
function getCurrentBulletinStatus(bulletin) {
|
|
123
|
+
if (bulletin.expiredStatus === BulletinExpiredStatus.EXPIRED) return BulletinStatusOptions.find((item) => item.value === BulletinExpiredStatus.EXPIRED);
|
|
124
|
+
return BulletinStatusOptions.find((item) => item.value === bulletin.status);
|
|
125
|
+
}
|
|
126
|
+
function validateNotificationMethod(_, val) {
|
|
127
|
+
if (val.length) return Promise.resolve();
|
|
128
|
+
else return Promise.reject(/* @__PURE__ */ new Error("请选择通知方式"));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 过滤所有方式为当前可用的通知方式
|
|
132
|
+
* @param val
|
|
133
|
+
* @returns
|
|
134
|
+
*/
|
|
135
|
+
function filterNotificationMethod(val) {
|
|
136
|
+
return val.filter((item) => BULLETIN_NOTIFICATION_METHOD_IDS.includes(item.id.toString()));
|
|
137
|
+
}
|
|
138
|
+
var range = (start, end) => {
|
|
139
|
+
const result = [];
|
|
140
|
+
for (let i = start; i < end; i++) result.push(i);
|
|
141
|
+
return result;
|
|
142
|
+
};
|
|
143
|
+
var disabledDate = (current) => current && current < dayjs().subtract(1, "day").endOf("day");
|
|
144
|
+
var disabledTime = (time) => {
|
|
145
|
+
const hours = dayjs().hour();
|
|
146
|
+
const minutes = dayjs().minute();
|
|
147
|
+
if (time && dayjs(time).date() === dayjs().date()) if (dayjs(time).hour() === hours) return {
|
|
148
|
+
disabledHours: () => range(0, hours),
|
|
149
|
+
disabledMinutes: () => range(0, minutes)
|
|
150
|
+
};
|
|
151
|
+
else return { disabledHours: () => range(0, hours) };
|
|
152
|
+
else return {};
|
|
153
|
+
};
|
|
154
|
+
function getBulletinNoticeInfoIcon(item) {
|
|
155
|
+
if (item.relationType === BulletinNoticeInfoType.UNIT) return "zt-iconfont zt-icon-unit";
|
|
156
|
+
else if (item.relationType === BulletinNoticeInfoType.GROUP) return "zt-iconfont zt-icon-relation";
|
|
157
|
+
else if (item.relationType === BulletinNoticeInfoType.ROLE) return "ega-core-iconfont ega-core-icon-role";
|
|
158
|
+
else return item.relationName?.slice(-2);
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { filterNotificationMethod as a, getBulletinNoticeInfoIcon as c, getUnifyNoticeInfoItem as d, validateNotificationMethod as f, disabledTime as i, getCurrentBulletinStatus as l, bulletinNoticeInfoTransToInstance as n, formatNum as o, disabledDate as r, getBulletinLevelStyle as s, assignBulletinNoticeType as t, getNoticeInfoItemUid as u };
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
import { B as bus, I as signature, z as BusEventKey } from "./utils-4fqWDxwG.js";
|
|
3
|
+
import { isEmptyText, storage } from "@kyjian/libs/utils";
|
|
4
|
+
import { message } from "ant-design-vue";
|
|
5
|
+
import { CbEvents, MessageType, OpenIMSDK, Platform, SessionType } from "@egova-im/open-im-sdk";
|
|
6
|
+
//#region ../egova-urbanpro-core/src/libs/types/im-message.ts
|
|
7
|
+
/**
|
|
8
|
+
* 通知消息类型
|
|
9
|
+
*/
|
|
10
|
+
var NOTIFICATION_MSG_TYPE = /* @__PURE__ */ function(NOTIFICATION_MSG_TYPE) {
|
|
11
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["IM_CHAT"] = -9999999] = "IM_CHAT";
|
|
12
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["DEFAULT"] = 0] = "DEFAULT";
|
|
13
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["REC_ARRIVE"] = 1] = "REC_ARRIVE";
|
|
14
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["SUP"] = 2] = "SUP";
|
|
15
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["REC_CHECK"] = 6] = "REC_CHECK";
|
|
16
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["REC_VERIFY"] = 7] = "REC_VERIFY";
|
|
17
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["BULLETIN"] = 8] = "BULLETIN";
|
|
18
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["GENERAL"] = 100] = "GENERAL";
|
|
19
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["OPERATION_MAINTENANCE_SYSTEM"] = 101] = "OPERATION_MAINTENANCE_SYSTEM";
|
|
20
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["KNOWLEDGE"] = 102] = "KNOWLEDGE";
|
|
21
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["CITIZEN_WITHDRAW_NOTICE"] = 103] = "CITIZEN_WITHDRAW_NOTICE";
|
|
22
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["REC_COPY"] = 104] = "REC_COPY";
|
|
23
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["CITIZEN_ONLINE_REC_ARRIVAL"] = 105] = "CITIZEN_ONLINE_REC_ARRIVAL";
|
|
24
|
+
NOTIFICATION_MSG_TYPE[NOTIFICATION_MSG_TYPE["EMERGENCY_REC_DISPATCH"] = 106] = "EMERGENCY_REC_DISPATCH";
|
|
25
|
+
return NOTIFICATION_MSG_TYPE;
|
|
26
|
+
}({});
|
|
27
|
+
var NOTIFICATION_MSG_REMINDER_TYPE = /* @__PURE__ */ function(NOTIFICATION_MSG_REMINDER_TYPE) {
|
|
28
|
+
NOTIFICATION_MSG_REMINDER_TYPE[NOTIFICATION_MSG_REMINDER_TYPE["FORCE"] = 1] = "FORCE";
|
|
29
|
+
NOTIFICATION_MSG_REMINDER_TYPE[NOTIFICATION_MSG_REMINDER_TYPE["NORMAL"] = 0] = "NORMAL";
|
|
30
|
+
return NOTIFICATION_MSG_REMINDER_TYPE;
|
|
31
|
+
}({});
|
|
32
|
+
var NOTIFICATION_MSG_REMINDER_FORCE_TYPE = /* @__PURE__ */ function(NOTIFICATION_MSG_REMINDER_FORCE_TYPE) {
|
|
33
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["REC_ARRIVE"] = -1] = "REC_ARRIVE";
|
|
34
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["BULLETIN"] = 1] = "BULLETIN";
|
|
35
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["SUP_ALLOCATION"] = 2] = "SUP_ALLOCATION";
|
|
36
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["SUP_OVERDUE"] = 3] = "SUP_OVERDUE";
|
|
37
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["GENERAL"] = 100] = "GENERAL";
|
|
38
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["OPERATION_MAINTENANCE_SYSTEM"] = 101] = "OPERATION_MAINTENANCE_SYSTEM";
|
|
39
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["KNOWLEDGE"] = 102] = "KNOWLEDGE";
|
|
40
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["CITIZEN_WITHDRAW_NOTICE"] = 103] = "CITIZEN_WITHDRAW_NOTICE";
|
|
41
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["REC_COPY"] = 104] = "REC_COPY";
|
|
42
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["CITIZEN_ONLINE_REC_ARRIVAL"] = 105] = "CITIZEN_ONLINE_REC_ARRIVAL";
|
|
43
|
+
NOTIFICATION_MSG_REMINDER_FORCE_TYPE[NOTIFICATION_MSG_REMINDER_FORCE_TYPE["EMERGENCY_REC_DISPATCH"] = 106] = "EMERGENCY_REC_DISPATCH";
|
|
44
|
+
return NOTIFICATION_MSG_REMINDER_FORCE_TYPE;
|
|
45
|
+
}({});
|
|
46
|
+
/**
|
|
47
|
+
* 系统通知发送人id
|
|
48
|
+
*/
|
|
49
|
+
var SYS_NOTIFICATION_SENDER_ID = "egovaIMAdmin";
|
|
50
|
+
var MSG_READ_STATUS = /* @__PURE__ */ function(MSG_READ_STATUS) {
|
|
51
|
+
MSG_READ_STATUS[MSG_READ_STATUS["ALL"] = 0] = "ALL";
|
|
52
|
+
MSG_READ_STATUS[MSG_READ_STATUS["READ"] = 1] = "READ";
|
|
53
|
+
MSG_READ_STATUS[MSG_READ_STATUS["UNREAD"] = 2] = "UNREAD";
|
|
54
|
+
return MSG_READ_STATUS;
|
|
55
|
+
}({});
|
|
56
|
+
var MSG_TAB_TYPE = MSG_READ_STATUS;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region ../egova-urbanpro-core/src/libs/utils/im.ts
|
|
59
|
+
var EXCEEDED_IM_CONNECTION_LIMIT_CODE = 886;
|
|
60
|
+
/**
|
|
61
|
+
* @description: OpenIM utils OpenIM 文档: https://open-im-docs.vercel.app/#/js_v2/sdk_integrate/message
|
|
62
|
+
*/
|
|
63
|
+
var Im = class {
|
|
64
|
+
constructor() {
|
|
65
|
+
this.openIM = new OpenIMSDK();
|
|
66
|
+
}
|
|
67
|
+
openIM;
|
|
68
|
+
userStore = void 0;
|
|
69
|
+
/** 由外部传入store,避免打成lib包之后出现引入了pinia相关代码,而提示pinia未注册的情况 */
|
|
70
|
+
setupStore(options) {
|
|
71
|
+
if (this.userStore) return;
|
|
72
|
+
this.userStore = options.userStore;
|
|
73
|
+
}
|
|
74
|
+
getOpenIm() {
|
|
75
|
+
return this.openIM;
|
|
76
|
+
}
|
|
77
|
+
async hasImLoggedIn() {
|
|
78
|
+
try {
|
|
79
|
+
const status = await this.openIM.getLoginStatus();
|
|
80
|
+
return status && status.errCode === 0;
|
|
81
|
+
} catch (err) {
|
|
82
|
+
console.debug("获取登录状态失败", err);
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
onConnectFailed(result) {
|
|
87
|
+
console.error("openIm connectFailed: ", result);
|
|
88
|
+
if (EXCEEDED_IM_CONNECTION_LIMIT_CODE === result.errCode) {
|
|
89
|
+
message.error("即时通讯登录失败:该账号的并发会话已超出限制");
|
|
90
|
+
storage.remove("im-token");
|
|
91
|
+
this.openIM.off(CbEvents.ONCONNECTFAILED, this.onConnectFailed.bind(this));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async loginIm() {
|
|
95
|
+
const { human } = this.userStore || {};
|
|
96
|
+
const humanId = human?.id;
|
|
97
|
+
const imToken = await storage.get("im-token");
|
|
98
|
+
const imJssdkUrl = await storage.get("im-jssdk-url");
|
|
99
|
+
if (!humanId || !imToken || !imJssdkUrl) return Promise.reject("uid、imToken、imJssdkUrl为空,无法登录即时通讯");
|
|
100
|
+
console.debug("开始登录即时通讯");
|
|
101
|
+
try {
|
|
102
|
+
/**
|
|
103
|
+
* @description: 在这里定义事件监听,主要为openIm在超出连接数限制的情况下,
|
|
104
|
+
* 会直接返回reject code 111 的登录失败消息,接收不到这个超限的消息
|
|
105
|
+
*/
|
|
106
|
+
this.openIM.on(CbEvents.ONCONNECTFAILED, this.onConnectFailed.bind(this));
|
|
107
|
+
const config = {
|
|
108
|
+
url: imJssdkUrl,
|
|
109
|
+
params: {
|
|
110
|
+
userID: humanId + "",
|
|
111
|
+
token: imToken,
|
|
112
|
+
url: imJssdkUrl,
|
|
113
|
+
platformID: Platform.Web,
|
|
114
|
+
isBatch: true
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
signature.signatureConfig(config);
|
|
118
|
+
const result = await this.openIM.login(config.params);
|
|
119
|
+
bus.emit(BusEventKey.MSG__MSG_CENTER__IM_LOGIN_FINISHED);
|
|
120
|
+
if (!result || result.errCode !== 0) {
|
|
121
|
+
let msg = "即时通讯登录失败";
|
|
122
|
+
if (result?.errMsg) msg = msg + ":" + result.errMsg;
|
|
123
|
+
return Promise.reject(msg);
|
|
124
|
+
} else {
|
|
125
|
+
console.debug("成功登录即时通讯");
|
|
126
|
+
return Promise.resolve();
|
|
127
|
+
}
|
|
128
|
+
} catch (e) {
|
|
129
|
+
console.error("即时通讯登录失败", e);
|
|
130
|
+
return Promise.reject(e);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async logoutIm() {
|
|
134
|
+
try {
|
|
135
|
+
return await this.openIM.logout();
|
|
136
|
+
} catch (e) {
|
|
137
|
+
console.error("即时通讯退出失败", e);
|
|
138
|
+
return Promise.reject(e);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async getConversationListSplit(options = {
|
|
142
|
+
offset: 0,
|
|
143
|
+
count: 1e3
|
|
144
|
+
}) {
|
|
145
|
+
try {
|
|
146
|
+
const res = await this.openIM.getConversationListSplit(options);
|
|
147
|
+
if (res && res.errCode === 0) return JSON.parse(res.data);
|
|
148
|
+
else {
|
|
149
|
+
const msg = res?.errMsg || "获取会话数据失败";
|
|
150
|
+
return Promise.reject(msg);
|
|
151
|
+
}
|
|
152
|
+
} catch (e) {
|
|
153
|
+
console.error("获取会话数据失败", e);
|
|
154
|
+
return Promise.reject(e);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* 获取指定会话
|
|
159
|
+
*/
|
|
160
|
+
async getOneConversation(sessionType, sourceID = "") {
|
|
161
|
+
const options = {
|
|
162
|
+
sourceID,
|
|
163
|
+
sessionType
|
|
164
|
+
};
|
|
165
|
+
try {
|
|
166
|
+
const res = await this.openIM.getOneConversation(options);
|
|
167
|
+
if (res && res.errCode === 0) return JSON.parse(res.data);
|
|
168
|
+
else {
|
|
169
|
+
const msg = res?.errMsg || "获取指定会话失败";
|
|
170
|
+
return Promise.reject(msg);
|
|
171
|
+
}
|
|
172
|
+
} catch (e) {
|
|
173
|
+
console.error("获取指定会话失败", e);
|
|
174
|
+
return Promise.reject(e);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 获取历史未读消息
|
|
179
|
+
*/
|
|
180
|
+
async getHistoryMessageList(options) {
|
|
181
|
+
try {
|
|
182
|
+
const res = await this.openIM.getHistoryMessageList(options);
|
|
183
|
+
if (res && res.errCode === 0) return JSON.parse(res.data);
|
|
184
|
+
else {
|
|
185
|
+
const msg = res?.errMsg || "获取历史消息失败";
|
|
186
|
+
return Promise.reject(msg);
|
|
187
|
+
}
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.error("获取历史消息失败", e);
|
|
190
|
+
return Promise.reject(e);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 搜索消息(可以用类型搜索)
|
|
195
|
+
*/
|
|
196
|
+
async searchLocalMessages(options) {
|
|
197
|
+
try {
|
|
198
|
+
const res = await this.openIM.searchLocalMessages(options);
|
|
199
|
+
if (res && res.errCode === 0) return JSON.parse(res.data);
|
|
200
|
+
else {
|
|
201
|
+
const msg = res?.errMsg || "搜索历史消息失败";
|
|
202
|
+
return Promise.reject(msg);
|
|
203
|
+
}
|
|
204
|
+
} catch (e) {
|
|
205
|
+
console.error("搜索历史消息失败", e);
|
|
206
|
+
return Promise.reject(e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 统计各类型的消息数量
|
|
211
|
+
*/
|
|
212
|
+
async countLocalMessages(options) {
|
|
213
|
+
try {
|
|
214
|
+
const res = await this.openIM.countLocalMessages(options);
|
|
215
|
+
if (res && res.errCode === 0) return JSON.parse(res.data)?.countInfo || [];
|
|
216
|
+
else {
|
|
217
|
+
const msg = res?.errMsg || "分类获取消息数量失败";
|
|
218
|
+
return Promise.reject(msg);
|
|
219
|
+
}
|
|
220
|
+
} catch (e) {
|
|
221
|
+
console.error("分类获取消息数量失败", e);
|
|
222
|
+
return Promise.reject(e);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 指定消息置为已读
|
|
227
|
+
*/
|
|
228
|
+
async markC2CMessageAsRead(userId, msgIdList, sessionType, exMainTypeIdList) {
|
|
229
|
+
try {
|
|
230
|
+
const res = await this.openIM.markC2CMessageAsRead({
|
|
231
|
+
userID: userId,
|
|
232
|
+
msgIDList: msgIdList,
|
|
233
|
+
sessionType,
|
|
234
|
+
exMainTypeIdList
|
|
235
|
+
});
|
|
236
|
+
if (res && res.errCode === 0) return Promise.resolve();
|
|
237
|
+
else {
|
|
238
|
+
const msg = res?.errMsg || "消息置为已读失败";
|
|
239
|
+
return Promise.reject(msg);
|
|
240
|
+
}
|
|
241
|
+
} catch (e) {
|
|
242
|
+
console.error("消息置为已读失败", e);
|
|
243
|
+
return Promise.reject(e);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* 指定消息置为未读
|
|
248
|
+
*/
|
|
249
|
+
async markC2CMessageAsUnRead(userId, msgIdList, sessionType) {
|
|
250
|
+
try {
|
|
251
|
+
const res = await this.openIM.markC2CMessageAsUnRead({
|
|
252
|
+
userID: userId,
|
|
253
|
+
msgIDList: msgIdList,
|
|
254
|
+
sessionType
|
|
255
|
+
});
|
|
256
|
+
if (res && res.errCode === 0) return Promise.resolve();
|
|
257
|
+
else {
|
|
258
|
+
const msg = res?.errMsg || "消息置为未读失败";
|
|
259
|
+
return Promise.reject(msg);
|
|
260
|
+
}
|
|
261
|
+
} catch (e) {
|
|
262
|
+
console.error("消息置为未读失败", e);
|
|
263
|
+
return Promise.reject(e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* 全部消息标记已读
|
|
268
|
+
*/
|
|
269
|
+
async markAllMessageAsRead() {
|
|
270
|
+
try {
|
|
271
|
+
const res = await this.openIM.markGroupMessageAsRead({
|
|
272
|
+
groupID: "",
|
|
273
|
+
msgIDList: []
|
|
274
|
+
});
|
|
275
|
+
if (res && res.errCode === 0) return Promise.resolve();
|
|
276
|
+
else {
|
|
277
|
+
const msg = res?.errMsg || "全部消息置为已读失败";
|
|
278
|
+
return Promise.reject(msg);
|
|
279
|
+
}
|
|
280
|
+
} catch (e) {
|
|
281
|
+
console.error("全部消息置为已读失败", e);
|
|
282
|
+
return Promise.reject(e);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* 转换websocket传来的字符串消息为对象格式
|
|
287
|
+
*/
|
|
288
|
+
translateMsg(msg) {
|
|
289
|
+
try {
|
|
290
|
+
const content = JSON.parse(msg.content);
|
|
291
|
+
const data = JSON.parse(content.data);
|
|
292
|
+
const result = {
|
|
293
|
+
msgId: msg.clientMsgID,
|
|
294
|
+
isRead: msg.isRead,
|
|
295
|
+
timestamp: msg.sendTime,
|
|
296
|
+
mainTypeId: data.exMainTypeId,
|
|
297
|
+
mainTypeName: data.exMainTypeName,
|
|
298
|
+
subTypeId: data.exSubTypeId,
|
|
299
|
+
subTypeName: data.exSubTypeName,
|
|
300
|
+
exRelateId: data.exRelateId,
|
|
301
|
+
sourceId: data.exSourceId,
|
|
302
|
+
sourceName: data.exSourceName,
|
|
303
|
+
title: data.exTitle,
|
|
304
|
+
content: data.exContent,
|
|
305
|
+
senderId: data.exSenderId,
|
|
306
|
+
senderName: data.exSenderName,
|
|
307
|
+
forceRemindFlag: data.forceRemindFlag || 0,
|
|
308
|
+
bizEntryUid: data.bizEntryUid,
|
|
309
|
+
actUid: data.actUid,
|
|
310
|
+
exUniqueId: data.exUniqueId,
|
|
311
|
+
exReminderSourceId: data.exReminderSourceId,
|
|
312
|
+
exReminderTypeId: data.exReminderTypeId,
|
|
313
|
+
appCode: data.appCode,
|
|
314
|
+
exRedirectUrl: data.exRedirectUrl
|
|
315
|
+
};
|
|
316
|
+
if (data.exMainTypeId === NOTIFICATION_MSG_TYPE.SUP) result.taskId = data.taskId;
|
|
317
|
+
else if (data.exMainTypeId === NOTIFICATION_MSG_TYPE.BULLETIN) result.noticeId = data.noticeId;
|
|
318
|
+
return result;
|
|
319
|
+
} catch (e) {
|
|
320
|
+
console.error("translateMsg解析通知消息异常", e);
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* 将即时通讯聊天消息转换为通知消息的格式,方便统一处理
|
|
326
|
+
* @param msg
|
|
327
|
+
* @returns
|
|
328
|
+
*/
|
|
329
|
+
transImChatMsg(msg, options) {
|
|
330
|
+
let mainTypeName = "消息";
|
|
331
|
+
if (msg.sessionType === SessionType.Single) mainTypeName = "单聊";
|
|
332
|
+
else if (msg.sessionType === SessionType.Group) mainTypeName = "群聊";
|
|
333
|
+
return {
|
|
334
|
+
msgId: msg.clientMsgID,
|
|
335
|
+
mainTypeId: NOTIFICATION_MSG_TYPE.IM_CHAT,
|
|
336
|
+
mainTypeName,
|
|
337
|
+
content: msg.content,
|
|
338
|
+
senderName: options?.showName || msg.senderNickname,
|
|
339
|
+
messageItem: msg
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
var im = new Im();
|
|
344
|
+
/**
|
|
345
|
+
* 通过是否存在此配置来判断是否启用了融云视频功能
|
|
346
|
+
* @returns
|
|
347
|
+
*/
|
|
348
|
+
function isRongCloudVideoEnable() {
|
|
349
|
+
return !isEmptyText(window.commonSetting.MOBILE_RONGYUN_CAS_APPCODE);
|
|
350
|
+
}
|
|
351
|
+
function isRongCloudImMsg(rongCloudMsg) {
|
|
352
|
+
return rongCloudMsg?.contentType === MessageType.CUSTOMMESSAGE && rongCloudMsg?.customElem?.extension === "rongCloud";
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
export { MSG_TAB_TYPE as a, NOTIFICATION_MSG_TYPE as c, MSG_READ_STATUS as i, SYS_NOTIFICATION_SENDER_ID as l, isRongCloudVideoEnable as n, NOTIFICATION_MSG_REMINDER_FORCE_TYPE as o, im as r, NOTIFICATION_MSG_REMINDER_TYPE as s, isRongCloudImMsg as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! egova-urbanpro-web v0.0.1 */
|
|
2
|
+
//#region ../egova-urbanpro-core/src/components/linglong/condition-panel/components/cascader-filter/utils.ts
|
|
3
|
+
function getTreeMaxLayer(data) {
|
|
4
|
+
let maxLayer = 1;
|
|
5
|
+
data.forEach((item) => {
|
|
6
|
+
if (item.children) {
|
|
7
|
+
const layer = getTreeMaxLayer(item.children) + 1;
|
|
8
|
+
if (layer > maxLayer) maxLayer = layer;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return maxLayer;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { getTreeMaxLayer as t };
|
package/es/version.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"build": {
|
|
3
|
+
"time": "2026-03-30 17:22:09"
|
|
4
|
+
},
|
|
5
|
+
"web": {
|
|
6
|
+
"branch": "develop",
|
|
7
|
+
"commit": {
|
|
8
|
+
"id": "d02b31726d7e9cb2493e9ce33373254f5ad40f5d",
|
|
9
|
+
"time": "2026-03-30 16:47:44"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"core": {
|
|
13
|
+
"branch": "develop",
|
|
14
|
+
"commit": {
|
|
15
|
+
"id": "b35840b0e94618bbc2c3ea0ae436ae8c2115a779",
|
|
16
|
+
"time": "2026-03-30 16:47:34"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"extend": {
|
|
20
|
+
"branch": "develop",
|
|
21
|
+
"commit": {
|
|
22
|
+
"id": "efd29f54e0b1f941ef0460b8f2698c0641300083",
|
|
23
|
+
"time": "2026-03-27 15:10:03"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"zartui": {
|
|
27
|
+
"branch": "develop",
|
|
28
|
+
"commit": {
|
|
29
|
+
"id": "de2e9d7da07aacda60fc6635a3bf3626c310e132",
|
|
30
|
+
"time": "2026-03-27 10:47:57"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|