zhangzengfei
2023-09-05 51ecc231aa4f73a5071e188b4528ab59d730b07f
src/pages/settings/index/index.vue
@@ -31,11 +31,7 @@
            @click="openAccount(item, index)"
          >
            <div class="touxiang">
              <img
                v-if="item.headpic"
                :src="`data:image/png;base64,${item.headpic}`"
                alt=""
              />
              <img v-if="item.headpic" :src="`data:image/png;base64,${item.headpic}`" alt="" />
              <span class="user-name">{{ item.username }}</span>
            </div>
            <div class="login-tag" v-if="item.id == curUserID">
@@ -44,11 +40,7 @@
          </div>
        </div>
        <div class="add-account" v-if="curUserRole != '普通用户'">
          <i
            class="el-icon-circle-plus"
            style="font-size: 40px"
            @click="openAdd"
          ></i>
          <i class="el-icon-circle-plus" style="font-size: 40px" @click="openAdd"></i>
        </div>
      </div>
    </div>
@@ -58,34 +50,21 @@
      :class="activeIndex == 0 ? 'container-right-for-account' : ''"
    >
      <div class="account-right" v-if="activeIndex == 0">
        <div
          class="account-content"
          v-if="inAccountDetail == false && isAddAccount == false"
        >
        <div class="account-content" v-if="inAccountDetail == false && isAddAccount == false">
          <div class="content-top">
            <div
              class="touxiang-big"
              @mouseenter="showChangePic = true"
              @mouseleave="showChangePic = false"
            >
            <div class="touxiang-big" @mouseenter="showChangePic = true" @mouseleave="showChangePic = false">
              <img
                v-if="activeAccountItem.headpic"
                :src="`data:image/png;base64,${activeAccountItem.headpic}`"
                alt=""
              />
              <div class="touxiang-mask" v-show="showChangePic">
                <span class="enable" v-if="!showJPGArr" @click="editHeadPic"
                  >编辑头像</span
                >
                <span class="enable" v-if="!showJPGArr" @click="editHeadPic">编辑头像</span>
              </div>
            </div>
            <div class="user-desc">
              <div class="user-name">
                <span
                  class="icon iconfont"
                  style="font-size: 19px; margin-right: 4px"
                  >&#xe737;</span
                >
                <span class="icon iconfont" style="font-size: 19px; margin-right: 4px">&#xe737;</span>
                <span>{{ activeAccountItem.username }}</span>
              </div>
              <div class="user-role">
@@ -93,30 +72,13 @@
              </div>
              <div class="nick-name">
                <span class="nick-text">昵称:</span>
                <span v-show="!showInputNickName">{{
                  activeAccountItem.nickname
                }}</span>
                <el-input
                  size="mini"
                  v-model="inputNickName"
                  v-if="showInputNickName"
                ></el-input>
                <span
                  v-show="!showInputNickName"
                  class="icon iconfont edit-icon"
                  @click="editNickName"
                  >&#xe60c;</span
                >
                <span
                  v-show="showInputNickName"
                  class="icon iconfont clear-icon"
                  @click="showInputNickName = false"
                <span v-show="!showInputNickName">{{ activeAccountItem.nickname }}</span>
                <el-input size="mini" v-model="inputNickName" v-if="showInputNickName"></el-input>
                <span v-show="!showInputNickName" class="icon iconfont edit-icon" @click="editNickName">&#xe60c;</span>
                <span v-show="showInputNickName" class="icon iconfont clear-icon" @click="showInputNickName = false"
                  >&#xe785;</span
                >
                <span
                  v-show="showInputNickName"
                  class="icon iconfont confirm-icon"
                  @click="hideInputNick"
                <span v-show="showInputNickName" class="icon iconfont confirm-icon" @click="hideInputNick"
                  >&#xe72e;</span
                >
              </div>
@@ -131,12 +93,7 @@
                :key="index"
                @click="pickHeadDefPic(item, index)"
              >
                <img
                  v-if="item"
                  :src="`data:image/png;base64,${item.path}`"
                  alt=""
                  srcset=""
                />
                <img v-if="item" :src="`data:image/png;base64,${item.path}`" alt="" srcset="" />
                <div class="img-mask" v-if="selectedPic == index">
                  <span class="icon iconfont enable">&#xe62a;</span>
                </div>
@@ -151,18 +108,10 @@
            <div class="item-btn alt-pw-btn" @click="showChangePassword">
              修改密码
            </div>
            <div
              class="item-btn del-usr-btn"
              v-if="isShowDeleteAccount"
              @click="deleteAccount"
            >
            <div class="item-btn del-usr-btn" v-if="isShowDeleteAccount" @click="deleteAccount">
              删除账户
            </div>
            <div
              v-if="isShowPermitBtn"
              class="item-btn auth-set-btn"
              @click="openPermission"
            >
            <div v-if="isShowPermitBtn" class="item-btn auth-set-btn" @click="openPermission">
              权限设置
            </div>
          </div>
@@ -173,39 +122,19 @@
            <span class="icon iconfont">&#xe738;</span>
            <span>修改密码</span>
          </div>
          <el-form
            :model="passwordForm"
            :rules="pwRules"
            ref="passwordForm"
            class="password-form"
          >
            <el-form-item
              prop="curPassword"
              v-if="activeAccountItem.id == curUserID"
            >
          <el-form :model="passwordForm" :rules="pwRules" ref="passwordForm" class="password-form">
            <el-form-item prop="curPassword" v-if="activeAccountItem.id == curUserID">
              <div class="p-title">当前密码</div>
              <el-input
                placeholder="必填"
                v-model="passwordForm.curPassword"
                show-password
              ></el-input>
              <el-input placeholder="必填" v-model="passwordForm.curPassword" show-password></el-input>
            </el-form-item>
            <el-form-item prop="newPassword">
              <div class="p-title">新密码</div>
              <el-input
                placeholder="必填"
                v-model="passwordForm.newPassword"
                show-password
              ></el-input>
              <el-input placeholder="必填" v-model="passwordForm.newPassword" show-password></el-input>
            </el-form-item>
            <el-form-item prop="confirmPassword">
              <div class="p-title">确认密码</div>
              <el-input
                placeholder="必填"
                v-model="passwordForm.confirmPassword"
                show-password
              ></el-input>
              <el-input placeholder="必填" v-model="passwordForm.confirmPassword" show-password></el-input>
            </el-form-item>
          </el-form>
          <div class="btns">
