@cgboiler/biz-mobile 1.18.5-beta → 1.18.7
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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/org-picker/OrgPicker.d.ts +3 -3
- package/es/org-picker/OrgPicker.js +19 -5
- package/es/org-picker/_atomic.css +1 -0
- package/es/org-picker/types.d.ts +2 -2
- package/es/org-picker/useApi.d.ts +7 -7
- package/es/org-picker/useApi.js +21 -14
- package/es/org-picker/useSearch.d.ts +2 -2
- package/es/org-picker/useSearch.js +32 -21
- package/es/project-select/useApi.js +3 -6
- package/es/rich-text-editor/RichTextEditor.js +6 -61
- package/es/rich-text-editor/_atomic.css +0 -2
- package/es/rich-text-editor/index.css +0 -1
- package/es/rich-text-editor/index.less +0 -191
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/org-picker/OrgPicker.d.ts +3 -3
- package/lib/org-picker/OrgPicker.js +19 -5
- package/lib/org-picker/_atomic.css +1 -0
- package/lib/org-picker/types.d.ts +2 -2
- package/lib/org-picker/useApi.d.ts +7 -7
- package/lib/org-picker/useApi.js +20 -13
- package/lib/org-picker/useSearch.d.ts +2 -2
- package/lib/org-picker/useSearch.js +31 -20
- package/lib/project-select/useApi.js +3 -6
- package/lib/rich-text-editor/RichTextEditor.js +5 -70
- package/lib/rich-text-editor/_atomic.css +0 -2
- package/lib/rich-text-editor/index.css +0 -1
- package/lib/rich-text-editor/index.less +0 -191
- package/package.json +68 -68
package/es/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace _default {
|
|
|
8
8
|
}
|
|
9
9
|
export default _default;
|
|
10
10
|
export function install(app: any): void;
|
|
11
|
-
export const version: "1.
|
|
11
|
+
export const version: "1.18.6";
|
|
12
12
|
import MdPreview from './md-preview';
|
|
13
13
|
import OrgPicker from './org-picker';
|
|
14
14
|
import ProjectSelect from './project-select';
|
package/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import MdPreview from "./md-preview";
|
|
|
2
2
|
import OrgPicker from "./org-picker";
|
|
3
3
|
import ProjectSelect from "./project-select";
|
|
4
4
|
import RichTextEditor from "./rich-text-editor";
|
|
5
|
-
const version = "1.
|
|
5
|
+
const version = "1.18.6";
|
|
6
6
|
function install(app) {
|
|
7
7
|
const components = [
|
|
8
8
|
MdPreview,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './index.less';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: import("vue").PropType<(string
|
|
4
|
+
type: import("vue").PropType<(string)[] | null>;
|
|
5
5
|
default: () => null;
|
|
6
6
|
};
|
|
7
7
|
show: {
|
|
@@ -24,7 +24,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
24
24
|
};
|
|
25
25
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:show" | "update:modelValue")[], "update:show" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
modelValue: {
|
|
27
|
-
type: import("vue").PropType<(string
|
|
27
|
+
type: import("vue").PropType<(string)[] | null>;
|
|
28
28
|
default: () => null;
|
|
29
29
|
};
|
|
30
30
|
show: {
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
49
49
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
50
50
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
51
51
|
}>, {
|
|
52
|
-
modelValue:
|
|
52
|
+
modelValue: string[] | null;
|
|
53
53
|
show: boolean;
|
|
54
54
|
multiple: boolean;
|
|
55
55
|
autoFocus: boolean;
|
|
@@ -24,6 +24,7 @@ var stdin_default = defineComponent({
|
|
|
24
24
|
} = api;
|
|
25
25
|
getOrgList();
|
|
26
26
|
const activeTab = ref("txl");
|
|
27
|
+
const isSearchFocus = ref(false);
|
|
27
28
|
const {
|
|
28
29
|
keyword,
|
|
29
30
|
searchRef,
|
|
@@ -32,7 +33,11 @@ var stdin_default = defineComponent({
|
|
|
32
33
|
handleDeleteHistorySelect,
|
|
33
34
|
highlightText,
|
|
34
35
|
renderSearchResult
|
|
35
|
-
} = useSearch(
|
|
36
|
+
} = useSearch({
|
|
37
|
+
props,
|
|
38
|
+
api,
|
|
39
|
+
isSearchFocus
|
|
40
|
+
});
|
|
36
41
|
const selectedItems = ref([]);
|
|
37
42
|
const sortOrgList = computed(() => {
|
|
38
43
|
const departments = orgList.value.filter((item) => item.type === "dept");
|
|
@@ -78,7 +83,7 @@ var stdin_default = defineComponent({
|
|
|
78
83
|
}
|
|
79
84
|
};
|
|
80
85
|
const handleHistorySelect = (item) => {
|
|
81
|
-
selectedItems.value = item.selectedUsers;
|
|
86
|
+
selectedItems.value = item.selectedUsers.map((user) => getUserInfoById(user.id));
|
|
82
87
|
};
|
|
83
88
|
const handleConfirm = () => {
|
|
84
89
|
emit("update:show", false);
|
|
@@ -101,6 +106,12 @@ var stdin_default = defineComponent({
|
|
|
101
106
|
"modelValue": keyword.value,
|
|
102
107
|
"onUpdate:modelValue": ($event) => keyword.value = $event,
|
|
103
108
|
"placeholder": "\u641C\u7D22\u4EBA\u5458",
|
|
109
|
+
"onFocus": () => {
|
|
110
|
+
isSearchFocus.value = true;
|
|
111
|
+
},
|
|
112
|
+
"onBlur": () => {
|
|
113
|
+
isSearchFocus.value = false;
|
|
114
|
+
},
|
|
104
115
|
"class": "search-bar"
|
|
105
116
|
}, null), _createVNode("div", {
|
|
106
117
|
"class": "org-selected-items"
|
|
@@ -117,7 +128,7 @@ var stdin_default = defineComponent({
|
|
|
117
128
|
"class": "color-[#aaa] text-[14px] text-center w-full leading-[38px]"
|
|
118
129
|
}, [_createTextVNode("\u672A\u9009\u62E9\u4EBA\u5458")])]), _createVNode("div", {
|
|
119
130
|
"class": "flex-1 flex flex-col overflow-hidden relative"
|
|
120
|
-
}, [_createVNode(Tabs, {
|
|
131
|
+
}, [props.multiple ? _createVNode(Tabs, {
|
|
121
132
|
"active": activeTab.value,
|
|
122
133
|
"onUpdate:active": ($event) => activeTab.value = $event
|
|
123
134
|
}, {
|
|
@@ -128,7 +139,7 @@ var stdin_default = defineComponent({
|
|
|
128
139
|
"title": "\u6700\u8FD1\u9009\u62E9",
|
|
129
140
|
"name": "zjxz"
|
|
130
141
|
}, null)]
|
|
131
|
-
}), _createVNode("div", {
|
|
142
|
+
}) : "", _createVNode("div", {
|
|
132
143
|
"class": "org-content-wrap"
|
|
133
144
|
}, [activeTab.value === "zjxz" ? _createVNode("div", {
|
|
134
145
|
"class": "recent-list-wrap flex-1 overflow-auto px-[16px] py-[8px]"
|
|
@@ -140,7 +151,10 @@ var stdin_default = defineComponent({
|
|
|
140
151
|
"class": "py-8px border-b border-[#eee] flex items-center"
|
|
141
152
|
}, [_createVNode("span", {
|
|
142
153
|
"class": "flex-1"
|
|
143
|
-
}, [historyItem.selectedUsers.map((user) =>
|
|
154
|
+
}, [historyItem.selectedUsers.map((user) => {
|
|
155
|
+
var _a;
|
|
156
|
+
return highlightText((_a = getUserInfoById(user.id)) == null ? void 0 : _a.name, keyword.value);
|
|
157
|
+
}).reduce((prev, curr) => [prev, "\uFF0C", curr])]), _createVNode("span", {
|
|
144
158
|
"class": "p-4px pl-2",
|
|
145
159
|
"onClick": (e) => {
|
|
146
160
|
e.stopPropagation();
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
.cgx-atm .right-0{right:0rem;}
|
|
38
38
|
.cgx-atm .top-0{top:0rem;}
|
|
39
39
|
.cgx-atm .z-1{z-index:1;}
|
|
40
|
+
.cgx-atm .h-\[300px\]{height:300px;}
|
|
40
41
|
.cgx-atm .flex-1{flex:1 1 0%;}
|
|
41
42
|
.cgx-atm .overflow-auto{overflow:auto;}
|
|
42
43
|
.cgx-atm .border-b{border-bottom-width:1px;border-bottom-style:solid;}
|
package/es/org-picker/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
export interface OrgItem {
|
|
3
|
-
id: string
|
|
3
|
+
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
type: string;
|
|
6
6
|
avatar?: string;
|
|
@@ -8,7 +8,7 @@ export interface OrgItem {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const orgPickerProps: {
|
|
10
10
|
modelValue: {
|
|
11
|
-
type: PropType<(string
|
|
11
|
+
type: PropType<(string)[] | null>;
|
|
12
12
|
default: () => null;
|
|
13
13
|
};
|
|
14
14
|
show: {
|
|
@@ -2,39 +2,39 @@ import { type OrgItem, RecentSelection } from './types';
|
|
|
2
2
|
export declare const useApi: () => {
|
|
3
3
|
userList: import("vue").Ref<{
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
id: string
|
|
5
|
+
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
type: string;
|
|
8
8
|
avatar?: string | undefined;
|
|
9
9
|
}[], OrgItem[] | {
|
|
10
10
|
[x: string]: any;
|
|
11
|
-
id: string
|
|
11
|
+
id: string;
|
|
12
12
|
name: string;
|
|
13
13
|
type: string;
|
|
14
14
|
avatar?: string | undefined;
|
|
15
15
|
}[]>;
|
|
16
16
|
orgList: import("vue").Ref<{
|
|
17
17
|
[x: string]: any;
|
|
18
|
-
id: string
|
|
18
|
+
id: string;
|
|
19
19
|
name: string;
|
|
20
20
|
type: string;
|
|
21
21
|
avatar?: string | undefined;
|
|
22
22
|
}[], OrgItem[] | {
|
|
23
23
|
[x: string]: any;
|
|
24
|
-
id: string
|
|
24
|
+
id: string;
|
|
25
25
|
name: string;
|
|
26
26
|
type: string;
|
|
27
27
|
avatar?: string | undefined;
|
|
28
28
|
}[]>;
|
|
29
29
|
orgSearchList: import("vue").Ref<{
|
|
30
30
|
[x: string]: any;
|
|
31
|
-
id: string
|
|
31
|
+
id: string;
|
|
32
32
|
name: string;
|
|
33
33
|
type: string;
|
|
34
34
|
avatar?: string | undefined;
|
|
35
35
|
}[], OrgItem[] | {
|
|
36
36
|
[x: string]: any;
|
|
37
|
-
id: string
|
|
37
|
+
id: string;
|
|
38
38
|
name: string;
|
|
39
39
|
type: string;
|
|
40
40
|
avatar?: string | undefined;
|
|
@@ -55,5 +55,5 @@ export declare const useApi: () => {
|
|
|
55
55
|
searchOrgList: import("lodash-es").DebouncedFunc<(userName: string) => Promise<void>>;
|
|
56
56
|
getRecentSelectedUsers: () => Promise<RecentSelection[]>;
|
|
57
57
|
setRecentSelectedUsers: (users: OrgItem[]) => Promise<void>;
|
|
58
|
-
getUserInfoById: (id: string | number) =>
|
|
58
|
+
getUserInfoById: (id: string | number) => OrgItem | undefined;
|
|
59
59
|
};
|
package/es/org-picker/useApi.js
CHANGED
|
@@ -18,7 +18,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import { ref } from "vue";
|
|
21
|
+
import { computed, ref } from "vue";
|
|
22
22
|
import { useFetch, getUserList, getStorage, getUserInfo, removeStorage } from "@cgboiler/core";
|
|
23
23
|
import { debounce } from "lodash-es";
|
|
24
24
|
const orgListCache = /* @__PURE__ */ new Map();
|
|
@@ -33,10 +33,17 @@ const fetchData = (url, cacheKey) => __async(void 0, null, function* () {
|
|
|
33
33
|
return res;
|
|
34
34
|
});
|
|
35
35
|
const fetchOrgList = (deptId) => __async(void 0, null, function* () {
|
|
36
|
-
const url = `https://wflow.
|
|
36
|
+
const url = `https://wflow.hrbbrg.cn/v1/oa/org/tree/cloud?deptId=${deptId}&type=user`;
|
|
37
37
|
return fetchData(url, deptId || "");
|
|
38
38
|
});
|
|
39
39
|
const userList = ref([]);
|
|
40
|
+
const userMap = computed(() => {
|
|
41
|
+
const map = /* @__PURE__ */ new Map();
|
|
42
|
+
userList.value.forEach((item) => {
|
|
43
|
+
map.set(item.id, item);
|
|
44
|
+
});
|
|
45
|
+
return map;
|
|
46
|
+
});
|
|
40
47
|
function initUserList() {
|
|
41
48
|
return __async(this, null, function* () {
|
|
42
49
|
userList.value = yield getUserList();
|
|
@@ -64,14 +71,20 @@ const useApi = () => {
|
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
const list = yield fetchOrgList(currentDeptId.value);
|
|
67
|
-
orgList.value = list
|
|
74
|
+
orgList.value = list.filter((item) => {
|
|
75
|
+
var _a;
|
|
76
|
+
if (item.type === "user") {
|
|
77
|
+
return ((_a = userMap.value.get(item.id)) == null ? void 0 : _a.status) !== 5;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}) || [];
|
|
68
81
|
});
|
|
69
82
|
const searchOrgList = debounce((userName) => __async(void 0, null, function* () {
|
|
70
83
|
if (!userName) {
|
|
71
84
|
orgSearchList.value = [];
|
|
72
85
|
return;
|
|
73
86
|
}
|
|
74
|
-
const url = `https://wflow.
|
|
87
|
+
const url = `https://wflow.hrbbrg.cn/v1/oa/org/tree/user/search/cloud?userName=${userName}`;
|
|
75
88
|
orgSearchList.value = yield fetchData(url);
|
|
76
89
|
}), 300);
|
|
77
90
|
const RECENT_SELECTED_USERS_KEY = "recent_selected_users_history";
|
|
@@ -87,7 +100,7 @@ const useApi = () => {
|
|
|
87
100
|
}
|
|
88
101
|
});
|
|
89
102
|
const url = decodeURIComponent(
|
|
90
|
-
`https://wflow.
|
|
103
|
+
`https://wflow.hrbbrg.cn/v1/wflow/process/form/wf687dda91e4b027b047d4654c/data?keywords=${name}_${user.userId}&pageNo=1&pageSize=20`
|
|
91
104
|
);
|
|
92
105
|
const res = yield fetchData(url);
|
|
93
106
|
let recentList = [];
|
|
@@ -124,10 +137,10 @@ const useApi = () => {
|
|
|
124
137
|
data.field5375578403639 = JSON.stringify(list);
|
|
125
138
|
}
|
|
126
139
|
if (dataId.value) {
|
|
127
|
-
url = `https://wflow.
|
|
140
|
+
url = `https://wflow.hrbbrg.cn/v1/wflow/process/form/wf687dda91e4b027b047d4654c/data/${dataId.value}`;
|
|
128
141
|
method = "PUT";
|
|
129
142
|
} else {
|
|
130
|
-
url = "https://wflow.
|
|
143
|
+
url = "https://wflow.hrbbrg.cn/v1/wflow/process/start/4e441786-65fa-11f0-aef7-ce938f4cd78d";
|
|
131
144
|
method = "POST";
|
|
132
145
|
}
|
|
133
146
|
const token = user.token;
|
|
@@ -226,13 +239,7 @@ const useApi = () => {
|
|
|
226
239
|
}
|
|
227
240
|
});
|
|
228
241
|
const getUserInfoById = (id) => {
|
|
229
|
-
|
|
230
|
-
userList.value.forEach((item) => {
|
|
231
|
-
if (item.id === id) {
|
|
232
|
-
name = item.name;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
return name;
|
|
242
|
+
return userList.value.find((item) => item.id === id);
|
|
236
243
|
};
|
|
237
244
|
return {
|
|
238
245
|
userList,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useSearch(props
|
|
1
|
+
export declare function useSearch({ props, api, isSearchFocus }: any): {
|
|
2
2
|
keyword: import("vue").Ref<string, string>;
|
|
3
3
|
searchRef: import("vue").Ref<any, any>;
|
|
4
4
|
setRecentUsers: (users: any[]) => Promise<void>;
|
|
@@ -7,5 +7,5 @@ export declare function useSearch(props: any, api: any): {
|
|
|
7
7
|
filteredOrgList: import("vue").ComputedRef<any>;
|
|
8
8
|
recentSelectedHistory: import("vue").Ref<any[], any[]>;
|
|
9
9
|
filterRecentSelectedHistory: import("vue").Ref<any[], any[]>;
|
|
10
|
-
highlightText: (text:
|
|
10
|
+
highlightText: (text: any, keyword: string) => any;
|
|
11
11
|
};
|
|
@@ -21,8 +21,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
21
|
import { createVNode as _createVNode, Fragment as _Fragment, createTextVNode as _createTextVNode } from "vue";
|
|
22
22
|
import "./_atomic.css";
|
|
23
23
|
import { ref, computed, watch, watchEffect, nextTick } from "vue";
|
|
24
|
-
import { Empty,
|
|
25
|
-
|
|
24
|
+
import { Empty, Image } from "vant";
|
|
25
|
+
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
26
|
+
function useSearch({
|
|
27
|
+
props,
|
|
28
|
+
api,
|
|
29
|
+
isSearchFocus
|
|
30
|
+
}) {
|
|
26
31
|
const {
|
|
27
32
|
orgSearchList,
|
|
28
33
|
getOrgList,
|
|
@@ -50,7 +55,10 @@ function useSearch(props, api) {
|
|
|
50
55
|
});
|
|
51
56
|
watchEffect(() => {
|
|
52
57
|
if (keyword.value) {
|
|
53
|
-
filterRecentSelectedHistory.value = recentSelectedHistory.value.filter((item) => item.selectedUsers.some((user) => keyword.value.split("").some((char) =>
|
|
58
|
+
filterRecentSelectedHistory.value = recentSelectedHistory.value.filter((item) => item.selectedUsers.some((user) => keyword.value.split("").some((char) => {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = getUserInfoById(user.id)) == null ? void 0 : _a.name.includes(char);
|
|
61
|
+
})));
|
|
54
62
|
} else {
|
|
55
63
|
filterRecentSelectedHistory.value = recentSelectedHistory.value;
|
|
56
64
|
}
|
|
@@ -92,34 +100,37 @@ function useSearch(props, api) {
|
|
|
92
100
|
handleSelect
|
|
93
101
|
}) => {
|
|
94
102
|
return _createVNode("div", {
|
|
95
|
-
"class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1"
|
|
96
|
-
}, [filterRecentSelectedHistory.value.length ? _createVNode(_Fragment, null, [_createVNode("p", {
|
|
103
|
+
"class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1 overflow-auto"
|
|
104
|
+
}, [filterRecentSelectedHistory.value.length && props.multiple ? _createVNode(_Fragment, null, [_createVNode("p", {
|
|
97
105
|
"class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
|
|
98
106
|
}, [_createTextVNode("\u6700\u8FD1\u9009\u62E9")]), _createVNode("div", {
|
|
99
|
-
"class": "recent-list-wrap flex-1
|
|
107
|
+
"class": "recent-list-wrap flex-1 py-[8px]"
|
|
100
108
|
}, [filterRecentSelectedHistory.value.map((historyItem) => _createVNode("div", {
|
|
101
109
|
"key": historyItem.id,
|
|
102
110
|
"onClick": () => handleHistorySelect(historyItem),
|
|
103
111
|
"class": "px-16px py-8px border-b border-[#eee]"
|
|
104
|
-
}, [_createVNode("span", null, [historyItem.selectedUsers.map((user) =>
|
|
112
|
+
}, [_createVNode("span", null, [historyItem.selectedUsers.map((user) => {
|
|
113
|
+
var _a;
|
|
114
|
+
return highlightText((_a = getUserInfoById(user.id)) == null ? void 0 : _a.name, keyword.value);
|
|
115
|
+
}).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? _createVNode(_Fragment, null, [" ", _createVNode("p", {
|
|
105
116
|
"class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
|
|
106
117
|
}, [_createTextVNode("\u901A\u8BAF\u5F55")]), _createVNode("div", {
|
|
107
|
-
"class": "
|
|
118
|
+
"class": "px-16px"
|
|
108
119
|
}, [filteredOrgList.value.length === 0 ? _createVNode(Empty, {
|
|
109
120
|
"description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
|
|
110
|
-
}, null) : _createVNode(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
})
|
|
121
|
+
}, null) : _createVNode(_Fragment, null, [filteredOrgList.value.map((item) => _createVNode("div", {
|
|
122
|
+
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
123
|
+
"onClick": () => handleSelect(item)
|
|
124
|
+
}, [_createVNode(Image, {
|
|
125
|
+
"class": "org-avatar",
|
|
126
|
+
"src": item.avatar
|
|
127
|
+
}, null), _createVNode("div", {
|
|
128
|
+
"class": "org-name"
|
|
129
|
+
}, [item.name, _createVNode("span", {
|
|
130
|
+
"class": "org-item-select-icon"
|
|
131
|
+
}, [_createTextVNode("\u2713")])])]))])])]) : "", isSearchFocus.value && isMobile ? _createVNode("div", {
|
|
132
|
+
"class": "h-[300px]"
|
|
133
|
+
}, null) : ""]);
|
|
123
134
|
};
|
|
124
135
|
return {
|
|
125
136
|
keyword,
|
|
@@ -23,12 +23,9 @@ import { useFetch } from "@cgboiler/core";
|
|
|
23
23
|
const useApi = () => {
|
|
24
24
|
const projectList = ref([]);
|
|
25
25
|
const getProjectList = () => __async(void 0, null, function* () {
|
|
26
|
-
const res = yield useFetch(
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
method: "GET"
|
|
30
|
-
}
|
|
31
|
-
);
|
|
26
|
+
const res = yield useFetch("https://wx.hrbbrg.cn/v1/note/projects", {
|
|
27
|
+
method: "GET"
|
|
28
|
+
});
|
|
32
29
|
if (res == null ? void 0 : res.d) {
|
|
33
30
|
projectList.value = res.d.filter((item) => item.projectName).map((item) => {
|
|
34
31
|
return {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import "./_atomic.css";
|
|
3
|
-
import { defineComponent
|
|
4
|
-
import StarterKit from "@tiptap/starter-kit";
|
|
5
|
-
import { Editor, EditorContent } from "@tiptap/vue-3";
|
|
6
|
-
import { TableKit } from "@tiptap/extension-table";
|
|
7
|
-
import { Placeholder } from "@tiptap/extensions";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
8
4
|
import { richTextEditorProps } from "./types";
|
|
9
5
|
import "./index.css";
|
|
6
|
+
import { RichTextEditor as BasicRichTextEditor } from "@cgboiler/biz-basic";
|
|
10
7
|
var stdin_default = defineComponent({
|
|
11
8
|
name: "RichTextEditor",
|
|
12
9
|
props: richTextEditorProps,
|
|
@@ -14,62 +11,10 @@ var stdin_default = defineComponent({
|
|
|
14
11
|
setup(props, {
|
|
15
12
|
emit
|
|
16
13
|
}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
const deleteTableRow = () => {
|
|
23
|
-
var _a;
|
|
24
|
-
(_a = editor.value) == null ? void 0 : _a.chain().focus().deleteRow().run();
|
|
25
|
-
};
|
|
26
|
-
const setTextFormat = (level) => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
if (level === 0) {
|
|
29
|
-
(_a = editor.value) == null ? void 0 : _a.chain().focus().setParagraph().run();
|
|
30
|
-
} else {
|
|
31
|
-
(_b = editor.value) == null ? void 0 : _b.chain().focus().toggleHeading({
|
|
32
|
-
level
|
|
33
|
-
}).run();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const showTableButtons = ref(false);
|
|
37
|
-
onMounted(() => {
|
|
38
|
-
editor.value = new Editor({
|
|
39
|
-
extensions: [StarterKit, TableKit.configure({
|
|
40
|
-
table: {
|
|
41
|
-
resizable: true
|
|
42
|
-
}
|
|
43
|
-
}), Placeholder.configure({
|
|
44
|
-
placeholder: props.placeholder
|
|
45
|
-
})],
|
|
46
|
-
content: props.modelValue,
|
|
47
|
-
onUpdate: ({
|
|
48
|
-
editor: editor2
|
|
49
|
-
}) => {
|
|
50
|
-
const html = editor2.getHTML();
|
|
51
|
-
emit("update:modelValue", html);
|
|
52
|
-
},
|
|
53
|
-
onSelectionUpdate: ({
|
|
54
|
-
editor: editor2
|
|
55
|
-
}) => {
|
|
56
|
-
showTableButtons.value = editor2.isActive("table");
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
watch(() => props.modelValue, (newValue) => {
|
|
61
|
-
var _a, _b;
|
|
62
|
-
if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
|
|
63
|
-
(_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
onBeforeUnmount(() => {
|
|
67
|
-
var _a;
|
|
68
|
-
(_a = editor.value) == null ? void 0 : _a.destroy();
|
|
69
|
-
});
|
|
70
|
-
return () => _createVNode(EditorContent, {
|
|
71
|
-
"class": "ProseMirror",
|
|
72
|
-
"editor": editor.value
|
|
14
|
+
return () => _createVNode(BasicRichTextEditor, {
|
|
15
|
+
"modelValue": props.modelValue,
|
|
16
|
+
"onUpdate:modelValue": (val) => emit("update:modelValue", val),
|
|
17
|
+
"placeholder": props.placeholder
|
|
73
18
|
}, null);
|
|
74
19
|
}
|
|
75
20
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.ProseMirror{flex:1;overflow:auto;outline:none;line-height:1.6;font-size:var(--font-base);--white: #fff;--black: #2e2b29;--black-contrast: #110f0e;--gray-1: rgba(61, 37, 20, .05);--gray-2: rgba(61, 37, 20, .08);--gray-3: rgba(61, 37, 20, .12);--gray-4: rgba(53, 38, 28, .3);--gray-5: rgba(28, 25, 23, .6);--green: #22c55e;--purple: #6a00f5;--purple-contrast: #5800cc;--purple-light: rgba(88, 5, 255, .05);--yellow-contrast: #facc15;--yellow: rgba(250, 204, 21, .4);--yellow-light: #fffae5;--red: #ff5c33;--red-light: #ffebe5;--shadow: 0px 12px 33px 0px rgba(0, 0, 0, .06), 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)}.ProseMirror :first-child{margin-top:0}.ProseMirror ul,.ProseMirror ol{padding:0 1rem;margin:1.25rem 1rem 1.25rem .4rem}.ProseMirror ul li p,.ProseMirror ol li p{margin-top:.25em;margin-bottom:.25em}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3,.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{line-height:1.1;margin-top:2.5rem;text-wrap:pretty}.ProseMirror h1,.ProseMirror h2{margin-top:3.5rem;margin-bottom:1.5rem}.ProseMirror h1{font-size:1.4rem}.ProseMirror h2{font-size:1.2rem}.ProseMirror h3{font-size:1.1rem}.ProseMirror h4,.ProseMirror h5,.ProseMirror h6{font-size:1rem}.ProseMirror code{background-color:var(--purple-light);border-radius:.4rem;color:var(--black);font-size:.85rem;padding:.25em .3em}.ProseMirror pre{background:var(--black);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.ProseMirror pre code{background:none;color:inherit;font-size:.8rem;padding:0}.ProseMirror blockquote{border-left:3px solid var(--gray-3);margin:1.5rem 0;padding-left:1rem}.ProseMirror hr{border:none;border-top:1px solid var(--gray-2);margin:2rem 0}.ProseMirror p.is-editor-empty:first-child:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror .is-empty:before{color:var(--gray-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--gray-3);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--gray-1);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--gray-2);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:var(--purple);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ProseMirror .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}
|