<template>
  <div class="labeling-page-container">
    <!-- 顶部操作栏：保留图片切换/缩放，新增审核按钮 -->
    <div class="labeling-header">
      <div class="header-left">
        <el-button-group>
          <el-button icon="el-icon-arrow-left" @click="prevImage" title="上一张" :disabled="imageList.length <= 1"></el-button>
          <el-button icon="el-icon-arrow-right" @click="nextImage" title="下一张" :disabled="imageList.length <= 1"></el-button>
          <el-button icon="el-icon-zoom-in" @click="zoomIn" title="放大"></el-button>
          <el-button icon="el-icon-zoom-out" @click="zoomOut" title="缩小"></el-button>
          <el-button icon="el-icon-refresh" @click="resetZoom" title="重置视图"></el-button>
        </el-button-group>
      </div>

      <div class="header-right">
        <!-- 审核操作按钮 -->
        <el-button type="success" @click="auditPass" class="audit-btn">审核通过</el-button>
        <el-button type="danger" @click="openRejectDialog" class="audit-btn">审核不通过</el-button>
      </div>
    </div>

    <!-- 主体内容区：仅保留图片展示和标注回显 -->
    <div class="labeling-main-wrapper">
      <div class="labeling-main">
        <!-- 左侧图片标注区 -->
        <div class="labeling-image-area">
          <div v-if="imageLoading" class="image-loading">
            <el-skeleton :rows="10" animated />
          </div>
          <div v-else ref="labelContainer" class="image-container" @wheel.prevent="handleWheelZoom">
            <div
              v-if="currentImage.isInvalidData === '0'"
              class="invalid-data-tip"
            >
              无效数据
            </div>
            <div class="image-wrapper" :style="{ transform: 'none', transformOrigin: 'center center' }">
              <img
                ref="labelImage"
                :src="currentImage.filePath"
                alt="审核图片"
                class="label-image"
                @load="onImageLoad"
                @error="onImageError"
                @mousedown.prevent
                style="display: none;"
              />
            </div>
          </div>
          <!-- 图片分页信息 -->
          <div class="image-pagination" v-if="!imageLoading">
            第 {{ currentImageIndex + 1 }} 张/共 {{ imageList.length }} 张 | 缩放比例：{{ Math.round(zoomScale * 100) }}%
          </div>
        </div>

        <!-- 右侧标注信息栏 -->
        <div class="labeling-sidebar">
          <div class="sidebar-title">标注信息</div>
          <div v-if="labelLoading" class="label-loading">
            <el-skeleton :rows="5" animated />
          </div>
          <div v-else class="sidebar-content">
            <div class="label-group" v-for="(group, index) in labelGroups" :key="group.id || index">
              <div class="label-group-header">
                <i class="el-icon el-icon-arrow-down"></i>
                <span>{{ group.name }} ({{ group.labels.length }})</span>
                <span class="label-count">{{ group.labels.length }}</span>
              </div>
              <div class="label-list">
                <div
                  class="label-item"
                  v-for="(label, labelIndex) in group.labels"
                  :key="label.id || labelIndex"
                >
                  <span class="label-name">#{{ labelIndex + 1 }} {{ label.name }} </span>
                  <span class="shape-count" v-if="label.shapeIds && label.shapeIds.length">
                    ({{ label.shapeIds.length }}个标注)
                  </span>
                </div>
              </div>
            </div>
            <div v-if="labelGroups.length === 0" class="no-label-data">
              <el-empty description="暂无标注数据"></el-empty>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 审核不通过弹窗 -->
    <el-dialog
      title="审核不通过"
      :visible.sync="rejectDialogVisible"
      width="500px"
      :close-on-click-modal="false"
      :before-close="handleDialogClose"
    >
      <div class="reject-dialog-content">
        <label class="reject-label">不通过原因:</label>
        <el-input
          type="textarea"
          v-model="auditRemark"
          :rows="8"
          placeholder="请输入审核不通过的原因..."
          class="reject-textarea"
        />
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="rejectDialogVisible = false">取消</el-button>
        <el-button type="primary" @click="confirmReject" :loading="isAuditing">提交</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import * as AILabelLib from 'ailabel'