@@ -244,68 +173,35 @@
              :key="index"
              @click="pickHeadDefPic(item, index)"
            >
              <img
                v-if="item"
                :src="`data:image/png;base64,${item.path}`"
                alt=""
                srcset=""
              />
              <img v-if="item" :src="`data:image/png;base64,${item.path}`" alt="" srcset="" />
              <div class="img-mask" v-if="selectedPic == index">
                <span class="icon iconfont enable">&#xe62a;</span>
              </div>
            </div>
          </div>
          <div class="fill-group">
            <el-form
              :model="addForm"
              :rules="addRules"
              ref="addForm"
              class="add-form"
            >
            <el-form :model="addForm" :rules="addRules" ref="addForm" class="add-form">
              <el-form-item prop="userName">
                <div class="p-title">用户名</div>
                <el-input
                  placeholder="2~10 位字符,不能以数字开头,不可包含汉字"
                  v-model="addForm.userName"
                ></el-input>
                <el-input placeholder="2~10 位字符,不能以数字开头,不可包含汉字" v-model="addForm.userName"></el-input>
              </el-form-item>
              <el-form-item prop="roleId" v-if="curUserRole != '普通用户'">
                <div class="p-title">角色</div>
                <el-select
                  v-model="addForm.roleId"
                  placeholder="请选择角色"
                  :popper-append-to-body="false"
                >
                  <el-option
                    v-for="(item, i) in roleList"
                    :key="i"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
                <el-select v-model="addForm.roleId" placeholder="请选择角色" :popper-append-to-body="false">
                  <el-option v-for="(item, i) in roleList" :key="i" :label="item.name" :value="item.id"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item prop="nickName">
                <div class="p-title">昵称</div>
                <el-input
                  placeholder="选填,2~10 位字符"
                  v-model="addForm.nickName"
                ></el-input>
                <el-input placeholder="选填,2~10 位字符" v-model="addForm.nickName"></el-input>
              </el-form-item>
              <el-form-item prop="password">
                <div class="p-title">密码</div>
                <el-input
                  placeholder="必填,至少为 6 位"
                  v-model="addForm.password"
                  show-password
                ></el-input>
                <el-input placeholder="必填,至少为 6 位" v-model="addForm.password" show-password></el-input>
              </el-form-item>
              <el-form-item prop="confirmPassword">
                <div class="p-title">确认密码</div>
                <el-input
                  placeholder="必填"
                  v-model="addForm.confirmPassword"
                  show-password
                ></el-input>
                <el-input placeholder="必填" v-model="addForm.confirmPassword" show-password></el-input>
              </el-form-item>
            </el-form>
          </div>
@@ -332,18 +228,10 @@
          <div class="adjust-zone">
            <div class="two-radio">
              <div
                class="radio"
                :class="isNtp ? '' : 'highlight-radio'"
                @click="isNtp = false"
              >
              <div class="radio" :class="isNtp ? '' : 'highlight-radio'" @click="isNtp = false">
                手动校时
              </div>
              <div
                class="radio"
                :class="isNtp ? 'highlight-radio' : ''"
                @click="isNtp = true"
              >
              <div class="radio" :class="isNtp ? 'highlight-radio' : ''" @click="isNtp = true">
                NTP校时
              </div>
            </div>
@@ -366,14 +254,8 @@
                      />
                    </div>
                    <div class="control">
                      <span class="icon iconfont" @click="plusOne('hrs')"
                        >&#xe60e;</span
                      >
                      <span
                        class="icon iconfont fanzhuan"
                        @click="minusOne('hrs')"
                        >&#xe60e;</span
                      >
                      <span class="icon iconfont" @click="plusOne('hrs')">&#xe60e;</span>
                      <span class="icon iconfont fanzhuan" @click="minusOne('hrs')">&#xe60e;</span>
                    </div>
                  </div>
                  <div class="sep">:</div>
@@ -392,14 +274,8 @@
                      />
                    </div>
                    <div class="control">
                      <span class="icon iconfont" @click="plusOne('min')"
                        >&#xe60e;</span
                      >
                      <span
                        class="icon iconfont fanzhuan"
                        @click="minusOne('min')"
                        >&#xe60e;</span
                      >
                      <span class="icon iconfont" @click="plusOne('min')">&#xe60e;</span>
                      <span class="icon iconfont fanzhuan" @click="minusOne('min')">&#xe60e;</span>
                    </div>
                  </div>
                  <div class="sep">:</div>
@@ -418,14 +294,8 @@
                      />
                    </div>
                    <div class="control">
                      <span class="icon iconfont" @click="plusOne('sec')"
                        >&#xe60e;</span
                      >
                      <span
                        class="icon iconfont fanzhuan"
                        @click="minusOne('sec')"
                        >&#xe60e;</span
                      >
                      <span class="icon iconfont" @click="plusOne('sec')">&#xe60e;</span>
                      <span class="icon iconfont fanzhuan" @click="minusOne('sec')">&#xe60e;</span>
                    </div>
                  </div>
                </div>
@@ -502,21 +372,14 @@
              </div>
              <div class="manual-time">
                <switchBar
                  :barName="`同步本计算机时间`"
                  @switchChange="syncBrowser"
                  :value="isSyncBrowser"
                ></switchBar>
                <switchBar :barName="`同步本计算机时间`" @switchChange="syncBrowser" :value="isSyncBrowser"></switchBar>
              </div>
            </div>
            <div class="ntp-wrap" v-if="isNtp">
              <el-form>
                <el-form-item label="服务器地址">
                  <ipInput
                    :ip="ntpServer"
                    @on-blur="ntpServer = arguments[0]"
                  ></ipInput>
                  <ipInput :ip="ntpServer" @on-blur="ntpServer = arguments[0]"></ipInput>
                </el-form-item>
                <el-form-item label="校时时间间隔">
@@ -531,12 +394,7 @@
                    ></el-input-number>
                    <span class="desc-min">分钟</span>
                    <el-button
                      type="text"
                      @click="testNTP"
                      :loading="ntpTestLoading"
                      >测试</el-button
                    >
                    <el-button type="text" @click="testNTP" :loading="ntpTestLoading">测试</el-button>
                  </div>
                </el-form-item>
              </el-form>
