潘志宝
2024-11-07 0ce8028e41d292af007b5580370866b33bc6b0d6
src/views/data/channel/http/api/tag/index.vue
@@ -47,7 +47,8 @@
            plain
            @click="handleImport"
            v-hasPermi="['data:channel-http-tag:import']">
            <Icon icon="ep:upload" /> 导入
            <Icon icon="ep:upload"/>
            导入
          </el-button>
          <el-button
            type="success"
@@ -55,8 +56,15 @@
            @click="handleExport"
            :loading="exportLoading"
            v-hasPermi="['data:channel-http-tag:export']">
            <Icon icon="ep:download" />导出
            <Icon icon="ep:download"/>
            导出
          </el-button>
        </el-form-item>
        <el-form-item label="更新当前值" label-width="100px">
          <el-switch
            v-model="queryParams.currentValue"
            active-color="#13ce66"
            inactive-color="#ff4949"/>
        </el-form-item>
      </el-form>
    </ContentWrap>
@@ -92,6 +100,25 @@
          <template #default="scope">
            <el-tag v-if="scope.row.enabled === 1" size="small">是</el-tag>
            <el-tag v-else size="small" type="danger">否</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="dataValue"
          label="数据值"
          header-align="center"
          align="center"
          :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}"
        />
        <el-table-column
          prop="quality"
          label="数据质量"
          header-align="center"
          align="center"
        >
          <template #default="scope">
            <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad
            </el-tag>
            <el-tag v-else size="small">good</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" min-width="110" fixed="right">
@@ -134,6 +161,7 @@
import TagForm from './TagForm.vue'
import download from "@/utils/download";
import {ref} from "vue";
  import {onBeforeUnmount, onMounted} from "vue";
import TagImportForm from '../../../common/tag/TagImportForm.vue'
defineOptions({name: 'HttpTag'})
@@ -151,7 +179,8 @@
  pageSize: 10,
  apiId: undefined,
  tagName: undefined,
  httpName: undefined
    httpName: undefined,
    currentValue:false,
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中