syntec3-0-ui-components-test 1.0.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.
Files changed (99) hide show
  1. package/README.md +5 -0
  2. package/dist/S3_0UC_main.csv +4 -0
  3. package/dist/S3_0UC_sub.csv +2 -0
  4. package/dist/globalVariableS3_0UC.json +1 -0
  5. package/dist/style.css +1 -0
  6. package/dist/syntec3-0-ui-components.es.js +19518 -0
  7. package/dist/syntec3-0-ui-components.es.js.map +1 -0
  8. package/dist/syntec3-0-ui-components.umd.js +23 -0
  9. package/dist/syntec3-0-ui-components.umd.js.map +1 -0
  10. package/dist/vite.svg +1 -0
  11. package/dist/web.config +17 -0
  12. package/package.json +137 -0
  13. package/src/App.vue +31 -0
  14. package/src/assets/fonts/genYoGothicTW-normal.js +7 -0
  15. package/src/assets/image/defaultImage.png +0 -0
  16. package/src/assets/vue.svg +1 -0
  17. package/src/components/Layout/modules/fullPageGlobal.vue +113 -0
  18. package/src/components/Layout/modules/viewFile/config.js +65 -0
  19. package/src/components/Layout/modules/viewFile/createView.vue +1000 -0
  20. package/src/components/Layout/modules/viewFile/filterCriteria.vue +816 -0
  21. package/src/components/Layout/modules/viewFile/viewList.vue +291 -0
  22. package/src/components/Layout/modules/viewFile/viewManageTool.js +271 -0
  23. package/src/components/Layout/modules/viewFile/viewRecord.vue +472 -0
  24. package/src/components/Layout/modules/viewFile/viewTabs.vue +542 -0
  25. package/src/components/Layout/tools/GlobalDialog.vue +115 -0
  26. package/src/components/Pagination.vue +139 -0
  27. package/src/components/columnConfigNext.vue +273 -0
  28. package/src/components/customFilter/customFilter.vue +492 -0
  29. package/src/components/customFilter/filterCriteria.vue +769 -0
  30. package/src/components/customTable/components/headerOperation/index.vue +136 -0
  31. package/src/components/customTable/components/headerTabs/index.vue +171 -0
  32. package/src/components/customTable/components/tableContent/index.vue +440 -0
  33. package/src/components/customTable/index.vue +305 -0
  34. package/src/components/dialog.vue +85 -0
  35. package/src/components/pageContent.vue +48 -0
  36. package/src/components/popover.vue +402 -0
  37. package/src/configFiles/apiFile/baseApiList.json +11 -0
  38. package/src/configFiles/apiFile/coreApiList.json +24 -0
  39. package/src/configFiles/apiFile/mesApiList.json +4 -0
  40. package/src/configFiles/apiFile/mmsApiList.json +3 -0
  41. package/src/configFiles/errorCode.json +291 -0
  42. package/src/configFiles/version.js +2 -0
  43. package/src/i18n/lang/en-us.json +2060 -0
  44. package/src/i18n/lang/errorCodeTranslate.mjs +847 -0
  45. package/src/i18n/lang/zh-cn.json +2062 -0
  46. package/src/i18n/lang/zh-tw.json +2059 -0
  47. package/src/index.js +115 -0
  48. package/src/main.js +51 -0
  49. package/src/plugins/excel.js +88 -0
  50. package/src/router/index.js +41 -0
  51. package/src/scriptFiles/apiConfig/baseApis.js +10 -0
  52. package/src/scriptFiles/apiConfig/mesApis.js +10 -0
  53. package/src/scriptFiles/apiConfig/mmsApis.js +10 -0
  54. package/src/scriptFiles/apiConfig/privateCloudCoreApis.js +13 -0
  55. package/src/scriptFiles/apiConfig/serviceRoute.js +23 -0
  56. package/src/scriptFiles/apis/baseApiFunction.js +63 -0
  57. package/src/scriptFiles/apis/mesApiFunction.js +15 -0
  58. package/src/scriptFiles/apis/mmsApiFunction.js +9 -0
  59. package/src/scriptFiles/apis/privateCloudCoreApiFunction.js +101 -0
  60. package/src/scriptFiles/backendApiFunction.js +11 -0
  61. package/src/scriptFiles/checkApiErrorMechanism.js +137 -0
  62. package/src/scriptFiles/common/objectDataProcessing.js +65 -0
  63. package/src/scss/base/commom.scss +1068 -0
  64. package/src/scss/base/dialog.scss +45 -0
  65. package/src/scss/base/index.scss +3 -0
  66. package/src/scss/base/table.scss +28 -0
  67. package/src/store/index.js +25 -0
  68. package/src/store/module/langStore.js +116 -0
  69. package/src/style.css +52 -0
  70. package/src/utils/excel.js +86 -0
  71. package/src/utils/formula.js +69 -0
  72. package/src/utils/https.js +13 -0
  73. package/src/utils/i18n.js +42 -0
  74. package/src/utils/shiftSelect.js +164 -0
  75. package/src/utils/summation.js +77 -0
  76. package/src/utils/tableWidth.js +29 -0
  77. package/src/utils/toolFun.js +93 -0
  78. package/src/views/productionWorkOrder/components/columnConfig.vue +242 -0
  79. package/src/views/productionWorkOrder/components/docCustomFieldForm.vue +739 -0
  80. package/src/views/productionWorkOrder/components/filePreview.vue +148 -0
  81. package/src/views/productionWorkOrder/components/querySearch.vue +363 -0
  82. package/src/views/productionWorkOrder/configFiles/excelImportErrorCode.json +94 -0
  83. package/src/views/productionWorkOrder/configFiles/pdfDefaultConfig.js +933 -0
  84. package/src/views/productionWorkOrder/configFiles/planMakingScript.js +600 -0
  85. package/src/views/productionWorkOrder/configFiles/productionRelatedScript.js +368 -0
  86. package/src/views/productionWorkOrder/configFiles/rulse.js +23 -0
  87. package/src/views/productionWorkOrder/configFiles/status.js +50 -0
  88. package/src/views/productionWorkOrder/index.vue +2174 -0
  89. package/src/views/productionWorkOrder/productionFlowLabel/component/addCirculationLabel.vue +394 -0
  90. package/src/views/productionWorkOrder/productionFlowLabel/component/circulationLabelTable.vue +124 -0
  91. package/src/views/productionWorkOrder/productionFlowLabel/component/materialPartFilePreview.vue +167 -0
  92. package/src/views/productionWorkOrder/productionFlowLabel/component/workOrderInformation.vue +28 -0
  93. package/src/views/productionWorkOrder/productionFlowLabel/index.vue +604 -0
  94. package/src/views/production_work_order/components/priorityTooltip.vue +53 -0
  95. package/src/views/production_work_order/index.vue +1307 -0
  96. package/src/views/review_record/components/materialInfo.vue +50 -0
  97. package/src/views/review_record/components/rootCause.vue +42 -0
  98. package/src/views/review_record/components/workDetail.vue +115 -0
  99. package/src/views/review_record/index.vue +884 -0
