@cgboiler/biz-mobile 1.11.0 → 1.13.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.
- package/es/index.d.ts +4 -2
- package/es/index.js +5 -1
- package/es/md-preview/MdPreview.d.ts +49 -0
- package/es/md-preview/MdPreview.js +59 -0
- package/es/md-preview/_atomic.css +32 -0
- package/es/md-preview/index.css +1 -0
- package/es/md-preview/index.d.ts +3 -0
- package/es/md-preview/index.js +5 -0
- package/es/md-preview/index.less +102 -0
- package/es/md-preview/style/index.d.ts +1 -0
- package/es/md-preview/style/index.js +1 -0
- package/es/md-preview/style/less.d.ts +1 -0
- package/es/md-preview/style/less.js +1 -0
- package/es/md-preview/types.d.ts +23 -0
- package/es/md-preview/types.js +24 -0
- package/es/md-preview/utils/customRules.d.ts +12 -0
- package/es/md-preview/utils/customRules.js +31 -0
- package/es/md-preview/utils/diffRenderer.d.ts +8 -0
- package/es/md-preview/utils/diffRenderer.js +24 -0
- package/es/md-preview/utils/index.d.ts +4 -0
- package/es/md-preview/utils/index.js +4 -0
- package/es/md-preview/utils/markdownRenderer.d.ts +7 -0
- package/es/md-preview/utils/markdownRenderer.js +24 -0
- package/es/md-preview/utils/typewriterEffect.d.ts +34 -0
- package/es/md-preview/utils/typewriterEffect.js +61 -0
- package/es/org-picker/OrgPicker.d.ts +4 -4
- package/es/org-picker/OrgPicker.js +16 -42
- package/es/org-picker/types.d.ts +3 -2
- package/es/org-picker/useApi.d.ts +15 -1
- package/es/org-picker/useApi.js +20 -25
- package/es/vue-sfc-shim.d.ts +3 -0
- package/lib/index.d.ts +4 -2
- package/lib/index.js +5 -1
- package/lib/md-preview/MdPreview.d.ts +49 -0
- package/lib/md-preview/MdPreview.js +76 -0
- package/lib/md-preview/_atomic.css +32 -0
- package/lib/md-preview/index.css +1 -0
- package/lib/md-preview/index.d.ts +3 -0
- package/lib/md-preview/index.js +34 -0
- package/lib/md-preview/index.less +102 -0
- package/lib/md-preview/style/index.d.ts +1 -0
- package/lib/md-preview/style/index.js +1 -0
- package/lib/md-preview/style/less.d.ts +1 -0
- package/lib/md-preview/style/less.js +1 -0
- package/lib/md-preview/types.d.ts +23 -0
- package/lib/md-preview/types.js +43 -0
- package/lib/md-preview/utils/customRules.d.ts +12 -0
- package/lib/md-preview/utils/customRules.js +50 -0
- package/lib/md-preview/utils/diffRenderer.d.ts +8 -0
- package/lib/md-preview/utils/diffRenderer.js +53 -0
- package/lib/md-preview/utils/index.d.ts +4 -0
- package/lib/md-preview/utils/index.js +20 -0
- package/lib/md-preview/utils/markdownRenderer.d.ts +7 -0
- package/lib/md-preview/utils/markdownRenderer.js +53 -0
- package/lib/md-preview/utils/typewriterEffect.d.ts +34 -0
- package/lib/md-preview/utils/typewriterEffect.js +79 -0
- package/lib/org-picker/OrgPicker.d.ts +4 -4
- package/lib/org-picker/OrgPicker.js +17 -43
- package/lib/org-picker/types.d.ts +3 -2
- package/lib/org-picker/useApi.d.ts +15 -1
- package/lib/org-picker/useApi.js +19 -24
- package/lib/vue-sfc-shim.d.ts +3 -0
- package/package.json +3 -2
- /package/es/org-picker/components/{deptImg.d.ts → DeptImg.d.ts} +0 -0
- /package/es/org-picker/components/{deptImg.js → DeptImg.js} +0 -0
- /package/lib/org-picker/components/{deptImg.d.ts → DeptImg.d.ts} +0 -0
- /package/lib/org-picker/components/{deptImg.js → DeptImg.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const customTildeRule: {
|
|
2
|
+
name: string;
|
|
3
|
+
level: string;
|
|
4
|
+
start(src: string): number;
|
|
5
|
+
tokenizer(src: string): {
|
|
6
|
+
type: string;
|
|
7
|
+
raw: string;
|
|
8
|
+
text: string;
|
|
9
|
+
} | undefined;
|
|
10
|
+
renderer(token: any): any;
|
|
11
|
+
};
|
|
12
|
+
export declare const initMarked: () => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
customTildeRule: () => customTildeRule,
|
|
21
|
+
initMarked: () => initMarked
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_marked = require("marked");
|
|
25
|
+
const customTildeRule = {
|
|
26
|
+
name: "customTilde",
|
|
27
|
+
level: "inline",
|
|
28
|
+
start(src) {
|
|
29
|
+
return src.indexOf("~");
|
|
30
|
+
},
|
|
31
|
+
tokenizer(src) {
|
|
32
|
+
const rule = /^~([^~]+)~/;
|
|
33
|
+
const match = src.match(rule);
|
|
34
|
+
if (match) {
|
|
35
|
+
return {
|
|
36
|
+
type: "customTilde",
|
|
37
|
+
raw: match[0],
|
|
38
|
+
text: match[0]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
renderer(token) {
|
|
43
|
+
return token.text;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const initMarked = () => {
|
|
47
|
+
import_marked.marked.use({
|
|
48
|
+
extensions: [customTildeRule]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
generateDiffHtml: () => generateDiffHtml
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
+
var DiffMatchPatch = __toESM(require("diff-match-patch"));
|
|
34
|
+
const generateDiffHtml = (previousText, currentText, fallbackHtml) => {
|
|
35
|
+
if (!previousText && !currentText)
|
|
36
|
+
return fallbackHtml;
|
|
37
|
+
const dmp = new DiffMatchPatch.diff_match_patch();
|
|
38
|
+
const diffs = dmp.diff_main(previousText, currentText);
|
|
39
|
+
dmp.diff_cleanupSemantic(diffs);
|
|
40
|
+
let html = '<div class="diff-unified-view"><pre>';
|
|
41
|
+
diffs.forEach(([type, text]) => {
|
|
42
|
+
const escapedText = text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br>");
|
|
43
|
+
if (type === 0) {
|
|
44
|
+
html += `<span class="diff-equal">${escapedText}</span>`;
|
|
45
|
+
} else if (type === -1) {
|
|
46
|
+
html += `<span class="diff-delete">${escapedText}</span>`;
|
|
47
|
+
} else if (type === 1) {
|
|
48
|
+
html += `<span class="diff-insert">${escapedText}</span>`;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
html += "</pre></div>";
|
|
52
|
+
return html;
|
|
53
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var stdin_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
17
|
+
__reExport(stdin_exports, require("./customRules"), module.exports);
|
|
18
|
+
__reExport(stdin_exports, require("./markdownRenderer"), module.exports);
|
|
19
|
+
__reExport(stdin_exports, require("./diffRenderer"), module.exports);
|
|
20
|
+
__reExport(stdin_exports, require("./typewriterEffect"), module.exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
renderMarkdown: () => renderMarkdown
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
+
var import_marked = require("marked");
|
|
34
|
+
var katex = __toESM(require("katex"));
|
|
35
|
+
var import_katex_min = require("katex/dist/katex.min.css");
|
|
36
|
+
const renderMarkdown = (text) => {
|
|
37
|
+
const processedText = (text || "").replace(/(\$\$[\s\S]+?\$\$|\$[^\$\n]+?\$)/g, (match) => {
|
|
38
|
+
return `@@MATH_FORMULA@@${encodeURIComponent(match)}@@`;
|
|
39
|
+
}).replace(/<\/?(pre|code)(\s[^>]*)?>/g, "").replace(/```markdown|```/g, "").replace(/(.*)```$/gm, "$1");
|
|
40
|
+
let renderedContent = (0, import_marked.marked)(processedText);
|
|
41
|
+
renderedContent = renderedContent.replace(/@@MATH_FORMULA@@([^@]+)@@/g, (_, encoded) => {
|
|
42
|
+
const formula = decodeURIComponent(encoded);
|
|
43
|
+
const isBlock = formula.startsWith("$$") && formula.endsWith("$$");
|
|
44
|
+
const tex = isBlock ? formula.slice(2, -2).trim() : formula.slice(1, -1).trim();
|
|
45
|
+
const html = katex.renderToString(tex, {
|
|
46
|
+
displayMode: isBlock,
|
|
47
|
+
throwOnError: false,
|
|
48
|
+
strict: false
|
|
49
|
+
});
|
|
50
|
+
return isBlock ? `<div class="katex-block">${html}</div>` : html;
|
|
51
|
+
});
|
|
52
|
+
return renderedContent.replace(/<a\s/g, '<a target="_blank" ');
|
|
53
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 打字机效果控制器
|
|
4
|
+
*/
|
|
5
|
+
export declare class TypewriterController {
|
|
6
|
+
private currentText;
|
|
7
|
+
private typingTimer;
|
|
8
|
+
private onComplete;
|
|
9
|
+
/**
|
|
10
|
+
* 构造函数
|
|
11
|
+
* @param currentText 当前文本的响应式引用
|
|
12
|
+
* @param onComplete 打字完成时的回调函数
|
|
13
|
+
*/
|
|
14
|
+
constructor(currentText: Ref<string>, onComplete: () => void);
|
|
15
|
+
/**
|
|
16
|
+
* 开始打字机效果
|
|
17
|
+
* @param fullContent 完整的内容
|
|
18
|
+
* @param speed 打字速度(毫秒)
|
|
19
|
+
*/
|
|
20
|
+
start(fullContent: string, speed?: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* 停止打字机效果
|
|
23
|
+
*/
|
|
24
|
+
stop(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 创建打字机效果控制器
|
|
28
|
+
* @param onComplete 打字完成时的回调函数
|
|
29
|
+
* @returns 打字机控制器和当前文本的引用
|
|
30
|
+
*/
|
|
31
|
+
export declare const useTypewriter: (onComplete: () => void) => {
|
|
32
|
+
currentText: Ref<string, string>;
|
|
33
|
+
controller: TypewriterController;
|
|
34
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __publicField = (obj, key, value) => {
|
|
20
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var stdin_exports = {};
|
|
24
|
+
__export(stdin_exports, {
|
|
25
|
+
TypewriterController: () => TypewriterController,
|
|
26
|
+
useTypewriter: () => useTypewriter
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
29
|
+
var import_vue = require("vue");
|
|
30
|
+
class TypewriterController {
|
|
31
|
+
/**
|
|
32
|
+
* 构造函数
|
|
33
|
+
* @param currentText 当前文本的响应式引用
|
|
34
|
+
* @param onComplete 打字完成时的回调函数
|
|
35
|
+
*/
|
|
36
|
+
constructor(currentText, onComplete) {
|
|
37
|
+
__publicField(this, "currentText");
|
|
38
|
+
__publicField(this, "typingTimer", null);
|
|
39
|
+
__publicField(this, "onComplete");
|
|
40
|
+
this.currentText = currentText;
|
|
41
|
+
this.onComplete = onComplete;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 开始打字机效果
|
|
45
|
+
* @param fullContent 完整的内容
|
|
46
|
+
* @param speed 打字速度(毫秒)
|
|
47
|
+
*/
|
|
48
|
+
start(fullContent, speed = 5) {
|
|
49
|
+
this.stop();
|
|
50
|
+
this.currentText.value = "";
|
|
51
|
+
let index = 0;
|
|
52
|
+
this.typingTimer = window.setInterval(() => {
|
|
53
|
+
if (index < fullContent.length) {
|
|
54
|
+
this.currentText.value = fullContent.slice(0, index + 1);
|
|
55
|
+
index++;
|
|
56
|
+
} else {
|
|
57
|
+
this.stop();
|
|
58
|
+
this.onComplete();
|
|
59
|
+
}
|
|
60
|
+
}, speed);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 停止打字机效果
|
|
64
|
+
*/
|
|
65
|
+
stop() {
|
|
66
|
+
if (this.typingTimer) {
|
|
67
|
+
clearInterval(this.typingTimer);
|
|
68
|
+
this.typingTimer = null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const useTypewriter = (onComplete) => {
|
|
73
|
+
const currentText = (0, import_vue.ref)("");
|
|
74
|
+
const controller = new TypewriterController(currentText, onComplete);
|
|
75
|
+
return {
|
|
76
|
+
currentText,
|
|
77
|
+
controller
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -17,10 +17,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
default: boolean;
|
|
18
18
|
};
|
|
19
19
|
'onUpdate:modelValue': {
|
|
20
|
-
type:
|
|
20
|
+
type: FunctionConstructor;
|
|
21
21
|
};
|
|
22
22
|
'onUpdate:show': {
|
|
23
|
-
type:
|
|
23
|
+
type: FunctionConstructor;
|
|
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: {
|
|
@@ -40,10 +40,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
40
40
|
default: boolean;
|
|
41
41
|
};
|
|
42
42
|
'onUpdate:modelValue': {
|
|
43
|
-
type:
|
|
43
|
+
type: FunctionConstructor;
|
|
44
44
|
};
|
|
45
45
|
'onUpdate:show': {
|
|
46
|
-
type:
|
|
46
|
+
type: FunctionConstructor;
|
|
47
47
|
};
|
|
48
48
|
}>> & Readonly<{
|
|
49
49
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -54,7 +54,7 @@ var import_vue = require("vue");
|
|
|
54
54
|
var import_atomic = require("./_atomic.css");
|
|
55
55
|
var import_vue2 = require("vue");
|
|
56
56
|
var import_vant = require("vant");
|
|
57
|
-
var
|
|
57
|
+
var import_DeptImg = __toESM(require("./components/DeptImg"));
|
|
58
58
|
var import_types = require("./types");
|
|
59
59
|
var import_useApi = require("./useApi");
|
|
60
60
|
var import_index = require("./index.css");
|
|
@@ -76,18 +76,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
76
76
|
getOrgList();
|
|
77
77
|
const selectedItems = (0, import_vue2.ref)([]);
|
|
78
78
|
(0, import_vue2.watch)(() => props.modelValue, (newValue) => {
|
|
79
|
+
var _a;
|
|
79
80
|
if (!newValue) {
|
|
80
81
|
selectedItems.value = [];
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}, 500);
|
|
84
|
+
if ((_a = userList.value) == null ? void 0 : _a.length) {
|
|
85
|
+
selectedItems.value = newValue.map((id) => {
|
|
86
|
+
return userList.value.find((item) => item.id === id);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
91
89
|
}, {
|
|
92
90
|
immediate: true
|
|
93
91
|
});
|
|
@@ -97,13 +95,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
97
95
|
return;
|
|
98
96
|
}
|
|
99
97
|
if (props.multiple) {
|
|
100
|
-
const
|
|
101
|
-
const index = currentValue.findIndex((s) => s.id === item.id);
|
|
98
|
+
const index = selectedItems.value.findIndex((s) => s.id === item.id);
|
|
102
99
|
if (index > -1) {
|
|
103
|
-
|
|
104
|
-
selectedItems.value = selectedItems.value.filter((selected) => selected.id !== item.id);
|
|
100
|
+
selectedItems.value.splice(index, 1);
|
|
105
101
|
} else {
|
|
106
|
-
currentValue.push(item.id);
|
|
107
102
|
selectedItems.value.push(item);
|
|
108
103
|
}
|
|
109
104
|
} else {
|
|
@@ -121,12 +116,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
121
116
|
const finished = (0, import_vue2.ref)(true);
|
|
122
117
|
const searchRef = (0, import_vue2.ref)();
|
|
123
118
|
(0, import_vue2.watch)(() => props.show, (newVal) => __async(this, null, function* () {
|
|
119
|
+
var _a;
|
|
124
120
|
if (newVal && props.autoFocus) {
|
|
125
121
|
yield (0, import_vue2.nextTick)();
|
|
126
|
-
|
|
127
|
-
var _a;
|
|
128
|
-
(_a = searchRef.value) == null ? void 0 : _a.focus();
|
|
129
|
-
}, 300);
|
|
122
|
+
(_a = searchRef.value) == null ? void 0 : _a.focus();
|
|
130
123
|
}
|
|
131
124
|
}));
|
|
132
125
|
(0, import_vue2.watch)(keyword, (newKeyword) => {
|
|
@@ -145,9 +138,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
145
138
|
return [...personnel, ...departments];
|
|
146
139
|
});
|
|
147
140
|
const isSelected = (item) => {
|
|
148
|
-
|
|
149
|
-
return false;
|
|
150
|
-
return selectedItems.value.find((s) => s.id === item.id);
|
|
141
|
+
return selectedItems.value.some((s) => s.id === item.id);
|
|
151
142
|
};
|
|
152
143
|
const onLoad = () => {
|
|
153
144
|
finished.value = true;
|
|
@@ -180,8 +171,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
180
171
|
"class": "separator"
|
|
181
172
|
}, [(0, import_vue.createTextVNode)(" / ")])]))]), (0, import_vue.createVNode)("div", {
|
|
182
173
|
"class": "feed-list-wrap"
|
|
183
|
-
}, [
|
|
184
|
-
"description": "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
|
|
174
|
+
}, [filteredOrgList.value.length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
|
|
175
|
+
"description": keyword.value ? "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458" : "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
|
|
185
176
|
}, null) : (0, import_vue.createVNode)(import_vant.List, {
|
|
186
177
|
"loading": loading.value,
|
|
187
178
|
"finished": finished.value,
|
|
@@ -190,32 +181,15 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
190
181
|
default: () => [filteredOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
|
|
191
182
|
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
192
183
|
"onClick": () => handleSelect(item)
|
|
193
|
-
}, [item.type === "dept" ? (0, import_vue.createVNode)("div", {
|
|
184
|
+
}, [item.type === "dept" && !keyword.value ? (0, import_vue.createVNode)("div", {
|
|
194
185
|
"class": "org-avatar"
|
|
195
|
-
}, [(0, import_vue.createVNode)(
|
|
196
|
-
"class": "org-avatar",
|
|
197
|
-
"src": item.avatar
|
|
198
|
-
}, null), (0, import_vue.createVNode)("div", {
|
|
199
|
-
"class": "org-name"
|
|
200
|
-
}, [item.name])]))]
|
|
201
|
-
}), keyword.value && (0, import_vue.createVNode)(import_vant.List, {
|
|
202
|
-
"loading": loading.value,
|
|
203
|
-
"finished": finished.value,
|
|
204
|
-
"onLoad": onLoad,
|
|
205
|
-
"class": "search-result-list"
|
|
206
|
-
}, {
|
|
207
|
-
default: () => [filteredOrgList.value.filter((item) => item.type !== "dept").map((item) => (0, import_vue.createVNode)("div", {
|
|
208
|
-
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
209
|
-
"onClick": () => handleSelect(item)
|
|
210
|
-
}, [(0, import_vue.createVNode)(import_vant.Image, {
|
|
186
|
+
}, [(0, import_vue.createVNode)(import_DeptImg.default, null, null)]) : (0, import_vue.createVNode)(import_vant.Image, {
|
|
211
187
|
"class": "org-avatar",
|
|
212
188
|
"src": item.avatar
|
|
213
189
|
}, null), (0, import_vue.createVNode)("div", {
|
|
214
190
|
"class": "org-name"
|
|
215
191
|
}, [item.name])]))]
|
|
216
|
-
}),
|
|
217
|
-
"class": "empty-search-result"
|
|
218
|
-
}, [(0, import_vue.createTextVNode)("\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458")])]), props.multiple && (0, import_vue.createVNode)("div", {
|
|
192
|
+
})]), props.multiple && (0, import_vue.createVNode)("div", {
|
|
219
193
|
"class": "bottom-section"
|
|
220
194
|
}, [selectedItems.value.length > 0 && (0, import_vue.createVNode)("div", {
|
|
221
195
|
"class": "selected-items"
|
|
@@ -4,6 +4,7 @@ export interface OrgItem {
|
|
|
4
4
|
name: string;
|
|
5
5
|
type: string;
|
|
6
6
|
avatar?: string;
|
|
7
|
+
[x: string]: any;
|
|
7
8
|
}
|
|
8
9
|
export declare const orgPickerProps: {
|
|
9
10
|
modelValue: {
|
|
@@ -23,10 +24,10 @@ export declare const orgPickerProps: {
|
|
|
23
24
|
default: boolean;
|
|
24
25
|
};
|
|
25
26
|
'onUpdate:modelValue': {
|
|
26
|
-
type:
|
|
27
|
+
type: FunctionConstructor;
|
|
27
28
|
};
|
|
28
29
|
'onUpdate:show': {
|
|
29
|
-
type:
|
|
30
|
+
type: FunctionConstructor;
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
33
|
export type OrgPickerProps = ExtractPropTypes<typeof orgPickerProps>;
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import { type OrgItem } from './types';
|
|
2
2
|
export declare const useApi: () => {
|
|
3
|
-
userList: import("vue").Ref<
|
|
3
|
+
userList: import("vue").Ref<{
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
id: string | number;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
avatar?: string | undefined;
|
|
9
|
+
}[], OrgItem[] | {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
id: string | number;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
avatar?: string | undefined;
|
|
15
|
+
}[]>;
|
|
4
16
|
orgList: import("vue").Ref<{
|
|
17
|
+
[x: string]: any;
|
|
5
18
|
id: string | number;
|
|
6
19
|
name: string;
|
|
7
20
|
type: string;
|
|
8
21
|
avatar?: string | undefined;
|
|
9
22
|
}[], OrgItem[] | {
|
|
23
|
+
[x: string]: any;
|
|
10
24
|
id: string | number;
|
|
11
25
|
name: string;
|
|
12
26
|
type: string;
|
package/lib/org-picker/useApi.js
CHANGED
|
@@ -44,27 +44,27 @@ var import_vue = require("vue");
|
|
|
44
44
|
var import_core = require("@cgboiler/core");
|
|
45
45
|
var import_lodash_es = require("lodash-es");
|
|
46
46
|
const orgListCache = /* @__PURE__ */ new Map();
|
|
47
|
-
const
|
|
48
|
-
if (orgListCache.has(
|
|
49
|
-
return orgListCache.get(
|
|
47
|
+
const fetchData = (url, cacheKey) => __async(void 0, null, function* () {
|
|
48
|
+
if (cacheKey && orgListCache.has(cacheKey)) {
|
|
49
|
+
return orgListCache.get(cacheKey);
|
|
50
|
+
}
|
|
51
|
+
const res = (yield (0, import_core.useFetch)(url, { method: "GET" })) || [];
|
|
52
|
+
if (cacheKey) {
|
|
53
|
+
orgListCache.set(cacheKey, res);
|
|
50
54
|
}
|
|
51
|
-
const res = (yield (0, import_core.useFetch)(
|
|
52
|
-
`https://wflow.cgboiler.com/v1/oa/org/tree/cloud?deptId=${deptId}&type=user`,
|
|
53
|
-
{
|
|
54
|
-
method: "GET"
|
|
55
|
-
}
|
|
56
|
-
)) || [];
|
|
57
|
-
orgListCache.set(deptId || "", res);
|
|
58
55
|
return res;
|
|
59
56
|
});
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
method: "GET"
|
|
64
|
-
})) || [];
|
|
65
|
-
userList.value = res;
|
|
57
|
+
const fetchOrgList = (deptId) => __async(void 0, null, function* () {
|
|
58
|
+
const url = `https://wflow.cgboiler.com/v1/oa/org/tree/cloud?deptId=${deptId}&type=user`;
|
|
59
|
+
return fetchData(url, deptId || "");
|
|
66
60
|
});
|
|
67
|
-
|
|
61
|
+
const userList = (0, import_vue.ref)([]);
|
|
62
|
+
function initUserList() {
|
|
63
|
+
return __async(this, null, function* () {
|
|
64
|
+
userList.value = yield (0, import_core.getUserList)();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
initUserList();
|
|
68
68
|
const useApi = () => {
|
|
69
69
|
const orgList = (0, import_vue.ref)([]);
|
|
70
70
|
const currentDeptId = (0, import_vue.ref)("1");
|
|
@@ -90,13 +90,8 @@ const useApi = () => {
|
|
|
90
90
|
orgList.value = [];
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
method: "GET"
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
orgList.value = res || [];
|
|
93
|
+
const url = `https://wflow.cgboiler.com/v1/oa/org/tree/user/search/cloud?userName=${userName}`;
|
|
94
|
+
orgList.value = yield fetchData(url);
|
|
100
95
|
}), 300);
|
|
101
96
|
return {
|
|
102
97
|
userList,
|
package/lib/vue-sfc-shim.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgboiler/biz-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"lodash-es": "^4.17.21",
|
|
46
46
|
"vant": "^4.9.19",
|
|
47
|
-
"@cgboiler/core": "1.1
|
|
47
|
+
"@cgboiler/core": "1.2.1",
|
|
48
|
+
"@cgboiler/share": "1.0.0"
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
50
51
|
"dev": "cg-cli dev",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|