// 导入审核相关接口
import {
  getAuditPicturesAPI,
  submitAuditResultAPI // 审核结果提交接口（需根据实际接口名调整）
} from '@/api/data/audit'
import {decryptWithSM4} from "@/utils/sm";

export default {
  name: 'LabelingAudit',
  data() {
    return {
      shapeColorMap: {
        rect: '#00ff00',
        polygon: '#0099ff',
        circle: '#ff9900'
      },
      imageList: [],
      currentImageIndex: 0,
      currentImage: {},
      imageLoading: false,
      labelGroups: [],
      labelLoading: false,
      ailabelInstance: null,
      zoomScale: 1.0,
      // 审核相关
      labelingTaskId: this.convertToNumber(decryptWithSM4(this.$route.query.labelingTaskId || '')),
      isAuditing: false, // 审核提交状态锁
      // 新增：审核不通过弹窗相关
      rejectDialogVisible: false,
      auditRemark: '' // 审核不通过原因
    }
  },
  mounted() {
    // 加载审核图片列表和标签数据
    this.loadAuditImages().then(() => {
      if (this.imageList.length > 0) {
        this.currentImage = this.imageList[this.currentImageIndex]
      }
    })
    this.loadLabelTreeData()
  },
  methods: {
    // 类型转换
    convertToNumber(value) {
      if (!value || value === '' || value === 'undefined' || value === 'null') {
        return '';
      }
      const num = Number(value);
      return isNaN(num) ? '' : num;
    },

    // 加载审核图片列表
    async loadAuditImages() {
      try {
        this.imageLoading = true
        if (!this.labelingTaskId) {
          this.$message.error('审核任务ID不能为空！')
          return
        }

        const res = await getAuditPicturesAPI({ labelingTaskId: this.labelingTaskId })
        console.log('审核图片接口返回：', res)

        if (res.code === 200 && res.data && Array.isArray(res.data)) {
          // 按图片分组处理标注数据
          const imageMap = {}

          res.data.forEach(item => {
            const key = item.labelingSampleId
            if (!imageMap[key]) {
              imageMap[key] = {
                id: item.labelingSampleId,
                datasetSampleId: item.datasetSampleId || item.labelingSampleId,
                filePath: item.filePath,
                isInvalidData: item.isInvalidData || '1',
                shapes: [],
                shapeLabelMap: {},
                labelShapeMap: {}
              }
            }

            // 解析标注坐标
            let shapeData = {}
            try {
              shapeData = JSON.parse(item.labelingCoordinate || '{}')
            } catch (e) {
              console.warn('解析标注坐标失败：', e)
              shapeData = {}
            }

            // 生成标注ID
            const shapeId = `shape_${item.labelingSampleId}_${item.labelId}_${Date.now()}`

            // 构造标注数据
            const shape = {
              id: shapeId,
              type: this.getShapeTypeByBoxType(item.boxType),
              x: shapeData.x || 0,
              y: shapeData.y || 0,
              width: shapeData.width || 0,
              height: shapeData.height || 0,
              radius: shapeData.radius || 0,
              points: shapeData.points || [],
              labelId: item.labelId,
              textContent: item.textContent || '',
              color: item.labelingColor || this.shapeColorMap[this.getShapeTypeByBoxType(item.boxType)]
            }

            // 添加到图片标注列表
            imageMap[key].shapes.push(shape)

            // 维护映射关系
            imageMap[key].shapeLabelMap[shapeId] = item.labelId
            if (!imageMap[key].labelShapeMap[item.labelId]) {
              imageMap[key].labelShapeMap[item.labelId] = []
            }
            imageMap[key].labelShapeMap[item.labelId].push(shapeId)
          })

          // 转换为数组
          this.imageList = Object.values(imageMap)

          if (this.imageList.length === 0) {
            this.$message.info('暂无审核图片数据')
          }
        } else {
          this.$message.warning('图片数据加载失败：' + (res.msg || '接口返回异常'))
          this.imageList = []
        }
      } catch (error) {
        console.error('加载审核图片失败：', error)
        this.$message.error('图片数据加载失败，请刷新重试')
        this.imageList = []
      } finally {
        this.imageLoading = false
      }
    },

    // 加载标签树数据（仅展示）
    async loadLabelTreeData() {
      try {
        this.labelLoading = true
        // 注：如果审核接口有单独的标签树接口，请替换此处
        // 暂时复用原有逻辑，实际项目中请根据后端接口调整
        this.labelGroups = []
      } catch (error) {
        console.error('加载标签树失败：', error)
        this.$message.error('标签数据加载失败，请刷新重试')
        this.labelGroups = []
      } finally {
        this.labelLoading = false
      }
    },

    // 转换box_type为前端标注类型
    getShapeTypeByBoxType(boxType) {
      switch (boxType) {
        case "1": return 'rect'
        case "2": return 'polygon'
        case "3": return 'circle'
        default: return 'rect'
      }
    },

    // 图片加载完成
    onImageLoad() {
      this.calcFitScale()
      if (this.ailabelInstance?.setScale) {
        this.ailabelInstance.setScale(this.zoomScale)
      }
      this.initAILabel()
      this.$nextTick(() => {
        if (this.ailabelInstance?.redrawMainCanvas) {
          this.ailabelInstance.redrawMainCanvas()
        }
      })
    },

    // 图片加载失败
    onImageError() {
      this.$message.error(`图片加载失败：${this.currentImage.filePath}`)
    },

    // 计算适配缩放比例
    calcFitScale() {
      const container = this.$refs.labelContainer
      const image = this.$refs.labelImage
      if (!container || !image) return

      const containerW = container.clientWidth
      const containerH = container.clientHeight
      const imgW = image.naturalWidth
      const imgH = image.naturalHeight

      const scaleW = containerW / imgW
      const scaleH = containerH / imgH
      this.zoomScale = Math.min(scaleW, scaleH)
      this.zoomScale = Math.max(0.1, Math.min(2.0, this.zoomScale))
    },

    // 初始化标注展示工具
    initAILabel() {
      const container = this.$refs.labelContainer
      const image = this.$refs.labelImage
      if (!container || !image || !this.currentImage.filePath) return

      // 销毁旧实例
      this.destroyAILabel()

      try {
        let instance = null
        // 适配标注库实例化方式
        if (AILabelLib.create) {
          instance = AILabelLib.create({
            el: container,
            image: image,
            config: {
              enableRect: false,
              enablePolygon: false,
              enableCircle: false,
              enableDrag: false,
              enableScale: false,
              style: {
                rect: { strokeStyle: '#00ff00', lineWidth: 2, fillStyle: 'rgba(0,255,0,0.1)' },
                polygon: { strokeStyle: '#0099ff', lineWidth: 2, fillStyle: 'rgba(0,153,255,0.1)' },
                circle: { strokeStyle: '#ff9900', lineWidth: 2, fillStyle: 'rgba(255,153,0,0.1)' }
              },
              fit: 'cover'
            }
          })
        } else if (AILabelLib.init) {
          instance = AILabelLib.init(container, image, { enableRect: false, enablePolygon: false, enableCircle: false })
        } else if (window.AILabel) {
          instance = window.AILabel({ el: container, image: image })
        } else {
          instance = this.createSimpleLabelTool(container, image)
        }

        if (instance) {
          this.ailabelInstance = instance
          if (instance.setScale) instance.setScale(this.zoomScale)
          this.loadLabelData()
        }
      } catch (e) {
        console.error('标注工具初始化失败：', e)
        this.$message.error(`初始化失败：${e.message}`)
      }
    },

    // 销毁标注实例
    destroyAILabel() {
      if (this.ailabelInstance) {
        try {
          this.ailabelInstance.destroy?.() || this.ailabelInstance.clear?.()
        } catch (e) {}
        this.ailabelInstance = null
      }
    },

    // 简易标注展示工具
    createSimpleLabelTool(container, image) {
      const tool = {
        el: container,
        image,
        shapes: [],
        mainCanvas: null,
        mainCtx: null,
        zoomScale: 1.0,

        init() {
          // 主画布
          const mainCanvas = document.createElement('canvas')
          mainCanvas.style.cssText = 'position:absolute;top:0;left:0;pointer-events:none;z-index:10;width:100%;height:100%;'
          mainCanvas.width = container.offsetWidth
          mainCanvas.height = container.offsetHeight
          container.appendChild(mainCanvas)
          this.mainCanvas = mainCanvas
          this.mainCtx = mainCanvas.getContext('2d')

          // 监听容器大小变化
          window.addEventListener('resize', () => this.resizeCanvas())

          // 绘制图片和标注
          this.redrawMainCanvas()

          return this
        },

        resizeCanvas() {
          this.mainCanvas.width = this.el.offsetWidth
          this.mainCanvas.height = this.el.offsetHeight
          this.redrawMainCanvas()
        },

        setScale(scale) {
          this.zoomScale = scale
          this.resizeCanvas()
        },

        // 绘制标注形状
        drawRect(x, y, w, h) {
          const shape = { id: `shape_${Date.now()}`, type: 'rect', x, y, width: w, height: h }
          this.shapes.push(shape)
          this.redrawMainCanvas()
          return shape.id
        },

        drawCircle(x, y, radius) {
          const shape = { id: `shape_${Date.now()}`, type: 'circle', x, y, radius }
          this.shapes.push(shape)
          this.redrawMainCanvas()
          return shape.id
        },

        drawPolygon(points) {
          const shape = { id: `shape_${Date.now()}`, type: 'polygon', points }
          this.shapes.push(shape)
          this.redrawMainCanvas()
          return shape.id
        },

        clearShapes() {
          this.shapes = []
          this.mainCtx.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height)
        },

        getShapes() {
          return [...this.shapes]
        },

        setShapeData(id, data) {
          const shape = this.shapes.find(s => s.id === id)
          if (shape) Object.assign(shape, data)
        },

        redrawMainCanvas() {
          this.mainCtx.clearRect(0, 0, this.mainCanvas.width, this.mainCanvas.height)
          this.mainCtx.save()

          // 居中逻辑
          this.mainCtx.translate(
            this.el.offsetWidth / 2,
            this.el.offsetHeight / 2
          )
          this.mainCtx.scale(this.zoomScale, this.zoomScale)
          if (this.image && this.image.naturalWidth && this.image.naturalHeight) {
            this.mainCtx.translate(
              -this.image.naturalWidth / 2,
              -this.image.naturalHeight / 2
            )
            // 绘制图片
            this.mainCtx.drawImage(
              this.image,
              0, 0,
              this.image.naturalWidth,
              this.image.naturalHeight
            )
          }

          // 绘制所有标注
          this.shapes.forEach(s => {
            if (s.type === 'rect') {
              this.mainCtx.strokeStyle = s.color || '#00ff00'
              this.mainCtx.fillStyle = 'rgba(0,255,0,0.1)'
              this.mainCtx.strokeRect(s.x, s.y, s.width, s.height)
              this.mainCtx.fillRect(s.x, s.y, s.width, s.height)
            } else if (s.type === 'circle') {
              this.mainCtx.strokeStyle = s.color || '#ff9900'
              this.mainCtx.fillStyle = 'rgba(255,153,0,0.1)'
              this.mainCtx.beginPath()
              this.mainCtx.arc(s.x, s.y, s.radius, 0, Math.PI * 2)
              this.mainCtx.closePath()
              this.mainCtx.fill()
              this.mainCtx.stroke()
            } else if (s.type === 'polygon') {
              this.mainCtx.strokeStyle = s.color || '#0099ff'
              this.mainCtx.fillStyle = 'rgba(0,153,255,0.1)'
              this.mainCtx.beginPath()
              s.points.forEach((point, idx) => {
                idx === 0 ? this.mainCtx.moveTo(point.x, point.y) : this.mainCtx.lineTo(point.x, point.y)
              })
              this.mainCtx.closePath()
              this.mainCtx.fill()
              this.mainCtx.stroke()
            }
          })

          this.mainCtx.restore()
        },

        destroy() {
          this.mainCanvas?.remove()
          window.removeEventListener('resize', this.resizeCanvas)
        }
      }
      return tool.init()
    },

    // 加载标注数据（仅展示）
    loadLabelData() {
      if (!this.ailabelInstance || !this.currentImage) return

      this.ailabelInstance.clearShapes?.()

      // 恢复映射关系
      if (this.currentImage.shapeLabelMap) {
        this.shapeLabelMap = JSON.parse(JSON.stringify(this.currentImage.shapeLabelMap))
      }

      // 绘制标注
      const shapes = this.currentImage.shapes || []
      shapes.forEach(shapeData => {
        try {
          let shapeId = ''
          if (shapeData.type === 'rect' && shapeData.x !== undefined) {
            shapeId = this.ailabelInstance.drawRect?.(shapeData.x, shapeData.y, shapeData.width, shapeData.height) || shapeData.id
          } else if (shapeData.type === 'polygon' && shapeData.points && shapeData.points.length >= 3) {
            shapeId = this.ailabelInstance.drawPolygon?.(shapeData.points) || shapeData.id
          } else if (shapeData.type === 'circle' && shapeData.radius !== undefined) {
            shapeId = this.ailabelInstance.drawCircle?.(shapeData.x, shapeData.y, shapeData.radius) || shapeData.id
          }

          // 绑定标注样式
          if (shapeId) {
            this.ailabelInstance.setShapeData?.(shapeId, {
              color: shapeData.color || this.shapeColorMap[shapeData.type]
            })
          }
        } catch (e) {
          console.warn('绘制标注失败：', e)
        }
      })
    },

    // 滚轮缩放
    handleWheelZoom(e) {
      e.preventDefault()
      const delta = e.deltaY > 0 ? -0.1 : 0.1
      this.zoomScale = Math.max(0.1, Math.min(2.0, this.zoomScale + delta))

      if (this.ailabelInstance?.setScale) {
        this.ailabelInstance.setScale(this.zoomScale)
      }
    },

    // 放大图片
    zoomIn() {
      this.zoomScale = Math.min(2.0, this.zoomScale + 0.1)
      if (this.ailabelInstance?.setScale) {
        this.ailabelInstance.setScale(this.zoomScale)
      }
    },

    // 缩小图片
    zoomOut() {
      this.zoomScale = Math.max(0.1, this.zoomScale - 0.1)
      if (this.ailabelInstance?.setScale) {
        this.ailabelInstance.setScale(this.zoomScale)
      }
    },

    // 重置缩放
    resetZoom() {
      this.zoomScale = 1.0
      if (this.ailabelInstance?.setScale) {
        this.ailabelInstance.setScale(this.zoomScale)
      }
    },

    // 上一张图片
    prevImage() {
      if (this.currentImageIndex > 0) {
        this.switchImage(this.currentImageIndex - 1)
      } else {
        this.$message.info('已是第一张！')
      }
    },

    // 下一张图片
    nextImage() {
      if (this.currentImageIndex < this.imageList.length - 1) {
        this.switchImage(this.currentImageIndex + 1)
      } else {
        this.$message.info('已是最后一张！')
      }
    },

    // 切换图片
    switchImage(index) {
      this.currentImageIndex = index
      this.currentImage = this.imageList[index]

      // 重新初始化标注展示
      this.$nextTick(() => {
        this.initAILabel()
      })
    },

    // 审核通过
    async auditPass() {
      await this.submitAuditResult(1)
    },

    // 新增：打开审核不通过弹窗
    openRejectDialog() {
      // 每次打开弹窗清空原因输入框
      this.auditRemark = ''
      this.rejectDialogVisible = true
    },

    // 新增：关闭弹窗时的处理
    handleDialogClose() {
      this.rejectDialogVisible = false
      this.auditRemark = ''
    },

    // 新增：确认审核不通过并提交
    async confirmReject() {
      // 校验原因是否填写
      if (!this.auditRemark.trim()) {
        this.$message.warning('请填写审核不通过的原因！')
        return
      }
      // 提交审核不通过结果
      await this.submitAuditResult(2)
      // 提交成功后关闭弹窗
      this.rejectDialogVisible = false
    },

    // 提交审核结果
    async submitAuditResult(auditStatus) {
      if (this.isAuditing) return
      if (!this.currentImage.id) {
        this.$message.error('当前图片ID为空，无法提交审核！')
        return
      }

      try {
        this.isAuditing = true
        const loadingInstance = this.$loading({ text: '提交审核结果中...' })

        // 构造审核提交参数
        const submitParams = {
          labelingTaskId: this.labelingTaskId,
          labelingSampleId: this.currentImage.id,
          auditStatus: auditStatus, // 1-通过，2-不通过
          datasetSampleId: this.currentImage.datasetSampleId || '',
          auditRemark: auditStatus === 2 ? this.auditRemark.trim() : '' // 仅审核不通过时传递原因
        }

        console.log('提交审核参数：', submitParams)

        // 调用审核提交接口
        const res = await submitAuditResultAPI(submitParams)

        if (res.code === 200) {
          this.$message.success(auditStatus === 1 ? '审核通过提交成功！' : '审核不通过提交成功！')

          // 自动切换到下一张（如果有）
          if (this.currentImageIndex < this.imageList.length - 1) {
            this.nextImage()
          }
        } else {
          this.$message.error('提交失败：' + (res.msg || '接口返回异常'))
        }
      } catch (error) {
        console.error('提交审核结果失败：', error)
        this.$message.error('提交失败，请重试！')
      } finally {
        this.isAuditing = false
        this.$loading().close()
      }
    }
  }
}
</script>

