无人机管理后台前端(已迁走)
张含笑
2025-05-26 8c7a8297944c0bb8038dc7ac21bdf22c6e06a229
feat:默认头像,事件工单可在详情页点击下一个事件处置
1 files modified
1 files added
62 ■■■■■ changed files
src/assets/images/defaultava.png patch | view | raw | blame | history
src/views/tickets/ticket.vue 62 ●●●●● patch | view | raw | blame | history
src/assets/images/defaultava.png
src/views/tickets/ticket.vue
@@ -322,7 +322,8 @@
        <!-- 图片和地图部分 -->
        <div class="media-section">
          <el-row :gutter="20">
            <el-col :span="12">
            <el-col :span="1"><div class="leftBtn" @click="leftClick"><</div></el-col>
            <el-col :span="11">
              <div class="media-box">
                <div class="media-title">事件图片</div>
                <div class="media-content">
@@ -346,9 +347,10 @@
                </div>
              </div>
            </el-col>
            <el-col :span="12">
            <el-col :span="11">
              <div class="media-box">
                <!-- 根据状态显示不同的标题和内容 -->
                <template v-if="currentDetail.status === 4">
                  <div class="media-title">工单处理图片</div>
                  <div class="media-content">
@@ -378,6 +380,7 @@
                </template>
              </div>
            </el-col>
             <el-col :span="1"><div class="leftBtn" @click="rightClick">></div></el-col>
          </el-row>
        </div>
@@ -523,6 +526,7 @@
  name: 'TicketPage',
  data () {
    return {
    currentIndex: 0, // 当前显示的数据索引
      submitLoading: false, // 新增loading状态
      draftLoading: false,
      approveLoading: false,
@@ -715,7 +719,9 @@
    console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn)
    console.log('permission', this.permission.tickets_tab_pending)
  },
  mounted () {
    const href = this.$route.href
    let curQueryParams = {}
@@ -951,7 +957,40 @@
      }
    },
  },
  methods: {
    leftClick() {
    if (this.tableData.length === 0) return
    if(this.currentIndex === 0) return
    this.currentIndex = (this.currentIndex - 1 + this.tableData.length) % this.tableData.length
    console.log('left', this.currentIndex);
  this.updateCurrentDetail()
  },
  // 右切换
  rightClick() {
    if (this.tableData.length === 0) return
    if(this.currentIndex >= this.tableData.length-1) return
    this.currentIndex = (this.currentIndex + 1) % this.tableData.length
     console.log('right', this.currentIndex);
    this.updateCurrentDetail()
  },
  // 更新当前详情
  updateCurrentDetail() {
    this.currentDetail = this.tableData[this.currentIndex]
    this.currentDetail.mediaUrl = this.currentDetail.photo_url
    console.log('this.currentDetail',this.currentDetail);
    // 如果使用地图组件,需要更新地图标记
    this.$nextTick(() => {
      if (this.$refs.MapContainer && this.currentDetail.location) {
        this.$refs.MapContainer.initAddEntity('point', this.currentDetail.location)
      }
    })
  },
    async loadAMapScripts () {
      try {
        const areaCode = this.userInfo.detail.areaCode
@@ -1164,6 +1203,7 @@
            isReview: item.is_review, // 添加复核状态字段映射
          }
        })
// console.log('this.tableData',this.tableData);
        // 更新总数显示
        this.page.total = total || 0
@@ -2369,6 +2409,8 @@
     * @returns {string} 缩略图地址
     */
    getThumbUrl (url) {
      if (!url) return ''
      const lastDot = url.lastIndexOf('.')
      if (lastDot === -1) return url
@@ -2550,6 +2592,7 @@
    .el-row {
      margin-bottom: 16px;
      &:last-child {
        margin-bottom: 0;
@@ -2800,8 +2843,21 @@
.media-section {
  margin-bottom: 20px;
}
  .el-row {
  display: flex;
  align-items: center;}
}
.leftBtn {
  width: 36px;
  height: 36px;
  background-color: #999;
  border-radius: 50%;
  text-align: center;
  line-height: 36px;
  color: #fff;
  cursor: pointer;
  }
.media-box {
  width: 100%;
  border: 1px solid #dcdfe6;