无人机管理后台前端(已迁走)
张含笑
2025-09-20 ee8589ea223a7ff864df467c4dbcafe9aa45909e
src/views/tickets/ticket.vue
@@ -414,13 +414,13 @@
        </div>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
        <div class="dialog-footer-new">
          <el-button type="danger" :loading="submitLoading" @click="submitForm">发布</el-button>
          <el-button type="infoprimary" plain :loading="draftLoading" @click="saveDraft"
            >存草稿</el-button
          >
          <el-button @click="handleCancel">取 消</el-button>
          <el-button @click="handleCancel" :icon="CircleClose">取 消</el-button>
        </div>
      </template>
    </el-dialog>
@@ -724,7 +724,7 @@
        </div>
        <!-- 操作按钮 -->
        <div class="dialog-footer1">
        <div class="dialog-footer1-new">
          <div class="leftBtn" :class="currentIndex === 0 ? 'disableds' : ''" @click="leftClick">
            上一页
          </div>
@@ -745,7 +745,7 @@
                @click="rejectTicket"
                >不通过</el-button
              >
              <el-button @click="detailVisible = false">取消</el-button>
              <el-button @click="detailVisible = false":icon="CircleClose">取消</el-button>
            </template>
            <template v-else-if="currentDetail.status === 0">
              <el-button
@@ -845,6 +845,7 @@
      title="批量审核"
      width="1100"
      append-to-body
      class="ztzf-dialog-mange"
      custom-class="review-dialog"
      @close="cancleBatchReject"
    >
@@ -922,7 +923,7 @@
      title="工单复核"
      width="30%"
      append-to-body
      custom-class="re-check-dialog"
      class="ztzf-dialog-mange"
      @close="reCheckDialog = false"
    >
      <div class="dialog-footer">
@@ -957,6 +958,7 @@
import elTooltipCopy from '@/components/ElTooltipCopy.vue';
import getBaseConfig from '@/buildConfig/config';
import CreateQRcode from '@/components/CreateQRcode/CreateQRcode.vue';
import { CircleClose } from '@element-plus/icons-vue';
const { envName } = getBaseConfig();
function regExp(label, name) {
  var reg = new RegExp(label + '=([^&]*)(&|$)', 'g');
@@ -1177,8 +1179,7 @@
    this.loadAMapScripts();
    this.fetchDropdownData();
    // console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn);
    // console.log('permission', this.permission.tickets_tab_pending);
  },
  mounted() {
@@ -1191,7 +1192,7 @@
    }
    let curQueryParams = {};
    let isTabProcessed = false;
    if (href.indexOf('?') != -1 && href.split('?').length > 0) {
      curQueryParams = href
        .split('?')[1]
@@ -1204,7 +1205,7 @@
          return pre;
        }, {});
      const { orderNumber = undefined, day = undefined } = curQueryParams;
      const { orderNumber = undefined, day = undefined, tab = undefined } = curQueryParams;
      // 日历传值
      if (day) {
@@ -1233,12 +1234,25 @@
          find && (find.query = {});
        });
      }
        if (tab) {
      const isTabValid = this.filteredTabs.some(t => t.name === tab);
      if (isTabValid) {
        this.activeTab = tab;
        this.handleTabChangeAfterJump();
        isTabProcessed = true;
        const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/ticket');
          find && (find.query = {});
      }
    }
    }
    this.fetchTabCounts(); // 新增:初始化时获取 tab 数据
    this.fetchTableData();
  },
  computed: {
    CircleClose() {
      return CircleClose
    },
    firstRowData() {
      return this.tableData.length > 0 ? this.tableData[0] : null;
    },
@@ -1346,8 +1360,7 @@
          // 修改这里:使用 types 数组查找对应的 label
          value:
            this.types.find(t => t.value === this.currentDetail.type)?.label ||
            this.currentDetail.type ||
            '/',
            this.currentDetail.type
        },
        { label: '关联任务', value: this.currentDetail.job_name || '/' },
        { label: '任务发起人', value: this.currentDetail.creator },
@@ -1357,8 +1370,7 @@
          label: '关联算法',
          value:
            this.algorithms.find(t => t.value === this.currentDetail.aiType)?.label ||
            this.currentDetail.aiType ||
            '/',
            this.currentDetail.aiType
        },
        { label: '发起单位', value: this.currentDetail.department },
        { label: '发起任务时间', value: this.currentDetail.startTime },
@@ -1480,7 +1492,6 @@
    },
    handleSFNodeClick(data) {
      console.log(data.dictKey, '666666666');
      this.filters.type = '';
      this.filters.algorithm = '';
      this.filters.type = data.dictKey;
@@ -2033,7 +2044,6 @@
    handleTabChange(tab) {
      this.activeTab = tab.props?.name || tab.name;
      const isReview = this.findObject(this.option.column, 'isReview');
      // 根据条件切换显隐
      isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
@@ -2043,7 +2053,15 @@
      this.fetchTableData();
      this.fetchTabCounts(); // 切换 tab 时重新获取数据
    },
    //新增 跳转后触发的Tab切换
handleTabChangeAfterJump() {
    const isReview = this.findObject(this.option.column, 'isReview');
    isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
    this.handleReset();
    this.page.currentPage = 1;
    this.fetchTableData();
    this.fetchTabCounts();
  },
    handleSearch() {
      this.page.currentPage = 1;
      this.fetchTableData();
@@ -3096,6 +3114,10 @@
<style lang="scss">
.custom-dialog {
  max-height: 96vh;
  .el-dialog__body {
    border-top: 0.1rem solid #f0f0f0;
  }
}
.custom-qrcode-popover {
  min-width: 160px !important;
@@ -3324,9 +3346,11 @@
    width: 100%;
  }
}
.dialog-footer {
  text-align: center;
:deep(.el-dialog__body) {
  border-top: 0.1rem solid #f0f0f0;
}
.dialog-footer-new {
  text-align: right;
  padding-top: 16px;
  border-top: 1px solid #ebeef5;
@@ -3342,7 +3366,7 @@
    }
  }
}
.dialog-footer1 {
.dialog-footer1-new {
  position: sticky;
  bottom: 28px;
  left: 0;
@@ -3739,6 +3763,7 @@
  :deep(.el-dialog__body) {
    padding: 0;
    background-color: #f5f7fa;
    border-top: 0.1rem solid #f0f0f0;
  }
}
@@ -3746,6 +3771,7 @@
  :deep(.el-dialog__body) {
    padding: 0;
    background-color: #f5f7fa;
    border-top: 0.1rem solid #f0f0f0;
  }
}