<style scoped lang="scss">
// 全局容器
.labeling-page-container {
  width: 100%;
  height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #f5f7fa;
  box-sizing: border-box;
}

// 顶部操作栏
.labeling-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #fff;
  border-bottom: 1px solid #e6e6e6;
  flex-shrink: 0;
  z-index: 100;

  .header-left {
    display: flex;
    align-items: center;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 15px;

    .audit-btn {
      padding: 8px 20px;
    }
  }
}

// 主体内容外层容器
.labeling-main-wrapper {
  height: 100%;
  overflow: hidden;
  padding: 15px;
  transition: all 0.3s ease;
}

// 主体内容区
.labeling-main {
  display: flex;
  gap: 20px;
  height: 100%;
  min-height: 0;

  // 左侧图片展示区
  .labeling-image-area {
    flex: 1;
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;

    .image-loading {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .image-container {
      flex: 1;
      position: relative;
      overflow: hidden;
      border: 1px solid #e6e6e6;
      border-radius: 4px;
      min-height: 400px;
      cursor: default;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #f0f0f0;
      padding: 0;
      box-sizing: border-box;

      .invalid-data-tip {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 999;
        background-color: rgba(255, 255, 255, 0.8);
        color: #ff0000;
        padding: 8px 16px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 6px;
        pointer-events: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        min-width: 120px;
        text-align: center;
      }

      .image-wrapper {
        position: relative;
        transition: transform 0.2s ease;
        max-width: 100%;
        max-height: 100%;
      }
    }

    .image-pagination {
      margin-top: 10px;
      font-size: 14px;
      color: #666;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }

  // 右侧标注信息栏
  .labeling-sidebar {
    width: 300px;
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid #e6e6e6;

    .sidebar-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 15px;
      padding-bottom: 8px;
      border-bottom: 1px solid #e6e6e6;
    }

    .sidebar-content {
      flex: 1;
      overflow-y: auto;

      .label-group {
        margin-bottom: 15px;

        .label-group-header {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 8px 10px;
          background-color: #f5f7fa;
          border-radius: 4px;
          margin-bottom: 8px;

          .el-icon {
            margin-right: 8px;
            font-size: 12px;
          }

          .label-count {
            font-size: 12px;
            color: #999;
          }
        }

        .label-list {
          padding-left: 10px;

          .label-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            margin-bottom: 5px;
            border-radius: 4px;
            background-color: #f5f7fa;

            .label-name {
              font-size: 14px;
              color: #333;
              flex: 1;
            }

            .shape-count {
              font-size: 12px;
              color: #999;
              margin-right: 8px;
            }
          }
        }
      }
    }
  }
}

// 审核不通过弹窗样式
.reject-dialog-content {
  padding: 10px 0;

  .reject-label {
    font-weight: normal;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: black;
  }

  .reject-textarea {
    width: 100%;
    box-sizing: border-box;
  }
}

// 滚动条样式
::v-deep .el-scrollbar__bar {
  width: 6px;
  height: 6px;
}

::v-deep .el-scrollbar__thumb {
  background-color: #ccc;
  border-radius: 3px;
}
</style>
