From 5f00696dfb25bc90034448ceb634ed1ef256681a Mon Sep 17 00:00:00 2001
From: qiyunfeng-create <1940665526@qq.com>
Date: 星期四, 21 八月 2025 21:13:35 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website

---
 src/views/personalCenter/teacherCertification.vue |  858 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 858 insertions(+), 0 deletions(-)

diff --git a/src/views/personalCenter/teacherCertification.vue b/src/views/personalCenter/teacherCertification.vue
new file mode 100644
index 0000000..65747f0
--- /dev/null
+++ b/src/views/personalCenter/teacherCertification.vue
@@ -0,0 +1,858 @@
+<template>
+  <div>
+    <el-dialog
+      align-center
+      destroy-on-close
+      :close-on-click-modal="false"
+      v-model="teacherDialog"
+      title="鏁欏笀璁よ瘉鐢宠"
+      class="myDialog"
+      @close="closeDialog(teacherFormRef)"
+    >
+      <div v-loading="loading" class="box">
+        <div class="body-box">
+          <div class="tipsBox">
+            <p class="main">娓╅Θ鎻愮ず</p>
+            <p>浠呴檺瀛︽牎鏈绋嬩换璇炬暀甯堢敵璇凤紱璇蜂笂浼犳湁鏁堝湪鑱屾暀甯堝伐浣滆瘉灏嗘湁鍔╀簬瀹℃牳銆�</p>
+          </div>
+          <el-form
+            ref="teacherFormRef"
+            :model="teacherInfo"
+            :rules="teacherRules"
+            label-width="140px"
+            class="teacherInfo"
+            status-icon
+          >
+            <el-form-item label="褰撳墠鐘舵�侊細">
+              <span class="wait" v-if="teacherInfo.state == 'WaitAudit'">绛夊緟瀹℃牳</span>
+              <span class="yes" v-else-if="teacherInfo.state == 'Normal'">宸茶璇�</span>
+              <span class="no" v-else-if="teacherInfo.state == 'Reject'"
+                ><span>宸查┏鍥�</span
+                ><span @click="lookReason()" class="wait hover" style="margin-left: 20px"
+                  >鏌ョ湅鍘熷洜</span
+                ></span
+              >
+              <span class="wait" v-else>寰呰璇�</span>
+            </el-form-item>
+            <el-form-item label="瀛︽牎锛�" prop="schoolName">
+              <span v-if="!editState">{{ teacherInfo.schoolName || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.schoolName"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ュ鏍�"
+              />
+            </el-form-item>
+            <el-form-item label="鐪熷疄濮撳悕锛�" prop="fullName">
+              <span v-if="!editState">{{ teacherInfo.fullName || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.fullName"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ョ湡瀹炲鍚�"
+              />
+            </el-form-item>
+            <el-form-item label="鑱岀О锛�">
+              <span v-if="!editState">{{ teacherInfo.positionalTitle || "-" }}</span>
+              <el-select
+                v-else
+                v-model="teacherInfo.positionalTitle"
+                placeholder="璇烽�夋嫨鑱岀О"
+              >
+                <el-option
+                  v-for="item in teachPosts"
+                  :key="item.value"
+                  :label="item.name"
+                  :value="item.name"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="浠绘暀璇剧▼锛�" prop="courseName">
+              <span v-if="!editState">{{ teacherInfo.courseName || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.courseName"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ヤ换鏁欒绋�"
+              />
+            </el-form-item>
+            <el-form-item label="鎵嬫満鍙凤細" prop="phone">
+              <span v-if="!editState">{{ teacherInfo.phone || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.phone"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ユ墜鏈哄彿"
+              />
+            </el-form-item>
+            <el-form-item label="搴ф満锛�" prop="telphone">
+              <span v-if="!editState">{{ teacherInfo.telphone || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.telphone"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ュ骇鏈�"
+              />
+            </el-form-item>
+            <el-form-item label="閭锛�" prop="email">
+              <span v-if="!editState">{{ teacherInfo.email || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.email"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ラ偖绠�"
+              />
+            </el-form-item>
+            <el-form-item label="璇︾粏鍦板潃锛�" prop="detailedAddress">
+              <span v-if="!editState">{{ teacherInfo.detailedAddress || "-" }}</span>
+              <el-input
+                v-else
+                v-model="teacherInfo.detailedAddress"
+                autocomplete="off"
+                placeholder="璇疯緭鍏ヨ缁嗗湴鍧�"
+              />
+            </el-form-item>
+            <el-form-item label="鍦ㄨ亴鏁欏笀宸ヤ綔璇侊細" prop="relevantCertificates">
+              <div class="uploadBox">
+                <div class="fileList">
+                  <div class="fileImgBox" v-for="(file, index) in fileList" :key="file">
+                    <el-image
+                      v-if="file.md5"
+                      style="width: 100%; height: 100%"
+                      :src="config?.requestCtx + `/file/GetPreViewImage?md5=` + file.md5"
+                      :zoom-rate="1.2"
+                      :max-scale="7"
+                      :min-scale="0.2"
+                      :hide-on-click-modal="true"
+                      :preview-src-list="showFileList"
+                      :initial-index="index"
+                      fit="contain"
+                    />
+                    <el-icon
+                      v-if="editState"
+                      @click="handleRemove(file)"
+                      color="#F56C6C"
+                      style="
+                        position: absolute;
+                        top: -10px;
+                        right: -10px;
+                        font-size: 20px;
+                        background: #fff;
+                        border-radius: 50%;
+                        cursor: pointer;
+                      "
+                      ><CircleCloseFilled
+                    /></el-icon>
+                  </div>
+                  <el-upload
+                    v-if="editState"
+                    class="upload"
+                    :http-request="fileUpload"
+                    :show-file-list="false"
+                    list-type="picture-card"
+                    :action="'#'"
+                  >
+                    <el-icon>
+                      <Plus />
+                    </el-icon>
+                  </el-upload>
+                </div>
+              </div>
+              <div class="grey" style="font-size: 12px">鏁欏姟澶勭洊绔犳枃浠躲�佹牎宸ュ崱鐨嗗彲</div>
+            </el-form-item>
+          </el-form>
+          <div class="agree-msg">
+            <!-- <input
+              :disabled="!editState ? true : false"
+              type="checkbox"
+              class="checkbox"
+              v-model="teacherInfo.agree"
+            /> -->
+            <el-checkbox
+              v-model="teacherInfo.agree"
+              :disabled="!editState ? true : false"
+            ></el-checkbox>
+            <span class="agree"
+              >鍚屾剰<span class="main hover" @click="dialogVisibleTecher = true"
+                >銆婃暀甯堣璇佹湇鍔℃潯娆俱��</span
+              ></span
+            >
+          </div>
+        </div>
+        <div class="footer-box">
+          <span class="myDialog-footer" v-if="!loading && editState">
+            <el-button @click="closeDialog(teacherFormRef)"> 鍙栨秷</el-button>
+            <el-button
+              type="primary"
+              @click="submitBtn(teacherFormRef)"
+              :loading="subLoading"
+            >
+              鎻愪氦</el-button
+            >
+          </span>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 鏁欏笀璁よ瘉鏈嶅姟鏉℃ -->
+    <el-dialog
+      title="銆婃暀甯堣璇佹湇鍔℃潯娆俱��"
+      v-model="dialogVisibleTecher"
+      :close-on-click-modal="false"
+      width="40%"
+    >
+      <div class="protocolBox" v-html="protocolTxt"></div>
+      <template #footer>
+        <span class="myDialog-footer" v-if="editState">
+          <el-button type="primary" class="btn" @click="dialogVisibleTecher = false"
+            >纭� 瀹�</el-button
+          >
+        </span>
+      </template>
+    </el-dialog>
+    <!-- 鏌ョ湅鍘熷洜 -->
+    <el-dialog
+      align-center
+      :close-on-click-modal="false"
+      v-model="dialogReason"
+      title="椹冲洖鍘熷洜"
+    >
+      <div class="reason" v-if="reasonTxt">
+        {{ reasonTxt }}
+      </div>
+      <div v-else>鏃�</div>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { reactive, ref, watch, defineEmits, inject, onMounted } from "vue";
+import type { FormInstance, FormRules } from "element-plus";
+import { ElMessage } from "element-plus";
+import tool from "@/assets/js/toolClass.js";
+import { getTopicMsgCmsItemFile } from "@/assets/js/middleGround/tool.js";
+import { useUserStore } from "@/store";
+const userStore = useUserStore();
+const MG: any = inject("MG");
+const config: any = inject("config");
+// 璇佷欢楠岃瘉
+const valiCertificate = (rule: any, value: any, callback: any) => {
+  if (fileList.value.length == 0) {
+    callback(new Error("璇蜂笂浼犵浉鍏宠瘉浠�"));
+  } else {
+    callback();
+  }
+};
+
+// const validateTelphone = (rule: any, value: any, callback: any) => {
+//   if (value !== "" && !config.reg_telphone.test(value)) {
+//     callback(new Error("璇疯緭鍏ユ纭牸寮忕殑搴ф満鍙�"));
+//   }
+//   callback();
+// };
+
+const validatePhone = (rule: any, value: any, callback: any) => {
+  if (value === "") {
+    callback(new Error("璇疯緭鍏ヨ仈绯荤數璇�"));
+  } else {
+    if (!config.reg_tel.test(value)) {
+      callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢佃瘽"));
+    }
+    callback();
+  }
+};
+const validateEmail = (rule: any, value: any, callback: any) => {
+  let myreg = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
+  if (value === "") {
+    callback(new Error("璇疯緭鍏ョ數瀛愰偖绠�"));
+  } else {
+    if (!myreg.test(value)) {
+      callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢靛瓙閭"));
+    }
+    callback();
+  }
+};
+
+const props = defineProps({
+  isShow: Boolean,
+});
+
+let teacherDialog = ref(false); //寮圭獥
+let loading = ref(false);
+let subLoading = ref(false);
+const teachPosts = ref([]);
+const teacherInfo = reactive({
+  schoolName: "", //瀛︽牎鍚嶇О
+  fullName: "", //濮撳悕
+  positionalTitle: "", //鑱岀О
+  courseName: "", //浠昏鏁欑▼
+  phone: "", //鑱旂郴鐢佃瘽
+  telphone: "", //搴ф満
+  email: "", //鑱旂郴閭
+  detailedAddress: "", //閫氳鍦板潃
+  relevantCertificates: [], //鐩稿叧璇佷欢
+  state: "", //瀹℃牳鐘舵�侀粯璁ゅ緟瀹℃牳
+  agree: false,
+});
+const topicMessageList = ref([]);
+const topicId = ref();
+const worksInfo = ref([]);
+const userId = ref();
+const teacherFormRef = ref<FormInstance>();
+
+interface TeacherInfo {
+  schoolName: string;
+  fullName: string;
+  courseName: string;
+  telphone: string;
+  phone: string;
+  email: string;
+  detailedAddress: string;
+  relevantCertificates: string[];
+}
+const teacherRules = reactive<FormRules<TeacherInfo>>({
+  schoolName: [{ required: true, message: "瀛︽牎鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }],
+  fullName: [{ required: true, message: "鐪熷疄濮撳悕涓嶈兘涓虹┖", trigger: "blur" }],
+  courseName: [{ required: true, message: "浠绘暀璇剧▼涓嶈兘涓虹┖", trigger: "blur" }],
+  // telphone: [{ validator: validateTelphone, trigger: "blur" }],
+  phone: [{ required: true, validator: validatePhone, trigger: "blur" }],
+  email: [{ required: true, validator: validateEmail, trigger: "blur" }],
+  detailedAddress: [{ required: true, message: "璇︾粏鍦板潃涓嶈兘涓虹┖", trigger: "blur" }],
+  relevantCertificates: [
+    { required: true, validator: valiCertificate, trigger: "change" },
+  ],
+});
+const fileList = ref([]);
+const editState = ref<boolean>(true);
+watch(props, (newValue) => {
+  // 缁熺洃鍚琾rops鐨勫�煎彉鍖栵紝鍔ㄦ�佷慨鏀筰sShow鐨勫��
+  teacherDialog.value = newValue.isShow;
+  if (teacherDialog.value) {
+    getpositionalTitle();
+    getAgreement();
+    if (localStorage.getItem(config.tokenKey)) {
+      getUserRole();
+    }
+  }
+});
+
+// 鑾峰彇鑱岀О
+function getpositionalTitle() {
+  const data = {
+    refCodes: ["positionalTitle"],
+  };
+  MG.store.getProductTypeField(data).then((res) => {
+    try {
+      const list = res[0];
+      const options = JSON.parse(list.config).option;
+      teachPosts.value = options;
+    } catch (error) {
+      teachPosts.value = [];
+    }
+  });
+}
+
+// 鑾峰彇鐧诲綍鐢ㄦ埛韬唤
+function getUserRole() {
+  loading.value = true;
+  MG.identity.getCurrentAppUser().then((res) => {
+    if (res) {
+      getType();
+      userId.value = res.userId;
+      let userInfo = res.infoList.find((item: any) => item.type == "userInfo");
+      let userTypeObj = res.infoList.find((item: any) => item.type == "userType");
+      const userData = {
+        userName: userInfo && userInfo.data ? JSON.parse(userInfo.data).name : "",
+        school: userInfo && userInfo.data ? JSON.parse(userInfo.data).school : "",
+        address: userInfo && userInfo.data ? JSON.parse(userInfo.data).address : "",
+        userType:
+          userTypeObj && userTypeObj.data ? JSON.parse(userTypeObj.data).userType : "",
+      };
+      let teacherRole = res.roleLinks.find((item) => item.role.refCode == "teacher");
+      let teacherInfos = res.infoList.find((item) => item.type == "teacherInfo");
+      let wechatInfo = res.infoList.find((item) => item.type == "WeChat");
+      let studentInfo = res.infoList.find((item) => item.type == "Default");
+      let phoneInfo = res.secretList.find((item) => item.type == "MobilePhone");
+      let emailInfo = res.secretList.find((item) => item.type == "EMail");
+      if (teacherRole && teacherInfos) {
+        userStore.setUserInfo({
+          ...userData,
+          ...teacherInfos,
+          phoneNumber: phoneInfo?.credential,
+          Email: emailInfo ? emailInfo.credential : JSON.parse(teacherInfos.data).email,
+          icon: wechatInfo?.icon,
+          role: "Teacher",
+          roleId: teacherRole.role.id,
+          userId: res.userId,
+        });
+      } else if (wechatInfo) {
+        userStore.setUserInfo({
+          ...userData,
+          ...wechatInfo,
+          phoneNumber: phoneInfo?.credential,
+          Email: emailInfo?.credential,
+          role: "Student",
+          userId: res.userId,
+        });
+      } else if (studentInfo) {
+        if (!studentInfo?.fullName) {
+          teacherInfo.fullName = userStore.userInfo!.userName;
+        }
+        userStore.setUserInfo({
+          ...userData,
+          ...studentInfo,
+          icon: wechatInfo?.icon,
+          phoneNumber: phoneInfo?.credential,
+          Email: emailInfo?.credential,
+          role: "Student",
+          userId: res.userId,
+        });
+      } else if (phoneInfo) {
+        userStore.setUserInfo({
+          ...userData,
+          ...phoneInfo,
+          name: phoneInfo?.credential,
+          icon: phoneInfo?.icon,
+          phoneNumber: phoneInfo?.credential,
+          role: "Student",
+          userId: res.userId,
+        });
+      }
+
+      teacherInfo.phone = userStore.userInfo!.phoneNumber;
+      teacherInfo.schoolName = userStore.userInfo!.school;
+      teacherInfo.detailedAddress = userStore.userInfo!.address;
+    }
+  });
+}
+
+function getType() {
+  const data = {
+    refCodes: ["teacherCertification"],
+  };
+  MG.resource.getCmsTypeByRefCode(data).then((res) => {
+    worksInfo.value = res[0].cmsTypeLinks[0].children;
+    newGetTeacherInfo();
+  });
+}
+
+// 鏂囦欢涓婁紶
+function fileUpload(file) {
+  console.log(file, 2);
+  return new Promise((resolve, reject) => {
+    const isJPG = file.file.type === "image/jpeg" || file.file.type === "image/png";
+    const isLt2M = (0.5 * file.file.size) / 1024 / 1024 < 0.5;
+    if (!isJPG) {
+      ElMessage.error("涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!");
+      return reject();
+    }
+    if (!isLt2M) {
+      ElMessage.error("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 500KB!");
+      return reject();
+    }
+    const FileName = file.file.name.split(".")[0];
+    const Extension = file.file.name.split(".")[1];
+    const FileType = file.file.type;
+    let size = 1024;
+    tool
+      .getFileMd5(file.file, size * 1024)
+      .then((e) => {
+        console.log(e, 2);
+        if (!fileList.value.find((item) => item.md5 == e)) {
+          const imgData = new FormData();
+          imgData.append("Md5", e);
+          imgData.append("FileName", FileName);
+          imgData.append("Extension", Extension);
+          imgData.append("FileType", FileType);
+          imgData.append("MetaData", null);
+          imgData.append("file", file.file);
+          MG.file.upload(imgData).then(() => {
+            fileList.value.push({
+              md5: e,
+              linkType: "LinkFile",
+              linkProtectType: "Public",
+              url: config.requestCtx + `/file/GetPreViewImage?md5=` + e,
+            });
+          });
+        } else {
+          ElMessage.error("褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�");
+        }
+      })
+      .catch((e) => {
+        console.error(e);
+      });
+  });
+}
+
+// 璇佷欢鍒犻櫎
+function handleRemove(file) {
+  for (let i = 0; i < fileList.value.length; i++) {
+    if (fileList.value[i].md5 == file.md5) {
+      fileList.value.splice(i, 1);
+    }
+  }
+}
+
+// 鐩戝惉鏂囦欢鍒楄〃鍙樺寲锛屽悓姝ヤ慨鏀瑰睍绀哄垪琛�
+const showFileList = ref([]);
+watch(
+  fileList,
+  (newValue) => {
+    showFileList.value = newValue.map(
+      (item) => config.requestCtx + `/file/GetPreViewImage?md5=` + item.md5
+    );
+  },
+  { immediate: true, deep: true }
+);
+
+// 鍏抽棴寮规锛屽洖璋冪埗灞傛柟娉�
+const emit = defineEmits(["dialogChange"]);
+const closeDialog = (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.resetFields();
+  teacherDialog.value = false;
+  emit("dialogChange", teacherDialog.value);
+};
+
+// 鏁欏笀鍗忚
+const dialogVisibleTecher = ref(false);
+const protocolTxt = ref("");
+const getAgreement = () => {
+  let query = {
+    path: "protocol",
+    fields: {
+      content: [],
+    },
+  };
+  MG.resource.getItem(query).then((res) => {
+    try {
+      const data = res.datas.find(
+        (e) => e.refCode == "teacherCertificationAgreement"
+      );
+      protocolTxt.value = data ? data.content : "鏆傛棤鍗忚";
+    } catch (error) {
+      protocolTxt.value = "鏆傛棤鍗忚";
+    }
+  });
+};
+
+//鏁欏笀淇℃伅
+function newGetTeacherInfo() {
+  const data = {
+    start: 0,
+    size: 10,
+    topicIdOrRefCode: "teacherRoleApproval",
+    appRefCode: config.appRefCode,
+    sort: {
+      type: "Desc",
+      field: "CreateDate",
+    },
+  };
+  MG.ugc.getTopicMessageList(data).then((res) => {
+    try {
+      fileList.value = [];
+      const resData = res.datas.find((i) => i.appUserCreator.userId === userId.value);
+      if (resData) {
+        if (resData.state == "WaitAudit") {
+          editState.value = false;
+        } else {
+          editState.value = true;
+        }
+        let info = getTopicMsgCmsItemFile(worksInfo.value, resData.cmsItemDataList);
+        teacherInfo.fullName = info.fullName;
+        teacherInfo.schoolName = info.schoolName;
+        teacherInfo.positionalTitle = info.positionalTitle;
+        teacherInfo.courseName = info.courseName;
+        teacherInfo.phone = info.phone;
+        teacherInfo.telphone = info.telphone ? info.telphone : "";
+        teacherInfo.email = info.email;
+        teacherInfo.detailedAddress = info.detailedAddress ? info.detailedAddress : "";
+        teacherInfo.relevantCertificates = info.relevantCertificates;
+        teacherInfo.agree = true;
+        teacherInfo.state = resData.state;
+        topicId.value = resData.id;
+        topicMessageList.value = resData.cmsItemDataList;
+        if (resData.feedBack != null) {
+          reasonTxt.value = JSON.parse(resData.feedBack).reason;
+        }
+        if (teacherInfo.relevantCertificates.length > 0) {
+          if (typeof teacherInfo.relevantCertificates == "object") {
+            teacherInfo.relevantCertificates.forEach((ele) => {
+              let imgObj = {
+                md5: ele.file.md5,
+                linkType: "LinkFile",
+                linkProtectType: "Public",
+                url: config.requestCtx + `/file/GetPreViewImage?md5=` + ele.file.md5,
+              };
+              fileList.value.push(imgObj);
+            });
+          } else {
+            let imgObj = {
+              md5: teacherInfo.relevantCertificates,
+              linkType: "LinkFile",
+              linkProtectType: "Public",
+              url:
+                config.requestCtx +
+                `/file/GetPreViewImage?md5=` +
+                teacherInfo.relevantCertificates,
+            };
+            fileList.value.push(imgObj);
+          }
+        }
+        loading.value = false;
+      } else {
+        loading.value = false;
+      }
+    } catch (error) {
+      loading.value = false;
+    }
+  });
+}
+
+//鏁欏笀璁よ瘉鎻愪氦
+const submitBtn = async (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  await formEl.validate((valid, fields) => {
+    if (valid) {
+      if (teacherInfo.agree) {
+        subLoading.value = true;
+        if (topicMessageList.value.length > 0) {
+          let dataRequests = tool.UpdateworksDataBytool(
+            worksInfo.value,
+            topicMessageList.value,
+            teacherInfo,
+            fileList.value
+          );
+          const data = {
+            description: "",
+            icon: "",
+            id: topicId.value,
+            topicIdOrRefCode: "teacherRoleApproval",
+            name: teacherInfo.fullName + "",
+            content: "",
+            state: "WaitAudit",
+            type: "teacherRegister",
+            newDataRequests: dataRequests.newData,
+            updateDataRequests: dataRequests.updateData,
+            delDataRequest: {
+              ids: [],
+            },
+          };
+          let basicInfo = JSON.parse(JSON.stringify(teacherInfo));
+          delete basicInfo.worksInfo;
+          delete basicInfo.state;
+          const userInfo = {
+            requests: [
+              {
+                data: JSON.stringify(basicInfo),
+                name: teacherInfo.fullName + "",
+                type: "newTeacherInfo",
+              },
+            ],
+          };
+          MG.identity.setAppUserInfo(userInfo).then((res) => {
+            if (res) {
+              MG.ugc.updateTopicMessage(data).then(() => {
+                if (res !== false) {
+                  ElMessage({
+                    message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...",
+                    type: "success",
+                  });
+                  teacherDialog.value = false;
+                  subLoading.value = false;
+                  newGetTeacherInfo();
+                } else {
+                  subLoading.value = false;
+                }
+              });
+            } else {
+              subLoading.value = true;
+            }
+          });
+        } else {
+          const data = {
+            topicIdOrRefCode: "teacherRoleApproval",
+            name: teacherInfo.fullName + "",
+            content: "",
+            state: "WaitAudit",
+            type: "teacherRegister",
+            cmsTypeRefCode: "teacherCertification",
+            newDataListRequest: tool.worksDataBytool(
+              worksInfo.value,
+              teacherInfo,
+              fileList.value
+            ),
+          };
+
+          let basicInfo = JSON.parse(JSON.stringify(teacherInfo));
+          delete basicInfo.worksInfo;
+          delete basicInfo.state;
+          const userInfo = {
+            requests: [
+              {
+                data: JSON.stringify(basicInfo),
+                name: teacherInfo.fullName + "",
+                type: "teacherInfo",
+              },
+            ],
+          };
+          MG.identity.setAppUserInfo(userInfo).then((res) => {
+            MG.ugc.newTopicMessage(data).then(() => {
+              if (res !== false) {
+                ElMessage({
+                  message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...",
+                  type: "success",
+                });
+                teacherDialog.value = false;
+                newGetTeacherInfo();
+                subLoading.value = false;
+              } else {
+                subLoading.value = false;
+              }
+            });
+          });
+        }
+      } else {
+        ElMessage({
+          message: "璇峰悓鎰忋�婃暀甯堣璇佹湇鍔℃潯娆俱�嬶紒",
+          type: "warning",
+        });
+      }
+    }
+  });
+};
+
+//鍘熷洜鏌ョ湅
+const dialogReason = ref(false);
+const reasonTxt = ref("");
+const lookReason = () => {
+  dialogReason.value = true;
+};
+defineExpose({ getUserRole });
+</script>
+<style lang="less">
+.myDialog {
+  width: 628px;
+  .el-dialog__body {
+    padding: 0;
+  }
+  .body-box {
+    padding: 10px 20px 40px;
+    height: 80vh;
+    overflow-y: auto;
+  }
+
+  .el-dialog__header {
+    padding: 15px;
+    margin-right: 0;
+    border-bottom: 1px solid #f4f4f4;
+  }
+  .el-dialog__title {
+    font-weight: bold;
+    font-size: 16px;
+  }
+
+  .el-dialog__headerbtn {
+    top: 6px;
+    right: 6px;
+  }
+
+  .footer-box {
+    padding: 15px;
+    border-top: 1px solid #f4f4f4;
+    text-align: right;
+    height: 63px;
+  }
+
+  .myDialog-footer {
+    .el-button {
+      padding: 0 20px;
+    }
+  }
+}
+</style>
+<style lang="less" scoped>
+.tipsBox {
+  line-height: 24px;
+  padding: 5px;
+  border: 1px solid #019e58;
+  background: rgba(116, 252, 188, 0.1);
+  color: #019e58;
+  text-align: center;
+  width: 86%;
+  margin: 0 auto 20px auto;
+
+  .main {
+    font-weight: bold;
+    text-align: center;
+  }
+}
+
+.teacherInfo {
+  .el-select {
+    width: 90%;
+    height: 38px;
+
+    /deep/.el-input__wrapper {
+      height: 38px;
+    }
+  }
+
+  .el-input {
+    width: 90%;
+    height: 38px;
+  }
+}
+
+.uploadBox {
+  padding: 10px 0 0 10px;
+  border: 1px solid #e9e9eb;
+  border-radius: 3px;
+  width: 330px;
+}
+
+.fileList .upload {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: 10px;
+  margin-bottom: 10px;
+}
+
+.fileImgBox {
+  display: inline-block;
+  position: relative;
+  width: 146px;
+  height: 146px;
+  border-radius: 6px;
+  background: #ddd;
+  margin-right: 10px;
+  margin-bottom: 10px;
+  vertical-align: middle;
+  border: 1px solid #c0ccda;
+}
+
+.fileList .fileImgBox:hover {
+  border-color: #019E58;
+}
+
+.agree-msg {
+  margin-left: 140px;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .agree {
+    margin-left: 5px;
+  }
+
+  .term {
+    color: #019E58;
+  }
+}
+.reason {
+  word-wrap: break-word;
+}
+.protocolBox {
+  height: 500px;
+  overflow-y: auto;
+}
+</style>

--
Gitblit v1.9.1