ol-base-components 3.4.5 → 3.4.6

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 (64) hide show
  1. package/dist/index.mjs +7105 -0
  2. package/dist/index.umd.js +1 -0
  3. package/dist/style.css +1 -0
  4. package/package.json +18 -4
  5. package/.eslintrc +0 -59
  6. package/.github/deploy.yml +0 -81
  7. package/.prettierignore +0 -6
  8. package/.prettierrc +0 -13
  9. package/.trae/rules/project.md +0 -2
  10. package/babel.config.js +0 -5
  11. package/jsconfig.json +0 -19
  12. package/readme1.md +0 -164
  13. package/src/App.vue +0 -932
  14. package/src/assets/Snipaste_2025-09-03_14-30-49.png +0 -0
  15. package/src/assets/api.png +0 -0
  16. package/src/assets/css/iconfont.css +0 -342
  17. package/src/assets/duojibiaotou.png +0 -0
  18. package/src/assets/effectPicture.png +0 -0
  19. package/src/assets/generator0.png +0 -0
  20. package/src/assets/generator1.png +0 -0
  21. package/src/assets/generator2.png +0 -0
  22. package/src/assets/icon/printModel.svg +0 -1
  23. package/src/assets/init.png +0 -0
  24. package/src/assets/logo.png +0 -0
  25. package/src/assets/olBaseComponentsLogo.svg +0 -100
  26. package/src/assets/print.svg +0 -1
  27. package/src/assets/run.png +0 -0
  28. package/src/assets/vscodecj.png +0 -0
  29. package/src/bin/initTemplate.js +0 -409
  30. package/src/bin/news.js +0 -171
  31. package/src/bin/openCloseloop.js +0 -154
  32. package/src/bin/openLoop.js +0 -154
  33. package/src/main.js +0 -13
  34. package/src/package/customSearch/index.js +0 -7
  35. package/src/package/customSearch/src/index.vue +0 -120
  36. package/src/package/dialog/index.js +0 -7
  37. package/src/package/dialog/src/index.vue +0 -419
  38. package/src/package/form/index.js +0 -7
  39. package/src/package/form/src/index.vue +0 -405
  40. package/src/package/formSearch/index.js +0 -7
  41. package/src/package/formSearch/src/components/SearchConfigDialog.vue +0 -957
  42. package/src/package/formSearch/src/index.js +0 -29
  43. package/src/package/formSearch/src/index.vue +0 -928
  44. package/src/package/index.js +0 -243
  45. package/src/package/numberRange/index.js +0 -7
  46. package/src/package/numberRange/src/index.vue +0 -351
  47. package/src/package/print/index.js +0 -76
  48. package/src/package/print/src/components/PaperSelector.vue +0 -109
  49. package/src/package/print/src/index.vue +0 -622
  50. package/src/package/print/src/provide/provider1.js +0 -215
  51. package/src/package/printModel/index.js +0 -7
  52. package/src/package/printModel/src/index.vue +0 -493
  53. package/src/package/table/index.js +0 -12
  54. package/src/package/table/src/TableColumn.vue +0 -77
  55. package/src/package/table/src/components/PrintTemplateSelector.vue +0 -210
  56. package/src/package/table/src/index.vue +0 -945
  57. package/src/package/table/src/nodata.jpg +0 -0
  58. package/src/package/table/src/printTable.vue +0 -196
  59. package/src/utils/getEnum.js +0 -8
  60. package/src/utils/initData.js +0 -138
  61. package/vue.config.js +0 -21
  62. /package/{public → dist}/favicon.ico +0 -0
  63. /package/{public → dist}/index.html +0 -0
  64. /package/{public → dist}/print-lock.css +0 -0