@@ -551,41 +409,16 @@
      </div>
    </div>
    <clusterManagement
      v-if="activeIndex == 2"
      ref="view_2"
      style="width: 100%"
    ></clusterManagement>
    <netSettings
      ref="view_3"
      v-if="activeIndex == 3"
      style="width: 100%"
    ></netSettings>
    <keyboardLanguage
      ref="view_4"
      v-if="activeIndex == 4"
      style="width: 100%"
    ></keyboardLanguage>
    <generalSettings
      ref="view_5"
      v-if="activeIndex == 5"
      style="width: 100%"
    ></generalSettings>
    <deviceInfo
      v-if="activeIndex == 6"
      style="width: 100%"
      ref="view_6"
    ></deviceInfo>
    <Authorization v-if="activeIndex == 7" style="width: 100%" ref="view_7">
    </Authorization>
    <clusterManagement v-if="activeIndex == 2" ref="view_2" style="width: 100%"></clusterManagement>
    <netSettings ref="view_3" v-if="activeIndex == 3" style="width: 100%"></netSettings>
    <keyboardLanguage ref="view_4" v-if="activeIndex == 4" style="width: 100%"></keyboardLanguage>
    <generalSettings ref="view_5" v-if="activeIndex == 5" style="width: 100%"></generalSettings>
    <deviceInfo v-if="activeIndex == 6" style="width: 100%" ref="view_6"></deviceInfo>
    <Authorization v-if="activeIndex == 7" style="width: 100%" ref="view_7"> </Authorization>
    <WebManage v-if="activeIndex == 8"></WebManage>
  </div>
  <div class="welcome-page" v-else ref="curPage" @mouseup="mouseDownIndex = ''">
    <div
      class="search-box"
      :class="showRecomand ? 'border-change' : ''"
      @click.stop
    >
    <div class="search-box" :class="showRecomand ? 'border-change' : ''" @click.stop>
      <el-input
        class="search-input"
        placeholder="查找设置"
@@ -598,17 +431,10 @@
      </el-input>
      <div class="search-res" v-if="showRecomand">
        <div
          class="res-bar"
          v-for="(item, index) in searchArrForShow"
          :key="index"
          @click="pickQuick(item.addr)"
        >
        <div class="res-bar" v-for="(item, index) in searchArrForShow" :key="index" @click="pickQuick(item.addr)">
          {{ item.name }}
        </div>
        <div class="no-res-bar" v-if="searchArrForShow.length == 0">
          没有找到与 {{ searchText }} 相关的结果
        </div>
        <div class="no-res-bar" v-if="searchArrForShow.length == 0">没有找到与 {{ searchText }} 相关的结果</div>
      </div>
      <div class="dummy-end" v-if="showRecomand" style="height: 14px"></div>
    </div>
@@ -631,7 +457,7 @@
</template>
<script>
import { getClockInfo, saveClockInfo, testNTPserver } from "@/api/system";
import { getClockInfo, saveClockInfo, testNTPserver } from "@/api/system"
import {
  addUser,
  getUsers,
@@ -641,18 +467,18 @@
  deleteUser,
  getUserMenus,
  defHeadPics,
  getRoles,
} from "@/api/user";
import switchBar from "../components/switchBar";
import ipInput from "../components/IPInput";
import clusterManagement from "../views/clusterManagement";
import netSettings from "../views/NetSettings";
import deviceInfo from "../views/deviceInfo";
import keyboardLanguage from "../views/keyboardLanguage";
import generalSettings from "../views/generalSettings";
import Authorization from "../views/Authorization";
import WebManage from "@/pages/settings/components/WebManage";
import { pad0, getUrlKey } from "@/api/utils";
  getRoles
} from "@/api/user"
import switchBar from "../components/switchBar"
import ipInput from "../components/IPInput"
import clusterManagement from "../views/clusterManagement"
import netSettings from "../views/NetSettings"
import deviceInfo from "../views/deviceInfo"
import keyboardLanguage from "../views/keyboardLanguage"
import generalSettings from "../views/generalSettings"
import Authorization from "../views/Authorization"
import WebManage from "@/pages/settings/components/WebManage"
import { pad0, getUrlKey } from "@/api/utils"
export default {
  name: "settings",
@@ -665,41 +491,41 @@
    generalSettings,
    deviceInfo,
    Authorization,
    WebManage,
    WebManage
  },
  data() {
    var v2 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
        callback(new Error("请再次输入密码"))
      } else if (value !== this.addForm.password) {
        callback(new Error("两次输入密码不一致!"));
        callback(new Error("两次输入密码不一致!"))
      } else {
        callback();
        callback()
      }
    };
    }
    var v4 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
        callback(new Error("请再次输入密码"))
      } else if (value !== this.passwordForm.newPassword) {
        callback(new Error("两次输入密码不一致!"));
        callback(new Error("两次输入密码不一致!"))
      } else {
        callback();
        callback()
      }
    };
    }
    const v1 = (rule, value, callback) => {
      if (value.trim() === "") {
        callback(new Error("请输入用户名"));
        this.addForm.userName = "";
        callback(new Error("请输入用户名"))
        this.addForm.userName = ""
      } else if (isNaN(Number(value[0])) == false) {
        callback(new Error("不能以数字开头"));
        callback(new Error("不能以数字开头"))
      } else if (/[\u4E00-\u9FA5]/g.test(value)) {
        callback(new Error("不能输入汉字"));
        callback(new Error("不能输入汉字"))
      } else if (value.length < 2 || value.length > 10) {
        callback(new Error("长度为 2 - 10 个字符"));
        callback(new Error("长度为 2 - 10 个字符"))
      } else {
        callback();
        callback()
      }
    };
    }
    return {
      showChangePic: false,
      syncYrs: "",
@@ -733,7 +559,7 @@
        { name: "手动校时", addr: [1, 1] },
        { name: "键盘和语言", addr: [4] },
        { name: "系统语言", addr: [4, 0] },
        { name: "键盘管理", addr: [4, 1] },
        { name: "键盘管理", addr: [4, 1] }
      ],
      inputNickName: "",
      showHourInput: false,
