ol-base-components 3.4.5 → 3.4.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.
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,215 +0,0 @@
1
- import { hiprint } from "vue-plugin-hiprint";
2
-
3
- export const provider1 = function () {
4
- const addElementTypes = context => {
5
- context.removePrintElementTypes("providerModule1");
6
- context.addPrintElementTypes("providerModule1", [
7
- new hiprint.PrintElementTypeGroup("常规", [
8
- {
9
- tid: "providerModule2.customText",
10
- title: "文本",
11
- customText: "自定义文本",
12
- custom: true,
13
- type: "text",
14
- options: {
15
- field: "name",
16
- testData: "内容",
17
- },
18
- },
19
- {
20
- tid: "providerModule2.longText",
21
- title: "长文本",
22
- type: "longText",
23
- options: {
24
- field: "test.longText",
25
- width: 200,
26
- testData: "长文本分页/不分页测试",
27
- },
28
- },
29
- {
30
- tid: "providerModule1.type",
31
- title: "纯文本",
32
- data: "纯文本",
33
- type: "text",
34
- options: {
35
- testData: "纯文本",
36
- height: 16,
37
- fontSize: 15,
38
- fontWeight: "700",
39
- textAlign: "center",
40
- hideTitle: true,
41
- },
42
- },
43
- {
44
- tid: "providerModule1.platform",
45
- title: "标题",
46
- data: "标题",
47
- type: "text",
48
- options: {
49
- field: "platform",
50
- testData: "平台名称",
51
- height: 17,
52
- fontSize: 16.5,
53
- fontWeight: "700",
54
- textAlign: "center",
55
- hideTitle: true,
56
- },
57
- },
58
- {
59
- tid: "providerModule2.table",
60
- title: "表格",
61
- type: "table",
62
- options: {
63
- field: "table",
64
- fields: [
65
- // { text: "名称", field: "name1" },
66
- // { text: "性别", field: "gender" },
67
- // { text: "数量", field: "count" },
68
- // { text: "金额", field: "amount" },
69
- ],
70
- },
71
- columns: [
72
- [
73
- { title: "名称", align: "center", field: "name" },
74
- { title: "性别", align: "center", field: "gender" },
75
- { title: "数量", align: "center", field: "count" },
76
- { title: "金额", align: "center", field: "amount" },
77
- ],
78
- ],
79
- // footerFormatter: function (options, rows, data, currentPageGridRowsData) {
80
- // console.log(currentPageGridRowsData);
81
- // if (data && data["totalCap"]) {
82
- // return `<td style="padding:0 10px" colspan="100">${
83
- // "应收金额大写: " + data["totalCap"]
84
- // }</td>`;
85
- // }
86
- // return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>';
87
- // },
88
- },
89
- {
90
- tid: "providerModule1.barcode",
91
- title: "条形码",
92
- data: "XS888888888",
93
- type: "text",
94
- options: {
95
- field: "barcode",
96
- testData: "XS888888888",
97
- height: 32,
98
- fontSize: 12,
99
- lineHeight: 18,
100
- textAlign: "left",
101
- textType: "barcode",
102
- },
103
- },
104
- {
105
- tid: "providerModule1.qrcode",
106
- title: "二维码",
107
- data: "XS888888888",
108
- type: "text",
109
- options: {
110
- field: "qrcode",
111
- testData: "XS888888888",
112
- height: 32,
113
- fontSize: 12,
114
- lineHeight: 18,
115
- textType: "qrcode",
116
- },
117
- },
118
-
119
- {
120
- tid: "providerModule1.image",
121
- title: "图片",
122
- data: "",
123
- type: "image",
124
- },
125
- ]),
126
- new hiprint.PrintElementTypeGroup("定制", [
127
- {
128
- tid: "providerModule1.khname",
129
- title: "客户名称",
130
- data: "高级客户",
131
- type: "text",
132
- options: {
133
- field: "name",
134
- testData: "高级客户",
135
- height: 16,
136
- fontSize: 6.75,
137
- fontWeight: "700",
138
- textAlign: "left",
139
- textContentVerticalAlign: "middle",
140
- },
141
- },
142
- {
143
- tid: "providerModule1.tel",
144
- title: "客户电话",
145
- data: "18888888888",
146
- type: "text",
147
- options: {
148
- field: "tel",
149
- testData: "18888888888",
150
- height: 16,
151
- fontSize: 6.75,
152
- fontWeight: "700",
153
- textAlign: "left",
154
- textContentVerticalAlign: "middle",
155
- },
156
- },
157
- {
158
- tid: "providerModule1.order",
159
- title: "订单编号",
160
- data: "XS888888888",
161
- type: "text",
162
- options: {
163
- field: "order",
164
- testData: "XS888888888",
165
- height: 16,
166
- fontSize: 6.75,
167
- fontWeight: "700",
168
- textAlign: "left",
169
- textContentVerticalAlign: "middle",
170
- },
171
- },
172
- {
173
- tid: "providerModule1.date",
174
- title: "业务日期",
175
- data: "2020-01-01",
176
- type: "text",
177
- options: {
178
- field: "date",
179
- testData: "2020-01-01",
180
- height: 16,
181
- fontSize: 6.75,
182
- fontWeight: "700",
183
- textAlign: "left",
184
- textContentVerticalAlign: "middle",
185
- },
186
- },
187
- ]),
188
- new hiprint.PrintElementTypeGroup("辅助", [
189
- {
190
- tid: "providerModule2.hline",
191
- title: "横线",
192
- type: "hline",
193
- },
194
- {
195
- tid: "providerModule2.vline",
196
- title: "竖线",
197
- type: "vline",
198
- },
199
- {
200
- tid: "providerModule2.rect",
201
- title: "矩形",
202
- type: "rect",
203
- },
204
- {
205
- tid: "providerModule2.oval",
206
- title: "椭圆",
207
- type: "oval",
208
- },
209
- ]),
210
- ]);
211
- };
212
- return {
213
- addElementTypes,
214
- };
215
- };
@@ -1,7 +0,0 @@
1
- import OlPrintModel from "./src/index.vue";
2
-
3
- OlPrintModel.install = function (Vue) {
4
- Vue.component("ol-print-model", OlPrintModel);
5
- };
6
-
7
- export default OlPrintModel;
@@ -1,493 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="print-manage-container">
4
- <div class="left-panel">
5
- <div class="panel-title">菜单树</div>
6
- <el-tree
7
- :data="menuTreeData"
8
- :props="treeProps"
9
- node-key="id"
10
- :current-node-key="currentMenuId"
11
- default-expand-all
12
- :expand-on-click-node="false"
13
- highlight-current
14
- @node-click="handleNodeClick"
15
- >
16
- </el-tree>
17
- </div>
18
- <div class="right-panel">
19
- <div class="panel-header">
20
- <span class="panel-title">{{ currentMenuName }} - 打印模板</span>
21
- <el-button type="primary" size="small" icon="el-icon-plus" @click="handleAdd">
22
- 新增模板
23
- </el-button>
24
- </div>
25
- <div class="template-list">
26
- <div v-if="templateList.length === 0" class="empty-card" @click="handleAdd">
27
- <i class="el-icon-plus add-icon"></i>
28
- <span class="add-text">点击添加模板</span>
29
- </div>
30
- <div v-for="template in templateList" :key="template.id" class="template-card">
31
- <div class="card-header">
32
- <i class="el-icon-document card-icon"></i>
33
- <span class="card-title">{{ template.templeteName }}</span>
34
- </div>
35
- <div class="card-body">
36
- <div class="card-info">
37
- <span class="info-label">数据源URL:</span>
38
- <span class="info-value">{{ template.sourceUrl || "无" }}</span>
39
- </div>
40
- <div class="card-info">
41
- <span class="info-label">备注:</span>
42
- <span class="info-value">{{ template.remark || "无" }}</span>
43
- </div>
44
- </div>
45
- <div class="card-footer">
46
- <el-button type="text" size="small" icon="el-icon-edit" @click="handleEdit(template)">
47
- 编辑
48
- </el-button>
49
- <el-button
50
- type="text"
51
- size="small"
52
- icon="el-icon-delete"
53
- class="delete-btn"
54
- @click="handleDelete(template)"
55
- >
56
- 删除
57
- </el-button>
58
- </div>
59
- </div>
60
- </div>
61
- </div>
62
-
63
- <el-dialog
64
- :title="dialogTitle"
65
- :visible.sync="dialogVisible"
66
- width="600px"
67
- :close-on-click-modal="false"
68
- >
69
- <el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
70
- <el-form-item label="模板名称" prop="templeteName">
71
- <el-input v-model="form.templeteName" placeholder="请输入模板名称"></el-input>
72
- </el-form-item>
73
- <el-form-item label="创建模板" prop="templeteJson">
74
- <span style="margin-right: 10px">{{ form.templeteJson ? "已创建" : "未创建" }}</span>
75
- <el-button type="primary" @click="handleCreateTemplate">创建模板</el-button>
76
- </el-form-item>
77
- <el-form-item label="数据源URL" prop="sourceUrl">
78
- <el-input
79
- v-model="form.sourceUrl"
80
- placeholder="请输入数据源URL"
81
- @blur="form.sourceUrl = form.sourceUrl && form.sourceUrl.trim()"
82
- ></el-input>
83
- </el-form-item>
84
- <el-form-item label="备注">
85
- <el-input
86
- v-model="form.remark"
87
- type="textarea"
88
- :rows="3"
89
- placeholder="请输入备注"
90
- ></el-input>
91
- </el-form-item>
92
- </el-form>
93
- <span slot="footer" class="dialog-footer">
94
- <el-button @click="dialogVisible = false">取消</el-button>
95
- <el-button type="primary" @click="handleSubmit">确定</el-button>
96
- </span>
97
- </el-dialog>
98
- </div>
99
- </div>
100
- </template>
101
-
102
- <script>
103
- export default {
104
- name: "print-model",
105
- data() {
106
- return {
107
- menuTreeData: [],
108
- treeProps: {
109
- label: "title",
110
- children: "child",
111
- },
112
- currentMenuId: null,
113
- currentMenuName: "全部",
114
- currentItem: {},
115
- templateList: [],
116
- dialogVisible: false,
117
- dialogTitle: "新增模板",
118
- form: {
119
- id: null,
120
- templeteName: "",
121
- remark: "",
122
- templeteJson: "",
123
- sourceUrl: "",
124
- },
125
- rules: {
126
- templeteName: [{ required: true, message: "请输入模板名称", trigger: "blur" }],
127
- templeteJson: [{ required: true, message: "请输入模板JSON", trigger: "blur" }],
128
- },
129
- };
130
- },
131
- mounted() {
132
- this.initMenuTree();
133
- },
134
- methods: {
135
- initMenuTree() {
136
- const wms = JSON.parse(localStorage.getItem("wms") || "{}");
137
- const menus = wms.SET_MENUS || [];
138
- this.menuTreeData = this.buildTreeData(menus);
139
- const firstNode = this.findFirstMenuNode(this.menuTreeData);
140
- if (firstNode) {
141
- this.currentMenuId = firstNode.id;
142
- this.currentMenuName = firstNode.title;
143
- this.currentItem = firstNode;
144
- this.loadTemplates(firstNode.id);
145
- }
146
- },
147
- findFirstMenuNode(menus) {
148
- if (!menus || menus.length === 0) return null;
149
- for (const menu of menus) {
150
- if (menu.child && menu.child.length > 0) {
151
- const found = this.findFirstMenuNode(menu.child);
152
- if (found) return found;
153
- }
154
- return menu;
155
- }
156
- return null;
157
- },
158
- buildTreeData(menus) {
159
- return menus.filter(menu => {
160
- if (menu.child && menu.child.length > 0) {
161
- menu.child = this.buildTreeData(menu.child);
162
- }
163
- return menu.type === 0;
164
- });
165
- },
166
- handleNodeClick(data) {
167
- this.currentMenuId = data.id;
168
- this.currentMenuName = data.title;
169
- this.currentItem = data;
170
- this.loadTemplates(data.id);
171
- },
172
- async loadTemplates(menuId) {
173
- try {
174
- const res = await this.get({
175
- url: "/api/app/print-templete/page-list",
176
- data: {
177
- MenuId: menuId,
178
- Page: 1,
179
- MaxResultCount: 1000,
180
- },
181
- });
182
- if (res.code !== 200) return;
183
- this.templateList = res.result?.items || [];
184
- } catch (error) {
185
- console.error("加载模板列表失败:", error);
186
- }
187
- },
188
- handleAdd() {
189
- this.dialogTitle = "新增模板";
190
- this.form = {
191
- id: null,
192
- templeteName: "",
193
- remark: "",
194
- templeteJson: "",
195
- sourceUrl: "",
196
- };
197
- this.dialogVisible = true;
198
- this.$nextTick(() => {
199
- this.$refs.formRef && this.$refs.formRef.clearValidate();
200
- });
201
- },
202
- handleEdit(template) {
203
- this.dialogTitle = "编辑模板";
204
- this.form = {
205
- id: template.id,
206
- templeteName: template.templeteName,
207
- remark: template.remark,
208
- templeteJson: template.templeteJson,
209
- sourceUrl: template.sourceUrl || "",
210
- };
211
- this.dialogVisible = true;
212
- },
213
- async handleDelete(template) {
214
- this.$confirm("确认删除该模板吗?", "提示", {
215
- confirmButtonText: "确定",
216
- cancelButtonText: "取消",
217
- type: "warning",
218
- })
219
- .then(async () => {
220
- try {
221
- await this.del({
222
- url: `/api/app/print-templete/print-templete/${template.id}`,
223
- });
224
- this.$message.success("删除成功");
225
- this.loadTemplates(this.currentMenuId);
226
- } catch (error) {
227
- console.error("删除失败:", error);
228
- }
229
- })
230
- .catch(() => {});
231
- },
232
- async handleSubmit() {
233
- this.$refs.formRef.validate(async valid => {
234
- if (valid) {
235
- try {
236
- if (this.form.id) {
237
- await this.put({
238
- url: "/api/app/print-templete/print-templete",
239
- data: {
240
- id: this.form.id,
241
- templeteName: this.form.templeteName,
242
- templeteJson: this.form.templeteJson,
243
- sourceUrl: this.form.sourceUrl,
244
- },
245
- });
246
- this.$message.success("编辑成功");
247
- } else {
248
- await this.post({
249
- url: "/api/app/print-templete/print-templete",
250
- data: {
251
- menuId: this.currentMenuId,
252
- templeteName: this.form.templeteName,
253
- templeteJson: this.form.templeteJson,
254
- sourceUrl: this.form.sourceUrl,
255
- },
256
- });
257
- this.$message.success("新增成功");
258
- }
259
- this.dialogVisible = false;
260
- this.loadTemplates(this.currentMenuId);
261
- } catch (error) {
262
- console.error("提交失败:", error);
263
- }
264
- }
265
- });
266
- },
267
- handleCreateTemplate() {
268
- let templateData = {};
269
- if (this.form.templeteJson) {
270
- try {
271
- templateData = JSON.parse(this.form.templeteJson);
272
- } catch (e) {
273
- console.error("解析模板JSON失败:", e);
274
- }
275
- }
276
- this.$hiprint({
277
- defaultTemplate: templateData,
278
- onSubmit: res => {
279
- this.form.templeteJson = JSON.stringify(res);
280
- console.log("保存的结果", this.form);
281
- this.$message.success("模板创建成功!");
282
- },
283
- });
284
- },
285
- },
286
- };
287
- </script>
288
-
289
- <style scoped>
290
- .print-manage-container {
291
- display: flex;
292
- height: calc(100vh - 84px);
293
- background: #f5f5f5;
294
- padding: 20px;
295
- gap: 20px;
296
- }
297
-
298
- .left-panel {
299
- width: 280px;
300
- background: #fff;
301
- border-radius: 4px;
302
- padding: 20px;
303
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
304
- overflow-y: auto;
305
- }
306
-
307
- .panel-title {
308
- font-size: 16px;
309
- font-weight: 500;
310
- color: #303133;
311
- }
312
-
313
- .custom-tree-node {
314
- flex: 1;
315
- display: flex;
316
- align-items: center;
317
- justify-content: space-between;
318
- font-size: 14px;
319
- padding-right: 8px;
320
- }
321
-
322
- .tree-icon {
323
- margin-right: 8px;
324
- font-size: 16px;
325
- color: #909399;
326
- }
327
-
328
- .tree-label {
329
- color: #606266;
330
- }
331
-
332
- .right-panel {
333
- flex: 1;
334
- background: #fff;
335
- border-radius: 4px;
336
- padding: 20px;
337
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
338
- display: flex;
339
- flex-direction: column;
340
- }
341
-
342
- .panel-header {
343
- display: flex;
344
- align-items: center;
345
- justify-content: space-between;
346
- margin-bottom: 20px;
347
- padding-bottom: 15px;
348
- border-bottom: 1px solid #ebeef5;
349
- }
350
-
351
- .panel-header .panel-title {
352
- font-size: 16px;
353
- font-weight: 500;
354
- color: #303133;
355
- }
356
-
357
- .template-list {
358
- overflow-y: auto;
359
- display: grid;
360
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
361
- gap: 20px;
362
- padding: 10px;
363
- }
364
-
365
- .empty-card {
366
- width: 100%;
367
- height: 200px;
368
- border: 2px dashed #dcdfe6;
369
- border-radius: 8px;
370
- display: flex;
371
- flex-direction: column;
372
- align-items: center;
373
- justify-content: center;
374
- cursor: pointer;
375
- transition: all 0.3s;
376
- grid-column: 1 / -1;
377
- }
378
-
379
- .empty-card:hover {
380
- border-color: #409eff;
381
- background: #f0f9ff;
382
- }
383
-
384
- .add-icon {
385
- font-size: 48px;
386
- color: #c0c4cc;
387
- margin-bottom: 10px;
388
- transition: all 0.3s;
389
- }
390
-
391
- .empty-card:hover .add-icon {
392
- color: #409eff;
393
- transform: scale(1.1);
394
- }
395
-
396
- .add-text {
397
- font-size: 14px;
398
- color: #909399;
399
- }
400
-
401
- .template-card {
402
- background: #fff;
403
- border: 1px solid #ebeef5;
404
- border-radius: 8px;
405
- padding: 20px;
406
- transition: all 0.3s;
407
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
408
- }
409
-
410
- .template-card:hover {
411
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
412
- transform: translateY(-2px);
413
- }
414
-
415
- .card-header {
416
- display: flex;
417
- align-items: center;
418
- margin-bottom: 15px;
419
- padding-bottom: 10px;
420
- border-bottom: 1px solid #f0f0f0;
421
- }
422
-
423
- .card-icon {
424
- font-size: 24px;
425
- color: #409eff;
426
- margin-right: 10px;
427
- }
428
-
429
- .card-title {
430
- font-size: 16px;
431
- font-weight: 500;
432
- color: #303133;
433
- flex: 1;
434
- }
435
-
436
- .card-body {
437
- margin-bottom: 15px;
438
- }
439
-
440
- .card-info {
441
- display: flex;
442
- align-items: center;
443
- margin-bottom: 10px;
444
- font-size: 14px;
445
- }
446
-
447
- .info-label {
448
- color: #909399;
449
- margin-right: 5px;
450
- }
451
-
452
- .info-value {
453
- color: #606266;
454
- flex: 1;
455
- word-break: break-all;
456
- }
457
-
458
- .card-footer {
459
- display: flex;
460
- justify-content: flex-end;
461
- gap: 10px;
462
- padding-top: 10px;
463
- border-top: 1px solid #f0f0f0;
464
- }
465
-
466
- .delete-btn {
467
- color: #f56c6c;
468
- }
469
-
470
- .delete-btn:hover {
471
- color: #f56c6c;
472
- }
473
-
474
- .dialog-footer {
475
- display: flex;
476
- justify-content: flex-end;
477
- gap: 10px;
478
- }
479
-
480
- ::-webkit-scrollbar {
481
- width: 6px;
482
- height: 6px;
483
- }
484
-
485
- ::-webkit-scrollbar-thumb {
486
- background: #dcdfe6;
487
- border-radius: 3px;
488
- }
489
-
490
- ::-webkit-scrollbar-track {
491
- background: #f5f5f5;
492
- }
493
- </style>