无人机管理后台前端(已迁走)
rain
2025-04-23 5923fb0a3664b82bc63f711dc359f616f822408d
Merge branch 'master' into test
2 files modified
98 ■■■■ changed files
src/api/device-setting/index.js 4 ●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue 94 ●●●● patch | view | raw | blame | history
src/api/device-setting/index.js
@@ -27,12 +27,12 @@
 * @param {*} body 
 * @returns 
 */
export const setThermalCurrentPaletteStyle = (deviceSn, workspaceId, body) => {
export const setThermalCurrentPaletteStyle = (deviceSn, workspaceId, param) => {
  return request({
    // /manage/api/v1/devices/selectDevicePage
    // url: `/localApi/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/setThermalCurrentPaletteStyle`,
    url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/setThermalCurrentPaletteStyle`,
    method: 'put',
    body,
    data: param,
  })
}
src/views/tickets/ticket.vue
@@ -131,11 +131,20 @@
            </el-col>
            <el-col :span="12">
              <el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
                <el-upload ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                  :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
                  :file-list="form.photos" :limit="1" accept="image/*" class="uploader">
                  <span
                    style="font-size: 32px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;">+</span>
                <el-upload ref="upload"
                  :action="'#'"
                  :auto-upload="false"
                  list-type="picture-card"
                  :on-change="handleFileChange"
                  :on-remove="handleUploadRemove"
                  :before-upload="beforeUpload"
                  :file-list="form.photos"
                  :limit="1"
                  accept="image/*"
                  class="create-upload">
                  <template v-if="form.photos.length < 1">
                    <i class="el-icon-plus">+</i>
                  </template>
                </el-upload>
                <div class="upload-tip">支持jpg/png格式图片,单张不超过5MB</div>
              </el-form-item>
@@ -273,11 +282,21 @@
        <!-- 上传图片 -->
        <div v-if="[3, 4].includes(currentDetail.status)" class="form-section" style="margin-bottom: 32px;">
          <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">上传图片</div>
          <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false"
            list-type="picture-card" :on-change="handleFileChange" :on-remove="handleUploadRemove"
            :before-upload="beforeUpload" :file-list="[]" :limit="1" accept="image/*">
            <span
              style="font-size: 32px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;">+</span>
          <el-upload v-if="hasProcessedAndOverBtnPermission()"
            ref="upload"
            :action="'#'"
            :auto-upload="false"
            list-type="picture-card"
            :on-change="handleFileChange"
            :on-remove="handleUploadRemove"
            :before-upload="beforeUpload"
            :file-list="currentDetail.photos || []"
            :limit="1"
            accept="image/*"
            class="detail-upload">
            <template v-if="!currentDetail.photos || currentDetail.photos.length < 1">
              <i class="el-icon-plus">+</i>
            </template>
          </el-upload>
          <div class="el-upload__tip" style="margin-top: 12px;" v-if="hasProcessedAndOverBtnPermission()">
            (上传照片即可完结工单,只能上传jpg、jpeg、png照片,且不超过5M)
@@ -847,7 +866,6 @@
          isPass: 0,
          eventNum: currentItem.orderNumber,
          eventName: currentItem.orderName,
          eventType: currentItem.type,
        };
        const response = await flowEvent(data);
@@ -1533,10 +1551,6 @@
          status: this.currentDetail.status,
          isPass: 0, // 0 表示通过
          eventNum: this.currentDetail.orderNumber,
          eventName: this.currentDetail.orderName, // 工单名称
          eventType: this.currentDetail.type, // 工单类型
          departmentId: this.dispatchForm.department, // 派发部门 ID
          handlerId: this.dispatchForm.handler, // 处理人 ID
        };
        const file = this.currentDetail.file || null; // 如果没有文件,则为 null
@@ -1965,7 +1979,6 @@
          status: currentItem.status,
          isPass: 0,
          eventNum: currentItem.orderNumber,
          eventName: currentItem.orderName,
        };
        console.log('删除前:', this.selections)
        const response = await flowEvent(data);
@@ -2729,4 +2742,53 @@
    }
  }
}
/* 新建工单和处理工单的上传组件样式 */
.create-upload,
.detail-upload {
  :deep(.el-upload--picture-card) {
    width: 120px;
    height: 100px;
    line-height: 100px;
  }
  /* 隐藏额外的上传按钮 */
  :deep(.el-upload.el-upload--picture-card) {
    display: none;
  }
  /* 当没有图片时显示上传按钮 */
  :deep(.el-upload.el-upload--picture-card:first-child) {
    display: flex;
  }
  /* 上传组件的预览图片样式 */
  :deep(.el-upload-list--picture-card .el-upload-list__item) {
    width: 120px;
    height: 100px;
  }
}
/* 事件图片和处理图片的预览样式 */
.media-content {
  :deep(.el-image) {
    width: 700px !important;
    height: 520px !important;
    .el-image__inner {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
/* 原有图片预览的样式 */
.el-image-viewer__wrapper {
  :deep(.el-image-viewer__img) {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}
</style>