@agile-team/wl-skills-kit 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.
- package/CHANGELOG.md +13 -0
- package/README.md +328 -0
- package/bin/wl-skills.js +104 -0
- package/files/.github/copilot-instructions.md +211 -0
- package/files/.github/docs/SYS_MENU_INFO.md +247 -0
- package/files/.github/docs/menu-sync-design.md +265 -0
- package/files/.github/docs/use-skill.md +379 -0
- package/files/.github/docs/wl-skills-kit.md +266 -0
- package/files/.github/skills/api-contract/SKILL.md +247 -0
- package/files/.github/skills/convention-extract/SKILL.md +355 -0
- package/files/.github/skills/menu-sync/SKILL.md +255 -0
- package/files/.github/skills/menu-sync/env/guide.md +73 -0
- package/files/.github/skills/page-codegen/SKILL.md +825 -0
- package/files/.github/skills/page-codegen/TPL-CHANGE-HISTORY.md +281 -0
- package/files/.github/skills/page-codegen/TPL-DETAIL-TABS.md +1112 -0
- package/files/.github/skills/page-codegen/TPL-DRIVEN.md +124 -0
- package/files/.github/skills/page-codegen/TPL-FORM-ROUTE.md +441 -0
- package/files/.github/skills/page-codegen/TPL-LIST.md +196 -0
- package/files/.github/skills/page-codegen/TPL-MASTER-DETAIL.md +153 -0
- package/files/.github/skills/page-codegen/TPL-OPERATION-STATION.md +442 -0
- package/files/.github/skills/page-codegen/TPL-RECORD-FORM.md +376 -0
- package/files/.github/skills/page-codegen/TPL-TREE-LIST.md +191 -0
- package/files/.github/skills/prototype-scan/SKILL.md +414 -0
- package/files/demo/README.md +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +54 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -0
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/api.md +88 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/data.ts +601 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-customer-archive/index.vue +64 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/api.md +67 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/data.ts +286 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.scss +139 -0
- package/files/demo/produce/aiflow/mmwr-customer-detail/index.vue +318 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -0
- package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -0
- package/files/demo/sale/demo/add-demo/data.ts +518 -0
- package/files/demo/sale/demo/add-demo/index.scss +207 -0
- package/files/demo/sale/demo/add-demo/index.vue +167 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/data.ts +524 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.scss +155 -0
- package/files/demo/sale/demo/billet-flame-cut-plan/index.vue +117 -0
- package/files/demo/sale/demo/domestic-trade-order/data.ts +308 -0
- package/files/demo/sale/demo/domestic-trade-order/index.scss +99 -0
- package/files/demo/sale/demo/domestic-trade-order/index.vue +77 -0
- package/files/demo/sale/demo/heat-batch-return/data.ts +367 -0
- package/files/demo/sale/demo/heat-batch-return/index.scss +100 -0
- package/files/demo/sale/demo/heat-batch-return/index.vue +170 -0
- package/files/demo/sale/demo/heat-batch-return/meltDialog.vue +320 -0
- package/files/demo/sale/demo/metallurgical-spec/data.ts +825 -0
- package/files/demo/sale/demo/metallurgical-spec/index.scss +264 -0
- package/files/demo/sale/demo/metallurgical-spec/index.vue +309 -0
- package/files/docs/jh-date-range.md +257 -0
- package/files/docs/jh-date.md +222 -0
- package/files/docs/jh-dept-picker.md +190 -0
- package/files/docs/jh-drag-row.md +590 -0
- package/files/docs/jh-file-upload.md +216 -0
- package/files/docs/jh-pagination.md +505 -0
- package/files/docs/jh-picker.md +218 -0
- package/files/docs/jh-select.md +148 -0
- package/files/docs/jh-text.md +248 -0
- package/files/docs/jh-user-picker.md +197 -0
- package/files/docs/page-query-hook-best-practices.md +362 -0
- package/files/docs/request.md +925 -0
- package/files/src/components/global/C_ParentView/index.vue +3 -0
- package/files/src/components/global/C_RightToolbar/index.vue +459 -0
- package/files/src/components/global/C_Splitter/index.vue +195 -0
- package/files/src/components/global/C_SvgIcon/index.vue +61 -0
- package/files/src/components/global/C_SvgIcon/svgicon.js +10 -0
- package/files/src/components/global/C_TagStatus/README.md +264 -0
- package/files/src/components/global/C_TagStatus/config.ts +192 -0
- package/files/src/components/global/C_TagStatus/index.vue +127 -0
- package/files/src/components/global/C_TagStatus/types.ts +64 -0
- package/files/src/components/global/C_Tree/README.md +153 -0
- package/files/src/components/global/C_Tree/index.scss +42 -0
- package/files/src/components/global/C_Tree/index.vue +119 -0
- package/files/src/components/global/C_Tree/types.ts +59 -0
- package/files/src/components/local/c_formModal/README.md +235 -0
- package/files/src/components/local/c_formModal/data.ts +95 -0
- package/files/src/components/local/c_formModal/index.scss +8 -0
- package/files/src/components/local/c_formModal/index.vue +107 -0
- package/files/src/components/local/c_formSections/README.md +496 -0
- package/files/src/components/local/c_formSections/data.ts +175 -0
- package/files/src/components/local/c_formSections/index.scss +280 -0
- package/files/src/components/local/c_formSections/index.vue +429 -0
- package/files/src/components/local/c_listModal/data.ts +41 -0
- package/files/src/components/local/c_listModal/index.vue +136 -0
- package/files/src/components/local/c_spliterTitle/index.scss +25 -0
- package/files/src/components/local/c_spliterTitle/index.vue +21 -0
- package/files/src/components/remote/AGGrid/README.md +530 -0
- package/files/src/components/remote/BaseForm/README.md +508 -0
- package/files/src/components/remote/BaseQuery/README.md +865 -0
- package/files/src/components/remote/BaseTable/README.md +941 -0
- package/files/src/components/remote/BaseToolbar/README.md +496 -0
- package/files/src/types/page.ts +24 -0
- package/package.json +31 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenYu ycyplus@gmail.com
|
|
3
|
+
* @Date: 2025-12-29 15:38:58
|
|
4
|
+
* @LastEditors: ChenYu ycyplus@gmail.com
|
|
5
|
+
* @LastEditTime: 2026-01-03 10:00:00
|
|
6
|
+
* @FilePath: \cx-ui-sale\src\views\sale\demo\add-demo\data.ts
|
|
7
|
+
* @Description: 新增编辑页示例 - 数据逻辑层(可作为新增编辑页模板)
|
|
8
|
+
* Copyright (c) 2025 by CHENY, All Rights Reserved 😎.
|
|
9
|
+
*/
|
|
10
|
+
import { ref, reactive, h, Component, computed } from "vue";
|
|
11
|
+
import { ElMessageBox, ElMessage } from "element-plus";
|
|
12
|
+
import { Check, Document } from "@element-plus/icons-vue";
|
|
13
|
+
import request from "@jhlc/common-core/src/util/request";
|
|
14
|
+
import type {
|
|
15
|
+
SectionConfig,
|
|
16
|
+
NavTabConfig,
|
|
17
|
+
HeaderAction
|
|
18
|
+
} from "@/components/local/c_formSections/data";
|
|
19
|
+
|
|
20
|
+
// ===== 类型定义 =====
|
|
21
|
+
interface ItemData {
|
|
22
|
+
id: number;
|
|
23
|
+
title: string;
|
|
24
|
+
furnaceNumber: string;
|
|
25
|
+
batchNumber: string;
|
|
26
|
+
productionLine: string;
|
|
27
|
+
feedCount: number;
|
|
28
|
+
feedWeight: number;
|
|
29
|
+
scrapCount: number;
|
|
30
|
+
scrapWeight: number;
|
|
31
|
+
operationTime: string;
|
|
32
|
+
shift: string;
|
|
33
|
+
team: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* API 配置 - 统一管理所有接口地址
|
|
38
|
+
*/
|
|
39
|
+
export const API_CONFIG = {
|
|
40
|
+
// 主档操作
|
|
41
|
+
save: "/api/order-form/save",
|
|
42
|
+
saveDraft: "/api/order-form/draft",
|
|
43
|
+
update: "/api/order-form/update",
|
|
44
|
+
getById: "/api/order-form/getOneById",
|
|
45
|
+
// 项次操作
|
|
46
|
+
itemList: "/api/order-items/list",
|
|
47
|
+
itemAdd: "/api/order-items/add",
|
|
48
|
+
itemRemove: "/api/order-items/remove"
|
|
49
|
+
} as const;
|
|
50
|
+
|
|
51
|
+
// ===== 状态定义 =====
|
|
52
|
+
/** 项次信息表格全屏状态 */
|
|
53
|
+
export const isItemTableFullscreen = ref(false);
|
|
54
|
+
|
|
55
|
+
/** 折叠面板展开状态 */
|
|
56
|
+
export const activeNames = ref(["1", "2", "3", "4", "5"]);
|
|
57
|
+
|
|
58
|
+
// ===== 顶部操作按钮配置 =====
|
|
59
|
+
export const headerActions: HeaderAction[] = [
|
|
60
|
+
{
|
|
61
|
+
label: "保存",
|
|
62
|
+
type: "primary",
|
|
63
|
+
icon: Check as Component,
|
|
64
|
+
onClick: async () => {
|
|
65
|
+
await saveForm(false);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "保存为草稿",
|
|
70
|
+
icon: Document as Component,
|
|
71
|
+
onClick: async () => {
|
|
72
|
+
await saveForm(true);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "取消",
|
|
77
|
+
onClick: () => {
|
|
78
|
+
ElMessageBox.confirm("确认放弃当前更改吗?", "提示", {
|
|
79
|
+
confirmButtonText: "确定",
|
|
80
|
+
cancelButtonText: "取消",
|
|
81
|
+
type: "warning"
|
|
82
|
+
})
|
|
83
|
+
.then(() => {
|
|
84
|
+
resetForm();
|
|
85
|
+
ElMessage.success("已清空表单数据");
|
|
86
|
+
})
|
|
87
|
+
.catch(() => {
|
|
88
|
+
// 用户取消操作
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
// ===== 楼层导航配置 =====
|
|
95
|
+
export const navTabsConfig: NavTabConfig[] = [
|
|
96
|
+
{ label: "订单信息", name: "order", sectionName: null },
|
|
97
|
+
{ label: "基本信息", name: "basic", sectionName: "1" },
|
|
98
|
+
{ label: "产品规格", name: "spec", sectionName: "5" },
|
|
99
|
+
{ label: "价格信息", name: "price", sectionName: null },
|
|
100
|
+
{ label: "生产要求", name: "production", sectionName: null },
|
|
101
|
+
{ label: "运输信息", name: "shipping", sectionName: "2" },
|
|
102
|
+
{ label: "特殊需求", name: "special", sectionName: "3" },
|
|
103
|
+
{ label: "变更信息", name: "change", sectionName: "4" }
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
/** 切换项次信息表格全屏状态 */
|
|
107
|
+
export const toggleItemTableFullscreen = () => {
|
|
108
|
+
isItemTableFullscreen.value = !isItemTableFullscreen.value;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// ===== 表单数据配置(数据+配置合一) =====
|
|
112
|
+
const formFieldsData = {
|
|
113
|
+
// 基本信息
|
|
114
|
+
basicInfo: {
|
|
115
|
+
mpsRequirement: {
|
|
116
|
+
value: "0-无",
|
|
117
|
+
label: "MPS要求",
|
|
118
|
+
type: "select",
|
|
119
|
+
options: [{ label: "0-无", value: "0-无" }]
|
|
120
|
+
},
|
|
121
|
+
mpsNumber: { value: "", label: "MPS编号", type: "input" },
|
|
122
|
+
mpsText: { value: "", label: "MPS文本", type: "input" },
|
|
123
|
+
supervisionRequirement: {
|
|
124
|
+
value: "0-无",
|
|
125
|
+
label: "监制要求",
|
|
126
|
+
type: "select",
|
|
127
|
+
options: [{ label: "0-无", value: "0-无" }]
|
|
128
|
+
},
|
|
129
|
+
firstDayInspection: {
|
|
130
|
+
value: "0-否",
|
|
131
|
+
label: "首日检",
|
|
132
|
+
type: "select",
|
|
133
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
134
|
+
},
|
|
135
|
+
isCollaborative: {
|
|
136
|
+
value: "0-否",
|
|
137
|
+
label: "是否协同",
|
|
138
|
+
type: "select",
|
|
139
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
140
|
+
},
|
|
141
|
+
orderEngineeringNo: { value: "", label: "订单工程编号", type: "input" },
|
|
142
|
+
process: { value: "", label: "制程", type: "input" },
|
|
143
|
+
fullOrderDelivery: {
|
|
144
|
+
value: "0-否",
|
|
145
|
+
label: "整单交付",
|
|
146
|
+
type: "select",
|
|
147
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
148
|
+
},
|
|
149
|
+
forcedRelease: {
|
|
150
|
+
value: "0-否",
|
|
151
|
+
label: "强制放行",
|
|
152
|
+
type: "select",
|
|
153
|
+
required: true,
|
|
154
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
155
|
+
},
|
|
156
|
+
isSampleDeliveryFree: {
|
|
157
|
+
value: "0-否",
|
|
158
|
+
label: "是否免费送样",
|
|
159
|
+
type: "select",
|
|
160
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
// 运输信息
|
|
164
|
+
shippingInfo: {
|
|
165
|
+
shippingMethod: {
|
|
166
|
+
value: "Q-汽运",
|
|
167
|
+
label: "运输方式",
|
|
168
|
+
type: "input",
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
consignee: { value: "002", label: "收货人", type: "input", required: true },
|
|
172
|
+
consigneeUnit: {
|
|
173
|
+
value: "中国石化国际石油工...",
|
|
174
|
+
label: "收货单位",
|
|
175
|
+
type: "input"
|
|
176
|
+
},
|
|
177
|
+
deliveryLocation: { value: "产出库", label: "交运地点", type: "input" },
|
|
178
|
+
arrivalStation: { value: "", label: "到站", type: "input" },
|
|
179
|
+
dedicatedLine: { value: "", label: "专用线", type: "input" },
|
|
180
|
+
consigneeAddress: {
|
|
181
|
+
value: "北京市朝阳区6A",
|
|
182
|
+
label: "收货地址",
|
|
183
|
+
type: "input"
|
|
184
|
+
},
|
|
185
|
+
consigneeSequenceNo: {
|
|
186
|
+
value: "002",
|
|
187
|
+
label: "收货人序号",
|
|
188
|
+
type: "input",
|
|
189
|
+
required: true
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
// 变更信息
|
|
193
|
+
changeInfo: {
|
|
194
|
+
changeType: { value: "", label: "变更类型", type: "input" },
|
|
195
|
+
changePerson: { value: "", label: "变更人", type: "input" },
|
|
196
|
+
changeTime: { value: "", label: "变更时间", type: "input" },
|
|
197
|
+
changeReason: { value: "", label: "变更原因", type: "textarea", rows: 2 },
|
|
198
|
+
changeFirstDayInspection: {
|
|
199
|
+
value: "0-否",
|
|
200
|
+
label: "首日检",
|
|
201
|
+
type: "select",
|
|
202
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
203
|
+
},
|
|
204
|
+
changeIsCollaborative: {
|
|
205
|
+
value: "0-否",
|
|
206
|
+
label: "是否协同",
|
|
207
|
+
type: "select",
|
|
208
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
209
|
+
},
|
|
210
|
+
changeOrderEngineeringNo: {
|
|
211
|
+
value: "",
|
|
212
|
+
label: "订单工程编号",
|
|
213
|
+
type: "input"
|
|
214
|
+
},
|
|
215
|
+
changeIsSampleDeliveryFree: {
|
|
216
|
+
value: "0-否",
|
|
217
|
+
label: "是否免费送样",
|
|
218
|
+
type: "select",
|
|
219
|
+
options: [{ label: "0-否", value: "0-否" }]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
// 产品规格
|
|
223
|
+
productSpec: {
|
|
224
|
+
productName: {
|
|
225
|
+
value: "",
|
|
226
|
+
label: "产品名称",
|
|
227
|
+
type: "input",
|
|
228
|
+
required: true
|
|
229
|
+
},
|
|
230
|
+
productCode: {
|
|
231
|
+
value: "",
|
|
232
|
+
label: "产品编码",
|
|
233
|
+
type: "input",
|
|
234
|
+
required: true
|
|
235
|
+
},
|
|
236
|
+
specification: { value: "", label: "规格型号", type: "input" },
|
|
237
|
+
material: { value: "", label: "材质", type: "input", required: true },
|
|
238
|
+
diameter: { value: "", label: "直径(mm)", type: "input" },
|
|
239
|
+
length: { value: "", label: "长度(mm)", type: "input" },
|
|
240
|
+
thickness: { value: "", label: "壁厚(mm)", type: "input" },
|
|
241
|
+
unitWeight: { value: "", label: "单重(kg)", type: "input" },
|
|
242
|
+
standard: { value: "", label: "执行标准", type: "input" },
|
|
243
|
+
surfaceTreatment: { value: "", label: "表面处理", type: "input" }
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** 表单数据(自动从配置生成) */
|
|
248
|
+
export const form = reactive(
|
|
249
|
+
Object.values(formFieldsData).reduce((acc, section) => {
|
|
250
|
+
Object.entries(section).forEach(([key, config]) => {
|
|
251
|
+
acc[key] = config.value;
|
|
252
|
+
});
|
|
253
|
+
return acc;
|
|
254
|
+
}, {} as Record<string, any>)
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
// ===== 区块元数据配置 =====
|
|
258
|
+
const sectionsMeta = [
|
|
259
|
+
{ key: "basicInfo", name: "1", id: "section-1", title: "基本信息" },
|
|
260
|
+
{ key: "shippingInfo", name: "2", id: "section-2", title: "运输信息" },
|
|
261
|
+
{
|
|
262
|
+
key: "special",
|
|
263
|
+
name: "3",
|
|
264
|
+
id: "section-3",
|
|
265
|
+
title: "特殊需求",
|
|
266
|
+
isSpecial: true
|
|
267
|
+
},
|
|
268
|
+
{ key: "changeInfo", name: "4", id: "section-4", title: "变更信息" },
|
|
269
|
+
{ key: "productSpec", name: "5", id: "section-5", title: "产品规格" }
|
|
270
|
+
] as const;
|
|
271
|
+
|
|
272
|
+
/** 自动生成区块配置 */
|
|
273
|
+
const sectionsConfigRaw: SectionConfig[] = sectionsMeta.map((meta) => ({
|
|
274
|
+
name: meta.name,
|
|
275
|
+
id: meta.id,
|
|
276
|
+
title: meta.title,
|
|
277
|
+
isSpecial: "isSpecial" in meta ? meta.isSpecial : undefined,
|
|
278
|
+
fieldsConfig:
|
|
279
|
+
meta.key === "special"
|
|
280
|
+
? []
|
|
281
|
+
: Object.entries(
|
|
282
|
+
formFieldsData[meta.key as keyof typeof formFieldsData] || {}
|
|
283
|
+
).map(([prop, config]) => {
|
|
284
|
+
const { value, ...rest } = config;
|
|
285
|
+
return { prop, ...rest } as any;
|
|
286
|
+
})
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
/** 表单区域配置(组件内部处理过滤逻辑) */
|
|
290
|
+
export const sectionsConfig = sectionsConfigRaw;
|
|
291
|
+
|
|
292
|
+
// ===== 项次信息表格配置 =====
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* 处理标题点击事件
|
|
296
|
+
* @param row 当前行数据
|
|
297
|
+
* @param index 行索引(从 0 开始)
|
|
298
|
+
*/
|
|
299
|
+
export const handleTitleClick = (row: ItemData, index: number) => {
|
|
300
|
+
ElMessageBox.alert(
|
|
301
|
+
`你可以对我做点什么操作?
|
|
302
|
+
|
|
303
|
+
行 ID: ${row.id}
|
|
304
|
+
行序号: ${index + 1}
|
|
305
|
+
标题: ${row.title}
|
|
306
|
+
炉号: ${row.furnaceNumber}
|
|
307
|
+
批号: ${row.batchNumber}
|
|
308
|
+
|
|
309
|
+
这里可以添加编辑、查看详情、删除等操作按钮。`,
|
|
310
|
+
`点击了第 ${index + 1} 行`,
|
|
311
|
+
{
|
|
312
|
+
confirmButtonText: "知道了",
|
|
313
|
+
type: "info"
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export const itemColumnsConfig = [
|
|
319
|
+
{ type: "selection", width: 40 },
|
|
320
|
+
{ type: "index", label: "序号", width: 60 },
|
|
321
|
+
{
|
|
322
|
+
name: "title",
|
|
323
|
+
label: "标题",
|
|
324
|
+
minWidth: 90,
|
|
325
|
+
// 使用 defaultSlot 自定义渲染蓝色链接样式,添加点击事件
|
|
326
|
+
defaultSlot: ({ row, $index }: { row: any; $index: number }) => {
|
|
327
|
+
return h(
|
|
328
|
+
"span",
|
|
329
|
+
{
|
|
330
|
+
style: "color: #409eff; cursor: pointer; text-decoration: underline;",
|
|
331
|
+
onClick: () => handleTitleClick(row, $index)
|
|
332
|
+
},
|
|
333
|
+
row.title
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "furnaceNumber",
|
|
339
|
+
label: "炉号",
|
|
340
|
+
minWidth: 110,
|
|
341
|
+
showOverflowTooltip: true
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "batchNumber",
|
|
345
|
+
label: "批号",
|
|
346
|
+
minWidth: 110,
|
|
347
|
+
showOverflowTooltip: true
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "productionLine",
|
|
351
|
+
label: "生产线",
|
|
352
|
+
minWidth: 150,
|
|
353
|
+
showOverflowTooltip: true
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: "feedCount",
|
|
357
|
+
label: "上料支数",
|
|
358
|
+
minWidth: 90,
|
|
359
|
+
showOverflowTooltip: true
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "feedWeight",
|
|
363
|
+
label: "上料重量",
|
|
364
|
+
minWidth: 90,
|
|
365
|
+
showOverflowTooltip: true
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: "scrapCount",
|
|
369
|
+
label: "废品支数",
|
|
370
|
+
minWidth: 90,
|
|
371
|
+
showOverflowTooltip: true
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "scrapWeight",
|
|
375
|
+
label: "废品重量",
|
|
376
|
+
minWidth: 90,
|
|
377
|
+
showOverflowTooltip: true
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: "operationTime",
|
|
381
|
+
label: "操作时间",
|
|
382
|
+
minWidth: 140,
|
|
383
|
+
showOverflowTooltip: true
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "shift",
|
|
387
|
+
label: "班次",
|
|
388
|
+
minWidth: 80,
|
|
389
|
+
showOverflowTooltip: true,
|
|
390
|
+
filterable: true
|
|
391
|
+
},
|
|
392
|
+
{ name: "team", label: "班组", minWidth: 80, showOverflowTooltip: true }
|
|
393
|
+
];
|
|
394
|
+
|
|
395
|
+
// ===== 数据生成 =====
|
|
396
|
+
/** 项次数据 */
|
|
397
|
+
export const itemData = ref<ItemData[]>([]);
|
|
398
|
+
|
|
399
|
+
/** 分页状态 */
|
|
400
|
+
export const currentPage = ref(1);
|
|
401
|
+
export const pageSize = ref(10);
|
|
402
|
+
|
|
403
|
+
/** 项次数据总数 */
|
|
404
|
+
export const itemTotal = ref(0);
|
|
405
|
+
|
|
406
|
+
/** 分页后的项次数据 */
|
|
407
|
+
export const paginatedItemData = computed(() => {
|
|
408
|
+
const start = (currentPage.value - 1) * pageSize.value;
|
|
409
|
+
const end = start + pageSize.value;
|
|
410
|
+
return itemData.value.slice(start, end);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
// ========== 方法定义 ==========
|
|
414
|
+
/** 添加特殊需求 */
|
|
415
|
+
export const addSpecialRequirement = () => {
|
|
416
|
+
console.log("添加特殊需求");
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 表单验证
|
|
421
|
+
*/
|
|
422
|
+
const validateForm = (): boolean => {
|
|
423
|
+
// 检查必填字段
|
|
424
|
+
const requiredFields = [
|
|
425
|
+
{ key: "productName", label: "产品名称" },
|
|
426
|
+
{ key: "productCode", label: "产品编码" },
|
|
427
|
+
{ key: "material", label: "材质" },
|
|
428
|
+
{ key: "shippingMethod", label: "运输方式" },
|
|
429
|
+
{ key: "consignee", label: "收货人" },
|
|
430
|
+
{ key: "consigneeSequenceNo", label: "收货人序号" },
|
|
431
|
+
{ key: "forcedRelease", label: "强制放行" }
|
|
432
|
+
];
|
|
433
|
+
|
|
434
|
+
for (const field of requiredFields) {
|
|
435
|
+
if (!form[field.key]) {
|
|
436
|
+
ElMessage.error(`请填写${field.label}`);
|
|
437
|
+
return false;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return true;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* 保存表单
|
|
446
|
+
* @param isDraft 是否保存为草稿
|
|
447
|
+
*/
|
|
448
|
+
const saveForm = async (isDraft: boolean) => {
|
|
449
|
+
try {
|
|
450
|
+
// 草稿可以不验证必填项
|
|
451
|
+
if (!isDraft && !validateForm()) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const res = await request({
|
|
456
|
+
url: isDraft ? API_CONFIG.saveDraft : API_CONFIG.save,
|
|
457
|
+
method: "post",
|
|
458
|
+
data: {
|
|
459
|
+
...form,
|
|
460
|
+
isDraft
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
ElMessage.success(res.message || (isDraft ? "草稿保存成功" : "保存成功"));
|
|
465
|
+
} catch (err) {
|
|
466
|
+
console.error("保存失败:", err);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* 重置表单
|
|
472
|
+
*/
|
|
473
|
+
const resetForm = () => {
|
|
474
|
+
Object.keys(form).forEach((key) => {
|
|
475
|
+
if (typeof form[key] === "string") {
|
|
476
|
+
form[key] = "";
|
|
477
|
+
} else if (typeof form[key] === "number") {
|
|
478
|
+
form[key] = 0;
|
|
479
|
+
} else if (Array.isArray(form[key])) {
|
|
480
|
+
form[key] = [];
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* 加载项次数据
|
|
487
|
+
*/
|
|
488
|
+
export const fetchItemData = async () => {
|
|
489
|
+
try {
|
|
490
|
+
const res = await request({
|
|
491
|
+
url: API_CONFIG.itemList,
|
|
492
|
+
method: "get",
|
|
493
|
+
params: {
|
|
494
|
+
page: currentPage.value,
|
|
495
|
+
size: pageSize.value
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
itemData.value = res.data.records || res.data;
|
|
500
|
+
itemTotal.value = res.data.total || res.data.length;
|
|
501
|
+
} catch (err) {
|
|
502
|
+
console.error("加载项次数据失败:", err);
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 刷新项次数据
|
|
508
|
+
*/
|
|
509
|
+
export const refreshItemData = () => {
|
|
510
|
+
fetchItemData();
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* 页面初始化
|
|
515
|
+
*/
|
|
516
|
+
export const initPage = () => {
|
|
517
|
+
fetchItemData();
|
|
518
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 新增编辑页示例 - 样式层
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.main-maintenance-container {
|
|
6
|
+
padding: 8px;
|
|
7
|
+
background-color: #f5f5f5;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
height: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
|
|
13
|
+
// C_Splitter 区域
|
|
14
|
+
.main-splitter {
|
|
15
|
+
flex: 1;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 表单卡片
|
|
20
|
+
.form-card {
|
|
21
|
+
height: 100%;
|
|
22
|
+
:deep(.el-card__body) {
|
|
23
|
+
padding: 0;
|
|
24
|
+
height: 100%;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 项次信息卡片
|
|
31
|
+
.items-card {
|
|
32
|
+
height: 100%;
|
|
33
|
+
:deep(.el-card__body) {
|
|
34
|
+
padding: 0;
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 全屏覆盖层
|
|
41
|
+
.fullscreen-overlay {
|
|
42
|
+
position: fixed;
|
|
43
|
+
top: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
width: 100vw;
|
|
46
|
+
height: 100vh;
|
|
47
|
+
z-index: 9999;
|
|
48
|
+
background: rgba(0, 0, 0, 0.5);
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
animation: fadeIn 0.3s;
|
|
53
|
+
|
|
54
|
+
.items-card-fullscreen {
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
margin: 0;
|
|
58
|
+
border-radius: 0;
|
|
59
|
+
|
|
60
|
+
:deep(.el-card__body) {
|
|
61
|
+
padding: 0;
|
|
62
|
+
height: 100%;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.child-items-section {
|
|
68
|
+
height: 100%;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@keyframes fadeIn {
|
|
74
|
+
from {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
to {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 子表格及增加行
|
|
84
|
+
.sub-table-container {
|
|
85
|
+
margin-top: 15px;
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.add-row {
|
|
90
|
+
color: #409eff;
|
|
91
|
+
font-size: 13px;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
border: 1px dashed #dcdfe6;
|
|
94
|
+
border-top: none;
|
|
95
|
+
text-align: left;
|
|
96
|
+
padding: 8px 12px;
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
background-color: #f5f7fa;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 项次信息区域
|
|
104
|
+
.child-items-section {
|
|
105
|
+
height: 100%;
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
background: #fff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.section-header {
|
|
112
|
+
padding: 8px 16px;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
border-bottom: 1px solid #e4e7ed;
|
|
117
|
+
background: #fafafa;
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
|
|
120
|
+
.collapse-icon {
|
|
121
|
+
color: #409eff;
|
|
122
|
+
font-size: 12px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.fullscreen-icon {
|
|
126
|
+
font-size: 18px;
|
|
127
|
+
color: #606266;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
transition: all 0.3s;
|
|
130
|
+
padding: 4px;
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
|
|
133
|
+
&:hover {
|
|
134
|
+
color: #409eff;
|
|
135
|
+
background-color: rgba(64, 158, 255, 0.1);
|
|
136
|
+
transform: scale(1.1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:active {
|
|
140
|
+
transform: scale(0.95);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.title-group {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 6px;
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
font-size: 13px;
|
|
150
|
+
color: #303133;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.child-table {
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
flex: 1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// 分页容器
|
|
160
|
+
.items-pagination {
|
|
161
|
+
padding: 12px 16px;
|
|
162
|
+
border-top: 1px solid #e4e7ed;
|
|
163
|
+
background: #fff;
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
|
|
166
|
+
// 拖动提示(仅常规模式显示)
|
|
167
|
+
.drag-hint {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
gap: 4px;
|
|
172
|
+
margin-bottom: 8px;
|
|
173
|
+
color: #909399;
|
|
174
|
+
font-size: 12px;
|
|
175
|
+
|
|
176
|
+
.drag-icon {
|
|
177
|
+
font-size: 14px;
|
|
178
|
+
color: #f56c6c;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.hint-text {
|
|
182
|
+
color: #909399;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 表格头部样式
|
|
188
|
+
:deep(.el-table th) {
|
|
189
|
+
background-color: #f5f7fa !important;
|
|
190
|
+
color: #606266;
|
|
191
|
+
font-size: 12px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 表格行样式
|
|
195
|
+
:deep(.el-table td) {
|
|
196
|
+
font-size: 12px;
|
|
197
|
+
padding: 6px 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// 表单字段全宽
|
|
201
|
+
:deep(.el-form-item__content) {
|
|
202
|
+
& > .el-select,
|
|
203
|
+
& > .el-input,
|
|
204
|
+
& > .el-date-picker {
|
|
205
|
+
width: 100%;
|
|
206
|
+
}
|
|
207
|
+
}
|