|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent, ref, onMounted, nextTick, onUnmounted } from 'vue';
|
|
|
+import { defineComponent, ref, onMounted, nextTick, onUnmounted, reactive } from 'vue';
|
|
|
import styles from './index.module.less';
|
|
|
import { NImage, NBadge, NPopover, NIcon, NModal, NTooltip } from 'naive-ui';
|
|
|
import styles2 from './modals/suggestion-option.module.less';
|
|
@@ -19,6 +19,7 @@ import boxBg from './images/boxBg.png';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import opinionIcon from './images/opinionIcon.png';
|
|
|
+import inviteIcon from './images/invite_student_icon.png';
|
|
|
import classHistoryIcon from './images/classHistoryIcon.png';
|
|
|
import 'animate.css';
|
|
|
import ForgotPassword from '/src/views/setting/modal/forgotPassword';
|
|
@@ -29,6 +30,9 @@ import ClassModal from '/src/views/home/modals/class-modal';
|
|
|
import { suggestMessageUnread } from '/src/api/user';
|
|
|
import { eventGlobal } from '/src/utils';
|
|
|
import { usePrepareStore } from '/src/store/modules/prepareLessons';
|
|
|
+import { schoolDetail } from '/src/views/studentList/api'
|
|
|
+import AddStudentModel from '/src/views/studentList/modals/addStudentModel';
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: 'layoutTop',
|
|
|
setup() {
|
|
@@ -44,6 +48,10 @@ export default defineComponent({
|
|
|
const userInfoStatus = ref(false);
|
|
|
const classRecordStatus = ref(false);
|
|
|
const prepareStore = usePrepareStore();
|
|
|
+ const state = reactive({
|
|
|
+ addStudentVisible: false,
|
|
|
+ activeRow: {} as any,
|
|
|
+ });
|
|
|
|
|
|
const oncheckEditStatus = (callBack: any) => {
|
|
|
if (prepareStore.getIsEditResource) {
|
|
@@ -80,6 +88,23 @@ export default defineComponent({
|
|
|
console.log(suggestionOptionRef.value, 'suggestionOptionRef');
|
|
|
};
|
|
|
|
|
|
+ // 邀请学生二维码
|
|
|
+ const showInviteQrcode = async () => {
|
|
|
+ try {
|
|
|
+ const { schoolInfos } = users.getUserInfo;
|
|
|
+ const schoolId =
|
|
|
+ schoolInfos.length > 0 ? schoolInfos[0].id : null;
|
|
|
+ if (schoolId) {
|
|
|
+ const { data } = await schoolDetail({ id: schoolId });
|
|
|
+ state.activeRow = data;
|
|
|
+
|
|
|
+ state.addStudentVisible = true;
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const suggestionStatus = ref(false);
|
|
|
const getSuggestMessageUnread = async () => {
|
|
|
try {
|
|
@@ -170,6 +195,18 @@ export default defineComponent({
|
|
|
</p>
|
|
|
</div>
|
|
|
<div class={styles.layoutRight}>
|
|
|
+ <NTooltip showArrow={false}>
|
|
|
+ {{
|
|
|
+ trigger: () => (
|
|
|
+ <div class={styles.optons} onClick={showInviteQrcode}>
|
|
|
+ <NBadge dot={suggestionStatus.value} color={'#FF1036'}>
|
|
|
+ <NImage src={inviteIcon} previewDisabled></NImage>
|
|
|
+ </NBadge>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ default: '邀请学生'
|
|
|
+ }}
|
|
|
+ </NTooltip>
|
|
|
<NPopover
|
|
|
width={380}
|
|
|
class={styles.popoverClassModel}
|
|
@@ -386,6 +423,16 @@ export default defineComponent({
|
|
|
(showSuggestionViseble.value = false)
|
|
|
}></SuggestionOption>
|
|
|
</NModal>
|
|
|
+
|
|
|
+ {state.addStudentVisible ? (
|
|
|
+ <div v-model:show={state.addStudentVisible} class={['n-modal-mask', styles.popBox]}>
|
|
|
+ <AddStudentModel
|
|
|
+ activeRow={state.activeRow}
|
|
|
+ onClose={() => {
|
|
|
+ state.addStudentVisible = false;
|
|
|
+ }}></AddStudentModel>
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
</>
|
|
|
);
|