feat: 参数配置教师应用和切换学生功能
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { reactive, ref, onMounted, toRaw, watch } from 'vue';
|
||||
import { PageContainer } from 'antdv-pro-layout';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
@@ -11,7 +12,6 @@ import usePtOptions from './hooks/usePtOptions';
|
||||
import useConfigList from './hooks/useConfigList';
|
||||
import useConfigArray from './hooks/useConfigArray';
|
||||
import useConfigArrayChild from './hooks/useConfigArrayChild';
|
||||
import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import { getAllNeConfig } from '@/api/ne/neConfig';
|
||||
import { getPtNeConfigData } from '@/api/pt/neConfig';
|
||||
import { hasRoles } from '@/plugins/auth-user';
|
||||
@@ -329,12 +329,14 @@ watch(
|
||||
);
|
||||
|
||||
const {
|
||||
ptConfigState,
|
||||
ptConfigSave,
|
||||
ptConfigReset,
|
||||
ptConfigApply,
|
||||
classState,
|
||||
studentStatus,
|
||||
studentSearch,
|
||||
} = usePtOptions({ t, treeState });
|
||||
} = usePtOptions({ t, fnActiveConfigNode });
|
||||
|
||||
const { tablePagination, listState, listEdit, listEditClose, listEditOk } =
|
||||
useConfigList({ t, treeState, ruleVerification });
|
||||
@@ -437,38 +439,77 @@ onMounted(() => {
|
||||
:options="classState.studentOptions"
|
||||
@search="studentSearch"
|
||||
@change="fnActiveConfigNode('#')"
|
||||
></a-select>
|
||||
>
|
||||
<template #option="{ value, label, status }">
|
||||
<span>{{ label }} </span>
|
||||
<a-tag
|
||||
v-if="status === '0'"
|
||||
color="processing"
|
||||
style="position: absolute; right: 0;}"
|
||||
>
|
||||
{{ status && '申请' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
<template
|
||||
v-if="
|
||||
hasRoles(['teacher']) &&
|
||||
classState.student &&
|
||||
studentStatus === '0'
|
||||
"
|
||||
>
|
||||
<a-button
|
||||
@click="ptConfigApply(treeState.neType, '2')"
|
||||
:loading="ptConfigState.applyLoading"
|
||||
>
|
||||
应用
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="ptConfigApply(treeState.neType, '3')"
|
||||
:loading="ptConfigState.applyLoading"
|
||||
>
|
||||
退回
|
||||
</a-button>
|
||||
</template>
|
||||
|
||||
<a-button
|
||||
v-roles:has="['admin', 'teacher']"
|
||||
:disabled="!!classState.student"
|
||||
v-show="!classState.student"
|
||||
@click="ptConfigApply(treeState.neType, '2')"
|
||||
:loading="ptConfigState.applyLoading"
|
||||
>
|
||||
(管理员/教师) 应用到网元
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="ptConfigSave(treeState.neType)"
|
||||
:loading="ptConfigState.saveLoading"
|
||||
v-roles:has="['admin']"
|
||||
>
|
||||
(管理员)载入网元配置为系统示例
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="ptConfigReset(treeState.neType)"
|
||||
v-show="!classState.student"
|
||||
:loading="ptConfigState.restLoading"
|
||||
v-roles:has="['teacher']"
|
||||
>
|
||||
(教师)重置为系统示例
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="ptConfigReset(treeState.neType)"
|
||||
:loading="ptConfigState.restLoading"
|
||||
v-roles:has="['student']"
|
||||
>
|
||||
(学生)重置为教师示例
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="ptConfigApply(treeState.neType, '0')"
|
||||
:loading="ptConfigState.applyLoading"
|
||||
v-roles:has="['student']"
|
||||
>
|
||||
(学生)申请应用到 {{ treeState.neType }}
|
||||
|
||||
Reference in New Issue
Block a user