无人机管理后台前端(已迁走)
罗广辉
2025-10-10 8bfd657326eb9d4bd9b63920cfe3bd362cea4445
src/views/tickets/ticket.vue
@@ -20,7 +20,7 @@
            />
            <!-- <el-select
              v-model="filters.department"
              placeholder="请选择所属单位"
              placeholder="请选择所属部门"
              class="filter-item"
              clearable
            >
@@ -115,7 +115,6 @@
              collapse-tags-tooltip
              clearable
              @check="handleCheck"
              @node-click="handleSFNodeClick"
              @clear="handleClear"
            />
            <el-select
@@ -277,10 +276,10 @@
          <el-row :gutter="16">
            <el-col :span="12">
              <el-form-item label="所属部门" prop="department">
              <el-form-item label="处理部门" prop="department">
                <el-select
                  v-model="form.department"
                  placeholder="请选择所属部门"
                  placeholder="请选择处理部门"
                  @change="handleDepartmentChange"
                  class="full-width"
                >
@@ -297,7 +296,7 @@
              <el-form-item label="处理人员" prop="handler">
                <el-select
                  v-model="form.handler"
                  placeholder="请先选择所属部门"
                  placeholder="请先选择处理人员"
                  :disabled="!form.department"
                  class="full-width"
                >
@@ -332,7 +331,7 @@
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="选择位置" prop="location">
              <el-form-item label="事件位置" prop="location">
                <div class="location-wrapper">
                  <avue-input-map
                    v-model="form.location"
@@ -365,7 +364,7 @@
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
              <el-form-item label="事件图片" prop="photos" required class="upload-wrapper">
                <el-upload
                  v-if="createoredit === 1"
                  ref="upload"
@@ -644,7 +643,7 @@
                      :src="getThumbUrl(currentDetail.mediaUrl)"
                      :preview-src-list="[getPreviewUrl(currentDetail.mediaUrl)]"
                      fit="contain"
                      style="pxToRemNum(width: 700px); pxToRemNum(height: 520px); cursor: pointer"
                      style=" cursor: pointer"
                    >
                      <template #placeholder>
                        <div class="image-placeholder">
@@ -857,13 +856,13 @@
      <div class="review-container">
        <div class="review-image-wrapper">
          <!-- 修改左右箭头的显示条件 -->
          <div
          <el-button
            v-if="selections.length > 1 && currentReviewImage"
            class="arrow-button left"
            @click="handlePrevImage"
            icon="el-icon-arrow-left"
          >
            <i class="el-icon-arrow-left"></i>
          </div>
          </el-button>
          <div class="review-image-container">
            <!-- <el-image v-if="currentReviewImage" :src="getThumbUrl(currentReviewImage)" fit="fill"
@@ -888,13 +887,13 @@
          </div>
          <!-- 修改右箭头的显示条件 -->
          <div
          <el-button
            v-if="selections.length > 1 && currentReviewImage"
            class="arrow-button right"
            @click="handleNextImage"
            icon="el-icon-arrow-right"
          >
            <i class="el-icon-arrow-right"></i>
          </div>
          </el-button>
        </div>
        <!-- 修改分页器的显示条件 -->
@@ -1049,8 +1048,8 @@
          // { label: "序号", prop: "id", width: 70 },
          { label: '工单编号', prop: 'orderNumber', width: 170 },
          { label: '工单名称', prop: 'orderName', width: 150, overHidden: true, tooltip: true },
          { label: '所属单位', prop: 'department', overHidden: true, tooltip: true },
          { label: '发起时间', prop: 'startTime', width: 160 },
          { label: '所属部门', prop: 'department', overHidden: true, tooltip: true },
          { label: '发起时间', prop: 'startTime', width: 160, overHidden: true },
          { label: '关联算法', prop: 'aiType', overHidden: true, tooltip: true },
          {
            label: '工单类型',
@@ -1068,8 +1067,8 @@
            width: 152,
            overHidden: true,
          },
          { label: '创建人', prop: 'creator', width: 70 },
          { label: '处理人', prop: 'handler', width: 70 },
          { label: '创建人', prop: 'creator', width: 120, overHidden: true, },
          { label: '处理人', prop: 'handler', width: 120, overHidden: true, },
          {
            slot: true,
            hide: envName === 'jiangwu' ? true : false,
@@ -1284,7 +1283,7 @@
          editable: false,
        },
        {
          label: '任务发起人',
          label: '工单创建人',
          value: this.currentDetail.creator,
          editable: false,
        },
