<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="代码" prop="code">
        <el-input
          v-model="queryParams.code"
          placeholder="请输入代码"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入名称"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所在省" prop="location">
        <el-input
          v-model="queryParams.location"
          placeholder="请输入所在地"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所在市" prop="cityName">
        <el-input
                v-model="queryParams.cityName"
                placeholder="请输入所在市"
                clearable
                @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="梯队" prop="tier">
        <el-select v-model="queryParams.tier" placeholder="请选择梯队" clearable style="width: 170px">
          <el-option
            v-for="dict in tier_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>

      <el-form-item label="招生省份" prop="enrollLocation">
        <el-input
          v-model="queryParams.enrollLocation"
          placeholder="请输入名称"
          clearable
          @keyup.enter="handleQuery"
        />
      </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>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['system:bBusiWishUniversities:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:bBusiWishUniversities:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:bBusiWishUniversities:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="Download"
          @click="handleExport"
          v-hasPermi="['system:bBusiWishUniversities:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="bBusiWishUniversitiesList" @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="国标编码" align="center" prop="gbCode" />-->
      <el-table-column label="名称" align="center">
        <template #default="{ row }">
          <span>{{ row.name }} ({{ row.code }})</span>
        </template>
      </el-table-column>
      <el-table-column label="logo" align="center" prop="logo">
        <template #default="{ row }">
          <image-preview v-if="row.logo" :src="row.logo" :width="50" :height="50" />
          <span v-else>暂无图片</span>
        </template>
      </el-table-column>
      <el-table-column label="所在地" align="center">
        <template #default="{ row }">
          <span>{{ row.location }} {{ row.cityName }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="主管部门类别" align="center" prop="managerType" />-->
      <el-table-column label="院校类型" align="center" prop="type" />
      <el-table-column label="学历层次" align="center" prop="level" />
      <el-table-column label="梯队" align="center" prop="tier">
        <template #default="scope">
          <dict-tag :options="tier_type" :value="scope.row.tier" />
        </template>
      </el-table-column>
<!--      <el-table-column label="排序" align="center" prop="tierRank" />-->
<!--      <el-table-column label="省id" align="center" prop="provinceId" />-->
<!--      <el-table-column label="市id" align="center" prop="cityId" />-->
<!--      <el-table-column label="研究生院(1:不是,2:是)" align="center" prop="yjsy" />-->
<!--      <el-table-column label="独立学院(1:不是,2:是)" align="center" prop="dlxy" />-->
<!--      <el-table-column label="民办高校(1:不是,2:是)" align="center" prop="mbgx" />-->
      <el-table-column label="电话" align="center" prop="tel">
        <template #default="{ row }">
          <span :title="row.tel" class="table-cell-ellipsis">{{ row.tel }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="网址" align="center" prop="url">-->
<!--        <template #default="{ row }">-->
<!--          <span :title="row.url" class="table-cell-ellipsis">{{ row.url }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="面积" align="center" prop="area" />-->
<!--      <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
<!--        <template #default="scope">-->
<!--          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="状态(0:无效,1:有效)" align="center" prop="status">-->
<!--        <template #default="scope">-->
<!--          <dict-tag :options="bool_values" :value="scope.row.status"/>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="BSH数量" align="center" prop="numberOfBSH" />-->
<!--      <el-table-column label="学生数" align="center" prop="numberOfStu" />-->
      <el-table-column label="评分" align="center" prop="comScore" />
<!--      <el-table-column label="教育部排名" align="center" prop="rankingOfEdu" />-->
<!--      <el-table-column label="排名" align="center" prop="ranking" />-->
      <el-table-column label="建立年份" align="center" prop="createdYear" />
<!--      <el-table-column label="硕士招办网站" align="center" prop="shuoShiZBWZ" />-->
<!--      <el-table-column label="vrUrl" align="center" prop="vrUrl" />-->
<!--      <el-table-column label="校训" align="center" prop="motto" />-->
      <el-table-column label="招办网站" align="center" prop="zhaoBanWZ">
        <template #default="{ row }">
          <span :title="row.zhaoBanWZ" class="table-cell-ellipsis">{{ row.zhaoBanWZ }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="简称" align="center" prop="shortName" />-->
<!--      <el-table-column label="英文名称" align="center" prop="enName" />-->
      <el-table-column label="简介" align="center" prop="introduction">
        <template #default="{ row }">
          <span :title="row.introduction" class="table-cell-ellipsis">{{ row.introduction }}</span>
        </template>
      </el-table-column>
      <el-table-column label="竞争力星级" align="center" prop="star">
        <template #default="scope">
          <dict-tag :options="university_stars" :value="scope.row.star" />
        </template>
      </el-table-column>
<!--      <el-table-column label="vr的短url" align="center" prop="vrShortUrl" />-->
<!--      <el-table-column label="庆祝日" align="center" prop="celebrateDay" />-->
      <el-table-column label="natureType" align="center" prop="natureType" />
      <el-table-column label="公私立" align="center" prop="natureTypeCN" />

      <!--      <el-table-column label="专业录取规则" align="center" prop="majorRule">-->
<!--        <template #default="{ row }">-->
<!--          <span :title="row.majorRule" class="table-cell-ellipsis">{{ row.majorRule }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="博士点" align="center" prop="pointsOfBo" />-->
<!--      <el-table-column label="硕士点" align="center" prop="pointsOfShuo" />-->
      <el-table-column label="bxLevel" align="center" prop="bxLevel" />
      <!-- <el-table-column label="features" align="center" prop="features" /> -->
      <!-- <el-table-column label="bxType" align="center" prop="bxType" /> -->
      <el-table-column label="考生类型" align="center" prop="entranceType" />
<!--      <el-table-column label="硕士招办电话" align="center" prop="shuoShiZBDH" />-->
      <el-table-column label="招办电话" align="center" prop="zhaoBanDH">
        <template #default="{ row }">
          <span :title="row.zhaoBanDH" class="table-cell-ellipsis">{{ row.zhaoBanDH }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="曾用名" align="center" prop="nameUsed" />-->
      <el-table-column label="地址" align="center" prop="address">
        <template #default="{ row }">
          <span :title="row.address" class="table-cell-ellipsis">{{ row.address }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="奖项" align="center" prop="awards" />-->
<!--      <el-table-column label="点击量" align="center" prop="hits" />-->
      <!-- <el-table-column label="学历层次" align="center" prop="eduLevel" /> -->
      <el-table-column label="banner" align="center" prop="bannerUrl">
        <template #default="{ row }">
          <image-preview v-if="row.bannerUrl" :src="row.bannerUrl" :width="50" :height="50" />
          <span v-else>暂无图片</span>
        </template>
      </el-table-column>
      <el-table-column label="网站" align="center" prop="webSite" />
<!--      <el-table-column label="名称" align="center" prop="name2" />-->
      <el-table-column label="招生省份" align="center" prop="enrollLocation" />
<!--      <el-table-column label="收藏数" align="center" prop="collect" />-->
<!--      <el-table-column label="虚拟收藏数" align="center" prop="favorities" />-->
<!--      <el-table-column label="createTime0" align="center" prop="createTime0" width="180">-->
<!--        <template #default="scope">-->
<!--          <span>{{ parseTime(scope.row.createTime0, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:bBusiWishUniversities:edit']">修改</el-button>
          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:bBusiWishUniversities:remove']">删除</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"
    />

    <!-- 添加或修改院校库对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form ref="bBusiWishUniversitiesRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="代码" prop="code">
          <el-input v-model="form.code" placeholder="请输入代码" />
        </el-form-item>
        <el-form-item label="国标编码" prop="gbCode">
          <el-input v-model="form.gbCode" placeholder="请输入国标编码" />
        </el-form-item>
        <el-form-item label="名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="logo" prop="logo">
          <image-upload v-model="form.logo" :limit="1" />
        </el-form-item>
        <el-form-item label="所在地" prop="location">
          <el-input v-model="form.location" placeholder="请输入所在地" />
        </el-form-item>
        <el-form-item label="学历层次" prop="level">
          <el-input v-model="form.level" placeholder="请输入学历层次" />
        </el-form-item>
        <el-form-item label="梯队" prop="tier">
          <el-select v-model="form.tier" placeholder="请选择梯队" clearable style="width: 100%">
            <el-option
              v-for="dict in tier_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="排序" prop="tierRank">
          <el-input v-model="form.tierRank" placeholder="请输入排序" />
        </el-form-item>
        <el-form-item label="省id" prop="provinceId">
          <el-input v-model="form.provinceId" placeholder="请输入省id" />
        </el-form-item>
        <el-form-item label="市id" prop="cityId">
          <el-input v-model="form.cityId" placeholder="请输入市id" />
        </el-form-item>
        <el-form-item label="研究生院(1:不是,2:是)" prop="yjsy">
          <el-input v-model="form.yjsy" placeholder="请输入研究生院(1:不是,2:是)" />
        </el-form-item>
        <el-form-item label="独立学院(1:不是,2:是)" prop="dlxy">
          <el-input v-model="form.dlxy" placeholder="请输入独立学院(1:不是,2:是)" />
        </el-form-item>
        <el-form-item label="民办高校(1:不是,2:是)" prop="mbgx">
          <el-input v-model="form.mbgx" placeholder="请输入民办高校(1:不是,2:是)" />
        </el-form-item>
        <el-form-item label="电话" prop="tel">
          <el-input v-model="form.tel" placeholder="请输入电话" />
        </el-form-item>
        <el-form-item label="网址" prop="url">
          <el-input v-model="form.url" placeholder="请输入网址" />
        </el-form-item>
        <el-form-item label="面积" prop="area">
          <el-input v-model="form.area" placeholder="请输入面积" />
        </el-form-item>
        <el-form-item label="状态(0:无效,1:有效)" prop="status">
          <el-select v-model="form.status" placeholder="请选择状态(0:无效,1:有效)">
            <el-option
              v-for="dict in bool_values"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="BSH数量" prop="numberOfBSH">
          <el-input v-model="form.numberOfBSH" placeholder="请输入BSH数量" />
        </el-form-item>
        <el-form-item label="学生数" prop="numberOfStu">
          <el-input v-model="form.numberOfStu" placeholder="请输入学生数" />
        </el-form-item>
        <el-form-item label="评分" prop="comScore">
          <el-input v-model="form.comScore" placeholder="请输入评分" />
        </el-form-item>
<!--        <el-form-item label="教育部排名" prop="rankingOfEdu">-->
<!--          <el-input v-model="form.rankingOfEdu" placeholder="请输入教育部排名" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="排名" prop="ranking">-->
<!--          <el-input v-model="form.ranking" placeholder="请输入排名" />-->
<!--        </el-form-item>-->
        <el-form-item label="建立年份" prop="createdYear">
          <el-input v-model="form.createdYear" placeholder="请输入建立年份" />
        </el-form-item>
        <el-form-item label="硕士招办网站" prop="shuoShiZBWZ">
          <el-input v-model="form.shuoShiZBWZ" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="vrUrl" prop="vrUrl">
          <el-input v-model="form.vrUrl" placeholder="请输入vrUrl" />
        </el-form-item>
        <el-form-item label="校训" prop="motto">
          <el-input v-model="form.motto" placeholder="请输入校训" />
        </el-form-item>
        <el-form-item label="招办网站" prop="zhaoBanWZ">
          <el-input v-model="form.zhaoBanWZ" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="简称" prop="shortName">
          <el-input v-model="form.shortName" placeholder="请输入简称" />
        </el-form-item>
        <el-form-item label="所在市" prop="cityName">
          <el-input v-model="form.cityName" placeholder="请输入所在市" />
        </el-form-item>
        <el-form-item label="英文名称" prop="enName">
          <el-input v-model="form.enName" placeholder="请输入英文名称" />
        </el-form-item>
        <el-form-item label="简介" prop="introduction">
          <el-input v-model="form.introduction" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="竞争力星级" prop="star">
          <el-select v-model="form.star" placeholder="请选择竞争力星级" clearable style="width: 100%">
            <el-option
              v-for="dict in university_stars"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="vr的短url" prop="vrShortUrl">
          <el-input v-model="form.vrShortUrl" placeholder="请输入vr的短url" />
        </el-form-item>
        <el-form-item label="庆祝日" prop="celebrateDay">
          <el-input v-model="form.celebrateDay" placeholder="请输入庆祝日" />
        </el-form-item>
        <el-form-item label="专业录取规则" prop="majorRule">
          <el-input v-model="form.majorRule" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="bxLevel" prop="bxLevel">
          <el-input v-model="form.bxLevel" placeholder="请输入bxLevel" />
        </el-form-item>
        <el-form-item label="bxLevel" prop="features">
          <el-input v-model="form.features" placeholder="请输入bxLevel" />
        </el-form-item>
        <el-form-item label="硕士招办电话" prop="shuoShiZBDH">
          <el-input v-model="form.shuoShiZBDH" placeholder="请输入硕士招办电话" />
        </el-form-item>
        <el-form-item label="招办电话" prop="zhaoBanDH">
          <el-input v-model="form.zhaoBanDH" placeholder="请输入招办电话" />
        </el-form-item>
        <el-form-item label="地址" prop="address">
          <el-input v-model="form.address" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="点击量" prop="hits">
          <el-input v-model="form.hits" placeholder="请输入点击量" />
        </el-form-item>
        <el-form-item label="院校举办：'private'私立, 'aw_ga'中外/港澳, 'public'公立" prop="natureTypeCN">
          <el-input v-model="form.natureTypeCN" placeholder="请输入院校举办：'private'私立, 'aw_ga'中外/港澳, 'public'公立" />
        </el-form-item>
        <el-form-item label="学历层次" prop="eduLevel">
          <el-input v-model="form.eduLevel" placeholder="请输入学历层次" />
        </el-form-item>
        <el-form-item label="bannerUrl" prop="bannerUrl">
          <image-upload v-model="form.bannerUrl" :limit="1" />
        </el-form-item>
        <el-form-item label="网站" prop="webSite">
          <el-input v-model="form.webSite" placeholder="请输入网站" />
        </el-form-item>
        <el-form-item label="名称" prop="name2">
          <el-input v-model="form.name2" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="名称" prop="enrollLocation">
          <el-input v-model="form.enrollLocation" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="收藏数" prop="collect">
          <el-input v-model="form.collect" placeholder="请输入收藏数" />
        </el-form-item>
        <el-form-item label="虚拟收藏数" prop="favorities">
          <el-input v-model="form.favorities" placeholder="请输入虚拟收藏数" />
        </el-form-item>
        <el-form-item label="createTime0" prop="createTime0">
          <el-date-picker clearable
            v-model="form.createTime0"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择createTime0">
          </el-date-picker>
        </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>
  </div>
</template>

<script setup name="BBusiWishUniversities">
import { listBBusiWishUniversities, getBBusiWishUniversities, delBBusiWishUniversities, addBBusiWishUniversities, updateBBusiWishUniversities } from "@/api/system/bBusiWishUniversities"

const { proxy } = getCurrentInstance()
const { bool_values, tier_type, university_stars } = proxy.useDict('bool_values', 'tier_type', 'university_stars')

const bBusiWishUniversitiesList = ref([])
const open = 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,
    code: null,
    gbCode: null,
    name: null,
    logo: null,
    location: null,
    managerType: null,
    type: null,
    level: null,
    tier: null,
    tierRank: null,
    provinceId: null,
    cityId: null,
    yjsy: null,
    dlxy: null,
    mbgx: null,
    tel: null,
    url: null,
    area: null,
    createTime: null,
    status: null,
    numberOfBSH: null,
    numberOfStu: null,
    comScore: null,
    rankingOfEdu: null,
    ranking: null,
    createdYear: null,
    shuoShiZBWZ: null,
    vrUrl: null,
    motto: null,
    zhaoBanWZ: null,
    shortName: null,
    cityName: null,
    enName: null,
    introduction: null,
    star: null,
    vrShortUrl: null,
    celebrateDay: null,
    natureType: null,
    majorRule: null,
    pointsOfBo: null,
    pointsOfShuo: null,
    bxLevel: null,
    features: null,
    bxType: null,
    entranceType: null,
    shuoShiZBDH: null,
    zhaoBanDH: null,
    nameUsed: null,
    address: null,
    awards: null,
    hits: null,
    natureTypeCN: null,
    eduLevel: null,
    bannerUrl: null,
    webSite: null,
    name2: null,
    enrollLocation: null,
    collect: null,
    favorities: null,
    createTime0: null
  },
  rules: {
    name: [
      { required: true, message: "名称不能为空", trigger: "blur" }
    ],
    status: [
      { required: true, message: "状态(0:无效,1:有效)不能为空", trigger: "change" }
    ],
  }
})

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

/** 查询院校库列表 */
function getList() {
  loading.value = true
  listBBusiWishUniversities(queryParams.value).then(response => {
    bBusiWishUniversitiesList.value = response.rows
    total.value = response.total
    loading.value = false
  })
}

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

// 表单重置
function reset() {
  form.value = {
    id: null,
    code: null,
    gbCode: null,
    name: null,
    logo: null,
    location: null,
    managerType: null,
    type: null,
    level: null,
    tier: null,
    tierRank: null,
    provinceId: null,
    cityId: null,
    yjsy: null,
    dlxy: null,
    mbgx: null,
    tel: null,
    url: null,
    area: null,
    createTime: null,
    status: null,
    numberOfBSH: null,
    numberOfStu: null,
    comScore: null,
    rankingOfEdu: null,
    ranking: null,
    createdYear: null,
    shuoShiZBWZ: null,
    vrUrl: null,
    motto: null,
    zhaoBanWZ: null,
    shortName: null,
    cityName: null,
    enName: null,
    introduction: null,
    star: null,
    vrShortUrl: null,
    celebrateDay: null,
    natureType: null,
    majorRule: null,
    pointsOfBo: null,
    pointsOfShuo: null,
    bxLevel: null,
    features: null,
    bxType: null,
    entranceType: null,
    shuoShiZBDH: null,
    zhaoBanDH: null,
    nameUsed: null,
    address: null,
    awards: null,
    hits: null,
    natureTypeCN: null,
    eduLevel: null,
    bannerUrl: null,
    webSite: null,
    name2: null,
    enrollLocation: null,
    collect: null,
    favorities: null,
    createTime0: null
  }
  proxy.resetForm("bBusiWishUniversitiesRef")
}

/** 搜索按钮操作 */
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
  getBBusiWishUniversities(_id).then(response => {
    form.value = response.data
    open.value = true
    title.value = "修改院校库"
  })
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["bBusiWishUniversitiesRef"].validate(valid => {
    if (valid) {
      if (form.value.id != null) {
        updateBBusiWishUniversities(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功")
          open.value = false
          getList()
        })
      } else {
        addBBusiWishUniversities(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 delBBusiWishUniversities(_ids)
  }).then(() => {
    getList()
    proxy.$modal.msgSuccess("删除成功")
  }).catch(() => {})
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('system/bBusiWishUniversities/export', {
    ...queryParams.value
  }, `bBusiWishUniversities_${new Date().getTime()}.xlsx`)
}

getList()
</script>
<style>
.table-cell-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
</style>
