|
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+<script setup>
|
|
|
2
|
+import { getCurrentInstance, onMounted, ref, computed } from 'vue';
|
|
|
3
|
+import { useRoute, useRouter } from 'vue-router';
|
|
|
4
|
+import tools from '@/tools'
|
|
|
5
|
+const {
|
|
|
6
|
+ proxy
|
|
|
7
|
+} = getCurrentInstance()
|
|
|
8
|
+
|
|
|
9
|
+const projectDictList = ref([])
|
|
|
10
|
+const caseTypeColumns = ref([])
|
|
|
11
|
+const caseSourceColumns = ref([])
|
|
|
12
|
+
|
|
|
13
|
+// 定义生成编号的函数
|
|
|
14
|
+const generateCode = () => {
|
|
|
15
|
+ const now = new Date();
|
|
|
16
|
+ const year = now.getFullYear();
|
|
|
17
|
+ const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
18
|
+ const day = String(now.getDate()).padStart(2, '0');
|
|
|
19
|
+ const formattedDate = `${year}${month}${day}`;
|
|
|
20
|
+ const hours = String(now.getHours()).padStart(2, '0');
|
|
|
21
|
+ const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
|
22
|
+ const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
|
23
|
+ const formattedTime = `${hours}${minutes}${seconds}`;
|
|
|
24
|
+ const sequenceNumber = Math.floor(Math.random() * 1000);
|
|
|
25
|
+ const paddedSequence = String(sequenceNumber).padStart(3, '0');
|
|
|
26
|
+ return `XMAL${formattedDate}${formattedTime}${paddedSequence}`;
|
|
|
27
|
+};
|
|
|
28
|
+
|
|
|
29
|
+// 获取字典数据
|
|
|
30
|
+const getProjectDicList = () => {
|
|
|
31
|
+ tools.dic.getDicList(['sgsafe_project_case_type', 'sgsafe_project_case_source']).then((response => {
|
|
|
32
|
+ console.log(JSON.stringify(response.data.data))
|
|
|
33
|
+ projectDictList.value = response.data.data
|
|
|
34
|
+
|
|
|
35
|
+ caseTypeColumns.value = projectDictList.value.sgsafe_project_case_type?.map(item => ({
|
|
|
36
|
+ text: item.dicName,
|
|
|
37
|
+ value: item.dicCode
|
|
|
38
|
+ })) || [];
|
|
|
39
|
+
|
|
|
40
|
+ caseSourceColumns.value = projectDictList.value.sgsafe_project_case_source?.map(item => ({
|
|
|
41
|
+ text: item.dicName,
|
|
|
42
|
+ value: item.dicCode
|
|
|
43
|
+ })) || [];
|
|
|
44
|
+
|
|
|
45
|
+ console.log('案例类型:', caseTypeColumns.value)
|
|
|
46
|
+ }))
|
|
|
47
|
+}
|
|
|
48
|
+
|
|
|
49
|
+const caseTypeFlag = ref(false)
|
|
|
50
|
+const caseSourceFlag = ref(false)
|
|
|
51
|
+let title = '新增项目案例'
|
|
|
52
|
+
|
|
|
53
|
+/* 返回上一级页面 */
|
|
|
54
|
+const router = useRouter()
|
|
|
55
|
+const onClickLeft = () => {
|
|
|
56
|
+ router.go(-1)
|
|
|
57
|
+}
|
|
|
58
|
+
|
|
|
59
|
+const guid = () => {
|
|
|
60
|
+ function S4() {
|
|
|
61
|
+ return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
|
62
|
+ }
|
|
|
63
|
+ return (S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4())
|
|
|
64
|
+}
|
|
|
65
|
+
|
|
|
66
|
+const route = useRoute()
|
|
|
67
|
+let planInfo = {}
|
|
|
68
|
+const isEdit = ref(route.query.mark === '1');
|
|
|
69
|
+const isReadOnly = ref(route.query.readOnly === 'true');
|
|
|
70
|
+const isCaseSubmitted = computed(() => isReadOnly.value && isEdit.value);
|
|
|
71
|
+const result = ref('')
|
|
|
72
|
+const fromVue = ref({})
|
|
|
73
|
+
|
|
|
74
|
+if (route.query.mark) {
|
|
|
75
|
+ planInfo = JSON.parse(route.query.mark)
|
|
|
76
|
+}
|
|
|
77
|
+
|
|
|
78
|
+
|
|
|
79
|
+// 新增模式
|
|
|
80
|
+if (planInfo == -1) {
|
|
|
81
|
+ const caseNumber = generateCode();
|
|
|
82
|
+ result.value = caseNumber;
|
|
|
83
|
+
|
|
|
84
|
+ fromVue.value = {
|
|
|
85
|
+ caseNumber: caseNumber,
|
|
|
86
|
+ projectName: '',
|
|
|
87
|
+ caseType: '',
|
|
|
88
|
+ caseSource: '',
|
|
|
89
|
+ startTime: '',
|
|
|
90
|
+ endTime: '',
|
|
|
91
|
+ tags: '',
|
|
|
92
|
+ caseSummary: '',
|
|
|
93
|
+ highLights: '',
|
|
|
94
|
+ resultsValue: '',
|
|
|
95
|
+ fileId: caseNumber,
|
|
|
96
|
+ viewCount: '0',
|
|
|
97
|
+ downloadCount: '0'
|
|
|
98
|
+ };
|
|
|
99
|
+
|
|
|
100
|
+}
|
|
|
101
|
+
|
|
|
102
|
+// 编辑模式
|
|
|
103
|
+if (planInfo == 1) {
|
|
|
104
|
+ title = '查看项目案例'
|
|
|
105
|
+ fromVue.value = JSON.parse(route.query.data)
|
|
|
106
|
+
|
|
|
107
|
+ // 清理微秒格式
|
|
|
108
|
+ if (fromVue.value.startTime && String(fromVue.value.startTime).includes('.')) {
|
|
|
109
|
+ fromVue.value.startTime = String(fromVue.value.startTime).split('.')[0];
|
|
|
110
|
+ }
|
|
|
111
|
+ if (fromVue.value.endTime && String(fromVue.value.endTime).includes('.')) {
|
|
|
112
|
+ fromVue.value.endTime = String(fromVue.value.endTime).split('.')[0];
|
|
|
113
|
+ }
|
|
|
114
|
+
|
|
|
115
|
+ // fileId 与 caseNumber 保持一致
|
|
|
116
|
+ if (!fromVue.value.fileId || fromVue.value.fileId !== fromVue.value.caseNumber) {
|
|
|
117
|
+ fromVue.value.fileId = fromVue.value.caseNumber;
|
|
|
118
|
+ }
|
|
|
119
|
+ result.value = fromVue.value.fileId;
|
|
|
120
|
+}
|
|
|
121
|
+
|
|
|
122
|
+// 时间选择器
|
|
|
123
|
+const showStartTimePicker = ref(false);
|
|
|
124
|
+const showEndTimePicker = ref(false);
|
|
|
125
|
+const currentStartDate = ref([2025, 1, 1])
|
|
|
126
|
+const currentEndDate = ref([2025, 1, 1])
|
|
|
127
|
+const currentStartTime = ref([0, 0, 0]);
|
|
|
128
|
+const currentEndTime = ref([0, 0, 0]);
|
|
|
129
|
+const minDate = ref(new Date(1900, 0, 1));
|
|
|
130
|
+const maxDate = ref(new Date(2100, 11, 31));
|
|
|
131
|
+
|
|
|
132
|
+const startDateOrTime = ref(false);
|
|
|
133
|
+const endDateOrTime = ref(false);
|
|
|
134
|
+
|
|
|
135
|
+// 开始时间选择
|
|
|
136
|
+const onStartDateConfirm = () => {
|
|
|
137
|
+ startDateOrTime.value = true;
|
|
|
138
|
+};
|
|
|
139
|
+
|
|
|
140
|
+const onConfirmStartDatetime = () => {
|
|
|
141
|
+ const year = currentStartDate.value[0];
|
|
|
142
|
+ const month = currentStartDate.value[1].toString().padStart(2, '0');
|
|
|
143
|
+ const day = currentStartDate.value[2].toString().padStart(2, '0');
|
|
|
144
|
+ const hours = currentStartTime.value[0].toString().padStart(2, '0');
|
|
|
145
|
+ const minutes = currentStartTime.value[1].toString().padStart(2, '0');
|
|
|
146
|
+ const seconds = currentStartTime.value[2].toString().padStart(2, '0');
|
|
|
147
|
+
|
|
|
148
|
+ fromVue.value.startTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
149
|
+ showStartTimePicker.value = false;
|
|
|
150
|
+ startDateOrTime.value = false;
|
|
|
151
|
+};
|
|
|
152
|
+
|
|
|
153
|
+const cancelStartDatePicker = () => {
|
|
|
154
|
+ showStartTimePicker.value = false;
|
|
|
155
|
+ startDateOrTime.value = false;
|
|
|
156
|
+};
|
|
|
157
|
+
|
|
|
158
|
+const cancelStartTimePicker = () => {
|
|
|
159
|
+ showStartTimePicker.value = false;
|
|
|
160
|
+ startDateOrTime.value = false;
|
|
|
161
|
+};
|
|
|
162
|
+
|
|
|
163
|
+// 结束时间选择
|
|
|
164
|
+const onEndDateConfirm = () => {
|
|
|
165
|
+ endDateOrTime.value = true;
|
|
|
166
|
+};
|
|
|
167
|
+
|
|
|
168
|
+const onConfirmEndDatetime = () => {
|
|
|
169
|
+ const year = currentEndDate.value[0];
|
|
|
170
|
+ const month = currentEndDate.value[1].toString().padStart(2, '0');
|
|
|
171
|
+ const day = currentEndDate.value[2].toString().padStart(2, '0');
|
|
|
172
|
+ const hours = currentEndTime.value[0].toString().padStart(2, '0');
|
|
|
173
|
+ const minutes = currentEndTime.value[1].toString().padStart(2, '0');
|
|
|
174
|
+ const seconds = currentEndTime.value[2].toString().padStart(2, '0');
|
|
|
175
|
+
|
|
|
176
|
+ fromVue.value.endTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
177
|
+ showEndTimePicker.value = false;
|
|
|
178
|
+ endDateOrTime.value = false;
|
|
|
179
|
+};
|
|
|
180
|
+
|
|
|
181
|
+const cancelEndDatePicker = () => {
|
|
|
182
|
+ showEndTimePicker.value = false;
|
|
|
183
|
+ endDateOrTime.value = false;
|
|
|
184
|
+};
|
|
|
185
|
+
|
|
|
186
|
+const cancelEndTimePicker = () => {
|
|
|
187
|
+ showEndTimePicker.value = false;
|
|
|
188
|
+ endDateOrTime.value = false;
|
|
|
189
|
+};
|
|
|
190
|
+
|
|
|
191
|
+// 标签选择
|
|
|
192
|
+const addTag = (item) => {
|
|
|
193
|
+ if (isCaseSubmitted.value) return;
|
|
|
194
|
+
|
|
|
195
|
+ const valueToStore = item.value?.trim() || '';
|
|
|
196
|
+ if (!valueToStore) return;
|
|
|
197
|
+
|
|
|
198
|
+ const currentTags = fromVue.value.tags
|
|
|
199
|
+ ? fromVue.value.tags.split(',').map(t => t.trim()).filter(Boolean)
|
|
|
200
|
+ : [];
|
|
|
201
|
+
|
|
|
202
|
+ if (currentTags.includes(valueToStore)) return;
|
|
|
203
|
+
|
|
|
204
|
+ currentTags.push(valueToStore);
|
|
|
205
|
+ fromVue.value.tags = currentTags.join(', ');
|
|
|
206
|
+};
|
|
|
207
|
+
|
|
|
208
|
+/* 组织树选择 */
|
|
|
209
|
+import { showFailToast, showLoadingToast, showSuccessToast } from 'vant';
|
|
|
210
|
+
|
|
|
211
|
+// 保存
|
|
|
212
|
+const addEmergencyDrillPlan = async () => {
|
|
|
213
|
+ const loadingToast = showLoadingToast({
|
|
|
214
|
+ duration: 0,
|
|
|
215
|
+ message: '加载中',
|
|
|
216
|
+ forbidClick: true
|
|
|
217
|
+ })
|
|
|
218
|
+
|
|
|
219
|
+ fromVue.value.fileId = result.value
|
|
|
220
|
+
|
|
|
221
|
+ var url = '/sgsafe/Manager/saveProject';
|
|
|
222
|
+ const params = {
|
|
|
223
|
+ json: JSON.stringify(fromVue.value)
|
|
|
224
|
+ }
|
|
|
225
|
+ proxy.$axios.post(url, params).then(res => {
|
|
|
226
|
+ if (res.data.code === 0 || res.data.code === '0') {
|
|
|
227
|
+ loadingToast.close()
|
|
|
228
|
+ showSuccessToast('保存成功')
|
|
|
229
|
+ onClickLeft()
|
|
|
230
|
+ } else {
|
|
|
231
|
+ loadingToast.close()
|
|
|
232
|
+ showFailToast('操作失败!' + res.data.msg)
|
|
|
233
|
+ }
|
|
|
234
|
+ }).catch(error => {
|
|
|
235
|
+ loadingToast.close()
|
|
|
236
|
+ showFailToast('保存失败: 网络错误')
|
|
|
237
|
+ console.error('保存失败:', error)
|
|
|
238
|
+ })
|
|
|
239
|
+}
|
|
|
240
|
+
|
|
|
241
|
+onMounted(() => {
|
|
|
242
|
+ getProjectDicList()
|
|
|
243
|
+ const today = new Date()
|
|
|
244
|
+ const year = today.getFullYear()
|
|
|
245
|
+ const month = today.getMonth() + 1
|
|
|
246
|
+ const day = today.getDate()
|
|
|
247
|
+ currentStartDate.value = [year, month, day]
|
|
|
248
|
+ currentEndDate.value = [year, month, day]
|
|
|
249
|
+ currentStartTime.value = [today.getHours(), today.getMinutes(), today.getSeconds()];
|
|
|
250
|
+ currentEndTime.value = [today.getHours(), today.getMinutes(), today.getSeconds()];
|
|
|
251
|
+
|
|
|
252
|
+ // 如果是编辑模式且有已有的时间,解析并初始化
|
|
|
253
|
+ if (isEdit.value) {
|
|
|
254
|
+ if (fromVue.value.startTime) {
|
|
|
255
|
+ try {
|
|
|
256
|
+ const timeStr = fromVue.value.startTime;
|
|
|
257
|
+ const [datePart, timePart] = timeStr.split(' ');
|
|
|
258
|
+ if (datePart && timePart) {
|
|
|
259
|
+ const [year, month, day] = datePart.split('-').map(Number);
|
|
|
260
|
+ const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
|
261
|
+ currentStartDate.value = [year, month, day];
|
|
|
262
|
+ currentStartTime.value = [hours || 0, minutes || 0, seconds || 0];
|
|
|
263
|
+ }
|
|
|
264
|
+ } catch (error) {
|
|
|
265
|
+ // 解析失败,使用默认值
|
|
|
266
|
+ }
|
|
|
267
|
+ }
|
|
|
268
|
+
|
|
|
269
|
+ if (fromVue.value.endTime) {
|
|
|
270
|
+ try {
|
|
|
271
|
+ const timeStr = fromVue.value.endTime;
|
|
|
272
|
+ const [datePart, timePart] = timeStr.split(' ');
|
|
|
273
|
+ if (datePart && timePart) {
|
|
|
274
|
+ const [year, month, day] = datePart.split('-').map(Number);
|
|
|
275
|
+ const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
|
276
|
+ currentEndDate.value = [year, month, day];
|
|
|
277
|
+ currentEndTime.value = [hours || 0, minutes || 0, seconds || 0];
|
|
|
278
|
+ }
|
|
|
279
|
+ } catch (error) {
|
|
|
280
|
+ // 解析失败,使用默认值
|
|
|
281
|
+ }
|
|
|
282
|
+ }
|
|
|
283
|
+ }
|
|
|
284
|
+})
|
|
|
285
|
+
|
|
|
286
|
+/* 文件上传 */
|
|
|
287
|
+import AttachmentS3 from '@/components/AttachmentS3.vue';
|
|
|
288
|
+
|
|
|
289
|
+const onSubmit = (values) => {
|
|
|
290
|
+ addEmergencyDrillPlan()
|
|
|
291
|
+}
|
|
|
292
|
+
|
|
|
293
|
+const onCaseTypeConfirm = ({ selectedOptions }) => {
|
|
|
294
|
+ caseTypeFlag.value = false;
|
|
|
295
|
+ fromVue.value.caseType = selectedOptions[0].text;
|
|
|
296
|
+};
|
|
|
297
|
+
|
|
|
298
|
+const onCaseSourceConfirm = ({ selectedOptions }) => {
|
|
|
299
|
+ caseSourceFlag.value = false;
|
|
|
300
|
+ fromVue.value.caseSource = selectedOptions[0].text;
|
|
|
301
|
+};
|
|
|
302
|
+
|
|
|
303
|
+</script>
|
|
|
304
|
+
|
|
|
305
|
+<template>
|
|
|
306
|
+
|
|
|
307
|
+ <div class="page-container">
|
|
|
308
|
+ <van-sticky class="header">
|
|
|
309
|
+ <van-nav-bar
|
|
|
310
|
+ :title="title"
|
|
|
311
|
+ left-text="返回"
|
|
|
312
|
+ left-arrow
|
|
|
313
|
+ @click-left="onClickLeft" >
|
|
|
314
|
+ </van-nav-bar>
|
|
|
315
|
+ </van-sticky>
|
|
|
316
|
+ <div class="scroll-container">
|
|
|
317
|
+ <van-form @submit="onSubmit">
|
|
|
318
|
+ <van-field
|
|
|
319
|
+ v-model="fromVue.caseNumber"
|
|
|
320
|
+ label="案例编号"
|
|
|
321
|
+ name="caseNumber"
|
|
|
322
|
+ readonly
|
|
|
323
|
+ :rules="[{required: true, message: '编号生成失败'}]"
|
|
|
324
|
+ />
|
|
|
325
|
+
|
|
|
326
|
+ <van-field
|
|
|
327
|
+ v-model="fromVue.projectName"
|
|
|
328
|
+ label="项目名称"
|
|
|
329
|
+ name="projectName"
|
|
|
330
|
+ :readonly="isCaseSubmitted"
|
|
|
331
|
+ required
|
|
|
332
|
+ placeholder="请输入项目名称"
|
|
|
333
|
+ :rules="[{required: true, message: '请输入项目名称'}]"
|
|
|
334
|
+ />
|
|
|
335
|
+
|
|
|
336
|
+ <van-field
|
|
|
337
|
+ v-model="fromVue.caseType"
|
|
|
338
|
+ readonly
|
|
|
339
|
+ label="案例类型"
|
|
|
340
|
+ name="caseType"
|
|
|
341
|
+ required
|
|
|
342
|
+ placeholder="请选择案例类型"
|
|
|
343
|
+ :rules="[{required: true, message: '请选择案例类型'}]"
|
|
|
344
|
+ @click="!isCaseSubmitted && (caseTypeFlag = true)"
|
|
|
345
|
+ />
|
|
|
346
|
+
|
|
|
347
|
+ <van-field
|
|
|
348
|
+ v-model="fromVue.caseSource"
|
|
|
349
|
+ readonly
|
|
|
350
|
+ label="案例来源"
|
|
|
351
|
+ name="caseSource"
|
|
|
352
|
+ placeholder="请选择案例来源"
|
|
|
353
|
+ @click="!isCaseSubmitted && (caseSourceFlag = true)"
|
|
|
354
|
+ />
|
|
|
355
|
+
|
|
|
356
|
+ <!-- 开始时间 -->
|
|
|
357
|
+ <van-field
|
|
|
358
|
+ v-model="fromVue.startTime"
|
|
|
359
|
+ is-link
|
|
|
360
|
+ readonly
|
|
|
361
|
+ name="startTime"
|
|
|
362
|
+ label="开始时间"
|
|
|
363
|
+ :colon="true"
|
|
|
364
|
+ placeholder="点击选择开始时间"
|
|
|
365
|
+ @click="!isCaseSubmitted && (showStartTimePicker = true)"
|
|
|
366
|
+ />
|
|
|
367
|
+
|
|
|
368
|
+ <!-- 结束时间 -->
|
|
|
369
|
+ <van-field
|
|
|
370
|
+ v-model="fromVue.endTime"
|
|
|
371
|
+ is-link
|
|
|
372
|
+ readonly
|
|
|
373
|
+ name="endTime"
|
|
|
374
|
+ label="结束时间"
|
|
|
375
|
+ :colon="true"
|
|
|
376
|
+ placeholder="点击选择结束时间"
|
|
|
377
|
+ @click="!isCaseSubmitted && (showEndTimePicker = true)"
|
|
|
378
|
+ />
|
|
|
379
|
+
|
|
|
380
|
+ <!-- 关键词/标签 -->
|
|
|
381
|
+ <van-field
|
|
|
382
|
+ v-model="fromVue.tags"
|
|
|
383
|
+ label="关键词/标签"
|
|
|
384
|
+ name="tags"
|
|
|
385
|
+ placeholder="请手动输入标签,多个标签用逗号分隔"
|
|
|
386
|
+ :readonly="isCaseSubmitted"
|
|
|
387
|
+ />
|
|
|
388
|
+
|
|
|
389
|
+ <!-- 标签按钮 -->
|
|
|
390
|
+ <!-- 整个 van-cell 删除 -->
|
|
|
391
|
+
|
|
|
392
|
+ <van-field
|
|
|
393
|
+ v-model="fromVue.caseSummary"
|
|
|
394
|
+ label="案例摘要"
|
|
|
395
|
+ name="caseSummary"
|
|
|
396
|
+ rows="3"
|
|
|
397
|
+ autosize
|
|
|
398
|
+ type="textarea"
|
|
|
399
|
+ placeholder="请输入案例摘要"
|
|
|
400
|
+ :readonly="isCaseSubmitted"
|
|
|
401
|
+ />
|
|
|
402
|
+
|
|
|
403
|
+ <van-field
|
|
|
404
|
+ v-model="fromVue.highLights"
|
|
|
405
|
+ label="创新点与亮点"
|
|
|
406
|
+ name="highLights"
|
|
|
407
|
+ rows="3"
|
|
|
408
|
+ autosize
|
|
|
409
|
+ type="textarea"
|
|
|
410
|
+ placeholder="请输入创新点与亮点"
|
|
|
411
|
+ :readonly="isCaseSubmitted"
|
|
|
412
|
+ />
|
|
|
413
|
+
|
|
|
414
|
+ <van-field
|
|
|
415
|
+ v-model="fromVue.resultsValue"
|
|
|
416
|
+ label="应用成效与价值"
|
|
|
417
|
+ name="resultsValue"
|
|
|
418
|
+ rows="3"
|
|
|
419
|
+ autosize
|
|
|
420
|
+ type="textarea"
|
|
|
421
|
+ placeholder="请输入应用成效与价值"
|
|
|
422
|
+ :readonly="isCaseSubmitted"
|
|
|
423
|
+ />
|
|
|
424
|
+
|
|
|
425
|
+ <van-field label="附件上传" >
|
|
|
426
|
+ <template #input>
|
|
|
427
|
+ <AttachmentS3 :f-id="result" :readonly="isCaseSubmitted" />
|
|
|
428
|
+ </template>
|
|
|
429
|
+ </van-field>
|
|
|
430
|
+
|
|
|
431
|
+ <div style="margin: 16px;">
|
|
|
432
|
+ <van-button v-if="!isReadOnly" round block type="primary" native-type="submit">
|
|
|
433
|
+ {{ isEdit ? '保存' : '提交' }}
|
|
|
434
|
+ </van-button>
|
|
|
435
|
+ </div>
|
|
|
436
|
+ </van-form>
|
|
|
437
|
+
|
|
|
438
|
+ <!-- 案例类型选择器 -->
|
|
|
439
|
+ <van-popup v-model:show="caseTypeFlag" round position="bottom">
|
|
|
440
|
+ <van-picker
|
|
|
441
|
+ :columns="caseTypeColumns"
|
|
|
442
|
+ @cancel="caseTypeFlag = false"
|
|
|
443
|
+ @confirm="onCaseTypeConfirm"
|
|
|
444
|
+ />
|
|
|
445
|
+ </van-popup>
|
|
|
446
|
+
|
|
|
447
|
+ <!-- 案例来源选择器 -->
|
|
|
448
|
+ <van-popup v-model:show="caseSourceFlag" round position="bottom">
|
|
|
449
|
+ <van-picker
|
|
|
450
|
+ :columns="caseSourceColumns"
|
|
|
451
|
+ @cancel="caseSourceFlag = false"
|
|
|
452
|
+ @confirm="onCaseSourceConfirm"
|
|
|
453
|
+ />
|
|
|
454
|
+ </van-popup>
|
|
|
455
|
+
|
|
|
456
|
+ <!-- 开始时间选择器 -->
|
|
|
457
|
+ <van-popup
|
|
|
458
|
+ v-model:show="showStartTimePicker"
|
|
|
459
|
+ position="bottom"
|
|
|
460
|
+ round
|
|
|
461
|
+ style="max-height: 50vh;"
|
|
|
462
|
+ >
|
|
|
463
|
+ <van-date-picker
|
|
|
464
|
+ v-if="!startDateOrTime"
|
|
|
465
|
+ v-model="currentStartDate"
|
|
|
466
|
+ title="选择开始日期"
|
|
|
467
|
+ :min-date="minDate"
|
|
|
468
|
+ :max-date="maxDate"
|
|
|
469
|
+ @confirm="onStartDateConfirm"
|
|
|
470
|
+ @cancel="cancelStartDatePicker"
|
|
|
471
|
+ >
|
|
|
472
|
+ <template #confirm>
|
|
|
473
|
+ <van-button type="primary" @click="onStartDateConfirm">下一步</van-button>
|
|
|
474
|
+ </template>
|
|
|
475
|
+ <template #cancel>
|
|
|
476
|
+ <van-button type="danger" @click="cancelStartDatePicker">取消</van-button>
|
|
|
477
|
+ </template>
|
|
|
478
|
+ </van-date-picker>
|
|
|
479
|
+
|
|
|
480
|
+ <van-time-picker
|
|
|
481
|
+ v-if="startDateOrTime"
|
|
|
482
|
+ v-model="currentStartTime"
|
|
|
483
|
+ title="选择开始时间"
|
|
|
484
|
+ :columns-type="['hour', 'minute', 'second']"
|
|
|
485
|
+ @confirm="onConfirmStartDatetime"
|
|
|
486
|
+ @cancel="cancelStartTimePicker"
|
|
|
487
|
+ >
|
|
|
488
|
+ <template #confirm>
|
|
|
489
|
+ <van-button type="primary" @click="onConfirmStartDatetime">确定</van-button>
|
|
|
490
|
+ </template>
|
|
|
491
|
+ <template #cancel>
|
|
|
492
|
+ <van-button type="danger" @click="cancelStartTimePicker">取消</van-button>
|
|
|
493
|
+ </template>
|
|
|
494
|
+ </van-time-picker>
|
|
|
495
|
+ </van-popup>
|
|
|
496
|
+
|
|
|
497
|
+ <!-- 结束时间选择器 -->
|
|
|
498
|
+ <van-popup
|
|
|
499
|
+ v-model:show="showEndTimePicker"
|
|
|
500
|
+ position="bottom"
|
|
|
501
|
+ round
|
|
|
502
|
+ style="max-height: 50vh;"
|
|
|
503
|
+ >
|
|
|
504
|
+ <van-date-picker
|
|
|
505
|
+ v-if="!endDateOrTime"
|
|
|
506
|
+ v-model="currentEndDate"
|
|
|
507
|
+ title="选择结束日期"
|
|
|
508
|
+ :min-date="minDate"
|
|
|
509
|
+ :max-date="maxDate"
|
|
|
510
|
+ @confirm="onEndDateConfirm"
|
|
|
511
|
+ @cancel="cancelEndDatePicker"
|
|
|
512
|
+ >
|
|
|
513
|
+ <template #confirm>
|
|
|
514
|
+ <van-button type="primary" @click="onEndDateConfirm">下一步</van-button>
|
|
|
515
|
+ </template>
|
|
|
516
|
+ <template #cancel>
|
|
|
517
|
+ <van-button type="danger" @click="cancelEndDatePicker">取消</van-button>
|
|
|
518
|
+ </template>
|
|
|
519
|
+ </van-date-picker>
|
|
|
520
|
+
|
|
|
521
|
+ <van-time-picker
|
|
|
522
|
+ v-if="endDateOrTime"
|
|
|
523
|
+ v-model="currentEndTime"
|
|
|
524
|
+ title="选择结束时间"
|
|
|
525
|
+ :columns-type="['hour', 'minute', 'second']"
|
|
|
526
|
+ @confirm="onConfirmEndDatetime"
|
|
|
527
|
+ @cancel="cancelEndTimePicker"
|
|
|
528
|
+ >
|
|
|
529
|
+ <template #confirm>
|
|
|
530
|
+ <van-button type="primary" @click="onConfirmEndDatetime">确定</van-button>
|
|
|
531
|
+ </template>
|
|
|
532
|
+ <template #cancel>
|
|
|
533
|
+ <van-button type="danger" @click="cancelEndTimePicker">取消</van-button>
|
|
|
534
|
+ </template>
|
|
|
535
|
+ </van-time-picker>
|
|
|
536
|
+ </van-popup>
|
|
|
537
|
+ </div>
|
|
|
538
|
+ </div>
|
|
|
539
|
+</template>
|
|
|
540
|
+
|
|
|
541
|
+<style scoped>
|
|
|
542
|
+.page-container {
|
|
|
543
|
+ height: 100vh;
|
|
|
544
|
+ display: flex;
|
|
|
545
|
+ flex-direction: column;
|
|
|
546
|
+}
|
|
|
547
|
+
|
|
|
548
|
+.scroll-container {
|
|
|
549
|
+ flex: 1;
|
|
|
550
|
+ overflow: auto;
|
|
|
551
|
+ -webkit-overflow-scrolling: touch;
|
|
|
552
|
+}
|
|
|
553
|
+
|
|
|
554
|
+.scroll-container::-webkit-scrollbar {
|
|
|
555
|
+ display: none;
|
|
|
556
|
+}
|
|
|
557
|
+
|
|
|
558
|
+.header, .footer {
|
|
|
559
|
+ flex-shrink: 0;
|
|
|
560
|
+ background: #f5f5f5;
|
|
|
561
|
+ padding: 12px;
|
|
|
562
|
+}
|
|
|
563
|
+</style>
|