Commit 23a0f08bfb50f54d467e7de73f5d8363bcb1d903
1 parent
231034b9
嵌入视频 待优化版本
Showing
3 changed files
with
134 additions
and
0 deletions
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -170,6 +170,20 @@ |
170 | 170 | <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> |
171 | 171 | <a-button type="danger">取消</a-button> |
172 | 172 | </a-popconfirm> |
173 | + | |
174 | + <!-- 添加问号图标按钮 --> | |
175 | + <a-tooltip placement="topLeft" title="点击进行流程演示"> | |
176 | + <a-button shape="circle" icon="question" @click="openVideoModal(record)" /> | |
177 | + </a-tooltip> | |
178 | + | |
179 | + <!-- VideoModal 组件 --> | |
180 | + <VideoModal | |
181 | + :visible="videoModalVisible" | |
182 | + :videoUrl="videoUrl" | |
183 | + :videoDescription="videoDescription" | |
184 | + @update:visible="closeVideoModal" | |
185 | + /> | |
186 | + | |
173 | 187 | </span> |
174 | 188 | |
175 | 189 | </a-table> |
... | ... | @@ -210,12 +224,14 @@ import {filterObj} from "@/utils/util"; |
210 | 224 | import MaterialTaskModal from "./modules/MaterialTaskModal"; |
211 | 225 | import CallReceiptBoxModal from "@views/system/task/modules/CallReceiptBoxModal"; |
212 | 226 | import CallReceiptEmptyBoxModal from "@views/system/task/modules/CallReceiptEmptyBoxModal"; |
227 | +import VideoModal from "@views/system/task/VideoModal.vue"; | |
213 | 228 | |
214 | 229 | |
215 | 230 | export default { |
216 | 231 | name: "ReceiptTaskHeaderList", |
217 | 232 | mixins: [JeecgListMixin], |
218 | 233 | components: { |
234 | + VideoModal, | |
219 | 235 | CallReceiptEmptyBoxModal, |
220 | 236 | CallReceiptBoxModal, |
221 | 237 | ManyEmptyInTaskModal, |
... | ... | @@ -230,6 +246,10 @@ export default { |
230 | 246 | selectIndex: null, |
231 | 247 | description: '任务表管理页面', |
232 | 248 | zoneList: [], |
249 | + selectedRowKeys: [], // 假设这个数组存储了选中的任务ID或对象 | |
250 | + videoModalVisible: false, // 控制视频模态框的显示 | |
251 | + videoUrl: '', | |
252 | + videoDescription: '', | |
233 | 253 | zoneOptions:[], |
234 | 254 | firstLoad:0, |
235 | 255 | isorter: { |
... | ... | @@ -416,6 +436,27 @@ export default { |
416 | 436 | } |
417 | 437 | }, |
418 | 438 | methods: { |
439 | + | |
440 | + | |
441 | + // 打开视频模态框 | |
442 | + openVideoModal(record) { | |
443 | + // 防止重复打开模态框 | |
444 | + if (this.videoModalVisible) return; // 如果已经打开,不再执行后续代码 | |
445 | + | |
446 | + if (record && record.taskType === 100) { | |
447 | + this.videoUrl = 'http://113.45.231.114:5000/d/%E4%B8%AD%E5%9B%BD%E7%A7%BB%E5%8A%A8/%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6/12%E6%9C%8826%E6%97%A5_compressed.mp4?sign=QtsysiX30DPzgX7eFV10C3AdzVdC7YzP1YyGuOVewMY=:0'; // 设置视频URL | |
448 | + this.videoDescription = '整盘入库教学'; // 设置视频描述 | |
449 | + this.videoModalVisible = true; // 显示模态框 | |
450 | + } else { | |
451 | + console.log("Task status is not 20, video modal will not open"); | |
452 | + } | |
453 | + }, | |
454 | + | |
455 | + // 关闭视频模态框 | |
456 | + closeVideoModal(value) { | |
457 | + this.videoModalVisible = value; // 更新 videoModalVisible 来关闭模态框 | |
458 | + }, | |
459 | + | |
419 | 460 | handleTableChange(pagination, filters, sorter) { |
420 | 461 | //分页、排序、筛选变化时触发 |
421 | 462 | if (Object.keys(sorter).length > 0) { |
... | ... | @@ -561,6 +602,8 @@ export default { |
561 | 602 | }); |
562 | 603 | }, |
563 | 604 | executeTask(record) { |
605 | + // 如果有任何执行操作,确保关闭模态框 | |
606 | + this.videoModalVisible = false; | |
564 | 607 | this.loading = true; |
565 | 608 | this.model = Object.assign({}, record); |
566 | 609 | execute(this.model).then((res) => { |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -172,6 +172,19 @@ |
172 | 172 | <a-popconfirm v-if="record.status <= 10 && record.taskType != 600 " v-has="'taskHeader:switchTask'" title="确定切换任务吗?" @confirm="() => switchTask(record)"> |
173 | 173 | <a-button type="danger">切换任务</a-button> |
174 | 174 | </a-popconfirm> |
175 | + | |
176 | + <!-- 添加问号图标按钮 --> | |
177 | + <a-tooltip placement="topLeft" title="点击进行流程演示"> | |
178 | + <a-button shape="circle" icon="question" @click="openVideoModal(record)" /> | |
179 | + </a-tooltip> | |
180 | + | |
181 | + <!-- VideoModal 组件 --> | |
182 | + <VideoModal | |
183 | + :visible="videoModalVisible" | |
184 | + :videoUrl="videoUrl" | |
185 | + :videoDescription="videoDescription" | |
186 | + @update:visible="closeVideoModal" | |
187 | + /> | |
175 | 188 | </span> |
176 | 189 | |
177 | 190 | </a-table> |
... | ... | @@ -211,11 +224,13 @@ import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal"; |
211 | 224 | import CallShipmentBoxModal from "@views/system/task/modules/CallShipmentBoxModal"; |
212 | 225 | import UpdatePriority from "@views/system/task/modules/UpdatePriority.vue"; |
213 | 226 | import ShipmentMaterialModal from "@views/system/task/modules/ShipmentMaterialModal.vue"; |
227 | +import VideoModal from "@views/system/task/VideoModal.vue"; | |
214 | 228 | |
215 | 229 | export default { |
216 | 230 | name: "ShipmentTaskHeaderList", |
217 | 231 | mixins: [JeecgListMixin], |
218 | 232 | components: { |
233 | + VideoModal, | |
219 | 234 | ShipmentMaterialModal, |
220 | 235 | CallShipmentBoxModal, |
221 | 236 | ManyEmptyOutTaskModal, |
... | ... | @@ -231,6 +246,10 @@ export default { |
231 | 246 | description: '任务表管理页面', |
232 | 247 | zoneList: [], |
233 | 248 | firstLoad:0, |
249 | + selectedRowKeys: [], // 假设这个数组存储了选中的任务ID或对象 | |
250 | + videoModalVisible: false, // 控制视频模态框的显示 | |
251 | + videoUrl: '', | |
252 | + videoDescription: '', | |
234 | 253 | isorter: { |
235 | 254 | column: 'status', |
236 | 255 | order: 'asc', |
... | ... | @@ -408,6 +427,28 @@ export default { |
408 | 427 | } |
409 | 428 | }, |
410 | 429 | methods: { |
430 | + | |
431 | + | |
432 | + // 打开视频模态框 | |
433 | + openVideoModal(record) { | |
434 | + // 防止重复打开模态框 | |
435 | + if (this.videoModalVisible) return; // 如果已经打开,不再执行后续代码 | |
436 | + | |
437 | + if (record && record.taskType === 300) { | |
438 | + this.videoUrl = 'http://113.45.231.114:5000/d/%E4%B8%AD%E5%9B%BD%E7%A7%BB%E5%8A%A8/%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6/12%E6%9C%8827%E6%97%A5_compressed.mp4?sign=KQHSFbdRSVEt01YZ6HPQpUqY1EINyd-7KbVOp0Ij3uA=:0'; // 设置视频URL | |
439 | + this.videoDescription = '整盘出库流程'; // 设置视频描述 | |
440 | + this.videoModalVisible = true; // 显示模态框 | |
441 | + } else { | |
442 | + console.log("Task status is not 20, video modal will not open"); | |
443 | + } | |
444 | + }, | |
445 | + | |
446 | + // 关闭视频模态框 | |
447 | + closeVideoModal(value) { | |
448 | + this.videoModalVisible = value; // 更新 videoModalVisible 来关闭模态框 | |
449 | + }, | |
450 | + | |
451 | + | |
411 | 452 | handleTableChange(pagination, filters, sorter) { |
412 | 453 | //分页、排序、筛选变化时触发 |
413 | 454 | if (Object.keys(sorter).length > 0) { |
... | ... |
ant-design-vue-jeecg/src/views/system/task/VideoModal.vue
0 → 100644
1 | +<template> | |
2 | + <a-modal :visible="visible" @cancel="handleClose" @ok="handleClose" title="流程演示"> | |
3 | + <div> | |
4 | + <!-- 添加 autoplay 和 muted 属性来确保视频自动播放 --> | |
5 | + <video :src="videoUrl" controls autoplay muted></video> | |
6 | + <p>{{ videoDescription }}</p> | |
7 | + </div> | |
8 | + <!-- 将确定和取消按钮替换为一个“已完成学习”按钮 --> | |
9 | + <template #footer> | |
10 | + <a-button type="primary" @click="handleComplete">已学习</a-button> | |
11 | + </template> | |
12 | + </a-modal> | |
13 | +</template> | |
14 | + | |
15 | +<script> | |
16 | +export default { | |
17 | + props: { | |
18 | + visible: { | |
19 | + type: Boolean, | |
20 | + required: true | |
21 | + }, | |
22 | + videoUrl: { | |
23 | + type: String, | |
24 | + default: '' | |
25 | + }, | |
26 | + videoDescription: { | |
27 | + type: String, | |
28 | + default: '' | |
29 | + } | |
30 | + }, | |
31 | + methods: { | |
32 | + handleClose() { | |
33 | + this.$emit('update:visible', false); // 关闭模态框时通知父组件 | |
34 | + }, | |
35 | + // 点击“已完成学习”按钮后的处理逻辑 | |
36 | + handleComplete() { | |
37 | + this.$emit('update:visible', false); // 关闭模态框 | |
38 | + this.$emit('completed'); // 触发已完成学习的事件 | |
39 | + }, | |
40 | + } | |
41 | +}; | |
42 | +</script> | |
43 | + | |
44 | +<style scoped> | |
45 | +/* 添加一些自定义样式,例如视频大小调整 */ | |
46 | +video { | |
47 | + max-width: 100%; | |
48 | + height: auto; | |
49 | +} | |
50 | +</style> | |
... | ... |