@@ -1,154 +0,0 @@
1
- // open-close-loop.js
2
- // 循环“打开→停留→关闭→间隔”的浏览器控制脚本(Windows)
3
- // 优先使用指定的 Chrome 路径独立进程(只关闭本次打开窗口);否则使用默认浏览器并通过进程名强关(会关闭该浏览器所有窗口)。
4
-
5
- const { spawn, exec, execSync } = require("child_process");
6
- const fs = require("fs");
7
- const path = require("path");
8
- const os = require("os");
9
-
10
- const COUNT = 0; // 循环次数;0 表示无限循环
11
- const MODE = "headless"; // headless|minimized|default headless:无头模式浏览器在后台运行,不显示窗口/minimized:最小化模式浏览器启动后立即最小化到任务栏/default:默认模式正常显示浏览器窗口
12
- // 支持多页面:同一轮“同时打开,同时关闭”
13
- const URLS = ["https://juejin.cn/post/7542083098738475059"];
14
- const OPEN_MS = 10000; // 打开停留时间
15
- const CLOSE_MS = 1000; // 关闭后间隔
16
- const BROWSER_PROC = "chrome.exe"; // 默认浏览器进程名(默认浏览器模式会强关所有该进程窗口)
17
- const CHROME_PATH = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
18
-
19
- const sleep = ms => new Promise(r => setTimeout(r, ms));
20
-
21
- const isWin = process.platform === "win32";
22
- if (!isWin) {
23
- console.error("当前脚本仅适配 Windows。");
24
- process.exit(1);
25
- }
26
-
27
- // 判断文件是否存在
28
- function fileExists(file) {
29
- try {
30
- fs.accessSync(file, fs.constants.X_OK | fs.constants.F_OK);
31
- return true;
32
- } catch {
33
- return false;
34
- }
35
- }
36
-
37
- // 创建临时profile,避免复用已开 Chrome 实例
38
- function makeTempProfile() {
39
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), "chrome-prof-"));
40
- return dir;
41
- }
42
-
43
- // 优雅关闭与清理(单实例变量)
44
- let currentProc = null;
45
- let currentProfile = null;
46
-
47
- async function cleanup() {
48
- try {
49
- if (currentProc && !currentProc.killed) {
50
- try {
51
- currentProc.kill();
52
- } catch {}
53
- try {
54
- execSync(`taskkill /PID ${currentProc.pid} /T /F`, { stdio: "ignore" });
55
- } catch {}
56
- }
57
- } catch {}
58
- currentProc = null;
59
-
60
- if (currentProfile) {
61
- try {
62
- fs.rmSync(currentProfile, { recursive: true, force: true });
63
- } catch {}
64
- currentProfile = null;
65
- }
66
- }
67
-
68
- process.on("SIGINT", async () => {
69
- await cleanup();
70
- process.exit(0);
71
- });
72
- process.on("SIGTERM", async () => {
73
- await cleanup();
74
- process.exit(0);
75
- });
76
-
77
- // Chrome 独立进程:同一轮“并发打开→停留→并发关闭并清理”
78
- async function openWithChromeLoop() {
79
- const loops = COUNT > 0 ? COUNT : Infinity;
80
- for (let i = 0; i < loops; i++) {
81
- const procs = [];
82
- const profiles = [];
83
-
84
- for (const url of URLS) {
85
- const prof = makeTempProfile();
86
- profiles.push(prof);
87
- const args = [
88
- "--new-window",
89
- `--user-data-dir=${prof}`,
90
- "--no-first-run",
91
- "--no-default-browser-check",
92
- ...(MODE === "headless" ? ["--headless=new", "--disable-gpu", "--hide-scrollbars"] : []),
93
- ...(MODE === "minimized" ? ["--start-minimized", "--window-size=1,1"] : []),
94
- url,
95
- ];
96
- const p = spawn(CHROME_PATH, args, { stdio: "ignore" });
97
- procs.push(p);
98
- }
99
-
100
- await sleep(OPEN_MS);
101
-
102
- // 并发关闭刚打开的所有 Chrome 进程
103
- for (const p of procs) {
104
- try {
105
- p.kill();
106
- } catch {}
107
- try {
108
- execSync(`taskkill /PID ${p.pid} /T /F`, { stdio: "ignore" });
109
- } catch {}
110
- }
111
- // 清理对应临时 profile
112
- for (const prof of profiles) {
113
- try {
114
- fs.rmSync(prof, { recursive: true, force: true });
115
- } catch {}
116
- }
117
-
118
- await sleep(CLOSE_MS);
119
- }
120
- await cleanup();
121
- process.exit(0);
122
- }
123
-
124
- // 默认浏览器:同一轮“并发打开→停留→一次性强关该进程所有窗口”
125
- async function openWithDefaultBrowserLoop() {
126
- const loops = COUNT > 0 ? COUNT : Infinity;
127
- for (let i = 0; i < loops; i++) {
128
- for (const url of URLS) {
129
- const startArgs =
130
- MODE === "minimized" ? ["/c", "start", "/min", "", url] : ["/c", "start", "", url];
131
- spawn("cmd", startArgs, { detached: true, stdio: "ignore" }).unref();
132
- }
133
-
134
- await sleep(OPEN_MS);
135
-
136
- // 一次性结束该浏览器所有窗口(注意:这会关闭同类浏览器的所有窗口)
137
- exec(`taskkill /IM ${BROWSER_PROC} /F`, () => {});
138
- await sleep(CLOSE_MS);
139
- }
140
- await cleanup();
141
- process.exit(0);
142
- }
143
-
144
- (async function main() {
145
- const useChrome = fileExists(CHROME_PATH);
146
- if (useChrome) {
147
- await openWithChromeLoop();
148
- } else {
149
- console.warn(
150
- `未找到 Chrome:${CHROME_PATH},将使用默认浏览器并通过进程名(${BROWSER_PROC})强制关闭。`
151
- );
152
- await openWithDefaultBrowserLoop();
153
- }
154
- })();
@@ -1,154 +0,0 @@
1
- // open-close-loop.js
2
- // 循环“打开→停留→关闭→间隔”的浏览器控制脚本(Windows)
3
- // 优先使用指定的 Chrome 路径独立进程(只关闭本次打开窗口);否则使用默认浏览器并通过进程名强关(会关闭该浏览器所有窗口)。
4
-
5
- const { spawn, exec, execSync } = require("child_process");
6
- const fs = require("fs");
7
- const path = require("path");
8
- const os = require("os");
9
-
10
- const COUNT = 0; // 循环次数;0 表示无限循环
11
- const MODE = process.env.MODE || "headless"; // headless|minimized|default
12
- // 支持多页面:同一轮“同时打开,同时关闭”
13
- const URLS = ["https://juejin.cn/post/7496406694357516303"];
14
- const OPEN_MS = 3000; // 打开停留时间
15
- const CLOSE_MS = 1000; // 关闭后间隔
16
- const BROWSER_PROC = "chrome.exe"; // 默认浏览器进程名(默认浏览器模式会强关所有该进程窗口)
17
- const CHROME_PATH = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
18
-
19
- const sleep = ms => new Promise(r => setTimeout(r, ms));
20
-
21
- const isWin = process.platform === "win32";
22
- if (!isWin) {
23
- console.error("当前脚本仅适配 Windows。");
24
- process.exit(1);
25
- }
26
-
27
- // 判断文件是否存在
28
- function fileExists(file) {
29
- try {
30
- fs.accessSync(file, fs.constants.X_OK | fs.constants.F_OK);
31
- return true;
32
- } catch {
33
- return false;
34
- }
35
- }
36
-
37
- // 创建临时profile,避免复用已开 Chrome 实例
38
- function makeTempProfile() {
39
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), "chrome-prof-"));
40
- return dir;
41
- }
42
-
43
- // 优雅关闭与清理(单实例变量)
44
- let currentProc = null;
45
- let currentProfile = null;
46
-
47
- async function cleanup() {
48
- try {
49
- if (currentProc && !currentProc.killed) {
50
- try {
51
- currentProc.kill();
52
- } catch {}
53
- try {
54
- execSync(`taskkill /PID ${currentProc.pid} /T /F`, { stdio: "ignore" });
55
- } catch {}
56
- }
57
- } catch {}
58
- currentProc = null;
59
-
60
- if (currentProfile) {
61
- try {
62
- fs.rmSync(currentProfile, { recursive: true, force: true });
63
- } catch {}
64
- currentProfile = null;
65
- }
66
- }
67
-
68
- process.on("SIGINT", async () => {
69
- await cleanup();
70
- process.exit(0);
71
- });
72
- process.on("SIGTERM", async () => {
73
- await cleanup();
74
- process.exit(0);
75
- });
76
-
77
- // Chrome 独立进程:同一轮“并发打开→停留→并发关闭并清理”
78
- async function openWithChromeLoop() {
79
- const loops = COUNT > 0 ? COUNT : Infinity;
80
- for (let i = 0; i < loops; i++) {
81
- const procs = [];
82
- const profiles = [];
83
-
84
- for (const url of URLS) {
85
- const prof = makeTempProfile();
86
- profiles.push(prof);
87
- const args = [
88
- "--new-window",
89
- `--user-data-dir=${prof}`,
90
- "--no-first-run",
91
- "--no-default-browser-check",
92
- ...(MODE === "headless" ? ["--headless=new", "--disable-gpu", "--hide-scrollbars"] : []),
93
- ...(MODE === "minimized" ? ["--start-minimized", "--window-size=1,1"] : []),
94
- url,
95
- ];
96
- const p = spawn(CHROME_PATH, args, { stdio: "ignore" });
97
- procs.push(p);
98
- }
99
-
100
- await sleep(OPEN_MS);
101
-
102
- // 并发关闭刚打开的所有 Chrome 进程
103
- for (const p of procs) {
104
- try {
105
- p.kill();
106
- } catch {}
107
- try {
108
- execSync(`taskkill /PID ${p.pid} /T /F`, { stdio: "ignore" });
109
- } catch {}
110
- }
111
- // 清理对应临时 profile
112
- for (const prof of profiles) {
113
- try {
114
- fs.rmSync(prof, { recursive: true, force: true });
115
- } catch {}
116
- }
117
-
118
- await sleep(CLOSE_MS);
119
- }
120
- await cleanup();
121
- process.exit(0);
122
- }
123
-
124
- // 默认浏览器:同一轮“并发打开→停留→一次性强关该进程所有窗口”
125
- async function openWithDefaultBrowserLoop() {
126
- const loops = COUNT > 0 ? COUNT : Infinity;
127
- for (let i = 0; i < loops; i++) {
128
- for (const url of URLS) {
129
- const startArgs =
130
- MODE === "minimized" ? ["/c", "start", "/min", "", url] : ["/c", "start", "", url];
131
- spawn("cmd", startArgs, { detached: true, stdio: "ignore" }).unref();
132
- }
133
-
134
- await sleep(OPEN_MS);
135
-
136
- // 一次性结束该浏览器所有窗口(注意:这会关闭同类浏览器的所有窗口)
137
- exec(`taskkill /IM ${BROWSER_PROC} /F`, () => {});
138
- await sleep(CLOSE_MS);
139
- }
140
- await cleanup();
141
- process.exit(0);
142
- }
143
-
144
- (async function main() {
145
- const useChrome = fileExists(CHROME_PATH);
146
- if (useChrome) {
147
- await openWithChromeLoop();
148
- } else {
149
- console.warn(
150
- `未找到 Chrome:${CHROME_PATH},将使用默认浏览器并通过进程名(${BROWSER_PROC})强制关闭。`
151
- );
152
- await openWithDefaultBrowserLoop();
153
- }
154
- })();
package/src/main.js DELETED
@@ -1,13 +0,0 @@
1
- import Vue from "vue";
2
- import ElementUI from "element-ui";
3
- import "element-ui/lib/theme-chalk/index.css";
4
- import App from "./App.vue";
5
- import OlCom, { swaggerInstall, Hiprint } from "@/package/index.js";
6
- Vue.use(ElementUI);
7
- Vue.use(Hiprint);
8
-
9
- Vue.use(OlCom, { method: "post", smartPrintBtn: true });
10
- swaggerInstall("http://220.179.249.140:20025/swagger/v1/swagger.json").then(() => {});
11
- new Vue({
12
- render: h => h(App),
13
- }).$mount("#app");
@@ -1,7 +0,0 @@
1
- import OlCustomSearch from "./src/index.vue";
2
-
3
- OlCustomSearch.install = function (Vue) {
4
- Vue.component("ol-customSearch", OlCustomSearch);
5
- };
6
-
7
- export default OlCustomSearch;
@@ -1,120 +0,0 @@
1
- <template>
2
- <ol-search
3
- :key="key"
4
- :form-search-data="formSearchData"
5
- isCustomSearch
6
- v-bind="$attrs"
7
- @onSave="onSave"
8
- :method="finalMethod"
9
- v-on="$listeners"
10
- ref="customSearchRef"
11
- />
12
- </template>
13
-
14
- <script>
15
- export default {
16
- name: "customSearch",
17
- props: {
18
- menuId: {
19
- type: String,
20
- default: "",
21
- },
22
- formSearchData: {
23
- type: Object,
24
- default: () => {
25
- return {
26
- buttonData: [],
27
- rules: {},
28
- value: {},
29
- tableSearchSlice: 4, // 默认为展开4当出现特色情况可以自行设置
30
- // 循环的各种组件
31
- tableSearch: [],
32
- // 表格框架各种样式
33
- options: {},
34
- reset: false, // 是否要重置
35
- enableConfig: false, // 是否启用配置功能
36
- customs: [],
37
- };
38
- },
39
- },
40
- // 请求方式 post get
41
- method: {
42
- type: String,
43
- },
44
- },
45
- data() {
46
- return {
47
- currentPageItem: {},
48
- key: 0,
49
- };
50
- },
51
-
52
- mounted() {
53
- this.$nextTick(() => {
54
- this.init();
55
- });
56
- },
57
- computed: {
58
- // 优先级:props > 全局配置 > 默认值
59
- finalMethod() {
60
- return this.method || (this.$olBaseConfig && this.$olBaseConfig.method) || "get";
61
- },
62
- },
63
- methods: {
64
- init() {
65
- const handleMenu = (arr, _this) => {
66
- for (const item of arr) {
67
- if (item.path === _this.$route.path) {
68
- return item;
69
- }
70
- if (item.child && item.child.length > 0 && item.type !== 1) {
71
- const found = handleMenu(item.child, _this);
72
- if (found) return found;
73
- }
74
- }
75
- return null;
76
- };
77
- let wms = JSON.parse(localStorage.getItem("wms"));
78
- let SET_MENUS = null;
79
- if (wms) SET_MENUS = wms.SET_MENUS;
80
- const menus = SET_MENUS;
81
- this.currentPageItem = handleMenu(menus, this);
82
-
83
- const targetMenuId = this.menuId || (this.currentPageItem && this.currentPageItem.id);
84
-
85
- this.get({
86
- url: `/api/app/menu-search-setting/by-menu`,
87
- data: {
88
- sysMenuId: targetMenuId,
89
- },
90
- }).then(res => {
91
- if (res.code !== 200) return;
92
- const configList = res.result.settingJson ? JSON.parse(res.result.settingJson) : [];
93
- this.$set(this.formSearchData, "tableSearch", configList);
94
- this.$refs.customSearchRef.init();
95
- // this.$nextTick(() => {
96
- // this.key++;
97
- // });
98
- });
99
- },
100
- //保存
101
- onSave(configList) {
102
- const targetMenuId = this.menuId || (this.currentPageItem && this.currentPageItem.id);
103
- this.post({
104
- url: `/api/app/menu-search-setting`,
105
- data: {
106
- sysMenuId: targetMenuId,
107
- settingJson: JSON.stringify(configList),
108
- },
109
- }).then(res => {
110
- if (res.code !== 200) return;
111
- this.$message.success("保存成功");
112
- });
113
-
114
- console.log("保存配置数据", configList);
115
- },
116
- },
117
- };
118
- </script>
119
-
120
- <style lang="scss" scoped></style>
@@ -1,7 +0,0 @@
1
- import Dialog from "./src/index.vue";
2
-
3
- Dialog.install = function (Vue) {
4
- Vue.component("ol-dialogTemplate ", Dialog);
5
- };
6
-
7
- export default Dialog;