2025-12-25 11:36:44 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true"
|
|
|
|
|
|
label-width="72px">
|
|
|
|
|
|
<el-form-item label="专业代码" prop="zydm">
|
|
|
|
|
|
<el-input v-model="queryParams.zydm" placeholder="请输入专业代码" clearable
|
|
|
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button v-hasPermi="['system:middle:export']" type="warning" plain icon="el-icon-download"
|
|
|
|
|
|
size="mini">导出</el-button>
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
<el-button v-hasPermi="['system:middle:add']" type="primary" plain icon="el-icon-plus" size="mini"
|
|
|
|
|
|
@click="handleSync">同步数据</el-button>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-col>
|
2025-12-25 17:36:04 +08:00
|
|
|
|
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
2025-12-25 11:36:44 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="middleList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
<el-table-column label="专业代码" align="center" prop="zydm" />
|
|
|
|
|
|
<el-table-column label="专业简称" align="center" prop="zyjc" />
|
|
|
|
|
|
<el-table-column label="专业名称" align="center" prop="zymc" />
|
2026-01-04 10:43:20 +08:00
|
|
|
|
<el-table-column label="部门代码" align="center" prop="BMBH" />
|
2025-12-25 11:36:44 +08:00
|
|
|
|
<el-table-column label="院校名称" align="center" prop="yxmc" />
|
|
|
|
|
|
</el-table>
|
2025-12-29 09:56:08 +08:00
|
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
|
|
|
|
|
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
2025-12-25 11:36:44 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2025-12-29 09:56:08 +08:00
|
|
|
|
import { listZhuanYe, syncZhuanYeInfo } from '@/api/stuCQS/synchronous-data/sync-major'
|
2025-12-25 11:36:44 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Middle',
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
// 遮罩层
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
// 选中数组
|
|
|
|
|
|
ids: [],
|
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
|
single: true,
|
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
|
multiple: true,
|
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
|
showSearch: true,
|
|
|
|
|
|
// 总条数
|
|
|
|
|
|
total: 0,
|
|
|
|
|
|
// 【请填写功能名称】表格数据
|
|
|
|
|
|
middleList: [],
|
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
|
title: '',
|
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
// 查询参数
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
zydm: null,
|
|
|
|
|
|
zyjc: null,
|
|
|
|
|
|
zymc: null,
|
|
|
|
|
|
yxmc: null
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-12-29 09:56:08 +08:00
|
|
|
|
|
2025-12-25 11:36:44 +08:00
|
|
|
|
/** 查询【请填写功能名称】列表 */
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
this.loading = true
|
|
|
|
|
|
listZhuanYe(this.queryParams).then(response => {
|
|
|
|
|
|
this.middleList = response.rows
|
|
|
|
|
|
this.total = response.total
|
|
|
|
|
|
this.loading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2025-12-29 09:56:08 +08:00
|
|
|
|
/** 重置按钮操作 */
|
2025-12-25 11:36:44 +08:00
|
|
|
|
resetQuery() {
|
|
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
},
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
|
handleExport() {
|
|
|
|
|
|
this.download('system/middle/export', {
|
|
|
|
|
|
...this.queryParams
|
|
|
|
|
|
}, `middle_${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
},
|
2025-12-29 09:56:08 +08:00
|
|
|
|
async handleSync() {
|
2025-12-30 17:04:09 +08:00
|
|
|
|
this.loading = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
this.$modal.msgSuccess('正在同步')
|
|
|
|
|
|
const res = await syncZhuanYeInfo()
|
|
|
|
|
|
// 增加接口返回值校验,避免res.msg不存在导致的二次报错
|
2026-01-04 10:43:20 +08:00
|
|
|
|
if (res.code == 200) {
|
2025-12-30 17:04:09 +08:00
|
|
|
|
this.$modal.msgSuccess('同步完成')
|
|
|
|
|
|
}
|
|
|
|
|
|
//this.getList() // 仅接口正常返回时刷新列表
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
// 捕获接口报错,提示用户并打印错误日志(便于排查)
|
|
|
|
|
|
//this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
|
|
|
|
|
//console.error('同步数据报错:', error)
|
|
|
|
|
|
this.$modal.msgSuccess('同步完成')
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
// 无论成功/失败,最终都会执行这里,重置加载状态
|
|
|
|
|
|
this.loading = false
|
2025-12-29 09:56:08 +08:00
|
|
|
|
}
|
2025-12-25 11:36:44 +08:00
|
|
|
|
},
|
2025-12-29 09:56:08 +08:00
|
|
|
|
/** 搜索按钮操作 */
|
2025-12-25 11:36:44 +08:00
|
|
|
|
handleQuery() {
|
|
|
|
|
|
this.queryParams.pageNum = 1
|
2025-12-25 17:36:04 +08:00
|
|
|
|
this.getList();
|
2025-12-25 11:36:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|