<template>
  <div class="app-container">
    <div
      class="background-color-fff padding-20 border-radius-8px margin-bottom-20"
    >
      <el-form
        :model="queryParams"
        ref="queryRef"
        :inline="true"
        v-show="showSearch"
        label-width="68px"
      >
        <el-form-item label="直播间ID" prop="roomId">
          <el-input
            v-model="queryParams.roomId"
            placeholder="请输入直播间ID"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <el-form-item label="直播名称" prop="roomName">
          <el-input
            v-model="queryParams.roomName"
            placeholder="请输入直播间名称"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <el-form-item label="创建者ID" prop="userId">
          <el-input
            v-model="queryParams.userId"
            placeholder="请输入创建者用户ID"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <el-form-item label="主播账号" prop="anchorAccount">
          <el-input
            v-model="queryParams.anchorAccount"
            placeholder="请输入主播账号"
            clearable
            @keyup.enter="handleQuery"
          />
        </el-form-item>
        <el-form-item label="开始时间" prop="startTime">
          <el-date-picker
            clearable
            v-model="queryParams.startTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择开始时间"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间" prop="endTime">
          <el-date-picker
            clearable
            v-model="queryParams.endTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择结束时间"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="直播状态" prop="status">
          <el-select v-model="queryParams.status" placeholder="请选择">
            <el-option label="准备中" :value="0"></el-option>
            <el-option label="直播中" :value="1"></el-option>
            <el-option label="已结束" :value="2"></el-option>
            <el-option label="已封禁" :value="3"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery"
            >搜索</el-button
          >
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </div>

    <div
      class="background-color-fff padding-20 border-radius-8px margin-bottom-20"
    >
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="Plus"
            @click="handleAdd"
            v-hasPermi="['service:imLiveRoom:add']"
          >
            新增
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            plain
            icon="Edit"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['service:imLiveRoom:edit']"
          >
            修改
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            plain
            icon="Delete"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['service:imLiveRoom:remove']"
          >
            删除
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['service:imLiveRoom:export']"
          >
            导出
          </el-button>
        </el-col>
        <right-toolbar
          v-model:showSearch="showSearch"
          @queryTable="getList"
        ></right-toolbar>
      </el-row>
    </div>

    <div
      class="background-color-fff padding-20 border-radius-8px margin-bottom-20"
    >
      <el-table
        v-loading="loading"
        :data="imLiveRoomList"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="主键ID" align="center" prop="id" />
        <el-table-column label="直播间ID" align="center" prop="roomId" />
        <el-table-column label="关联群组ID" align="center" prop="groupId" />
        <el-table-column label="直播间名称" align="center" prop="roomName" />
        <!-- <el-table-column label="直播间描述" align="center" prop="roomDescription" /> -->
        <el-table-column label="直播间封面" align="center" prop="coverUrl">
          <template #default="scope">
            <image-preview :src="scope.row.coverUrl"></image-preview>
          </template>
        </el-table-column>
        <!-- <el-table-column label="直播流地址" align="center" prop="liveUrl" /> -->
        <el-table-column label="OBS推流地址" align="center" prop="liveUrl">
          <template #default="scope">
            <el-text class="w-150px mb-2" truncated>
              {{ scope.row.liveUrl }}
            </el-text>
            <el-button
              v-if="scope.row.liveUrl"
              slot="reference"
              type="text"
              v-copyText="scope.row.liveUrl"
            >
              复制
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="OBS推流密钥" align="center" prop="pushKey">
          <template #default="scope">
            <el-text class="w-150px mb-2" truncated>
              {{ scope.row.pushKey }}
            </el-text>
            <el-button
              v-if="scope.row.pushKey"
              slot="reference"
              type="text"
              v-copyText="scope.row.pushKey"
            >
              复制
            </el-button>
          </template>
        </el-table-column>
        <el-table-column label="创建者用户ID" align="center" prop="userId" />
        <el-table-column
          label="直播间创建者账号"
          align="center"
          prop="ownerAccount"
        />
        <el-table-column label="主播账号" align="center" prop="anchorAccount" />
        <el-table-column label="状态" align="center" prop="status">
          <template #default="{ row }">
            {{
              row.status == 0
                ? "准备中"
                : row.status == 1
                  ? "直播中"
                  : row.status == 2
                    ? "已结束"
                    : "已封禁"
            }}
          </template>
        </el-table-column>
        <!-- <el-table-column
                    label="直播类型：1-普通直播 2-语音直播 3-屏幕分享"
                    align="center"
                    prop="liveType"
                /> -->
        <!-- <el-table-column label="最大观众数" align="center" prop="maxViewers" /> -->
        <el-table-column
          label="当前观众数"
          align="center"
          prop="currentViewers"
        />
        <el-table-column
          label="虚拟观众数"
          align="center"
          prop="virtualViewers"
        />
        <el-table-column label="点赞数" align="center" prop="likeCount" />
        <el-table-column label="礼物数" align="center" prop="giftCount" />
        <el-table-column
          label="开始时间"
          align="center"
          prop="startTime"
          width="180"
        >
          <template #default="scope">
            <span>{{
              parseTime(scope.row.startTime, "{y}-{m}-{d} {h}:{i}:{s}")
            }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="结束时间"
          align="center"
          prop="endTime"
          width="180"
        >
          <template #default="scope">
            <span>{{
              parseTime(scope.row.endTime, "{y}-{m}-{d} {h}:{i}:{s}")
            }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column label="直播时长(秒)" align="center" prop="duration" /> -->
        <!-- <el-table-column label="是否录制：0-否 1-是" align="center" prop="isRecorded" /> -->
        <!-- <el-table-column label="录制回放地址" align="center" prop="recordUrl" /> -->
        <!-- <el-table-column label="是否私密：0-公开 1-私密" align="center" prop="isPrivate" /> -->
        <!-- <el-table-column label="观看密码" align="center" prop="password" /> -->
        <!-- <el-table-column label="拉流密钥" align="center" prop="pullKey" /> -->
        <el-table-column label="版本号" align="center" prop="version" />
        <el-table-column
          label="操作"
          align="center"
          class-name="small-padding fixed-width"
          fixed="right"
          width="120"
        >
          <template #default="scope">
            <el-button
              link
              type="primary"
              icon="Edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['service:imLiveRoom:edit']"
            >
              查看
            </el-button>
            <el-button
              link
              type="primary"
              icon="Delete"
              v-if="scope.row.status < 2"
              @click="handleDelete(scope.row)"
              v-hasPermi="['service:imLiveRoom:remove']"
            >
              解散
            </el-button>
            <el-button
              link
              type="primary"
              icon="Edit"
              v-if="scope.row.status < 2"
              @click="handleVirtual(scope.row)"
              v-hasPermi="['service:imLiveRoom:edit']"
            >
              虚拟观众
            </el-button>
            <el-button
              link
              type="primary"
              icon="Edit"
              @click="handleUpdateShow(scope.row, 0)"
              v-if="scope.row.status == 1 && scope.row.isPrivate == 1"
              v-hasPermi="['service:imLiveRoom:edit']"
            >
              列表显示
            </el-button>
            <el-button
              link
              type="primary"
              icon="Edit"
              @click="handleUpdateShow(scope.row, 1)"
              v-if="scope.row.status == 1 && scope.row.isPrivate == 0"
              v-hasPermi="['service:imLiveRoom:edit']"
            >
              列表隐藏
            </el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total > 0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
      />
    </div>

    <!-- 添加或修改直播间对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form
        ref="imLiveRoomRef"
        :model="form"
        :rules="rules"
        label-width="80px"
        label-position="top"
      >
        <el-form-item label="直播间ID" prop="roomId">
          <el-input v-model="form.roomId" placeholder="请输入直播间ID" />
        </el-form-item>
        <el-form-item label="关联群组ID" prop="groupId">
          <el-input v-model="form.groupId" placeholder="请输入关联群组ID" />
        </el-form-item>
        <el-form-item label="直播间名称" prop="roomName">
          <el-input v-model="form.roomName" placeholder="请输入直播间名称" />
        </el-form-item>
        <el-form-item label="直播间描述" prop="roomDescription">
          <el-input
            v-model="form.roomDescription"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="直播间封面URL" prop="coverUrl">
          <el-input
            v-model="form.coverUrl"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="OBS推流地址" prop="liveUrl">
          <el-input
            v-model="form.liveUrl"
            type="textarea"
            placeholder="请输入内容"
          />
        </el-form-item>
        <!-- <el-form-item label="播放地址" prop="playUrl">
                    <el-input v-model="form.playUrl" type="textarea" placeholder="请输入内容" />
                </el-form-item> -->
        <el-form-item label="OBS推流密钥" prop="pushKey">
          <el-input v-model="form.pushKey" placeholder="请输入推流密钥" />
        </el-form-item>
        <el-form-item label="创建者用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入创建者用户ID" />
        </el-form-item>
        <el-form-item label="直播间创建者账号" prop="ownerAccount">
          <el-input
            v-model="form.ownerAccount"
            placeholder="请输入直播间创建者账号"
          />
        </el-form-item>
        <el-form-item label="主播账号" prop="anchorAccount">
          <el-input v-model="form.anchorAccount" placeholder="请输入主播账号" />
        </el-form-item>
        <el-form-item label="最大观众数" prop="maxViewers">
          <el-input v-model="form.maxViewers" placeholder="请输入最大观众数" />
        </el-form-item>
        <el-form-item label="当前观众数" prop="currentViewers">
          <el-input
            v-model="form.currentViewers"
            placeholder="请输入当前观众数"
          />
        </el-form-item>
        <!-- <el-form-item label="虚拟观众数" prop="virtualViewers">
                    <el-input v-model="form.virtualViewers" placeholder="请输入虚拟观众数" />
                </el-form-item> -->
        <el-form-item label="点赞数" prop="likeCount">
          <el-input v-model="form.likeCount" placeholder="请输入点赞数" />
        </el-form-item>
        <el-form-item label="礼物数" prop="giftCount">
          <el-input v-model="form.giftCount" placeholder="请输入礼物数" />
        </el-form-item>
        <!-- <el-form-item label="开始时间" prop="startTime">
                    <el-date-picker
                        clearable
                        v-model="form.startTime"
                        type="date"
                        value-format="YYYY-MM-DD"
                        placeholder="请选择开始时间"
                    ></el-date-picker>
                </el-form-item>
                <el-form-item label="结束时间" prop="endTime">
                    <el-date-picker
                        clearable
                        v-model="form.endTime"
                        type="date"
                        value-format="YYYY-MM-DD"
                        placeholder="请选择结束时间"
                    ></el-date-picker>
                </el-form-item> -->
        <el-form-item label="直播时长(秒)" prop="duration">
          <el-input v-model="form.duration" placeholder="请输入直播时长(秒)" />
        </el-form-item>
        <!-- <el-form-item label="是否录制：0-否 1-是" prop="isRecorded">
                    <el-input v-model="form.isRecorded" placeholder="请输入是否录制：0-否 1-是" />
                </el-form-item> -->
        <!-- <el-form-item label="录制回放地址" prop="recordUrl">
                    <el-input v-model="form.recordUrl" type="textarea" placeholder="请输入内容" />
                </el-form-item>
                <el-form-item label="是否私密：0-公开 1-私密" prop="isPrivate">
                    <el-input
                        v-model="form.isPrivate"
                        placeholder="请输入是否私密：0-公开 1-私密"
                    />
                </el-form-item> -->
        <!-- <el-form-item label="观看密码" prop="password">
                    <el-input v-model="form.password" placeholder="请输入观看密码" />
                </el-form-item>
               
                <el-form-item label="拉流密钥" prop="pullKey">
                    <el-input v-model="form.pullKey" placeholder="请输入拉流密钥" />
                </el-form-item> -->
        <el-form-item label="版本号" prop="version">
          <el-input v-model="form.version" placeholder="请输入版本号" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
    <!-- 添加或修改虚拟观众配置对话框 -->
    <el-dialog
      title="虚拟观众配置"
      v-model="openVirtual"
      width="500px"
      append-to-body
    >
      <el-form
        ref="imLiveVirtualConfigRef"
        :model="formVirtual"
        :rules="Virtualrules"
        label-width="80px"
        label-position="top"
      >
        <el-form-item label="直播间ID" prop="roomId">
          <el-input
            v-model="formVirtual.roomId"
            disabled
            placeholder="请输入直播间ID"
          />
        </el-form-item>
        <el-form-item label="虚拟观众数量" prop="virtualCount">
          <el-input
            v-model="formVirtual.virtualCount"
            placeholder="请输入虚拟观众数量"
          />
        </el-form-item>
        <el-form-item label="是否启用" prop="isActive">
          <el-select
            v-model="formVirtual.isActive"
            placeholder="请选择是否启用"
          >
            <el-option
              v-for="dict in sys_general_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitFormVirtual">确 定</el-button>
          <el-button @click="cancelVirtual">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="ImLiveRoom">
import {
  listImLiveRoom,
  getImLiveRoom,
  delImLiveRoom,
  addImLiveRoom,
  updateImLiveRoom,
  removeImLiveRoom,
} from "@/api/service/imLiveRoom";
import {
  listImLiveVirtualConfig,
  getImLiveVirtualConfig,
  delImLiveVirtualConfig,
  addImLiveVirtualConfig,
  updateImLiveVirtualConfig,
} from "@/api/service/imLiveVirtualConfig";

const { proxy } = getCurrentInstance();
const { sys_general_yes_no } = proxy.useDict("sys_general_yes_no");

const imLiveRoomList = ref([]);
const open = ref(false);
const openVirtual = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");

const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    roomId: null,
    groupId: null,
    roomName: null,
    roomDescription: null,
    coverUrl: null,
    liveUrl: null,
    playUrl: null,
    userId: null,
    ownerAccount: null,
    anchorAccount: null,
    status: null,
    liveType: null,
    maxViewers: null,
    currentViewers: null,
    virtualViewers: null,
    likeCount: null,
    giftCount: null,
    startTime: null,
    endTime: null,
    duration: null,
    isRecorded: null,
    recordUrl: null,
    isPrivate: null,
    password: null,
    pushKey: null,
    pullKey: null,
    version: null,
  },
  rules: {
    roomId: [{ required: true, message: "直播间ID不能为空", trigger: "blur" }],
    groupId: [
      { required: true, message: "关联群组ID不能为空", trigger: "blur" },
    ],
    roomName: [
      { required: true, message: "直播间名称不能为空", trigger: "blur" },
    ],
    userId: [
      { required: true, message: "创建者用户ID不能为空", trigger: "blur" },
    ],
    ownerAccount: [
      { required: true, message: "直播间创建者账号不能为空", trigger: "blur" },
    ],
    anchorAccount: [
      { required: true, message: "主播账号不能为空", trigger: "blur" },
    ],
    status: [
      {
        required: true,
        message: "状态：0-准备中 1-直播中 2-已结束 3-已封禁不能为空",
        trigger: "change",
      },
    ],
    liveType: [
      {
        required: true,
        message: "直播类型：1-普通直播 2-语音直播 3-屏幕分享不能为空",
        trigger: "change",
      },
    ],
    maxViewers: [
      { required: true, message: "最大观众数不能为空", trigger: "blur" },
    ],
    currentViewers: [
      { required: true, message: "当前观众数不能为空", trigger: "blur" },
    ],
    virtualViewers: [
      { required: true, message: "虚拟观众数不能为空", trigger: "blur" },
    ],
    likeCount: [{ required: true, message: "点赞数不能为空", trigger: "blur" }],
    giftCount: [{ required: true, message: "礼物数不能为空", trigger: "blur" }],
    duration: [
      { required: true, message: "直播时长(秒)不能为空", trigger: "blur" },
    ],
    isRecorded: [
      {
        required: true,
        message: "是否录制：0-否 1-是不能为空",
        trigger: "blur",
      },
    ],
    isPrivate: [
      {
        required: true,
        message: "是否私密：0-公开 1-私密不能为空",
        trigger: "blur",
      },
    ],
    version: [{ required: true, message: "版本号不能为空", trigger: "blur" }],
    createTime: [
      { required: true, message: "创建时间不能为空", trigger: "blur" },
    ],
    updateTime: [
      { required: true, message: "更新时间不能为空", trigger: "blur" },
    ],
  },
  formVirtual: {},
  Virtualrules: {
    roomId: [{ required: true, message: "直播间ID不能为空", trigger: "blur" }],
    virtualCount: [
      { required: true, message: "虚拟观众数量不能为空", trigger: "blur" },
    ],
    enterInterval: [
      { required: true, message: "进入间隔(秒)不能为空", trigger: "blur" },
    ],
    leaveInterval: [
      { required: true, message: "离开间隔(秒)不能为空", trigger: "blur" },
    ],
    minWatchTime: [
      { required: true, message: "最小观看时间(秒)不能为空", trigger: "blur" },
    ],
    maxWatchTime: [
      { required: true, message: "最大观看时间(秒)不能为空", trigger: "blur" },
    ],
    likeProbability: [
      { required: true, message: "点赞概率不能为空", trigger: "blur" },
    ],
    giftProbability: [
      { required: true, message: "送礼概率不能为空", trigger: "blur" },
    ],
    isActive: [
      {
        required: true,
        message: "是否启用：0-否 1-是不能为空",
        trigger: "blur",
      },
    ],
    createTime: [
      { required: true, message: "创建时间不能为空", trigger: "blur" },
    ],
    updateTime: [
      { required: true, message: "更新时间不能为空", trigger: "blur" },
    ],
  },
});

