|
@@ -11,9 +11,16 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
<el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
- <el-button type="primary" status="success" @click="onAdd"
|
|
|
|
|
|
+ <el-button type="success" status="success" @click="onAdd"
|
|
>新建</el-button
|
|
>新建</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="schoolStatusInfo.syncEnable"
|
|
|
|
+ :loading="loading || schoolStatusInfo.running"
|
|
|
|
+ @click="onSync"
|
|
|
|
+ >
|
|
|
|
+ 机构同步
|
|
|
|
+ </el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
@@ -22,10 +29,14 @@
|
|
<el-table-column prop="name" label="名称" />
|
|
<el-table-column prop="name" label="名称" />
|
|
<el-table-column prop="code" label="代码" />
|
|
<el-table-column prop="code" label="代码" />
|
|
<el-table-column prop="subCode" label="子机构代码" width="100" />
|
|
<el-table-column prop="subCode" label="子机构代码" width="100" />
|
|
- <el-table-column prop="doubleTrack" label="双评轨迹" width="100" />
|
|
|
|
|
|
+ <el-table-column prop="doubleTrack" label="双评轨迹" width="100">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ {{ scope.row.doubleTrack ? '开启' : '关闭' }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="province" label="省份" />
|
|
<el-table-column prop="province" label="省份" />
|
|
<el-table-column prop="city" label="城市" />
|
|
<el-table-column prop="city" label="城市" />
|
|
- <el-table-column label="操作">
|
|
|
|
|
|
+ <el-table-column label="操作" width="240">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button size="small" link @click="onEdit(scope.row)">
|
|
<el-button size="small" link @click="onEdit(scope.row)">
|
|
修改
|
|
修改
|
|
@@ -53,7 +64,12 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 编辑学校 -->
|
|
<!-- 编辑学校 -->
|
|
- <ModifySchool ref="modifySchoolRef" :row-data="curRow" @modified="getList" />
|
|
|
|
|
|
+ <ModifySchool
|
|
|
|
+ ref="modifySchoolRef"
|
|
|
|
+ :row-data="curRow"
|
|
|
|
+ :status-info="schoolStatusInfo"
|
|
|
|
+ @modified="getList"
|
|
|
|
+ />
|
|
<!-- 编辑学校管理员 -->
|
|
<!-- 编辑学校管理员 -->
|
|
<ModifySchoolAdmin ref="modifySchoolAdminRef" :row-data="curRow" />
|
|
<ModifySchoolAdmin ref="modifySchoolAdminRef" :row-data="curRow" />
|
|
|
|
|
|
@@ -82,18 +98,19 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
- import { computed, reactive, ref } from 'vue';
|
|
|
|
|
|
+ import { computed, reactive, ref, onMounted } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
- import { schoolListPage } from '@/api/admin';
|
|
|
|
- import { SchoolItem, SchoolListFilter } from '@/api/types/admin';
|
|
|
|
|
|
+ import { schoolListPage, syncSchool, getSchoolStatusInfo } from '@/api/admin';
|
|
|
|
+ import {
|
|
|
|
+ SchoolItem,
|
|
|
|
+ SchoolListFilter,
|
|
|
|
+ SchoolStatusInfo,
|
|
|
|
+ } from '@/api/types/admin';
|
|
import useTable from '@/hooks/table';
|
|
import useTable from '@/hooks/table';
|
|
|
|
+ import useLoading from '@/hooks/loading';
|
|
import { downloadExport } from '@/utils/download-export';
|
|
import { downloadExport } from '@/utils/download-export';
|
|
|
|
|
|
- // import useDictOption from '@/hooks/dict-option';
|
|
|
|
- // import useLoading from '@/hooks/loading';
|
|
|
|
- // import { useAppStore, useUserStore } from '@/store';
|
|
|
|
-
|
|
|
|
import ModifySchool from './ModifySchool.vue';
|
|
import ModifySchool from './ModifySchool.vue';
|
|
import ModifySchoolAdmin from './ModifySchoolAdmin.vue';
|
|
import ModifySchoolAdmin from './ModifySchoolAdmin.vue';
|
|
|
|
|
|
@@ -103,10 +120,12 @@
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
|
- // const appStore = useAppStore();
|
|
|
|
- // const userStore = useUserStore();
|
|
|
|
|
|
+ // 学校状态信息
|
|
|
|
+ const schoolStatusInfo = ref<SchoolStatusInfo>({} as SchoolStatusInfo);
|
|
|
|
+ async function getSchoolStatus() {
|
|
|
|
+ schoolStatusInfo.value = await getSchoolStatusInfo();
|
|
|
|
+ }
|
|
|
|
|
|
- // const preDate = getBeforeWeek();
|
|
|
|
const searchModel = reactive<SchoolListFilter>({
|
|
const searchModel = reactive<SchoolListFilter>({
|
|
name: '',
|
|
name: '',
|
|
});
|
|
});
|
|
@@ -118,7 +137,6 @@
|
|
const curRow = ref({} as SchoolItem);
|
|
const curRow = ref({} as SchoolItem);
|
|
const modifySchoolRef = ref();
|
|
const modifySchoolRef = ref();
|
|
function onEdit(row: SchoolItem) {
|
|
function onEdit(row: SchoolItem) {
|
|
- console.log(row);
|
|
|
|
curRow.value = row;
|
|
curRow.value = row;
|
|
modifySchoolRef.value?.open();
|
|
modifySchoolRef.value?.open();
|
|
}
|
|
}
|
|
@@ -129,9 +147,8 @@
|
|
|
|
|
|
const modifySchoolAdminRef = ref();
|
|
const modifySchoolAdminRef = ref();
|
|
function onEditAdmin(row: SchoolItem) {
|
|
function onEditAdmin(row: SchoolItem) {
|
|
- console.log(row);
|
|
|
|
curRow.value = row;
|
|
curRow.value = row;
|
|
- modifySchoolRef.value?.open();
|
|
|
|
|
|
+ modifySchoolAdminRef.value?.open();
|
|
}
|
|
}
|
|
function onEditRoleAuth(row: SchoolItem) {
|
|
function onEditRoleAuth(row: SchoolItem) {
|
|
route.push({
|
|
route.push({
|
|
@@ -141,7 +158,27 @@
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // 导入
|
|
|
|
|
|
+ // 同步
|
|
|
|
+ const { loading, setLoading } = useLoading();
|
|
|
|
+ async function onSync() {
|
|
|
|
+ if (loading.value) return;
|
|
|
|
+
|
|
|
|
+ setLoading(true);
|
|
|
|
+ try {
|
|
|
|
+ const res = await syncSchool();
|
|
|
|
+ if (res.success) {
|
|
|
|
+ ElMessage.success('同步成功');
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(res.message);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ } finally {
|
|
|
|
+ setLoading(false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 科目拆分
|
|
const importDialogRef = ref();
|
|
const importDialogRef = ref();
|
|
const importExamId = ref(0);
|
|
const importExamId = ref(0);
|
|
const uploadData = computed(() => {
|
|
const uploadData = computed(() => {
|
|
@@ -167,4 +204,8 @@
|
|
function importSuccess() {
|
|
function importSuccess() {
|
|
importDialogRef.value?.close();
|
|
importDialogRef.value?.close();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ getSchoolStatus();
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|