ol-base-components 0.1.2

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.
@@ -0,0 +1,196 @@
1
+ <template>
2
+ <div class="Print_box" style="width: 100%">
3
+ <!-- 理货清单 -->
4
+ <div
5
+ class="Print_hader"
6
+ style="
7
+ text-align: center;
8
+ font-size: 25px;
9
+ font-weight: 500;
10
+ margin-bottom: 15px;
11
+ "
12
+ >
13
+ {{ printListObj.title }}
14
+ </div>
15
+ <div class="Print_body">
16
+ <div class="Print_body_table" style="margin-bottom: 15px">
17
+ <table
18
+ style="
19
+ width: 100%;
20
+ border-collapse: collapse;
21
+ border: 1px black solid;
22
+ box-sizing: border-box;
23
+ "
24
+ >
25
+ <thead style="display: table-header-group">
26
+ <tr>
27
+ <th
28
+ v-for="(head, index) in printListObj.tableHeader"
29
+ :key="index"
30
+ :colspan="head.colspan"
31
+ :style="{
32
+ border: '1px solid black',
33
+ padding: '7px',
34
+ fontSize: '12px',
35
+ width: head.width,
36
+ minWidth: head.width,
37
+ maxWidth: head.width,
38
+ wordBreak: 'break-all',
39
+ wordWrap: 'break-word',
40
+ }"
41
+ >
42
+ {{ head.label }}
43
+ </th>
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ <tr v-for="(item, index) in printListObj.tableData" :key="index">
48
+ <div v-for="(head, i) in printListObj.tableHeader" :key="i">
49
+ <td
50
+ v-if="item.hot == 2"
51
+ :style="{
52
+ border: '1px solid black',
53
+ padding: '7px',
54
+ fontSize: '12px',
55
+ width: head.width,
56
+ wordBreak: 'break-all',
57
+ wordWrap: 'break-word',
58
+ background: '#ccc !important',
59
+ }"
60
+ >
61
+ <span>{{ item[head.prop] }} </span>
62
+ </td>
63
+
64
+ <td
65
+ v-else
66
+ :style="{
67
+ border: '1px solid black',
68
+ padding: '7px',
69
+ fontSize: '12px',
70
+ width: head.width,
71
+ fontWeight: head.weight,
72
+ wordBreak: 'break-all',
73
+ wordWrap: 'break-word',
74
+ }"
75
+ >
76
+ <span>{{ item[head.prop] }} </span>
77
+ </td>
78
+ </div>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+ </div>
83
+ </div>
84
+ <div class="Print_footer"></div>
85
+ <div style="page-break-after: always"></div>
86
+ </div>
87
+ </template>
88
+
89
+ <script>
90
+ export default {
91
+ props: {
92
+ printListObj: Object, //打印参数
93
+ },
94
+ data() {
95
+ return {
96
+ //表头
97
+ tableHeader: [
98
+ {
99
+ label: "Item No",
100
+ prop: "itemNo",
101
+ },
102
+ {
103
+ label: "STO",
104
+ prop: "sto",
105
+ },
106
+ {
107
+ label: "Country of Origin",
108
+ prop: "countryofOrigin",
109
+ },
110
+ {
111
+ label: "Material",
112
+ prop: "material",
113
+ },
114
+ {
115
+ label: "Deliervy Qty",
116
+ prop: "deliervyQty",
117
+ },
118
+ {
119
+ label: "Label Req.",
120
+ prop: "labenReq",
121
+ },
122
+ {
123
+ label: "Batch",
124
+ prop: "batch",
125
+ },
126
+ {
127
+ label: "Bill of Land",
128
+ prop: "billofLand",
129
+ },
130
+ ],
131
+ //body 数据
132
+ tableData: [
133
+ {
134
+ countryofOrigin: "22",
135
+ createDate: "2020-08-03T15:10:16",
136
+ deliervyQty: 33,
137
+ invoice: "22",
138
+ itemNo: "1",
139
+ labenReq: "22",
140
+ material: "22",
141
+ sto: "sto",
142
+ actualQty: 0,
143
+ batch: "batch",
144
+ billofLand: "billofLand",
145
+ },
146
+ {
147
+ actualQty: 0,
148
+ batch: "444",
149
+ billofLand: "555",
150
+ countryofOrigin: "66666",
151
+ createDate: "2020-08-03T15:10:16",
152
+ deliervyQty: 33,
153
+ invoice: "6677",
154
+ itemNo: "1",
155
+ labenReq: "666666",
156
+ material: "6666666",
157
+ sto: "88888888888",
158
+ },
159
+ ],
160
+ };
161
+ },
162
+ watch: {
163
+ printListObj: {
164
+ handler() {
165
+ // debugger
166
+ },
167
+ deep: true,
168
+ },
169
+ },
170
+ };
171
+ </script>
172
+
173
+ <style lang="scss" scoped>
174
+ .Print_box {
175
+ width: 100%;
176
+ }
177
+ .Print_hader {
178
+ text-align: center;
179
+ font-size: 30px;
180
+ font-weight: 500;
181
+ }
182
+
183
+ .Print_body_QR {
184
+ float: right;
185
+ }
186
+ .Print_body_label {
187
+ display: flex;
188
+ justify-content: space-between;
189
+ }
190
+ .Print_body_table {
191
+ // margin-bottom: 15px;
192
+ }
193
+ ::v-deep .active {
194
+ font-weight: 800 !important;
195
+ }
196
+ </style>
package/vue.config.js ADDED
@@ -0,0 +1,21 @@
1
+ const { defineConfig } = require("@vue/cli-service");
2
+ const path = require("path");
3
+
4
+ module.exports = defineConfig({
5
+ transpileDependencies: true,
6
+ lintOnSave: false,
7
+ configureWebpack: {
8
+ output: {
9
+ // filename: "my-library.js", // 输出文件名
10
+ library: "MyComponentLibrary", // 库名称
11
+ libraryTarget: "umd", // 输出格式
12
+ globalObject: "this", // 适应不同环境
13
+ },
14
+ resolve: {
15
+ alias: {
16
+ "@": path.resolve(__dirname, "src"),
17
+ "my-component-library": path.resolve(__dirname, "src/package/index.js"), // 指向你的组件入口
18
+ },
19
+ },
20
+ },
21
+ });