const { queryParams, form, rules, formVirtual, Virtualrules } = toRefs(data);

/** 查询直播间列表 */
function getList() {
  loading.value = true;
  listImLiveRoom(queryParams.value).then((response) => {
    imLiveRoomList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}

function copySuccess() {
  proxy.$modal.msgSuccess("复制成功");
}

// 取消按钮
function cancel() {
  open.value = false;
  reset();
}

// 取消按钮
function cancelVirtual() {
  open.value = false;
  resetVirtual();
}

function handleVirtual(item) {
  resetVirtual();
  formVirtual.value.roomId = item.roomId;
  openVirtual.value = true;
}

// 表单重置
function resetVirtual() {
  formVirtual.value = {
    id: null,
    roomId: null,
    virtualCount: null,
    nicknamePrefix: null,
    avatarPool: null,
    enterInterval: null,
    leaveInterval: null,
    minWatchTime: null,
    maxWatchTime: null,
    likeProbability: null,
    giftProbability: null,
    isActive: null,
    lastSyncTime: null,
    createTime: null,
    updateTime: null,
  };
  proxy.resetForm("imLiveVirtualConfigRef");
}

/** 提交按钮 */
function submitFormVirtual() {
  proxy.$refs["imLiveVirtualConfigRef"].validate((valid) => {
    if (valid) {
      if (formVirtual.value.id != null) {
        updateImLiveVirtualConfig(formVirtual.value).then((response) => {
          proxy.$modal.msgSuccess("修改成功");
          openVirtual.value = false;
        });
      } else {
        addImLiveVirtualConfig(formVirtual.value).then((response) => {
          proxy.$modal.msgSuccess("新增成功");
          openVirtual.value = false;
        });
      }
    }
  });
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    roomId: null,
    groupId: null,
    roomName: null,
    roomDescription: null,
    coverUrl: null,
    liveUrl: null,
    playUrl: null,
    userId: null,
    ownerAccount: null,
    anchorAccount: null,
    status: null,
    liveType: null,
    maxViewers: null,
    currentViewers: null,
    virtualViewers: null,
    likeCount: null,
    giftCount: null,
    startTime: null,
    endTime: null,
    duration: null,
    isRecorded: null,
    recordUrl: null,
    isPrivate: null,
    password: null,
    pushKey: null,
    pullKey: null,
    version: null,
    createTime: null,
    updateTime: null,
  };
  proxy.resetForm("imLiveRoomRef");
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef");
  handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map((item) => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "添加直播间";
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value;
  getImLiveRoom(_id).then((response) => {
    form.value = response.data;
    open.value = true;
    title.value = "修改直播间";
  });
}

function handleUpdateShow(row, num) {
  // console.log(row);
  row.isPrivate = num;
  updateImLiveRoom(row).then((response) => {
    proxy.$modal.msgSuccess("修改成功");
    open.value = false;
    getList();
  });
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["imLiveRoomRef"].validate((valid) => {
    if (valid) {
      if (form.value.id != null) {
        updateImLiveRoom(form.value).then((response) => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
      } else {
        addImLiveRoom(form.value).then((response) => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
      }
    }
  });
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal
    .confirm('是否确认解散直播间编号为"' + _ids + '"的数据项？')
    .then(function () {
      return removeImLiveRoom(row);
    })
    .then(() => {
      getList();
      proxy.$modal.msgSuccess("删除成功");
    })
    .catch(() => {});
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download(
    "service/imLiveRoom/export",
    {
      ...queryParams.value,
    },
    `imLiveRoom_${new Date().getTime()}.xlsx`,
  );
}

getList();
</script>