@@ -1337,7 +1336,7 @@
          type: 'input',
        },
        { label: '关键任务', value: this.currentDetail.keyData, editable: false },
        { label: '任务发起人', value: this.currentDetail.creator, editable: false },
        { label: '工单创建人', value: this.currentDetail.creator, editable: false },
        { label: '当前状态', value: this.mapStatus(this.currentDetail.status), editable: false },
        { label: '事件地址', value: this.currentDetail.address, editable: false },
        {
@@ -1370,7 +1369,7 @@
        },
        { label: '关联任务', value: this.currentDetail.job_name || '/' },
        { label: '任务发起人', value: this.currentDetail.creator },
        { label: '工单创建人', value: this.currentDetail.creator },
        { label: '当前状态', value: this.mapStatus(this.currentDetail.status) },
        { label: '事件地址', value: this.currentDetail.address || this.currentDetail.latAndLon }, // 包含经纬度信息
        {
@@ -1524,7 +1523,7 @@
        });
      } else if (column.no === 4) {
        navigator.clipboard.writeText(row.department).then(() => {
          this.$message.success('复制所属单位成功');
          this.$message.success('复制所属部门成功');
        });
      }
    },
@@ -1756,7 +1755,8 @@
          user_id: currentTab?.name === 'myTickets' ? this.userInfo.user_id : undefined,
          is_review: this.filters.isReview === '' ? undefined : this.filters.isReview, // 添加复核状态查询参数
        };
       source:1  ,//数据来源
       };
        const response = await getList(params);
        if (!response?.data?.data?.records) {
@@ -1804,6 +1804,8 @@
            job_name: item.job_name || '',
            job_create_time: item.job_create_time || '',
            isReview: item.is_review, // 添加复核状态字段映射
          };
        });
@@ -2213,9 +2215,10 @@
      };
      console.log('this.currentDetail', this.currentDetail);
      this.detailVisible = true;
      this.handleTypeChange(this.currentDetail.type);
      console.log('this.currentDetail.location', this.currentDetail.location);
      this.$nextTick(() => {
        if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
@@ -2291,7 +2294,7 @@
        const headers = [
          '工单编号',
          '工单名称',
          '所属单位',
          '所属部门',
          '发起时间',
          '关联算法',
          '工单内容',
@@ -2319,7 +2322,7 @@
      return {
        工单编号: item.orderNumber || item.event_num || '',
        工单名称: item.orderName || item.event_name || '',
        所属单位: item.department || item.dept_name || '',
        所属部门: item.department || item.dept_name || '',
        发起时间: item.startTime || item.create_time || '',
        关联算法: item.aiType || item.ai_types || '',
        工单内容: item.address || item.content || '',
@@ -2537,6 +2540,7 @@
      // console.log('权限检查:', this.permission)
      return this.permission && this.permission.tickets_review_btn === true;
    },
    async submitDispatch() {
      if (this.dispatchLoading) return;
      if (!this.currentDetail.orderName || !this.currentDetail.orderName.trim()) {
@@ -2561,7 +2565,22 @@
      }
      this.dispatchLoading = true;
      console.log('派发成功', this.currentDetail);
      const isValue = this.algorithms.some(item => item.value === this.currentDetail.aiType);
      let resultValue;
      if (isValue) {
        // 如果已经是value,直接使用
        resultValue = this.currentDetail.aiType;
      } else {
        // 否则查找对应的value
        const matched = this.algorithms.find(
          item => item.dict_value === this.currentDetail.aiType ||
                  item.label === this.currentDetail.aiType
        );
        resultValue = matched ? matched.value : null;
      }
// console.log('resultValue',resultValue);
      this.$refs.dispatchForm.validate(async valid => {
        if (valid) {
          try {
@@ -2575,7 +2594,7 @@
              content: this.currentDetail.content, // 使用 content 替代原来的 remark
              createDept: this.dispatchForm.department, // 派发部门 ID
              updateUser: this.dispatchForm.handler, // 处理人 ID
              aiType: this.currentDetail.aiType,
              aiType:resultValue,
            };
            console.log('派发', data);
@@ -3825,6 +3844,7 @@
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
@@ -3843,10 +3863,12 @@
    &.left {
      left: 20px;
      color: #ffffff;
    }
    &.right {
      right: 20px;
      color: #ffffff;
    }
  }