@@ -757,69 +583,69 @@
      settime: "",
      weekday: "",
      menuArr: [
        {
          name: "账户",
          icon: "\ue6de",
          imgUrl: "/images/settings/账户-蓝.png",
          blackIcon: "/images/settings/黑色一级icon/账户.png",
          whiteIcon: "/images/settings/白色一级icon/账户.png",
        },
        // {
        //   name: "账户",
        //   icon: "\ue6de",
        //   imgUrl: "/images/settings/账户-蓝.png",
        //   blackIcon: "/images/settings/黑色一级icon/账户.png",
        //   whiteIcon: "/images/settings/白色一级icon/账户.png",
        // },
        {
          name: "日期时间",
          icon: "\ue6ff",
          imgUrl: "/images/settings/时间日期.png",
          blackIcon: "/images/settings/黑色一级icon/时间信息.png",
          whiteIcon: "/images/settings/白色一级icon/时间日期.png",
          whiteIcon: "/images/settings/白色一级icon/时间日期.png"
        },
        {
          name: "集群管理",
          icon: "\ue6df",
          imgUrl: "/images/settings/集群管理.png",
          blackIcon: "/images/settings/黑色一级icon/集群管理.png",
          whiteIcon: "/images/settings/白色一级icon/集群管理.png",
          whiteIcon: "/images/settings/白色一级icon/集群管理.png"
        },
        {
          name: "网络设置",
          icon: "\ue6dd",
          imgUrl: "/images/settings/网络设置.png",
          blackIcon: "/images/settings/黑色一级icon/网络设置.png",
          whiteIcon: "/images/settings/白色一级icon/网络设置.png",
          whiteIcon: "/images/settings/白色一级icon/网络设置.png"
        },
        {
          name: "键盘和语言",
          icon: "\ue6dc",
          imgUrl: "/images/settings/键盘和语言.png",
          blackIcon: "/images/settings/黑色一级icon/键盘和语言.png",
          whiteIcon: "/images/settings/白色一级icon/键盘和语言.png",
          whiteIcon: "/images/settings/白色一级icon/键盘和语言.png"
        },
        {
          name: "通用设置",
          icon: "\ue6db",
          imgUrl: "/images/settings/通用设置.png",
          blackIcon: "/images/settings/黑色一级icon/通用设置.png",
          whiteIcon: "/images/settings/白色一级icon/通用设置.png",
          whiteIcon: "/images/settings/白色一级icon/通用设置.png"
        },
        {
          name: "设备信息",
          icon: "\ue756",
          imgUrl: "/images/settings/设备信息.png",
          blackIcon: "/images/settings/黑色一级icon/设备信息.png",
          whiteIcon: "/images/settings/白色一级icon/设备信息.png",
        },
        // {
        //   name: "设备信息",
        //   icon: "\ue756",
        //   imgUrl: "/images/settings/设备信息.png",
        //   blackIcon: "/images/settings/黑色一级icon/设备信息.png",
        //   whiteIcon: "/images/settings/白色一级icon/设备信息.png",
        // },
        {
          name: "授权管理",
          icon: "\ue7e9;",
          imgUrl: "/images/settings/授权管理.png",
          blackIcon: "/images/settings/黑色一级icon/授权管理.png",
          whiteIcon: "/images/settings/白色一级icon/授权管理.png",
          whiteIcon: "/images/settings/白色一级icon/授权管理.png"
        },
        {
          name: "域名管理",
          icon: "\ue6db",
          imgUrl: "/images/settings/通用设置.png",
          blackIcon: "/images/settings/黑色一级icon/通用设置.png",
          whiteIcon: "/images/settings/白色一级icon/通用设置.png",
        },
          whiteIcon: "/images/settings/白色一级icon/通用设置.png"
        }
      ],
      accountArr: [],
      jpgArr: [],
@@ -837,7 +663,7 @@
      passwordForm: {
        curPassword: "",
        newPassword: "",
        confirmPassword: "",
        confirmPassword: ""
      },
      activeAccountIndex: 0,
      sysMenus: [],
