From e41f52fa15319540574081f263d680b3a642cb3f Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 30 Jul 2025 11:28:35 +0800
Subject: [PATCH] Merge branch 'dev' of http://139.196.74.78:10010/r/drone/drone-web-manage into dev
---
src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue | 19 ++++
src/views/tickets/ticket.vue | 128 ++++++++++++++++++++-----------
src/views/tickets/orderLog.vue | 25 ++++-
src/components/ElTooltipCopy.vue | 52 +++++++++++++
src/views/dataCenter/dataCenter.vue | 10 ++
5 files changed, 179 insertions(+), 55 deletions(-)
diff --git a/src/components/ElTooltipCopy.vue b/src/components/ElTooltipCopy.vue
new file mode 100644
index 0000000..8f5d94a
--- /dev/null
+++ b/src/components/ElTooltipCopy.vue
@@ -0,0 +1,52 @@
+<template>
+ <el-tooltip :show-after="200" placement="top" effect="dark">
+ <div class="defaultDisplay" :style="{textAlign}">
+ <slot name="default" />
+ </div>
+ <template #content>
+ <span class="popUpContent" @click="clickTest">{{ showCopyText ? '复制' : content }}</span>
+ </template>
+ </el-tooltip>
+</template>
+<script setup>
+import { ElMessage } from 'element-plus'
+
+const props = defineProps({
+ content: {
+ type: String,
+ required: true
+ },
+ showCopyText: {
+ type: Boolean,
+ default: false
+ },
+ textAlign:{
+ type: String,
+ default: 'center'
+ }
+})
+
+function clickTest(e) {
+ navigator.clipboard
+ .writeText(props.content)
+ .then(() => {
+ ElMessage.success('复制成功!')
+ })
+ .catch(() => {
+ ElMessage.error('复制失败,请重试!')
+ })
+}
+</script>
+<style scoped lang="scss">
+.popUpContent{
+ cursor: pointer;
+}
+
+.defaultDisplay{
+ display: inline-block;
+ width: 100%;
+ white-space:nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+</style>
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index 267f5cb..7acdbd8 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -35,7 +35,14 @@
</el-table-column>
<el-table-column property="nestName" label="所属机巢" />
<el-table-column property="jobName" label="任务名称" show-overflow-tooltip />
- <el-table-column prop="nickName" label="文件名称" show-overflow-tooltip />
+ <el-table-column prop="nickName" label="文件名称" width="160">
+ <template #default="scope">
+ <el-tooltip-copy :content="scope.row.nickName" :showCopyText="true">
+ {{scope.row.nickName}}
+ </el-tooltip-copy>
+ </template>
+ </el-table-column>
+
<el-table-column property="link" label="缩略图" width="120">
<template #default="scope">
<img
@@ -304,6 +311,7 @@
import { getShowImg, getSmallImg, getzsSmallImg } from '@/utils/util';
import { onMounted, watch } from 'vue';
import dayjs from 'dayjs';
+import ElTooltipCopy from '@/components/ElTooltipCopy.vue';
function bytesToMB(bytes, decimalPlaces = 2) {
if (typeof bytes !== 'number' || bytes < 0) return '0';
diff --git a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
index c9105e0..8a16eff 100644
--- a/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/job/components/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -3,15 +3,27 @@
<div class="task-intermediate-content">
<SearchBox @search="searchClick" @addTask="handleAddTask"></SearchBox>
<div class="task-table">
- <el-table border :data="jobListData" class="custom-header" @cell-click="handleCellClick">
+ <el-table border :data="jobListData" class="custom-header">
<el-table-column label="序号" type="index" width="60">
<template #default="{ $index }">
{{ ($index + 1 + (jobListParams.current - 1) * jobListParams.size).toString().padStart(2,
'0') }}
</template>
</el-table-column>
- <el-table-column prop="job_info_num" label="任务编号" show-overflow-tooltip align="center" />
- <el-table-column prop="name" label="任务名称" show-overflow-tooltip align="center" />
+ <el-table-column prop="job_info_num" label="任务编号" width="160">
+ <template #default="scope">
+ <el-tooltip-copy :content="scope.row.job_info_num" :showCopyText="true">
+ {{scope.row.job_info_num}}
+ </el-tooltip-copy>
+ </template>
+ </el-table-column>
+ <el-table-column prop="name" label="任务编号" width="160">
+ <template #default="scope">
+ <el-tooltip-copy :content="scope.row.name" :showCopyText="true">
+ {{scope.row.name}}
+ </el-tooltip-copy>
+ </template>
+ </el-table-column>
<el-table-column prop="dept_name" label="所属部门" width="200" align="center" />
<el-table-column prop="device_names" label="所属机巢" />
<el-table-column prop="ai_type_str" label="关联算法" show-overflow-tooltip align="center" />
@@ -108,6 +120,7 @@
import { useStore } from 'vuex'
import { cloneDeep } from 'lodash'
import { inject, onBeforeUnmount } from 'vue';
+import ElTooltipCopy from '@/components/ElTooltipCopy.vue';
const store = useStore()
const singleUavHome = computed(() => store.state.home.singleUavHome)
const jobListParams = reactive({
diff --git a/src/views/tickets/orderLog.vue b/src/views/tickets/orderLog.vue
index bb81085..9dddfcb 100644
--- a/src/views/tickets/orderLog.vue
+++ b/src/views/tickets/orderLog.vue
@@ -92,7 +92,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>
@@ -508,11 +520,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 +596,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 +615,7 @@
showOverflowTooltip: true,
},
{
- label: '已执行次数', prop: 'job_num', width: 96, ellipsis: true,
+ label: '已执行次数', prop: 'job_num', width: 70, ellipsis: true,
showOverflowTooltip: true,
},
{
@@ -887,7 +900,7 @@
// if (selectedTime < now) {
// return this.$message.warning('任务时间不能小于当前时间')
-
+
// }
// }
// }
@@ -1351,7 +1364,7 @@
}
:deep(.el-textarea__inner) {
- resize: none;
+ resize: none;
}
.action-bar {
diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index ce4b381..bbd330d 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -98,22 +98,20 @@
</div>
<!-- 表格部分 -->
- <avue-crud
- class="ztzf-public-general-avue-crud"
- ref="avueCrud"
- v-model="tableData"
- :option="option"
- :data="tableData"
- v-model:page="page"
- @size-change="sizeChange"
- @current-change="handleCurrentChange"
- @refresh-change="refreshChange"
- :table-loading="loading"
- @selection-change="handleSelectionChange"
- @cell-click="handleCellClick"
- :permission="permissionList"
- v-if="activeTab === tab.name"
- >
+ <avue-crud class="ztzf-public-general-avue-crud" ref="avueCrud" v-model="tableData" :option="option"
+ :data="tableData" v-model:page="page" @size-change="sizeChange" @current-change="handleCurrentChange"
+ @refresh-change="refreshChange" :table-loading="loading" @selection-change="handleSelectionChange"
+ :permission="permissionList" v-if="activeTab === tab.name">
+ <template #orderNumber="{ row }">
+ <el-tooltip-copy :content="row.orderNumber" :showCopyText="true" textAlign="left">
+ {{ row.orderNumber }}
+ </el-tooltip-copy>
+ </template>
+ <template #orderName="{ row }">
+ <el-tooltip-copy :content="row.orderName" :showCopyText="true" textAlign="left">
+ {{ row.orderName }}
+ </el-tooltip-copy>
+ </template>
<template #menu-left>
<el-button
v-if="(activeTab === 'all' || activeTab === 'myTickets') && permissionList.addBtn"
@@ -210,7 +208,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="工单类型" prop="type">
- <el-select v-model="form.type" placeholder="请选择工单类型" class="full-width">
+
+ <el-select @change="handleTypeChange" v-model="form.type" placeholder="请选择工单类型" class="full-width" >
<el-option
v-for="item in types"
:key="item.value"
@@ -267,6 +266,7 @@
multiple
placeholder="请选择关联算法"
class="full-width"
+ :disabled="!form.type"
>
<el-option
v-for="item in algorithms"
@@ -365,7 +365,9 @@
<el-button type="infoprimary" plain :loading="draftLoading" @click="saveDraft"
>存草稿</el-button
>
- <el-button @click="dialogVisible = false">取 消</el-button>
+
+
+ <el-button @click="handleCancel">取 消</el-button>
</div>
</template>
</el-dialog>
@@ -866,17 +868,19 @@
getStepInfo,
getReviewById,
getCreateEventJob,
-} from '@/api/tickets/ticket';
-import { export_json_to_excel } from '@/utils/exportExcel';
-import geoJson from '@/assets/geoJson.json';
-import { mapGetters } from 'vuex';
-import { getAdcodeObj } from '@/utils/disposeData';
-function regExp(label, name) {
- var reg = new RegExp(label + '=([^&]*)(&|$)', 'g');
- return name.match(reg)[0].split('=')[1];
+} from '@/api/tickets/ticket'
+import { export_json_to_excel } from '@/utils/exportExcel'
+import geoJson from '@/assets/geoJson.json'
+import { mapGetters } from 'vuex'
+import { getAdcodeObj } from '@/utils/disposeData'
+import elTooltipCopy from '@/components/ElTooltipCopy.vue'
+function regExp (label, name) {
+ var reg = new RegExp(label + '=([^&]*)(&|$)', 'g')
+ return name.match(reg)[0].split('=')[1]
}
export default {
+ components: { elTooltipCopy },
name: 'TicketPage',
data() {
return {
@@ -911,6 +915,7 @@
},
departments: [],
types: [],
+ allAlgorithms: [],
handlers: [
{ label: '处理人A', value: 'handlerA' },
{ label: '处理人B', value: 'handlerB' },
@@ -949,15 +954,15 @@
column: [
// { label: "序号", prop: "id", width: 70 },
- { label: '工单编号', prop: 'orderNumber', width: 120, overHidden: true, tooltip: true },
+ { label: '工单编号', prop: 'orderNumber', width: 170 },
{ label: '工单名称', prop: 'orderName', width: 150, overHidden: true, tooltip: true },
- { label: '所属单位', prop: 'department', overHidden: true, tooltip: true },
+ { label: '所属单位', prop: 'department',width: 150, overHidden: true, tooltip: true },
{ label: '发起时间', prop: 'startTime', width: 160 },
{ label: '关联算法', prop: 'aiType', width: 150, overHidden: true, tooltip: true },
{
label: '工单类型',
prop: 'type',
- width: 130,
+ width: 110,
overHidden: true,
tooltip: true,
type: 'select',
@@ -970,8 +975,8 @@
width: 152,
overHidden: true,
},
- { label: '创建人', prop: 'creator', width: 100 },
- { label: '处理人', prop: 'handler', width: 100 },
+ { label: '创建人', prop: 'creator', width: 70 },
+ { label: '处理人', prop: 'handler', width: 70 },
{
slot: true,
hide: false,
@@ -1131,7 +1136,7 @@
this.$nextTick(() => {
this.isShowInfo = true;
});
-
+
console.log('orderNumber', orderNumber);
}
}
@@ -1393,7 +1398,7 @@
const subAreaCode = areaCode ? areaCode.substring(0, 6) : '';
const adcodeObj = getAdcodeObj(geoJson, 'adcode', subAreaCode);
- console.log('区域代码:', subAreaCode);
+ // console.log('区域代码:', subAreaCode);
// 直接从返回对象中获取正确的路径
const center = adcodeObj?.payload?.objects?.collection?.geometries?.[0]?.properties?.center;
@@ -1479,7 +1484,8 @@
async fetchDropdownData() {
try {
const response = await getTicketInfo();
- const { dept_data, event_type, ai_type } = response.data.data;
+
+ const { dept_data, event_type, ai_type,info } = response.data.data;
this.departments = dept_data.map(item => ({
label: item.dept_name,
@@ -1498,16 +1504,19 @@
const columnType = this.findObject(this.option.column, 'type');
columnType.dicData = this.types;
+ this.allAlgorithms = info
+ // console.log('工单类型',this.types);
+ // console.log('关联算法',this.allAlgorithms );
// 确保算法数据的映射一致
- this.algorithms =
- ai_type?.map(item => ({
- dict_key: item.dict_key,
- dict_value: item.dict_value,
- // 同时添加 label 和 value 以兼容两处使用
- label: item.dict_value,
- value: item.dict_key,
- })) || [];
+ // this.algorithms =
+ // ai_type?.map(item => ({
+ // dict_key: item.dict_key,
+ // dict_value: item.dict_value,
+ // // 同时添加 label 和 value 以兼容两处使用
+ // label: item.dict_value,
+ // value: item.dict_key,
+ // })) || [];
// 构建用户ID和名称的映射关系
this.userNameToIdMap = {};
@@ -1519,6 +1528,33 @@
} catch (error) {
this.$message.error('加载下拉框数据失败');
}
+ },
+ // 工单类型变化时触发
+ handleTypeChange(typeValue) {
+ if (!typeValue) {
+ // 未选择类型时清空算法列表
+ this.algorithms = [];
+ return;
+ }
+
+ const matchedCategory = this.allAlgorithms.find(
+ category => category.dict_key === typeValue
+ );
+
+ if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) {
+ // 无匹配的算法时清空
+ this.algorithms = [];
+ this.$message.info('该工单类型暂无关联算法');
+ return;
+ }
+
+ this.algorithms = matchedCategory.algorithms.map(algo => ({
+ label: algo.dict_value,
+ value: algo.dict_key,
+ dict_key: algo.dict_key,
+ dict_value: algo.dict_value
+ }));
+
},
async fetchTableData() {
@@ -1773,7 +1809,10 @@
this.draftLoading = false;
}
},
-
+ handleCancel (){
+ this.resetForm();
+ this.dialogVisible = false;
+},
handleLocationChange(val) {
let locationValue = val.value;
if (locationValue && locationValue.length >= 2) {
@@ -2434,8 +2473,7 @@
// 获取工单类型值 - 从types中找到匹配的值
const typeValue =
- this.types.find(t => t.label === row.type)?.value || row.work_order_type_dict_key;
-
+ this.types.find(t => t.value === row.type)?.value || row.work_order_type_dict_key;
// 获取处理人ID - 使用userNameToIdMap映射
const handlerId = this.userNameToIdMap[row.handler] || row.handler;
--
Gitblit v1.9.3