潘志宝
2024-11-22 df90c0c5cfa4de114798015b92120ad8ba8b4826
src/views/data/channel/kio/index.vue
@@ -19,20 +19,20 @@
      </el-form-item>
      <el-form-item>
        <el-button @click="handleQuery">
          <Icon icon="ep:search" class="mr-5px" />
          <Icon icon="ep:search" class="mr-5px"/>
          搜索
        </el-button>
        <el-button @click="resetQuery">
          <Icon icon="ep:refresh" class="mr-5px" />
          <Icon icon="ep:refresh" class="mr-5px"/>
          重置
        </el-button>
        <el-button
          type="primary"
          plain
          @click="openForm('create')"
          v-hasPermi="['system:tenant:create']"
          v-hasPermi="['data:channel-kio:create']"
        >
          <Icon icon="ep:plus" class="mr-5px" />
          <Icon icon="ep:plus" class="mr-5px"/>
          新增
        </el-button>
      </el-form-item>
@@ -42,25 +42,33 @@
  <!-- 列表 -->
  <ContentWrap>
    <el-table v-loading="loading" :data="list">
      <el-table-column label="实例名称" align="center" prop="instanceName" />
      <el-table-column label="IP地址" align="center" prop="address" />
      <el-table-column label="端口" align="center" prop="port" />
      <el-table-column label="用户名" align="center" prop="username" />
      <el-table-column label="实例名称" align="center" prop="instanceName"/>
      <el-table-column label="IP地址" align="center" prop="address"/>
      <el-table-column label="端口" align="center" prop="port"/>
      <el-table-column label="用户名" align="center" prop="username"/>
      <el-table-column label="操作" align="center" min-width="110" fixed="right">
        <template #default="scope">
          <el-button
            link
            type="primary"
            @click="openForm('update', scope.row.id)"
            v-hasPermi="['system:tenant:update']"
            v-hasPermi="['data:channel-kio:update']"
          >
            编辑
          </el-button>
          <el-button
            link
            type="primary"
            @click="openTagList(scope.row.instanceName)"
            v-hasPermi="['data:channel-kio:update']"
          >
            TAG
          </el-button>
          <el-button
            link
            type="danger"
            @click="handleDelete(scope.row.id)"
            v-hasPermi="['system:tenant:delete']"
            v-hasPermi="['data:channel-kio:delete']"
          >
            删除
          </el-button>
@@ -77,14 +85,18 @@
  </ContentWrap>
  <!-- 表单弹窗:添加/修改 -->
  <KioDeviceForm ref="formRef" @success="getList" />
  <KioDeviceForm ref="formRef" @success="getList"/>
  <!-- TAG弹窗:添加/修改 -->
  <TagList ref="tagRef" @success="getList" />
</template>
<script lang="ts" setup>
import * as KioApi from '@/api/data/channel/kio'
import KioDeviceForm from './KioDeviceForm.vue'
  import * as KioApi from '@/api/data/channel/kio'
  import KioDeviceForm from './KioDeviceForm.vue'
  import TagList from './tag/index.vue'
defineOptions({name: 'DataKio'})
  defineOptions({name: 'DataKio'})
  const message = useMessage() // 消息弹窗
  const {t} = useI18n() // 国际化
@@ -131,6 +143,12 @@
    formRef.value.open(type, id)
  }
  /** TAG操作 */
  const tagRef = ref()
  const openTagList = (id?: string,name?: string) => {
    tagRef.value.open(id,name)
  }
  /** 删除按钮操作 */
  const handleDelete = async (id: number) => {
    try {