<template>
  <div class="app-container">
    <el-card class="topCard">
      <!-- 搜索栏 -->
      <div class="topDiv">
        <span>工位号：</span>
        <el-input v-model="searchStation" placeholder="请输入工位号" clearable size="small" style="width: 150px" @keyup.enter.native="handleSearch" />
        <span style="margin-left: 10px">参数：</span>
        <el-input v-model="searchParam" placeholder="模糊搜索" clearable size="small" style="width: 150px" />
        <span style="margin-left: 10px">参数描述：</span>
        <el-input v-model="searchParamDesc" placeholder="模糊搜索" clearable size="small" style="width: 150px" />
        <span style="margin-left: 10px">是否启用：</span>
        <el-select v-model="searchEnabled" placeholder="全部" clearable size="small" style="width: 100px">
          <el-option label="启用" value="1" />
          <el-option label="禁用" value="0" />
        </el-select>
        <span style="margin-left: 10px">可用型号：</span>
        <el-select v-model="searchModel" placeholder="全部" clearable size="small" style="width: 120px">
          <el-option v-for="item in modelOptions" :key="item.flag" :label="item.name" :value="String(item.flag)" />
        </el-select>
        <el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 10px" @click="handleSearch">查询</el-button>
        <el-button type="success" plain size="small" icon="el-icon-plus" @click="handleAdd">新增</el-button>
        <el-button :loading="exportLoading" :disabled="exportLoading" type="warning" plain size="small" icon="el-icon-download" @click="handleExport">导出</el-button>
      </div>

      <!-- 数据表格 -->
      <el-table
        v-loading="loading"
        :data="tableData"
        :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
        element-loading-text="数据加载中"
        style="width: 100%"
        max-height="700px"
        border
        size="mini">
        <el-table-column align="center" type="index" width="55" label="序号" />
        <el-table-column align="center" label="TagId1" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click="showTagDetail(scope.row.TagId1)">{{ scope.row.TagId1 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId2" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId2" type="text" size="mini" @click="showTagDetail(scope.row.TagId2)">{{ scope.row.TagId2 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId3" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId3" type="text" size="mini" @click="showTagDetail(scope.row.TagId3)">{{ scope.row.TagId3 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId4" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId4" type="text" size="mini" @click="showTagDetail(scope.row.TagId4)">{{ scope.row.TagId4 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId5" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId5" type="text" size="mini" @click="showTagDetail(scope.row.TagId5)">{{ scope.row.TagId5 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId6" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId6" type="text" size="mini" @click="showTagDetail(scope.row.TagId6)">{{ scope.row.TagId6 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId7" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId7" type="text" size="mini" @click="showTagDetail(scope.row.TagId7)">{{ scope.row.TagId7 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" label="TagId8" width="110" show-overflow-tooltip>
          <template slot-scope="scope">
            <el-button v-if="scope.row.TagId8" type="text" size="mini" @click="showTagDetail(scope.row.TagId8)">{{ scope.row.TagId8 }}</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="组号" label="组号" width="60" />
        <el-table-column align="center" prop="来源工位号" label="来源工位号" width="100" />
        <el-table-column align="center" label="工位号" width="100">
          <template slot-scope="scope">
            {{ scope.row.工位号 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="是否启用" width="80">
          <template slot-scope="scope">
            <el-tag :type="scope.row.是否启用 === 1 ? 'success' : 'danger'" size="mini">
              {{ scope.row.是否启用 === 1 ? '启用' : '禁用' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="MOM_参数" label="参数" width="130" show-overflow-tooltip />
        <el-table-column align="center" prop="MOM_参数描述" label="参数描述" min-width="140" show-overflow-tooltip />
        <el-table-column align="center" prop="MOM_数据类型" label="数据类型" width="90">
          <template slot-scope="scope">
            <el-tag :type="scope.row.MOM_数据类型 === 'NUMBER' ? '' : 'info'" size="mini">
              {{ scope.row.MOM_数据类型 }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="可用型号" min-width="220">
          <template slot-scope="scope">
            <el-tag
              v-for="model in parseModelFlags(scope.row.可用型号)"
              :key="model.flag"
              size="mini"
              type="success"
              style="margin: 2px">
              {{ model.name }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="150" fixed="right">
          <template slot-scope="scope">
            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
            <el-button size="mini" type="text" icon="el-icon-delete" style="color: #F56C6C" @click="handleDelete(scope.row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>

      <!-- 分页 -->
      <div class="block" style="margin-top: 10px;">
        <el-pagination
          v-if="!loading"
          :current-page="pageCurrent"
          :page-sizes="[50, 100, 200]"
          :page-size="pageSize"
          :total="total"
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange" />
      </div>
    </el-card>

    <!-- 新增/编辑弹窗 -->
    <el-dialog :visible.sync="dialogVisible" :title="dialogTitle" center width="750px" :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="130px" size="small">
        <!-- 必填字段区域 -->
        <el-divider content-position="left">必填字段</el-divider>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="TagId1:" prop="TagId1">
              <el-input v-model="form.TagId1" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="来源工位号:" prop="来源工位号">
              <el-input v-model="form.来源工位号" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="工位号:" prop="工位号">
              <el-input v-model="form.工位号" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="组号:" prop="组号">
              <el-input v-model="form.组号" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="是否启用:" prop="是否启用">
              <el-switch v-model="form.是否启用" :active-value="1" :inactive-value="0" active-text="启用" inactive-text="禁用" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数据类型:" prop="MOM_数据类型">
              <el-select v-model="form.MOM_数据类型" placeholder="请选择" style="width: 100%">
                <el-option label="NUMBER" value="NUMBER" />
                <el-option label="Text" value="Text" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="参数:" prop="MOM_参数">
              <el-input v-model="form.MOM_参数" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="参数描述:" prop="MOM_参数描述">
              <el-input v-model="form.MOM_参数描述" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="可用型号:" prop="selectedModels">
          <el-checkbox-group v-model="form.selectedModels">
            <el-checkbox v-for="item in modelOptions" :key="item.flag" :label="item.flag">
              {{ item.name }}（{{ item.flag }}）
            </el-checkbox>
          </el-checkbox-group>
        </el-form-item>

        <!-- 选填字段区域 -->
        <el-divider content-position="left">选填字段</el-divider>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="TagId2:">
              <el-input v-model="form.TagId2" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="TagId3:">
              <el-input v-model="form.TagId3" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="TagId4:">
              <el-input v-model="form.TagId4" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="TagId5:">
              <el-input v-model="form.TagId5" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="TagId6:">
              <el-input v-model="form.TagId6" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="TagId7:">
              <el-input v-model="form.TagId7" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="TagId8:">
              <el-input v-model="form.TagId8" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="MOM_序号:">
              <el-input v-model="form.MOM_序号" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="数据收集组:">
              <el-input v-model="form.MOM_数据收集组" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收集组描述:">
              <el-input v-model="form.MOM_数据收集组描述" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="提示:">
              <el-input v-model="form.MOM_提示" placeholder="选填" clearable />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" size="small" :loading="submitLoading" @click="handleSubmit">确定</el-button>
      </div>
    </el-dialog>

    <!-- TagID 点位详情弹窗 -->
    <el-dialog :visible.sync="tagDialogVisible" :title="'点位详情 - ' + currentTagId" center width="600px">
      <el-descriptions v-if="tagDetail" :column="1" border size="small">
        <el-descriptions-item label="TagID">{{ tagDetail.TagID }}</el-descriptions-item>
        <el-descriptions-item label="TagName">{{ tagDetail.TagName }}</el-descriptions-item>
        <el-descriptions-item label="工位号">{{ tagDetail.工位号 }}</el-descriptions-item>
        <el-descriptions-item label="数据来源">{{ tagDetail.数据来源 }}</el-descriptions-item>
        <el-descriptions-item label="IP">{{ tagDetail.IP }}</el-descriptions-item>
        <el-descriptions-item label="DbName">{{ tagDetail.DbName }}</el-descriptions-item>
        <el-descriptions-item label="变量类型">{{ tagDetail.变量类型 }}</el-descriptions-item>
        <el-descriptions-item label="变量地址">{{ tagDetail.变量地址 }}</el-descriptions-item>
        <el-descriptions-item label="测量单位">{{ tagDetail.测量单位 }}</el-descriptions-item>
      </el-descriptions>
      <div v-else style="text-align: center; padding: 20px; color: #999;">
        <span v-if="tagLoading">加载中...</span>
        <span v-else>未找到该点位信息</span>
      </div>
      <div slot="footer">
        <el-button size="small" @click="tagDialogVisible = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 搜索条件
      searchStation: '',
      searchParam: '',
      searchParamDesc: '',
      searchEnabled: '',
      searchModel: '',
      // 表格
      tableData: [],
      loading: false,
      total: 0,
      pageSize: 50,
      pageCurrent: 1,
      exportLoading: false,
      // 弹窗
      dialogVisible: false,
      dialogTitle: '新增',
      submitLoading: false,
      isEdit: false,
      editId: null,
      // 机型选项
      modelOptions: [],
      // Tag详情弹窗
      tagDialogVisible: false,
      tagDetail: null,
      tagLoading: false,
      currentTagId: '',
      // 表单
      form: {
        TagId1: '',
        TagId2: '',
        TagId3: '',
        TagId4: '',
        TagId5: '',
        TagId6: '',
        TagId7: '',
        TagId8: '',
        组号: '1',
        来源工位号: '',
        工位号: '',
        是否启用: 1,
        MOM_数据收集组: '',
        MOM_数据收集组描述: '',
        MOM_序号: '',
        MOM_参数: '',
        MOM_参数描述: '',
        MOM_提示: '',
        MOM_数据类型: '',
        selectedModels: []
      },
      rules: {
        TagId1: [{ required: true, message: '请输入TagId1', trigger: 'blur' }],
        来源工位号: [{ required: true, message: '请输入来源工位号', trigger: 'blur' }],
        工位号: [{ required: true, message: '请输入工位号', trigger: 'blur' }],
        组号: [{ required: true, message: '请输入组号', trigger: 'blur' }],
        MOM_参数: [{ required: true, message: '请输入参数', trigger: 'blur' }],
        MOM_参数描述: [{ required: true, message: '请输入参数描述', trigger: 'blur' }],
        MOM_数据类型: [{ required: true, message: '请选择数据类型', trigger: 'change' }],
        selectedModels: [{ type: 'array', required: true, message: '请选择可用型号', trigger: 'change' }]
      }
    }
  },
  created() {
    this.getModelOptions()
    this.getdate()
  },
  methods: {
    // 获取机型代码选项
    getModelOptions() {
      const param = []
      const Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
      this.ExecDatabase(Data).then(response => {
        this.modelOptions = (response.data || [])
          .filter(item => item.是否禁用 !== 1)
          .map(item => ({
            name: item.发动机型号,
            flag: item.发动机机型标志
          }))
      }).catch(error => {
        console.error('获取机型代码失败:', error)
        this.$message.error('获取机型代码失败')
      })
    },
    // 显示TagID点位详情
    showTagDetail(tagId) {
      if (!tagId) return
      this.currentTagId = tagId
      this.tagDetail = null
      this.tagLoading = true
      this.tagDialogVisible = true
      const param = []
      param[0] = ['TagID', tagId]
      const Data = this.CreateData('11', 'MES收集组维护_点位详情查询', param)
      this.ExecDatabase(Data).then(response => {
        if (response.data && response.data.length > 0) {
          this.tagDetail = response.data[0]
        }
        this.tagLoading = false
      }).catch(() => {
        this.tagLoading = false
      })
    },
    // 将可用型号字符串解析为对象数组
    parseModelFlags(flagStr) {
      if (!flagStr) return []
      const flags = flagStr.toString().split('').map(Number)
      return flags
        .map(f => {
          const match = this.modelOptions.find(m => m.flag === f)
          return match ? { flag: f, name: match.name } : { flag: f, name: '未知(' + f + ')' }
        })
    },
    // 将选中的型号数组转为存储字符串
    buildModelStr(selectedFlags) {
      return selectedFlags.sort((a, b) => a - b).join('')
    },
    // 分页查询
    getdate() {
      this.loading = true
      const param = []
      param[0] = ['工位号', this.searchStation]
      param[1] = ['MOM_参数', this.searchParam]
      param[2] = ['MOM_参数描述', this.searchParamDesc]
      param[3] = ['是否启用', this.searchEnabled]
      param[4] = ['可用型号', this.searchModel]
      param[5] = ['PageCurrent', this.pageCurrent]
      param[6] = ['PageSize', this.pageSize]
      param[7] = ['PageCount', '1111', 'int', '1']
      param[8] = ['ItemCount', '1111', 'int', '1']
      const Data = this.CreateData('11', 'MES收集组维护_分页查询', param)
      this.ExecDatabase(Data).then(response => {
        this.tableData = response.data.result || []
        this.total = parseInt(response.data.output[0].ItemCount)
        this.loading = false
      }).catch(error => {
        console.error('查询收集组失败:', error)
        this.$message.error('查询收集组失败')
        this.loading = false
      })
    },
    handleSearch() {
      this.pageCurrent = 1
      this.getdate()
    },
    handleSizeChange(val) {
      this.pageCurrent = 1
      this.pageSize = val
      this.getdate()
    },
    handleCurrentChange(val) {
      this.pageCurrent = val
      this.getdate()
    },
    // 重置表单
    resetForm() {
      this.form = {
        TagId1: '',
        TagId2: '',
        TagId3: '',
        TagId4: '',
        TagId5: '',
        TagId6: '',
        TagId7: '',
        TagId8: '',
        组号: '1',
        来源工位号: '',
        工位号: '',
        是否启用: 1,
        MOM_数据收集组: '',
        MOM_数据收集组描述: '',
        MOM_序号: '',
        MOM_参数: '',
        MOM_参数描述: '',
        MOM_提示: '',
        MOM_数据类型: '',
        selectedModels: []
      }
      this.$nextTick(() => {
        if (this.$refs.form) {
          this.$refs.form.clearValidate()
        }
      })
    },
    // 新增
    handleAdd() {
      this.isEdit = false
      this.editId = null
      this.dialogTitle = '新增收集组'
      this.resetForm()
      this.dialogVisible = true
    },
    // 编辑
    handleEdit(row) {
      this.isEdit = true
      this.editId = row.ID
      this.dialogTitle = '编辑收集组'
      // 解析可用型号为选中数组
      const selectedModels = row.可用型号
        ? row.可用型号.toString().split('').map(Number)
        : []
      this.form = {
        TagId1: row.TagId1 || '',
        TagId2: row.TagId2 || '',
        TagId3: row.TagId3 || '',
        TagId4: row.TagId4 || '',
        TagId5: row.TagId5 || '',
        TagId6: row.TagId6 || '',
        TagId7: row.TagId7 || '',
        TagId8: row.TagId8 || '',
        组号: row.组号 || '1',
        来源工位号: row.来源工位号 || '',
        工位号: row.工位号 || '',
        是否启用: row.是否启用 != null ? row.是否启用 : 1,
        MOM_数据收集组: row.MOM_数据收集组 || '',
        MOM_数据收集组描述: row.MOM_数据收集组描述 || '',
        MOM_序号: row.MOM_序号 || '',
        MOM_参数: row.MOM_参数 || '',
        MOM_参数描述: row.MOM_参数描述 || '',
        MOM_提示: row.MOM_提示 || '',
        MOM_数据类型: row.MOM_数据类型 || '',
        selectedModels: selectedModels
      }
      this.dialogVisible = true
      this.$nextTick(() => {
        if (this.$refs.form) {
          this.$refs.form.clearValidate()
        }
      })
    },
    // 提交新增/编辑
    handleSubmit() {
      // 手动校验可用型号
      if (this.form.selectedModels.length === 0) {
        this.$message.warning('请至少选择一个可用型号')
        return
      }
      this.$refs.form.validate(valid => {
        if (!valid) return
        this.submitLoading = true
        const modelStr = this.buildModelStr([...this.form.selectedModels])
        const param = []
        if (this.isEdit) {
          param.push(['ID', this.editId])
        }
        param.push(['TagId1', this.form.TagId1])
        param.push(['TagId2', this.form.TagId2])
        param.push(['TagId3', this.form.TagId3])
        param.push(['TagId4', this.form.TagId4])
        param.push(['TagId5', this.form.TagId5])
        param.push(['TagId6', this.form.TagId6])
        param.push(['TagId7', this.form.TagId7])
        param.push(['TagId8', this.form.TagId8])
        param.push(['组号', this.form.组号])
        param.push(['来源工位号', this.form.来源工位号])
        param.push(['工位号', this.form.工位号])
        param.push(['是否启用', this.form.是否启用])
        param.push(['MOM_数据收集组', this.form.MOM_数据收集组])
        param.push(['MOM_数据收集组描述', this.form.MOM_数据收集组描述])
        param.push(['MOM_序号', this.form.MOM_序号])
        param.push(['MOM_参数', this.form.MOM_参数])
        param.push(['MOM_参数描述', this.form.MOM_参数描述])
        param.push(['MOM_提示', this.form.MOM_提示])
        param.push(['MOM_状态', 'Enabled'])
        param.push(['MOM_数据类型', this.form.MOM_数据类型])
        param.push(['可用型号', modelStr])

        const spName = this.isEdit ? 'MES收集组维护_编辑' : 'MES收集组维护_增加'
        const Data = this.CreateData('11', spName, param)
        this.ExecDatabase(Data).then(response => {
          const result = response.data && response.data[0] ? response.data[0] : {}
          if (result.result === 1) {
            this.$message.success(this.isEdit ? '编辑成功' : '新增成功')
            this.dialogVisible = false
            this.getdate()
          } else {
            this.$message.error(result.msg || '操作失败')
          }
          this.submitLoading = false
          }).catch(error => {
            console.error(this.isEdit ? '编辑收集组失败:' : '新增收集组失败:', error)
            this.$message.error(this.isEdit ? '编辑收集组失败' : '新增收集组失败')
            this.submitLoading = false
          })
      })
    },
    // 删除
    handleDelete(row) {
      this.$confirm('确定要删除该收集组记录吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        const param = []
        param[0] = ['ID', row.ID]
        const Data = this.CreateData('12', 'MES收集组维护_删除', param)
        this.ExecDatabase(Data).then(response => {
          const result = response.data && response.data[0] ? response.data[0] : {}
          if (result.result === '1') {
            this.$message.success('删除成功')
            this.getdate()
          } else {
            this.$message.error('删除失败')
          }
        }).catch(error => {
          console.error('删除收集组失败:', error)
          this.$message.error('删除收集组失败')
        })
      }).catch(() => {})
    },
    // 导出
    handleExport() {
      if (this.tableData.length === 0) {
        this.$message.warning('暂无数据')
        return
      }
      const param = []
      param[0] = ['工位号', this.searchStation]
      param[1] = ['MOM_参数', this.searchParam]
      param[2] = ['MOM_参数描述', this.searchParamDesc]
      param[3] = ['是否启用', this.searchEnabled]
      param[4] = ['可用型号', this.searchModel]
      param[5] = ['PageCurrent', 1]
      param[6] = ['PageSize', 99999999]
      param[7] = ['PageCount', '1111', 'int', '1']
      param[8] = ['ItemCount', '1111', 'int', '1']
      const exportData = JSON.parse(this.CreateData('2005', 'MES收集组维护_分页查询', param))
      exportData.exportFileName = 'MES收集组维护'
      exportData.exportColumns = 'TagId1,TagId2,TagId3,TagId4,TagId5,TagId6,TagId7,TagId8,组号,来源工位号,工位号,是否启用,MOM_参数=参数,MOM_参数描述=参数描述,MOM_数据类型=数据类型,可用型号'
      const Data = JSON.stringify(exportData)
      this.runExcelExport(Data, 'exportLoading')
    }
  }
}
</script>

<style scoped>
.topCard {
  margin: 5px;
}
.topDiv {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.topDiv span {
  white-space: nowrap;
}
</style>
