|
|
@@ -3,17 +3,29 @@
|
|
|
<div class="form-item flex left">
|
|
|
<el-button @click="openResourceDirectory" v-log="{ describe: { action: '打开资源目录' } }">打开资源目录</el-button>
|
|
|
</div>
|
|
|
+ <div class="form-item flex left super-row">
|
|
|
+ <span class="super-label">超级权限</span>
|
|
|
+ <el-switch
|
|
|
+ :model-value="userInfoStore.isHLM"
|
|
|
+ :disabled="userInfoStore.isHLMAccount"
|
|
|
+ @change="onSuperChange"
|
|
|
+ />
|
|
|
+ <span class="super-hint">{{ superHint }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
+import { ref, computed } from 'vue';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
import client from "@/stores/modules/client";
|
|
|
import configInfo from '@/stores/modules/config';
|
|
|
+import useUserInfo from '@/stores/modules/user';
|
|
|
import icpList from '@/utils/ipc';
|
|
|
|
|
|
const clientStore = client();
|
|
|
const configInfoStore = configInfo();
|
|
|
+const userInfoStore = useUserInfo();
|
|
|
|
|
|
const isVisible = ref(false);
|
|
|
|
|
|
@@ -38,7 +50,17 @@ function openResourceDirectory() {
|
|
|
clientStore.ipc.send(icpList.utils.shellFun, params);
|
|
|
}
|
|
|
|
|
|
-// 挂载时注册事件监听器
|
|
|
+const superHint = computed(() => {
|
|
|
+ if (userInfoStore.isHLMAccount) return '当前已是惠利玛账号'
|
|
|
+ if (userInfoStore.superPermission) return '已开启,高级设置/演示模式/开发工具立即生效,关闭后立刻恢复'
|
|
|
+ return '开启后与惠利玛员工相同的配置,无需重启'
|
|
|
+})
|
|
|
+
|
|
|
+function onSuperChange(val) {
|
|
|
+ userInfoStore.setSuperPermission(!!val)
|
|
|
+ ElMessage.success(val ? '超级权限已开启' : '超级权限已关闭')
|
|
|
+}
|
|
|
+
|
|
|
defineExpose({
|
|
|
showDebugPanel,
|
|
|
hideDebugPanel,
|
|
|
@@ -50,4 +72,20 @@ defineExpose({
|
|
|
.debug-panel {
|
|
|
padding-bottom: 10px;
|
|
|
}
|
|
|
+.super-row {
|
|
|
+ align-items: center;
|
|
|
+ gap: 12px;
|
|
|
+ margin-top: 8px;
|
|
|
+}
|
|
|
+.super-label {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1a2233;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+.super-hint {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #8b95ab;
|
|
|
+ line-height: 1.4;
|
|
|
+}
|
|
|
</style>
|