From c832bf2e80ac465e71b7a1c1f7a59d4252030989 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 05 Aug 2025 17:33:08 +0800
Subject: [PATCH] feat:事件工单滚动条
---
src/views/tickets/orderLog.vue | 73 ++++++++++++++++++++++++------------
1 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/src/views/tickets/orderLog.vue b/src/views/tickets/orderLog.vue
index 5141e1d..f695d28 100644
--- a/src/views/tickets/orderLog.vue
+++ b/src/views/tickets/orderLog.vue
@@ -1,13 +1,4 @@
-<!--
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2025-04-15 20:02:29
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2025-04-28 11:38:16
- * @FilePath: \drone-web-manage\src\views\tickets\orderLog.vue
- * @Description:
- *
- * Copyright (c) 2025 by shuishen, All Rights Reserved.
--->
+
<template>
<basic-container>
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
@@ -21,11 +12,11 @@
@keyup.enter="handleSearch" />
</div>
- <div class="search-bar-box-item">
- <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>
- <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />
- </el-select>
- </div>
+<!-- <div class="search-bar-box-item">-->
+<!-- <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>-->
+<!-- <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />-->
+<!-- </el-select>-->
+<!-- </div>-->
<div class="search-bar-box-item">
<el-date-picker v-model="filters.dateRange" type="daterange" range-separator="至"
@@ -33,7 +24,7 @@
</div>
<div class="search-bar-box-item">
- <el-select v-model="filters.file_id" placeholder="请选择关联航线" clearable>
+ <el-select v-model="filters.file_id" placeholder="请选择关联航线" filterable clearable>
<el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
:value="item.wayline_id" />
</el-select>
@@ -92,7 +83,19 @@
<!-- 表格部分 -->
<avue-crud class="ztzf-public-general-avue-crud" :data="tableData" :option="option" v-model:page="page"
ref="crud" :table-loading="loading" @current-change="currentChange" @refresh-change="refreshChange"
- @on-load="onLoad" @search-change="searchChange" @size-change="sizeChange" @cell-click="handleCellClick" v-if="activeTab === tab.name">
+ @on-load="onLoad" @search-change="searchChange" @size-change="sizeChange" v-if="activeTab === tab.name">
+ <template #job_info_num="{row}">
+ <el-tooltip-copy :content="row.job_info_num" :showCopyText="true" textAlign="left">
+ {{ row.job_info_num }}
+ </el-tooltip-copy>
+ </template>
+
+ <template #name="{ row }">
+ <el-tooltip-copy :content="row.name" :showCopyText="true" textAlign="left">
+ {{ row.name }}
+ </el-tooltip-copy>
+ </template>
+
<template #menu-left>
<el-button v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'" type="primary" icon="el-icon-plus"
@click="handleAdd">新建工单</el-button>
@@ -229,7 +232,7 @@
</el-dialog>
<!-- 工单详情对话框 -->
- <el-dialog v-model="detailVisible" :title="detailTitle" width="70%" :close-on-click-modal="false"
+ <el-dialog align-center v-model="detailVisible" :title="detailTitle" width="70%" :close-on-click-modal="false"
@close="resetForm">
<div class="event-title-center">{{ form.name }}</div>
<el-form :model="form" :rules="rules" ref="testform" label-width="100px">
@@ -508,11 +511,13 @@
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn'; // 导入中文语言包
import weekday from 'dayjs/plugin/weekday';
+import elTooltipCopy from '@/components/ElTooltipCopy.vue'
dayjs.extend(weekday);
dayjs.locale('zh-cn');
export default {
+ components: { elTooltipCopy },
name: 'TicketPage',
data () {
return {
@@ -582,8 +587,7 @@
column: [
{
- label: '工单编号', prop: 'job_info_num', width: 100, ellipsis: true, overHidden: true,
- showOverflowTooltip: true,
+ label: '工单编号', prop: 'job_info_num', width: 150,
},
{
label: '工单名称', prop: 'name', width: 100, ellipsis: true, overHidden: true,
@@ -602,7 +606,7 @@
showOverflowTooltip: true,
},
{
- label: '已执行次数', prop: 'job_num', width: 96, ellipsis: true,
+ label: '已执行次数', prop: 'job_num', width: 70, ellipsis: true,
showOverflowTooltip: true,
},
{
@@ -693,6 +697,8 @@
mounted () {
this.fetchTableData()
const id = this.$route.query.id
+ console.log('idddddd',id);
+
if (id) {
// 确保 id 存在
this.handleViewDetail({ id })
@@ -865,6 +871,17 @@
this.form.begin_time = this.formatDate(dateRange[0])
this.form.end_time = this.formatDate(dateRange[1])
+
+ // 如果选中日期包含当前天,那么选中的时间点不能小于当前时间
+ if (this.form.deal_time) {
+ const selectedDate = dayjs(this.form.date_range[0]).format('YYYY-MM-DD')
+ const selectedTime = dayjs(selectedDate + ' ' + this.form.deal_time).toDate()
+ const now = new Date()
+
+ if (selectedDate === dayjs().format('YYYY-MM-DD') && selectedTime < now) {
+ return this.$message.warning('任务时间不能小于当前时间')
+ }
+ }
const submitData = {
...this.form,
@@ -887,7 +904,7 @@
// if (selectedTime < now) {
// return this.$message.warning('任务时间不能小于当前时间')
-
+
// }
// }
// }
@@ -1050,7 +1067,6 @@
: (this.detailTitle = '编辑工单')
this.detailVisible = true
-
// 更新航线列表,追加 wayline_file_region_vo 数据
if (data.wayline_file_region_vo) {
const newWayline = data.wayline_file_region_vo
@@ -1066,6 +1082,9 @@
}
this.initMapLine(data.device_map_infos)
+ const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/orderLog')
+ find && (find.query = {})
+
},
async handleCheckDetail (row) {
const response = await orderLogDetails(row.id)
@@ -1228,6 +1247,8 @@
this.$message.success('审核通过')
this.detailVisibleCopy = false
+ this.detailVisible = false
+
this.page.currentPage = 1
this.onLoad(this.page, this.query)
// this.handleViewDetail()
@@ -1244,6 +1265,8 @@
let data = response.data.data
this.$message.success('驳回成功')
this.detailVisibleCopy = false
+
+ // this.detailVisible = false
this.page.currentPage = 1
this.onLoad(this.page, this.query)
@@ -1347,7 +1370,7 @@
}
:deep(.el-textarea__inner) {
- resize: none;
+ resize: none;
}
.action-bar {
@@ -1362,7 +1385,7 @@
.el-dialog {
.el-form-item {
- margin-bottom: 20px;
+ margin-bottom: 10px;
}
}
--
Gitblit v1.9.3