@@ -0,0 +1,440 @@
1
+ <template>
2
+ <!-- table组件 -->
3
+ <div class="table-wrapper" :data-test-id="`${dataTestId}-DIV-To1wh5`">
4
+ <div class="table-content" :data-test-id="`${dataTestId}-DIV-cL2A1K`">
5
+ <el-table
6
+ ref="tableRef"
7
+ v-loading="loading"
8
+ v-shift-select:tableRef
9
+ :data="tableData"
10
+ height="100%"
11
+ style="width: 100%"
12
+ border
13
+ highlight-current-row
14
+ scrollbar-always-on
15
+ stripe
16
+ :show-summary="showSummary"
17
+ :summary-method="summaryMethod"
18
+ :data-test-id="`${dataTestId}-EL-TABLE-YQ7at9`"
19
+ :default-sort="defaultSort"
20
+ v-bind="$attrs"
21
+ @cell-click="onCellClick"
22
+ @selection-change="handleSelectionChange"
23
+ @sort-change="onSortChange"
24
+ >
25
+ <!-- 选择列 -->
26
+ <el-table-column
27
+ v-if="showSelection"
28
+ type="selection"
29
+ :width="showSummary ? 60 : 50"
30
+ :selectable="selectable"
31
+ align="center"
32
+ :data-test-id="`${dataTestId}-EL-TABLE-COLUMN-Sc8zKF`"
33
+ />
34
+ <!-- 序号列 -->
35
+ <el-table-column
36
+ v-if="showIndex"
37
+ type="index"
38
+ label="#"
39
+ width="50"
40
+ align="center"
41
+ fixed="left"
42
+ :data-test-id="`${dataTestId}-EL-TABLE-COLUMN-vQ3j6j`"
43
+ >
44
+ <template #default="{ $index }">
45
+ {{ getRowIndex($index) }}
46
+ </template>
47
+ </el-table-column>
48
+ <!-- 动态列 -->
49
+ <el-table-column
50
+ v-for="(column, index) in tableColumns"
51
+ :key="column.value"
52
+ :label="column.text"
53
+ :prop="String(column.value)"
54
+ :fixed="column.isFixed ? 'left' : false"
55
+ align="center"
56
+ show-overflow-tooltip
57
+ :sortable="column.sortable"
58
+ :min-width="column.minWidth || columnMinWidth || 120"
59
+ :width="column.isCustom ? getColumnWidth(column.text, String(column.value), tableData, 200) : 'auto'"
60
+ :data-test-id="`${dataTestId}-EL-TABLE-COLUMN-vQ3j6j-${index}`"
61
+ :sort-params="column.sortParams"
62
+ v-bind="column.attrs"
63
+ >
64
+ <!--
65
+ 表头列有规则描述(tooltipSlot/tooltipContent同时存在时优先显示columnSlot)
66
+ {
67
+ tooltipIcon: 'icon图标用于触发tooltip',
68
+ tooltipSlot: 'tooltip显示内容,用于自定义组件显示内容',
69
+ tooltipContent: 'tooltip显示内容,默认的文本字符串'
70
+ }
71
+ -->
72
+ <template #header>
73
+ <div
74
+ style="display: inline-flex; justify-content: center; align-items: center"
75
+ :data-test-id="`${dataTestId}-DIV-asjQke`"
76
+ >
77
+ <!-- 左侧插槽 -->
78
+ <component
79
+ :is="column.leftSlot"
80
+ v-if="column.leftSlot"
81
+ :data-test-id="`${dataTestId}-COMPONENT-pgSWCu`"
82
+ />
83
+ <span :data-test-id="`${dataTestId}-SPAN-iBEcrY`">{{ column.text }}</span>
84
+ <!-- 右侧插槽 -->
85
+ <component
86
+ :is="column.rightSlot"
87
+ v-if="column.rightSlot"
88
+ :data-test-id="`${dataTestId}-COMPONENT-WYbm6e`"
89
+ />
90
+ </div>
91
+ </template>
92
+ <!-- 需要格式化的table项 -->
93
+ <!-- 自定义列, 当格式化无法满足时可以使用自定义列 -->
94
+ <template v-if="column.columntSlot" #default="{ row, $index }">
95
+ <component
96
+ :is="column.columntSlot"
97
+ :row="row"
98
+ :index="$index"
99
+ :data-test-id="`${dataTestId}-COMPONENT-24Y9n6`"
100
+ />
101
+ </template>
102
+ <template v-else-if="column.formatter" #default="{ row }">
103
+ <!--
104
+ tags格式化格式: {
105
+ bgColor: 'tag背景颜色',
106
+ textColor: 'tag文字颜色',
107
+ text: '国际化后的文本',
108
+ }
109
+ -->
110
+ <el-tag
111
+ v-if="column.formatterType === 'tags'"
112
+ :style="`color:${column.formatter(row, column).bgColor}`"
113
+ style="margin-left: 4px"
114
+ :color="column.formatter(row, column).textColor"
115
+ :data-test-id="`${dataTestId}-EL-TAG-mfRiQa`"
116
+ >
117
+ {{ column.formatter(row, column).text }}
118
+ </el-tag>
119
+ <div v-else-if="column.formatterType === 'icon'" :data-test-id="`${dataTestId}-DIV-bLxOMG`">
120
+ <!--
121
+ icon格式化格式: {
122
+ icon: '需要显示v-icon图标',
123
+ color: '图标的颜色',
124
+ text: '国际化后的文本'
125
+ }
126
+ text配置的话会显示tooltip,不配置则不显示
127
+ -->
128
+ <el-tooltip
129
+ v-if="column.formatter(row, column).text"
130
+ class="box-item"
131
+ effect="dark"
132
+ :content="column.formatter(row, column).text"
133
+ placement="top"
134
+ :data-test-id="`${dataTestId}-EL-TOOLTIP-LsKqgG`"
135
+ >
136
+ <v-icon
137
+ :class="column.formatter(row, column).icon"
138
+ :style="`color: ${column.formatter(row, column).color};`"
139
+ :data-test-id="`${dataTestId}-V-ICON-qSsT49`"
140
+ />
141
+ </el-tooltip>
142
+ <v-icon
143
+ v-else
144
+ :class="column.formatter(row, column).icon"
145
+ :style="`color: ${column.formatter(row, column).color};`"
146
+ :data-test-id="`${dataTestId}-V-ICON-qSsT49`"
147
+ />
148
+ </div>
149
+ <!--
150
+ file格式化格式: [{
151
+ file: '文件地址',
152
+ name: '文件名称,用于列表显示',
153
+ }]
154
+ 如果没有name则显示file,如果都没有则显示占位符
155
+ -->
156
+ <div v-else-if="column.formatterType === 'file'" :data-test-id="`${dataTestId}-DIV-6Qg7rD`">
157
+ <div
158
+ v-for="(file, cut) in column.formatter(row, column)"
159
+ :key="cut"
160
+ class="file-name"
161
+ :style="`color: ${file.color || '#409eff'};`"
162
+ :data-test-id="`${dataTestId}-DIV-Et2BFU-${cut}`"
163
+ >
164
+ {{ file.name || file.file || '---' }}
165
+ <span v-if="cut < column.formatter(row, column).length - 1" :data-test-id="`${dataTestId}-SPAN-wLZkzY`">
166
+ ,
167
+ </span>
168
+ </div>
169
+ </div>
170
+ <!--
171
+ link格式化格式: {
172
+ link: '链接地址',
173
+ name: '链接名称,用于列表显示',
174
+ }
175
+ 如果没有name则显示link,如果都没有则显示占位符
176
+ -->
177
+ <div v-else-if="column.formatterType === 'link'" :data-test-id="`${dataTestId}-DIV-54trNN`">
178
+ <el-link
179
+ :href="column.formatter(row, column).link"
180
+ :underline="column.formatter(row, column).underline"
181
+ target="_blank"
182
+ :style="formatterLinkStyle(row, column)"
183
+ :data-test-id="`${dataTestId}-EL-LINK-8g2RDk`"
184
+ >
185
+ {{ column.formatter(row, column).name || column.formatter(row, column).link || '---' }}
186
+ </el-link>
187
+ </div>
188
+ <span v-else :data-test-id="`${dataTestId}-SPAN-rCQPnk`">{{ column.formatter(row, column) || '---' }}</span>
189
+ </template>
190
+ </el-table-column>
191
+ <!-- 操作列(固定) -->
192
+ <el-table-column
193
+ v-if="tableActionsWidth > 0"
194
+ :label="t('action')"
195
+ :min-width="tableActionsWidth"
196
+ :fixed="actionsFixed"
197
+ align="center"
198
+ :data-test-id="`${dataTestId}-EL-TABLE-COLUMN-gLrVJL`"
199
+ >
200
+ <template #default="{ row, $index }">
201
+ <!-- 直接使用父组件传递的 slot,并传递数据 -->
202
+ <slot name="tableActions" :row="row" :index="$index" />
203
+ </template>
204
+ </el-table-column>
205
+ </el-table>
206
+ </div>
207
+ <!-- 分页组件 -->
208
+ <div v-if="showPagination" class="pagination-content" :data-test-id="`${dataTestId}-DIV-UYLlzi`">
209
+ <pagination
210
+ style="background-color: transparent; padding-bottom: 0.625rem; padding-top: 1.25rem"
211
+ :total="total"
212
+ :current-page="currentPage"
213
+ :page-size="pageSize"
214
+ :selected-num="selectedRows.length"
215
+ :current-count="tableData.length"
216
+ :has-selected="true"
217
+ :permission-code="permissionCode"
218
+ :data-test-id="`${dataTestId}-PAGINATION-msjXvX`"
219
+ :page-type="pageType"
220
+ @changePage="handlePageChange"
221
+ />
222
+ </div>
223
+ </div>
224
+ </template>
225
+
226
+ <script setup>
227
+ import { ref, computed } from 'vue';
228
+ import { useI18n } from 'vue-i18n';
229
+ import { getColumnWidth } from '@/utils/tableWidth';
230
+ import pagination from '@/components/Pagination.vue';
231
+
232
+ const props = defineProps({
233
+ // 表格数据
234
+ tableData: {
235
+ type: Array,
236
+ default: () => [],
237
+ },
238
+ // 列配置
239
+ columns: {
240
+ type: Array,
241
+ default: () => [],
242
+ },
243
+ // 操作列的最小宽度,设置为0则不显示
244
+ tableActionsWidth: {
245
+ type: Number,
246
+ default: 120,
247
+ },
248
+ // 分页信息
249
+ currentPage: {
250
+ type: Number,
251
+ default: 1,
252
+ },
253
+ pageSize: {
254
+ type: Number,
255
+ default: 20,
256
+ },
257
+ // table的loading状态
258
+ loading: {
259
+ type: Boolean,
260
+ default: false,
261
+ },
262
+ // 功能开关
263
+ showSelection: {
264
+ type: Boolean,
265
+ default: true,
266
+ },
267
+ // 是否显示序号列
268
+ showIndex: {
269
+ type: Boolean,
270
+ default: true,
271
+ },
272
+ // 操作列固定规则
273
+ actionsFixed: {
274
+ type: [Boolean, String],
275
+ default: 'right',
276
+ },
277
+ // 列的最小宽度
278
+ columnMinWidth: {
279
+ type: Number,
280
+ default: 200,
281
+ },
282
+ permissionCode: {
283
+ type: String,
284
+ default: '',
285
+ },
286
+ total: {
287
+ // table数据总数量,用于分页
288
+ type: Number,
289
+ default: 0,
290
+ },
291
+ // 复选框选择的数据长度,用于分页组件回显已选中条数
292
+ selectedNum: {
293
+ type: Number,
294
+ default: 0,
295
+ },
296
+ // 默认的排序列的 prop 和顺序。
297
+ defaultSort: {
298
+ type: Object,
299
+ default: () => ({}),
300
+ },
301
+ // 是否显示合计行
302
+ showSummary: {
303
+ type: Boolean,
304
+ default: false,
305
+ },
306
+ // 合并格式方法
307
+ summaryMethod: Function,
308
+ // 选择列禁用规则
309
+ selectable: Function,
310
+ pageType: Number,
311
+ // 是否显示分页组件
312
+ showPagination: {
313
+ type: Boolean,
314
+ default: true,
315
+ },
316
+ dataTestId: String,
317
+ });
318
+
319
+ const $emit = defineEmits([
320
+ 'selectionChange', // 选中行
321
+ 'sortChange', // 自定义排序
322
+ 'cellClick', // 单元格点击
323
+ 'pageChange',
324
+ ]);
325
+ const { t } = useI18n();
326
+ const tableRef = ref();
327
+ const selectedRows = ref([]);
328
+ const tableColumns = computed(() => {
329
+ return props.columns.filter((item) => !!item.isShown);
330
+ });
331
+ // 计算行索引
332
+ const getRowIndex = (index) => {
333
+ return (props.currentPage - 1) * props.pageSize + index + 1;
334
+ };
335
+ // 排序
336
+ function onSortChange(e) {
337
+ if (e.column.sortable === 'custom') {
338
+ $emit('sortChange', e);
339
+ } else {
340
+ tableRef.value.sort(e.prop, e.order);
341
+ }
342
+ }
343
+ function formatterLinkStyle(row, column) {
344
+ const obj = column.formatter(row, column);
345
+ return `
346
+ --el-link-hover-text-color: ${obj.hoverColor || '#409eff'};
347
+ --el-link-text-color: ${obj.color || '#606266'}
348
+ `;
349
+ }
350
+ // 选择变化事件
351
+ const handleSelectionChange = (selection) => {
352
+ selectedRows.value = selection;
353
+ $emit('selectionChange', selection);
354
+ };
355
+
356
+ // 清空选择
357
+ const clearSelection = () => {
358
+ tableRef.value?.clearSelection();
359
+ };
360
+
361
+ // 切换选择行
362
+ const toggleRowSelection = (row, selected) => {
363
+ tableRef.value?.toggleRowSelection(row, selected);
364
+ };
365
+ const handlePageChange = (val) => {
366
+ $emit('pageChange', val);
367
+ };
368
+ // 单元格点击事件,返回row和cell
369
+ function onCellClick(row, cell) {
370
+ $emit('cellClick', {
371
+ row,
372
+ cell,
373
+ });
374
+ }
375
+ // 暴露方法
376
+ defineExpose({
377
+ tableRef,
378
+ getTableRef: () => tableRef.value,
379
+ clearSelection,
380
+ toggleRowSelection,
381
+ selectedRows,
382
+ });
383
+ </script>
384
+
385
+ <style lang="scss" scoped>
386
+ @use '@/scss/base/table.scss';
387
+ .table-wrapper {
388
+ height: 100%;
389
+ display: flex;
390
+ flex-direction: column;
391
+ overflow: hidden;
392
+ .table-content {
393
+ flex: 1;
394
+ overflow: hidden;
395
+ }
396
+ .file-name {
397
+ color: rgb(18, 80, 136);
398
+ cursor: pointer;
399
+ white-space: nowrap;
400
+ overflow: hidden;
401
+ text-overflow: ellipsis;
402
+ }
403
+ :deep(.el-table) {
404
+ --el-table-header-bg-color: #edf3f8;
405
+ --el-table-header-text-color: #303133;
406
+ --el-table-border-color: #ebeef5;
407
+ --el-table-row-hover-bg-color: #f5f7fa;
408
+
409
+ height: 100%;
410
+
411
+ .el-table__body-wrapper {
412
+ scrollbar-width: thin;
413
+
414
+ &::-webkit-scrollbar {
415
+ width: 6px;
416
+ height: 6px;
417
+ }
418
+
419
+ &::-webkit-scrollbar-thumb {
420
+ background: #c0c4cc;
421
+ border-radius: 3px;
422
+ }
423
+ }
424
+
425
+ // 操作列样式
426
+ .el-table__fixed-right {
427
+ .el-button-group {
428
+ :deep(.el-button) {
429
+ padding: 4px 8px;
430
+
431
+ &:hover {
432
+ color: var(--el-color-primary);
433
+ background-color: var(--el-fill-color-light);
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+ }
440
+ </style>