@@ -848,489 +674,482 @@
        password: "",
        headpic: "",
        confirmPassword: "",
        roleId: "",
        roleId: ""
      },
      props: {
        label: "name",
        label: "name"
      },
      addRules: {
        userName: [{ validator: v1, trigger: "blur" }],
        nickName: [
          { min: 2, max: 10, message: "长度为 2 - 10 位", trigger: "blur" },
        ],
        nickName: [{ min: 2, max: 10, message: "长度为 2 - 10 位", trigger: "blur" }],
        password: [
          { required: true, message: "请输入密码", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" }
        ],
        confirmPassword: [{ validator: v2, trigger: "blur" }],
        confirmPassword: [{ validator: v2, trigger: "blur" }]
      },
      pwRules: {
        curPassword: [
          { required: true, message: "请输入密码", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" }
        ],
        newPassword: [
          { required: true, message: "请输入密码", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" },
          { min: 6, message: "长度至少为 6 位", trigger: "blur" }
        ],
        confirmPassword: [{ validator: v4, trigger: "blur" }],
        confirmPassword: [{ validator: v4, trigger: "blur" }]
      },
      account_list_scroll: false,
    };
      account_list_scroll: false
    }
  },
  created() {
    let color = localStorage.getItem("--colorCard");
    let color = localStorage.getItem("--colorCard")
    if (color) {
      document.documentElement.style.setProperty("--colorCard", `${color}`);
      document.documentElement.style.setProperty("--colorCard", `${color}`)
    }
  },
  beforeDestroy() {
    clearTimeout(this.clockTimer);
    clearInterval(this.browserTimer);
    clearTimeout(this.clockTimer)
    clearInterval(this.browserTimer)
  },
  mounted() {
    // 返回按钮回调
    window.addEventListener("message", (e) => {
      if (e.data.msg === "返回系统设置") {
        this.showWelcome = true;
        this.showWelcome = true
      }
    });
    const menu = getUrlKey("menu");
    })
    const menu = getUrlKey("menu")
    if (menu) {
      this.showWelcome = false;
      this.activeIndex = this.menuArr.findIndex((x) => x.name == menu);
      this.showWelcome = false
      this.activeIndex = this.menuArr.findIndex((x) => x.name == menu)
      this.$nextTick(() => {
        this.$refs.view_3.openRight(2);
      });
        this.$refs.view_3.openRight(2)
      })
    }
    this.fetchUserList();
    this.fetchDefHeadPic();
    const e = this.$refs.curPage;
    this.fetchUserList()
    this.fetchDefHeadPic()
    const e = this.$refs.curPage
    if (e) {
      e.addEventListener("click", () => {
        if (this.showRecomand) {
          this.showRecomand = false;
          this.showRecomand = false
        }
      });
      })
    }
  },
  methods: {
    fetchDefHeadPic() {
      defHeadPics().then((res) => {
        this.jpgArr = res.data;
      });
        this.jpgArr = res.data
      })
    },
    fetchUserList(showLast = false) {
      getUsers().then((res) => {
        this.accountArr = res.data;
        this.accountArr = res.data
        if (this.accountArr.length) {
          this.activeAccountItem = this.accountArr[this.activeAccountIndex];
          this.activeAccountItem = this.accountArr[this.activeAccountIndex]
        }
        if (showLast) {
          this.cancelAdd();
          const lastIdx = this.accountArr.length - 1;
          this.openAccount(this.accountArr[lastIdx], lastIdx);
          this.cancelAdd()
          const lastIdx = this.accountArr.length - 1
          this.openAccount(this.accountArr[lastIdx], lastIdx)
        }
      });
      })
    },
    confirmChangePic() {
      updateUser({
        id: this.activeAccountItem.id,
        headpic: this.addForm.headpic,
        headpic: this.addForm.headpic
      }).then((res) => {
        if (res.success) {
          this.$message.success(res.msg);
          this.fetchUserList();
          this.cacelChoosePic();
          this.$message.success(res.msg)
          this.fetchUserList()
          this.cacelChoosePic()
        }
      });
      })
    },
    checkMonthInput() {
      this.inputMonth = this.inputMonth.replace(/[^\d]/g, "");
      if (this.inputMonth.length > 2)
        this.inputMonth = this.inputMonth.slice(0, 2);
      this.inputMonth = this.inputMonth.replace(/[^\d]/g, "")
      if (this.inputMonth.length > 2) this.inputMonth = this.inputMonth.slice(0, 2)
      if (+this.inputMonth > 12) {
        this.inputMonth = "12";
        this.inputMonth = "12"
      }
    },
    checkDayInput() {
      this.inputDay = this.inputDay.replace(/[^\d]/g, "");
      this.inputDay = this.inputDay.replace(/[^\d]/g, "")
      if (this.inputDay.length > 2) {
        this.inputDay = this.inputDay.slice(0, 2);
        this.inputDay = this.inputDay.slice(0, 2)
      }
      const max = this.getMaxDayOfMonth();
      const max = this.getMaxDayOfMonth()
      if (+this.inputDay > max) {
        this.inputDay = max + "";
        this.inputDay = max + ""
      }
    },
    editNickName() {
      this.showInputNickName = true;
      this.inputNickName = this.activeAccountItem.nickname;
      this.showInputNickName = true
      this.inputNickName = this.activeAccountItem.nickname
    },
    hideInputNick() {
      if (this.inputNickName == this.activeAccountItem.nickname) {
        this.showInputNickName = false;
        return;
        this.showInputNickName = false
        return
      }
      updateUser({
        id: this.activeAccountItem.id,
        nickname: this.inputNickName,
        nickname: this.inputNickName
      }).then((res) => {
        this.activeAccountItem.nickname = this.inputNickName;
        this.$message.success(res.msg);
        this.fetchUserList(true);
        this.showInputNickName = false;
      });
        this.activeAccountItem.nickname = this.inputNickName
        this.$message.success(res.msg)
        this.fetchUserList(true)
        this.showInputNickName = false
      })
    },
    openAccount(item, i) {
      this.showInputNickName = false;
      this.activeAccountItem = item;
      this.activeAccountIndex = i;
      this.isChangePw = false;
      this.inAccountDetail = false;
      this.cancelSet();
      this.inAccountDetail = false;
      this.isAddAccount = false;
      this.selectedPic = null;
      this.cacelChoosePic();
      this.fetchMenu();
      this.showInputNickName = false
      this.activeAccountItem = item
      this.activeAccountIndex = i
      this.isChangePw = false
      this.inAccountDetail = false
      this.cancelSet()
      this.inAccountDetail = false
      this.isAddAccount = false
      this.selectedPic = null
      this.cacelChoosePic()
      this.fetchMenu()
    },
    minusOne(typ) {
      this.isSyncBrowser = false;
      this.syncBrowser(false);
      let num;
      this.isSyncBrowser = false
      this.syncBrowser(false)
      let num
      switch (typ) {
        case "hrs":
          num = +this.syncHour - 1;
          num = +this.syncHour - 1
          if (num == -1) {
            num = 23;
            num = 23
          }
          this.syncHour = pad0(+num);
          break;
          this.syncHour = pad0(+num)
          break
        case "min":
          num = +this.syncMin - 1;
          num = +this.syncMin - 1
          if (num == -1) {
            num = 59;
            num = 59
          }
          this.syncMin = pad0(+num);
          break;
          this.syncMin = pad0(+num)
          break
        case "sec":
          num = +this.syncSec + 1;
          num = +this.syncSec + 1
          if (num == -1) {
            num = 59;
            num = 59
          }
          this.syncSec = pad0(+num);
          break;
          this.syncSec = pad0(+num)
          break
        case "yrs":
          num = +this.syncYrs - 1;
          this.syncYrs = pad0(+num);
          break;
          num = +this.syncYrs - 1
          this.syncYrs = pad0(+num)
          break
        case "mth":
          num = +this.syncMonth - 1;
          num = +this.syncMonth - 1
          if (num == 0) {
            num = 12;
            this.minusOne("yrs");
            num = 12
            this.minusOne("yrs")
          }
          this.syncMonth = pad0(+num);
          this.syncMonth = pad0(+num)
          if (+this.syncDay > this.getMaxDayOfMonth()) {
            this.minusOne("day");
            this.minusOne("day")
          }
          break;
          break
        case "day":
          num = +this.syncDay - 1;
          num = +this.syncDay - 1
          if (num == 0) {
            num = this.getMaxDayOfMonth();
            num = this.getMaxDayOfMonth()
          }
          this.syncDay = pad0(+num);
          break;
          this.syncDay = pad0(+num)
          break
        default:
          break;
          break
      }
    },
    getMaxDayOfMonth() {
      return new Date(+this.syncYrs, +this.syncMonth, 0).getDate();
      return new Date(+this.syncYrs, +this.syncMonth, 0).getDate()
    },
    fatherChange(item) {
      item.children.forEach((x) => {
        x.selected = item.selected;
      });
        x.selected = item.selected
      })
    },
    childrenChange(item) {
      let SomeOneSelected = item.children.some((x) => x.selected == true);
      item.selected = SomeOneSelected;
      let SomeOneSelected = item.children.some((x) => x.selected == true)
      item.selected = SomeOneSelected
    },
    plusOne(typ) {
      this.isSyncBrowser = false;
      this.syncBrowser(false);
      let num;
      this.isSyncBrowser = false
      this.syncBrowser(false)
      let num
      switch (typ) {
        case "hrs":
          num = +this.syncHour + 1;
          num = +this.syncHour + 1
          if (num == 24) {
            num = 0;
            num = 0
          }
          this.syncHour = pad0(+num);
          break;
          this.syncHour = pad0(+num)
          break
        case "min":
          num = +this.syncMin + 1;
          num = +this.syncMin + 1
          if (num == 60) {
            num = 0;
            num = 0
          }
          this.syncMin = pad0(+num);
          break;
          this.syncMin = pad0(+num)
          break
        case "sec":
          num = +this.syncSec + 1;
          num = +this.syncSec + 1
          if (num == 60) {
            num = 0;
            num = 0
          }
          this.syncSec = pad0(+num);
          break;
          this.syncSec = pad0(+num)
          break
        case "yrs":
          num = +this.syncYrs + 1;
          this.syncYrs = pad0(+num);
          break;
          num = +this.syncYrs + 1
          this.syncYrs = pad0(+num)
          break
        case "mth":
          num = +this.syncMonth + 1;
          num = +this.syncMonth + 1
          if (num == 13) {
            num = 1;
            num = 1
          }
          this.syncMonth = pad0(+num);
          this.syncMonth = pad0(+num)
          if (+this.syncDay > this.getMaxDayOfMonth()) {
            this.minusOne("day");
            this.minusOne("day")
          }
          break;
          break
        case "day":
          num = +this.syncDay + 1;
          num = +this.syncDay + 1
          if (num > this.getMaxDayOfMonth()) {
            num = 1;
            num = 1
          }
          this.syncDay = pad0(+num);
          break;
          this.syncDay = pad0(+num)
          break
        default:
          break;
          break
      }
    },
    editHeadPic() {
      this.showJPGArr = true;
      this.showJPGArr = true
      this.jpgArr.forEach((item, index) => {
        if (this.activeAccountItem.headpic == item.path) {
          this.selectedPic = index;
          this.selectedPic = index
        }
      });
      })
    },
    submitClock() {
      if (this.isNtp) {
        if (this.ntpServer === "" || this.ntpServer === "...") {
          this.$notify.error("NTP 服务器地址不能为空");
          return false;
          this.$notify.error("NTP 服务器地址不能为空")
          return false
        } else if (this.timeInterval === "") {
          this.timeInterval = 1;
          this.timeInterval = 1
        }
      } else if (this.isSyncBrowser) {
        if (this.settime === "") {
          this.$notify.error("设置时间不能为空");
          return false;
          this.$notify.error("设置时间不能为空")
          return false
        }
      } else {
        this.settime = `${this.syncYrs}-${this.syncMonth}-${this.syncDay} ${this.syncHour}:${this.syncMin}:${this.syncSec}`;
        this.settime = `${this.syncYrs}-${this.syncMonth}-${this.syncDay} ${this.syncHour}:${this.syncMin}:${this.syncSec}`
      }
      const now = new Date().getTime();
      const now = new Date().getTime()
      if (new Date(this.settime).getTime() > now) {
        this.$message.warning(
          "设置的时间不能晚于当前时间: " + this.formatTime(now, "Y-M-D h:m:s")
        );
        return;
        this.$message.warning("设置的时间不能晚于当前时间: " + this.formatTime(now, "Y-M-D h:m:s"))
        return
      }
      saveClockInfo({
        timeZone: this.timezone,
        ntp: this.isNtp,
        ntpServer: this.ntpServer,
        interval: this.timeInterval,
        newTime: this.settime,
        newTime: this.settime
      }).then(
        (rsp) => {
          if (rsp && rsp.success) {
            this.$notify.success("设置成功");
            this.$notify.success("设置成功")
          }
          this.initClockConf();
          this.initClockConf()
        },
        (err) => {
          this.$notify.error("设置失败 " + err.msg);
          this.$notify.error("设置失败 " + err.msg)
        }
      );
      )
    },
    saveAuth() {
      updataUser({
        id: this.activeAccountItem.id,
        menuIds: this.$refs.treeMenus.getCheckedKeys(),
        menuIds: this.$refs.treeMenus.getCheckedKeys()
      }).then((res) => {
        if (res.success) {
          this.$message.success(res.msg);
          this.cancelSet();
          this.$message.success(res.msg)
          this.cancelSet()
        }
      });
      })
    },
    formatTime(timestamp, format) {
      const formatNumber = (n) => {
        n = n + "";
        return n[1] ? n : "0" + n;
      };
      var formateArr = ["Y", "M", "D", "h", "m", "s"];
      var returnArr = [];
      var date = new Date(timestamp);
      returnArr.push(date.getFullYear());
      returnArr.push(formatNumber(date.getMonth() + 1));
      returnArr.push(formatNumber(date.getDate()));
      returnArr.push(formatNumber(date.getHours()));
      returnArr.push(formatNumber(date.getMinutes()));
      returnArr.push(formatNumber(date.getSeconds()));
      for (var i in returnArr) {
        format = format.replace(formateArr[i], returnArr[i]);
        n = n + ""
        return n[1] ? n : "0" + n
      }
      return format;
      var formateArr = ["Y", "M", "D", "h", "m", "s"]
      var returnArr = []
      var date = new Date(timestamp)
      returnArr.push(date.getFullYear())
      returnArr.push(formatNumber(date.getMonth() + 1))
      returnArr.push(formatNumber(date.getDate()))
      returnArr.push(formatNumber(date.getHours()))
      returnArr.push(formatNumber(date.getMinutes()))
      returnArr.push(formatNumber(date.getSeconds()))
      for (var i in returnArr) {
        format = format.replace(formateArr[i], returnArr[i])
      }
      return format
    },
    initClockConf(ntpTest = false) {
      getClockInfo().then((rsp) => {
        if (rsp && rsp.success) {
          this.timezone = rsp.data.time_zone;
          this.timezone = rsp.data.time_zone
          if (!ntpTest) {
            this.isNtp = rsp.data.ntp;
            this.isNtp = rsp.data.ntp
          }
          if (rsp.data.ntp) {
            this.ntpServer = rsp.data.ntp_server;
            this.timeInterval = rsp.data.interval;
            this.ntpServer = rsp.data.ntp_server
            this.timeInterval = rsp.data.interval
          }
          this.timestamp = rsp.data.local_time;
          this.weekday =
            "星期" +
            "日一二三四五六".charAt(new Date(+this.timestamp * 1000).getDay());
          this.timestamp = rsp.data.local_time
          this.weekday = "星期" + "日一二三四五六".charAt(new Date(+this.timestamp * 1000).getDay())
          if (this.clockTimer === null) {
            this.runClock();
            if (!this.isNtp) this.parseTime();
            this.runClock()
            if (!this.isNtp) this.parseTime()
          }
        }
      });
      })
    },
    openMenu(i) {
      this.activeIndex = i;
      this.activeIndex = i
      if (this.activeIndex == 1) {
        this.initClockConf();
        this.initClockConf()
      }
    },
    openWelcome(i) {
      this.showWelcome = false;
      this.openMenu(i);
      this.showWelcome = false
      this.openMenu(i)
    },
    showInput(typ) {
      this[`show${typ}Input`] = true;
      this[`show${typ}Input`] = true
      this.$nextTick(() => {
        this.$refs[`ipt${typ}`].focus();
      });
        this.$refs[`ipt${typ}`].focus()
      })
    },
    hideInput(typ) {
      if (this[`input${typ}`]) {
        this[`sync${typ}`] = pad0(+this[`input${typ}`]);
        this[`sync${typ}`] = pad0(+this[`input${typ}`])
      }
      this[`show${typ}Input`] = false;
      this[`input${typ}`] = "";
      this[`show${typ}Input`] = false
      this[`input${typ}`] = ""
      if (typ == "Month") {
        const max = this.getMaxDayOfMonth();
        const max = this.getMaxDayOfMonth()
        if (+this.syncDay > max) {
          this.syncDay = max + "";
          this.syncDay = max + ""
        }
      }
    },
    cancelSetTime() {
      this.parseTime();
      this.ntpServer = "...";
      this.timeInterval = 10;
      this.parseTime()
      this.ntpServer = "..."
      this.timeInterval = 10
    },
    syncBrowser(enable) {
      this.isSyncBrowser = enable;
      this.isSyncBrowser = enable
      if (!enable) {
        clearInterval(this.browserTimer);
        clearInterval(this.browserTimer)
      } else {
        this.browserTimer = setInterval(() => {
          this.settime = this.formatTime(new Date().getTime(), "Y-M-D h:m:s");
          let [arr1, arr2] = this.settime.split(" ");
          [this.syncYrs, this.syncMonth, this.syncDay] = arr1.split("-");
          [this.syncHour, this.syncMin, this.syncSec] = arr2.split(":");
        }, 1000);
          this.settime = this.formatTime(new Date().getTime(), "Y-M-D h:m:s")
          let [arr1, arr2] = this.settime.split(" ")
          ;[this.syncYrs, this.syncMonth, this.syncDay] = arr1.split("-")
          ;[this.syncHour, this.syncMin, this.syncSec] = arr2.split(":")
        }, 1000)
      }
    },
    openAdd() {
      this.inAccountDetail = false;
      this.isAddAccount = true;
      this.selectedPic = 0;
      this.addForm.headpic = this.jpgArr[0].path;
      this.inAccountDetail = false
      this.isAddAccount = true
      this.selectedPic = 0
      this.addForm.headpic = this.jpgArr[0].path
      getRoles().then((res) => {
        if (res.success) {
          this.roleList = res.data;
          this.roleList = res.data
        }
      });
      })
    },
    cancelAdd() {
      this.inAccountDetail = false;
      this.isAddAccount = false;
      this.$refs["addForm"].resetFields();
      this.selectedPic = null;
      this.inAccountDetail = false
      this.isAddAccount = false
      this.$refs["addForm"].resetFields()
      this.selectedPic = null
    },
    cancelPassword() {
      this.isChangePw = false;
      this.inAccountDetail = false;
      this.$refs["passwordForm"].resetFields();
      this.isChangePw = false
      this.inAccountDetail = false
      this.$refs["passwordForm"].resetFields()
    },
    pickQuick(addr) {
      if (addr.length == 1) {
        this.openWelcome(addr[0]);
        this.openWelcome(addr[0])
      } else {
        this.openWelcome(addr[0]);
        this.openWelcome(addr[0])
        this.$nextTick(() => {
          if (addr[0] == 1) {
            return;
            return
          }
          this.$refs[`view_${addr[0]}`].openRight(addr[1]);
        });
          this.$refs[`view_${addr[0]}`].openRight(addr[1])
        })
      }
    },
    cacelChoosePic() {
      this.addForm.headpic = "";
      this.showChangePic = false;
      this.selectedPic = null;
      this.showJPGArr = false;
      this.addForm.headpic = ""
      this.showChangePic = false
      this.selectedPic = null
      this.showJPGArr = false
    },
    SaveNewPassword(formName) {
      let data;
      let data
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.passwordForm.curPassword == "") {
            data = {
              userId: this.activeAccountItem.id,
              oldPwd: "",
              newPwd: this.passwordForm.newPassword,
            };
              newPwd: this.passwordForm.newPassword
            }
          } else {
            data = {
              oldPwd: this.passwordForm.curPassword,
              newPwd: this.passwordForm.newPassword,
            };
              newPwd: this.passwordForm.newPassword
            }
          }
          updatePassword(data).then(
            (res) => {
              if (res.success) {
                this.$message.success("密码" + res.msg);
                this.$message.success("密码" + res.msg)
                setTimeout(() => {
                  this.cancelPassword();
                }, 1000);
                  this.cancelPassword()
                }, 1000)
              }
            },
            (err) => {
              this.$message.error("保存失败," + err.msg);
              this.$message.error("保存失败," + err.msg)
            }
          );
          )
        }
      });
      })
    },
    saveAddAccount(formName) {
      this.$refs[formName].validate((valid) => {
@@ -1340,189 +1159,183 @@
            password: this.addForm.password,
            nickname: this.addForm.nickName,
            headpic: this.addForm.headpic,
            roleId: this.addForm.roleId,
          };
            roleId: this.addForm.roleId
          }
          addUser(data).then(
            (res) => {
              this.$message.success(res.data);
              this.fetchUserList(true);
              this.$message.success(res.data)
              this.fetchUserList(true)
            },
            (err) => {
              this.$message.error("保存失败," + err.msg);
              this.$message.error("保存失败," + err.msg)
            }
          );
          )
        } else {
          return false;
          return false
        }
      });
      })
    },
    pickHeadDefPic(item, i) {
      if (this.selectedPic == i) {
        this.selectedPic = null;
        this.addForm.headpic = "";
        return;
        this.selectedPic = null
        this.addForm.headpic = ""
        return
      }
      this.addForm.headpic = item.path;
      this.selectedPic = i;
      this.addForm.headpic = item.path
      this.selectedPic = i
    },
    testNTP() {
      this.ntpTestLoading = true;
      this.ntpTestLoading = true
      testNTPserver({ server: this.ntpServer })
        .then((rsp) => {
          if (rsp && rsp.success) {
            this.$notify({
              type: "success",
              message: "时间同步成功",
            });
              message: "时间同步成功"
            })
          } else {
            this.$notify({
              type: "error",
              message: "时间同步失败",
            });
              message: "时间同步失败"
            })
          }
          this.ntpTestLoading = false;
          this.initClockConf(true);
          this.ntpTestLoading = false
          this.initClockConf(true)
        })
        .catch((err) => {
          this.$notify({
            type: "error",
            message: "时间同步失败,请检查服务器ip",
          });
          this.ntpTestLoading = false;
        });
            message: "时间同步失败,请检查服务器ip"
          })
          this.ntpTestLoading = false
        })
    },
    cancelSet() {
      this.isSetPermission = false;
      this.inAccountDetail = false;
      this.sysMenus = [];
      this.isSetPermission = false
      this.inAccountDetail = false
      this.sysMenus = []
    },
    showChangePassword() {
      this.isChangePw = true;
      this.inAccountDetail = true;
      this.isChangePw = true
      this.inAccountDetail = true
    },
    runClock() {
      const str = this.formatTime(++this.timestamp * 1000, "Y-M-D h:m:s");
      [this.equipmentDate, this.equipmentTime] = str.split(" ");
      const str = this.formatTime(++this.timestamp * 1000, "Y-M-D h:m:s")
      ;[this.equipmentDate, this.equipmentTime] = str.split(" ")
      this.clockTimer = setTimeout(() => {
        this.runClock();
      }, 1000);
        this.runClock()
      }, 1000)
    },
    deleteAccount() {
      const h = this.$createElement;
      const h = this.$createElement
      this.$msgbox({
        title: "",
        message: h(
          "div",
          {
            style:
              "display: flex;  flex-direction: column; justify-content: center; align-items: center;",
            style: "display: flex;  flex-direction: column; justify-content: center; align-items: center;"
          },
          [
            h("span", { class: "icon iconfont warn-icon" }, "\ue71c"),
            h("span", { class: "warn-title" }, "删除账户"),
            h("span", { class: "warn-dec" }, "您是否确认删除账户?"),
            h("span", { class: "warn-dec" }, "您是否确认删除账户?")
          ]
        ),
        showCancelButton: true,
        showClose: true,
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        customClass: "del-account-message-box",
        customClass: "del-account-message-box"
      })
        .then(() => {
          let obj = {
            ids: [this.activeAccountItem.id],
          };
            ids: [this.activeAccountItem.id]
          }
          deleteUser(obj).then((res) => {
            if (res.success) {
              this.fetchUserList();
              this.$message.success("删除成功!");
              this.fetchUserList()
              this.$message.success("删除成功!")
            } else {
              this.$message.error("删除失败");
              this.$message.error("删除失败")
            }
          });
          })
        })
        .catch(() => {});
        .catch(() => {})
    },
    fetchMenu() {
      getUserMenus({
        userId: this.activeAccountItem.id,
        userId: this.activeAccountItem.id
      }).then((res) => {
        if (res && res.success) {
          this.sysMenus = res.data;
          let arr = [];
          this.drawChecked(this.sysMenus, arr);
          this.checkedArr = arr;
          this.sysMenus = res.data
          let arr = []
          this.drawChecked(this.sysMenus, arr)
          this.checkedArr = arr
        }
      });
      })
    },
    drawChecked(arr, res) {
      for (const item of arr) {
        if (item.selected && !item.children) res.push(item.id);
        if (item.children) this.drawChecked(item.children, res);
        if (item.selected && !item.children) res.push(item.id)
        if (item.children) this.drawChecked(item.children, res)
      }
    },
    openPermission() {
      this.inAccountDetail = true;
      this.isSetPermission = true;
      this.inAccountDetail = true
      this.isSetPermission = true
      if (this.sysMenus.length == 0) {
        this.fetchMenu();
        this.fetchMenu()
      }
    },
    parseTime() {
      [this.syncYrs, this.syncMonth, this.syncDay] =
        this.equipmentDate.split("-");
      [this.syncHour, this.syncMin, this.syncSec] =
        this.equipmentTime.split(":");
    },
      ;[this.syncYrs, this.syncMonth, this.syncDay] = this.equipmentDate.split("-")
      ;[this.syncHour, this.syncMin, this.syncSec] = this.equipmentTime.split(":")
    }
  },
  computed: {
    activeUserRole() {
      if (
        this.activeAccountItem.sysRoles &&
        this.activeAccountItem.sysRoles.length
      ) {
        return this.activeAccountItem.sysRoles[0].name;
      if (this.activeAccountItem.sysRoles && this.activeAccountItem.sysRoles.length) {
        return this.activeAccountItem.sysRoles[0].name
      }
      return "普通用户";
      return "普通用户"
    },
    curUserRole() {
      const info = JSON.parse(sessionStorage.getItem("userInfo"));
      return info.roleName;
      const info = JSON.parse(sessionStorage.getItem("userInfo"))
      return info.roleName
    },
    curUserID() {
      const info = JSON.parse(sessionStorage.getItem("userInfo"));
      return info.id;
      const info = JSON.parse(sessionStorage.getItem("userInfo"))
      return info.id
    },
    isShowDeleteAccount() {
      if (this.curUserRole == "超级管理员") {
        return this.activeUserRole != "超级管理员";
        return this.activeUserRole != "超级管理员"
      } else if (this.curUserRole == "管理员") {
        return this.activeUserRole == "普通用户";
        return this.activeUserRole == "普通用户"
      }
      return false;
      return false
    },
    isShowPermitBtn() {
      // basic 用户不允许修改权限
      if (this.activeUserRole == "超级管理员") {
        return false;
        return false
      }
      if (this.curUserRole == "管理员") {
        return this.activeUserRole == "普通用户";
        return this.activeUserRole == "普通用户"
      } else {
        return this.curUserRole != "普通用户";
        return this.curUserRole != "普通用户"
      }
    },
    searchArrForShow() {
      if (this.searchText == "") {
        return this.searchArr;
        return this.searchArr
      } else {
        return this.searchArr.filter((item) => {
          return item.name.indexOf(this.searchText.toUpperCase()) > -1;
        });
          return item.name.indexOf(this.searchText.toUpperCase()) > -1
        })
      }
    },
    }
  },
  watch: {
    showWelcome(newVal) {
@@ -1530,22 +1343,22 @@
        // 隐藏返回按按钮
        window.parent.postMessage(
          {
            msg: "hiddenBack",
            msg: "hiddenBack"
          },
          "*"
        );
        )
      } else {
        //显示返回按钮
        window.parent.postMessage(
          {
            msg: "showBack",
            msg: "showBack"
          },
          "*"
        );
        )
      }
    },
  },
};
    }
  }
}
</script>
<style lang="scss">
.welcome-page {
@@ -1596,8 +1409,7 @@
        line-height: 36px;
        outline: 0;
        padding: 0 20px;
        -webkit-transition: border-color 0.2s
          cubic-bezier(0.645, 0.045, 0.355, 1);
        -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
        transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
        width: 100%;
        font-weight: bold;
@@ -2588,11 +2400,8 @@
          }
        }
      }
      .el-form-item.is-required:not(.is-no-asterisk)
        > .el-form-item__label:before,
      .el-form-item.is-required:not(.is-no-asterisk)
        .el-form-item__label-wrap
        > .el-form-item__label:before {
      .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before,
      .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label:before {
        display: none;
      }
      .el-form-item {