Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
@ -78,6 +78,8 @@ stopBatPath = process.platform === 'win32' ? stopBatPath.replace(/^(\w:)/, '/$1'
|
||||
let isRestart = false
|
||||
let mainWindow;
|
||||
|
||||
let isSeverInit = false
|
||||
let isAppInit = false
|
||||
function createWindow(): void {
|
||||
// Create the browser window.
|
||||
|
||||
@ -150,6 +152,10 @@ function createWindow(): void {
|
||||
// 监听启动页完成的消息
|
||||
ipcMain.on('splash-completed', () => {
|
||||
// 启动页进度条已完成,可以关闭启动页并显示主窗口
|
||||
if(isSeverInit) {
|
||||
mainWindow.webContents.send('program-init')
|
||||
}
|
||||
isAppInit = true
|
||||
setTimeout(() => {
|
||||
splashWindow.destroy()
|
||||
mainWindow.maximize() // 先最大化
|
||||
@ -562,38 +568,53 @@ if (!gotTheLock) {
|
||||
// buttons: ['确定']
|
||||
// })
|
||||
// 执行批处理文件
|
||||
exec(startBatPath.substring(1, 200), (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`执行错误: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
if (stderr) {
|
||||
console.error(`错误输出: ${stderr}`);
|
||||
return;
|
||||
}
|
||||
console.log(`批处理输出: ${stdout}`);
|
||||
});
|
||||
// const batProcess = spawn('cmd.exe', ['/c', startBatPath.substring(1, 200)]);
|
||||
// // 实时监听标准输出(stdout)
|
||||
// batProcess.stdout.on('data', (data) => {
|
||||
// // data 是 Buffer 类型,转为字符串后输出
|
||||
// console.log(`批处理输出: ${data.toString().trim()}`);
|
||||
// });
|
||||
|
||||
// // 监听错误输出(stderr)
|
||||
// batProcess.stderr.on('data', (data) => {
|
||||
// console.error(`错误输出: ${data.toString().trim()}`);
|
||||
// });
|
||||
|
||||
// // 监听进程执行出错(如文件不存在、权限问题等)
|
||||
// batProcess.on('error', (error) => {
|
||||
// exec(startBatPath.substring(1, 200), (error, stdout, stderr) => {
|
||||
// if (error) {
|
||||
// console.error(`执行错误: ${error.message}`);
|
||||
// return;
|
||||
// }
|
||||
// if (stderr) {
|
||||
// console.error(`错误输出: ${stderr}`);
|
||||
// return;
|
||||
// }
|
||||
// console.log(`批处理输出: ${stdout}`);
|
||||
// });
|
||||
|
||||
// // 监听进程退出事件(执行结束后触发)
|
||||
// batProcess.on('close', (code) => {
|
||||
// console.log(`批处理执行完毕,退出码: ${code}`);
|
||||
// });
|
||||
const batProcess = spawn('cmd.exe', ['/c', startBatPath.substring(1, 200)]);
|
||||
// 实时监听标准输出(stdout)
|
||||
batProcess.stdout.on('data', (data) => {
|
||||
// data 是 Buffer 类型,转为字符串后输出
|
||||
let string = data.toString().trim()
|
||||
// console.log(`批处理输出: ${string}`);
|
||||
// 临时处理:应用启动失败或项目文档地址出现时,认为服务初始化完成;后续需后端配合
|
||||
if(string.indexOf('APPLICATION FAILED TO START') !== -1 || string.indexOf('项目文档地址') !== -1) {
|
||||
if(!isSeverInit) {
|
||||
isSeverInit = true
|
||||
if(isAppInit) {
|
||||
mainWindow.webContents.send('program-init')
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('judgment-isSeverInit', (event) => {
|
||||
event.returnValue = isSeverInit
|
||||
})
|
||||
|
||||
// 监听错误输出(stderr)
|
||||
batProcess.stderr.on('data', () => {
|
||||
// console.error(`错误输出: ${data.toString().trim()}`);
|
||||
});
|
||||
|
||||
// 监听进程执行出错
|
||||
batProcess.on('error', () => {
|
||||
// console.error(`执行错误: ${error.message}`);
|
||||
});
|
||||
|
||||
// 监听进程退出事件(执行结束后触发)
|
||||
batProcess.on('close', (code) => {
|
||||
console.log(`批处理执行完毕,退出码: ${code}`);
|
||||
});
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
|
||||
|
||||
27
src/renderer/components.d.ts
vendored
27
src/renderer/components.d.ts
vendored
@ -11,33 +11,6 @@ declare module 'vue' {
|
||||
BaseDialog: typeof import('./src/components/dialog/baseDialog.vue')['default']
|
||||
Directory: typeof import('./src/components/dialog/directory.vue')['default']
|
||||
DirectoryEdit: typeof import('./src/components/dialog/directoryEdit.vue')['default']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
||||
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
||||
ElCol: typeof import('element-plus/es')['ElCol']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElImage: typeof import('element-plus/es')['ElImage']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
|
||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSlider: typeof import('element-plus/es')['ElSlider']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||
Index_b: typeof import('./src/components/SvgIcon/index_b.vue')['default']
|
||||
Pagination: typeof import('./src/components/Pagination/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
//@ts-nocheck
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import setTool from './components/setTool/setTool.vue'
|
||||
import weather from './components/weather/index.vue'
|
||||
|
||||
@ -214,7 +214,7 @@ const minusCircle = async (index) => {
|
||||
}
|
||||
}
|
||||
const changeRadius = async (e) => {
|
||||
proxy.$handleInputLimit(e)
|
||||
proxy?.$handleInputLimit(e)
|
||||
let newCircle = JSON.parse(JSON.stringify(circle.value))
|
||||
if (radiusUnit.value == 'km') {
|
||||
for (let i = 0; i < newCircle.length; i++) {
|
||||
|
||||
@ -168,7 +168,7 @@ const remove = () => {
|
||||
})
|
||||
}
|
||||
const changeRadius = (e)=>{
|
||||
proxy.$handleInputLimit(e)
|
||||
proxy?.$handleInputLimit(e)
|
||||
if (radiusUnit.value == 'km') {
|
||||
entityOptions.value.radius = radius.value * 1000
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ const remove = () => {
|
||||
})
|
||||
}
|
||||
const changeRadius = (e) => {
|
||||
proxy.$handleInputLimit(e)
|
||||
proxy?.$handleInputLimit(e)
|
||||
if (radiusUnit.value == 'km') {
|
||||
entityOptions.value.radius = radius.value * 1000
|
||||
}
|
||||
|
||||
@ -11,14 +11,8 @@
|
||||
<firstMenu class="absolute zIndex9" ref="firstMenuRef"></firstMenu>
|
||||
<!--底部菜单-->
|
||||
<bottomMenu class="absolute zIndex9" ref="bottomMenuRef"></bottomMenu>
|
||||
<input
|
||||
type="file"
|
||||
id="fileInputlink"
|
||||
style="display: none"
|
||||
multiple
|
||||
accept=".jpeg,.png,.jpg,.mp4,.pdf"
|
||||
@input="uploadFile"
|
||||
/>
|
||||
<input type="file" id="fileInputlink" style="display: none" multiple accept=".jpeg,.png,.jpg,.mp4,.pdf"
|
||||
@input="uploadFile" />
|
||||
|
||||
<!-- 多点视线分析 -->
|
||||
<!-- <Visibility ref="visibility"></Visibility> -->
|
||||
@ -557,6 +551,122 @@ onMounted(async () => {
|
||||
await YJ.on({ host: baseURL, token: localStorage.getItem('Authorization') })
|
||||
createEarth()
|
||||
})
|
||||
|
||||
// function getLatLngBySheetNumber(sheetNumber) {
|
||||
// // 比例尺代码映射(逆向):代码 -> 比例尺及步长
|
||||
// const scaleInfoMap = {
|
||||
// '': { scale: '1:100万', lngStep: 6, latStep: 4 },
|
||||
// 'B': { scale: '1:50万', lngStep: 3, latStep: 2 },
|
||||
// 'C': { scale: '1:25万', lngStep: 1.5, latStep: 1 },
|
||||
// 'D': { scale: '1:10万', lngStep: 0.5, latStep: 1 / 3 },
|
||||
// 'E': { scale: '1:5万', lngStep: 0.25, latStep: 1 / 6 },
|
||||
// 'F': { scale: '1:2.5万', lngStep: 0.125, latStep: 1 / 12 },
|
||||
// 'G': { scale: '1:1万', lngStep: 0.0625, latStep: 1 / 24 },
|
||||
// 'H': { scale: '1:5000', lngStep: 0.03125, latStep: 1 / 48 }
|
||||
// };
|
||||
|
||||
// // 1:100万行号字母对应表(A-V对应1-22)
|
||||
// const rowChars = 'ABCDEFGHIJKLMNOPQRSTUV';
|
||||
|
||||
// // 解析编号结构
|
||||
// let scaleCode, row100WChar, col100W, subRow, subCol;
|
||||
|
||||
// // 1:100万编号格式:1个字母 + 2位数字(如J50)
|
||||
// if (sheetNumber.length === 3) {
|
||||
// scaleCode = '';
|
||||
// row100WChar = sheetNumber[0];
|
||||
// col100W = parseInt(sheetNumber.slice(1), 10);
|
||||
// subRow = 1; // 1:100万无细分,默认第1行
|
||||
// subCol = 1; // 1:100万无细分,默认第1列
|
||||
// }
|
||||
// // 其他比例尺:1个字母 + 2位数字 + 1位代码 + 3位行 + 3位列(如J50E001001)
|
||||
// else if (sheetNumber.length === 10) {
|
||||
// row100WChar = sheetNumber[0];
|
||||
// col100W = parseInt(sheetNumber.slice(1, 3), 10);
|
||||
// scaleCode = sheetNumber[3];
|
||||
// subRow = parseInt(sheetNumber.slice(4, 7), 10);
|
||||
// subCol = parseInt(sheetNumber.slice(7, 10), 10);
|
||||
// } else {
|
||||
// throw new Error('无效的图幅编号格式,请检查输入');
|
||||
// }
|
||||
|
||||
// // 验证行字母合法性(A-V)
|
||||
// const row100WIndex = rowChars.indexOf(row100WChar);
|
||||
// if (row100WIndex === -1) {
|
||||
// throw new Error('无效的1:100万图幅行字母(必须为A-V)');
|
||||
// }
|
||||
// const row100W = row100WIndex + 1; // 行号(1-22)
|
||||
|
||||
// // 验证列号合法性(1-60)
|
||||
// if (col100W < 1 || col100W > 60) {
|
||||
// throw new Error('无效的1:100万图幅列号(必须为1-60)');
|
||||
// }
|
||||
|
||||
// // 验证比例尺代码和细分行列号
|
||||
// const scaleInfo = scaleInfoMap[scaleCode];
|
||||
// if (!scaleInfo) {
|
||||
// throw new Error('不支持的比例尺代码(必须为B-H或空)');
|
||||
// }
|
||||
// if (subRow < 1 || subCol < 1) {
|
||||
// throw new Error('细分行列号必须为正整数');
|
||||
// }
|
||||
|
||||
// // 计算1:100万图幅的经纬度范围
|
||||
// const minLng100W = (col100W - 31) * 6; // 1:100万图幅西边界经度
|
||||
// const maxLng100W = minLng100W + 6; // 1:100万图幅东边界经度
|
||||
// const maxLat100W = row100W * 4; // 1:100万图幅北边界纬度
|
||||
// const minLat100W = maxLat100W - 4; // 1:100万图幅南边界纬度
|
||||
|
||||
// // 计算当前比例尺图幅在1:100万内的偏移量,反推精确范围
|
||||
// const { lngStep, latStep, scale } = scaleInfo;
|
||||
// const minLng = minLng100W + (subCol - 1) * lngStep; // 图幅西边界经度
|
||||
// const maxLng = minLng + lngStep; // 图幅东边界经度
|
||||
// const maxLat = maxLat100W - (subRow - 1) * latStep; // 图幅北边界纬度(注意纬度方向是从北向南递增)
|
||||
// const minLat = maxLat - latStep; // 图幅南边界纬度
|
||||
|
||||
// let object = {
|
||||
// scale,
|
||||
// longitude: [minLng, maxLng], // [西经, 东经]
|
||||
// latitude: [minLat, maxLat] // [南纬, 北纬]
|
||||
// }
|
||||
// highlightSheetIndex(window.earth, object)
|
||||
// return object;
|
||||
// }
|
||||
|
||||
// function highlightSheetIndex(sdk, object) {
|
||||
// let viewer = sdk.viewer;
|
||||
|
||||
// let height = 8848
|
||||
// let positions = [
|
||||
// Cesium.Cartesian3.fromDegrees(object.longitude[0], object.latitude[0], height),
|
||||
// Cesium.Cartesian3.fromDegrees(object.longitude[1], object.latitude[0], height),
|
||||
// Cesium.Cartesian3.fromDegrees(object.longitude[1], object.latitude[1], height),
|
||||
// Cesium.Cartesian3.fromDegrees(object.longitude[0], object.latitude[1], height),
|
||||
// Cesium.Cartesian3.fromDegrees(object.longitude[0], object.latitude[0], height),
|
||||
// ]
|
||||
// let gridPrimitives = new Cesium.PrimitiveCollection();
|
||||
// gridPrimitives.name = 'highlightSheetIndexGridPrimitives';
|
||||
// viewer.scene.primitives.add(gridPrimitives);
|
||||
// const geometryInstances = new Cesium.GeometryInstance({
|
||||
// geometry: new Cesium.GroundPolylineGeometry({
|
||||
// positions: positions,
|
||||
// width: 1,
|
||||
// vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
|
||||
// arcType: Cesium.ArcType.RHUMB,
|
||||
// })
|
||||
// });
|
||||
|
||||
// gridPrimitives.add(new Cesium.GroundPolylinePrimitive({
|
||||
// geometryInstances: geometryInstances,
|
||||
// appearance: new Cesium.PolylineMaterialAppearance({
|
||||
// material: Cesium.Material.fromType('Color', {
|
||||
// color: Cesium.Color.fromCssColorString('#f00')
|
||||
// })
|
||||
// })
|
||||
// }));
|
||||
// }
|
||||
|
||||
// window.getLatLngBySheetNumber = getLatLngBySheetNumber
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="login-container"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0"
|
||||
>
|
||||
<transition
|
||||
name="video-fade"
|
||||
mode="out-in"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"
|
||||
>
|
||||
<div class="login-container" style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0">
|
||||
<transition name="video-fade" mode="out-in"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover">
|
||||
<!-- 第一个视频,播放一次 -->
|
||||
<!-- <video v-if="!isFirstVideoPlayed" ref="firstVideoRef" key="first-video" muted @ended="onFirstVideoEnded"
|
||||
src="../../assets/video/login_front.mp4"
|
||||
@ -15,17 +9,11 @@
|
||||
<!-- 第二个视频,循环播放 -->
|
||||
<!-- <video v-else key="second-video" autoplay loop muted src="../../assets/video/login_feature.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"></video> -->
|
||||
<video
|
||||
key="second-video"
|
||||
autoplay
|
||||
loop
|
||||
muted
|
||||
src="../../assets/video/author_video.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"
|
||||
></video>
|
||||
<video key="second-video" autoplay loop muted src="../../assets/video/author_video.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"></video>
|
||||
</transition>
|
||||
<!-- 登录页面 -->
|
||||
<div class="rightBox" v-if="isDesktop && !isAuth">
|
||||
<div class="rightBox" v-if="isDesktop">
|
||||
<el-button size="small" :icon="Setting" @click="serviceDialog = true"> </el-button>
|
||||
<el-button size="small" :icon="SwitchButton" @click="goExit"> </el-button>
|
||||
</div>
|
||||
@ -39,95 +27,45 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-form
|
||||
class="login-form"
|
||||
autoComplete="on"
|
||||
:model="loginForm"
|
||||
:rules="loginRules"
|
||||
ref="loginFormRef"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form class="login-form" autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginFormRef"
|
||||
label-position="left">
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
name="username"
|
||||
type="text"
|
||||
v-model="loginForm.username"
|
||||
autoComplete="on"
|
||||
placeholder="请输入用户名"
|
||||
:prefix-icon="User"
|
||||
/>
|
||||
<el-input name="username" type="text" v-model="loginForm.username" autoComplete="on" placeholder="请输入用户名"
|
||||
:prefix-icon="User" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
type="password"
|
||||
@keyup.enter.native="handleLogin(loginFormRef)"
|
||||
v-model="loginForm.password"
|
||||
autoComplete="on"
|
||||
placeholder="请输入密码"
|
||||
:prefix-icon="Unlock"
|
||||
show-password
|
||||
></el-input>
|
||||
<el-input type="password" @keyup.enter.native="handleLogin(loginFormRef)" v-model="loginForm.password"
|
||||
autoComplete="on" placeholder="请输入密码" :prefix-icon="Unlock" show-password></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="rememberForget">
|
||||
<!-- justify-content: space-around;align-items: center; -->
|
||||
<div style="display: flex">
|
||||
<svg
|
||||
class="checkbox-svg"
|
||||
v-show="checkboxVModel"
|
||||
style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
fill="rgba(var(--color-base1), 1)"
|
||||
d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z"
|
||||
></path>
|
||||
<svg class="checkbox-svg" v-show="checkboxVModel" style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14"
|
||||
viewBox="0 0 14 14" fill="none">
|
||||
<path fill="rgba(var(--color-base1), 1)"
|
||||
d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z">
|
||||
</path>
|
||||
<path
|
||||
d="M5.47283 8.3039L3.10764 6.12807C3.06194 6.08647 2.99525 6.08647 2.94955 6.12946L2.04424 6.98093C1.98989 7.03224 1.98495 7.12376 2.03312 7.18201L6.03602 11.9566C6.09778 12.0301 6.20647 12.0065 6.24105 11.9136C7.03644 9.69343 9.25835 5.63439 11.9619 2.69585C11.999 2.65564 12.0101 2.59601 11.9904 2.54331L11.8211 2.08568C11.7915 2.00525 11.7038 1.97474 11.6396 2.02328C8.63587 4.21019 6.45966 6.92546 5.47283 8.3039Z"
|
||||
fill="#004242"
|
||||
></path>
|
||||
fill="#004242"></path>
|
||||
</svg>
|
||||
<svg
|
||||
class="checkbox-svg"
|
||||
v-show="!checkboxVModel"
|
||||
style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
fill="url(#linear_border_2442_533_0)"
|
||||
d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z"
|
||||
></path>
|
||||
<svg class="checkbox-svg" v-show="!checkboxVModel" style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14"
|
||||
viewBox="0 0 14 14" fill="none">
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2442_533_0)"
|
||||
d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z">
|
||||
</path>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="linear_border_2442_533_0"
|
||||
x1="0"
|
||||
y1="-0.5574798583984375"
|
||||
x2="12.1173095703125"
|
||||
y2="12.878036499023438"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<linearGradient id="linear_border_2442_533_0" x1="0" y1="-0.5574798583984375" x2="12.1173095703125"
|
||||
y2="12.878036499023438" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<el-checkbox
|
||||
:disabled="loading"
|
||||
v-model="checkboxVModel"
|
||||
@change="rememberpwd"
|
||||
label="string"
|
||||
>记住密码</el-checkbox
|
||||
>
|
||||
<el-checkbox :disabled="loading" v-model="checkboxVModel" @change="rememberpwd"
|
||||
label="string">记住密码</el-checkbox>
|
||||
<!-- <div style="cursor: pointer;">忘记密码?</div> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -150,24 +88,15 @@
|
||||
<h2 class="greet"><span>欢迎您使用</span>实景三维电子沙盘系统</h2>
|
||||
<div class="serviceContent">
|
||||
<el-tabs v-model="selectedService" class="demo-tabs" @tab-click="handleSelect">
|
||||
<el-tab-pane
|
||||
v-for="item in serviceOptions"
|
||||
:label="item.name"
|
||||
:name="item.name"
|
||||
></el-tab-pane>
|
||||
<el-tab-pane v-for="item in serviceOptions" :label="item.name" :name="item.name"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="tabPanel">
|
||||
<template v-if="selectedService == '接口服务'">
|
||||
<div class="item">
|
||||
<span class="itemLabel">服务选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="servVal">
|
||||
<el-option
|
||||
size="mini"
|
||||
v-for="item in servOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
>
|
||||
<el-option size="mini" v-for="item in servOptions" :key="item.value" :label="item.name"
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -199,13 +128,8 @@
|
||||
<div class="item">
|
||||
<span class="itemLabel">串口选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="gpsVal">
|
||||
<el-option
|
||||
size="mini"
|
||||
v-for="item in gpsOptions"
|
||||
:key="item.value"
|
||||
:label="item.Product"
|
||||
:value="item.Name"
|
||||
>
|
||||
<el-option size="mini" v-for="item in gpsOptions" :key="item.value" :label="item.Product"
|
||||
:value="item.Name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -220,14 +144,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 授权页面 -->
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
class="graffiti"
|
||||
title="系统授权"
|
||||
:closeCallback="closeCallBack"
|
||||
left="calc(50vw - 188px)"
|
||||
top="calc(50vh - 191px)"
|
||||
>
|
||||
<Dialog ref="baseDialog" class="graffiti" title="系统授权" :closeCallback="closeCallBack" left="calc(50vw - 188px)"
|
||||
top="calc(50vh - 191px)">
|
||||
<template #content>
|
||||
<div class="auth_info custom_scroll_bar content_h">
|
||||
<div class="auth_info_box">
|
||||
@ -235,12 +153,7 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authCode') }}
|
||||
</div>
|
||||
<div
|
||||
class="auth_info_text"
|
||||
@click="copy(authInfo.license_code)"
|
||||
style="cursor: pointer"
|
||||
title="点击可复制"
|
||||
>
|
||||
<div class="auth_info_text" @click="copy(authInfo.license_code)" style="cursor: pointer" title="点击可复制">
|
||||
{{ authInfo.license_code || '' }}
|
||||
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
|
||||
</div>
|
||||
@ -263,22 +176,13 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authType') }}
|
||||
</div>
|
||||
<div
|
||||
v-if="authInfo.status != null"
|
||||
class="auth_info_text"
|
||||
style="font-size: 16px"
|
||||
:style="{
|
||||
<div v-if="authInfo.status != null" class="auth_info_text" style="font-size: 16px" :style="{
|
||||
color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)'
|
||||
}"
|
||||
>
|
||||
}">
|
||||
{{ authInfo.status ? t('auths.authTempExpire') : t('auths.authexpire') }}
|
||||
</div>
|
||||
<!-- <div v-else class="auth_info_text">{{ authInfo.message || '无' }}</div> -->
|
||||
<div
|
||||
v-else
|
||||
class="auth_info_text"
|
||||
style="font-size: 16px; color: rgba(241, 108, 85, 1)"
|
||||
>
|
||||
<div v-else class="auth_info_text" style="font-size: 16px; color: rgba(241, 108, 85, 1)">
|
||||
{{ t('auths.noAuthexpire') }}
|
||||
</div>
|
||||
</div>
|
||||
@ -294,6 +198,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
//@ts-nocheck
|
||||
import { User, Unlock, Setting, SwitchButton } from '@element-plus/icons-vue'
|
||||
import { useLogin } from './useLogin'
|
||||
import { useSetUp } from './useSetUp'
|
||||
@ -346,6 +251,7 @@ onMounted(() => {
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
import useClipboard from 'vue-clipboard3'
|
||||
import { ipcMain } from 'electron'
|
||||
import { AuthApi } from '@/api/setting/auth'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@ -478,9 +384,9 @@ const getAuthCode = async () => {
|
||||
const res = await AuthApi.authInfo()
|
||||
authInfo.value.license_code = res.data
|
||||
}
|
||||
setTimeout(() => {
|
||||
getAuthCode()
|
||||
}, 5000)
|
||||
// setTimeout(() => {
|
||||
// getAuthCode()
|
||||
// }, 8000)
|
||||
//复制
|
||||
|
||||
const copy = async (text) => {
|
||||
@ -491,14 +397,28 @@ const copy = async (text) => {
|
||||
ElMessage.error('复制失败')
|
||||
}
|
||||
}
|
||||
|
||||
let isSeverInit = ipcRenderer.sendSync('judgment-isSeverInit');
|
||||
// 如果服务端未初始化,等待初始化完成
|
||||
if (isSeverInit) {
|
||||
if (!router.currentRoute.value.query.type) {
|
||||
setTimeout(() => {
|
||||
getAuthCode()
|
||||
getAuthInfo()
|
||||
}, 5000)
|
||||
} else {
|
||||
isAuth.value = false
|
||||
}
|
||||
}
|
||||
else {
|
||||
ipcRenderer.once('program-init', () => {
|
||||
if (!router.currentRoute.value.query.type) {
|
||||
getAuthCode()
|
||||
getAuthInfo()
|
||||
} else {
|
||||
isAuth.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
// 添加过渡样式
|
||||
@ -875,8 +795,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
align-items: center;
|
||||
margin: 15px 0;
|
||||
|
||||
.select {
|
||||
}
|
||||
.select {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -913,6 +832,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//授权
|
||||
.auth_info {
|
||||
width: 100%;
|
||||
@ -964,8 +884,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
z-index: 99;
|
||||
background: linear-gradient(0deg, #00ffff33 0%, #00ffff00 100%), rgba(0, 0, 0, 0.6);
|
||||
border: 1.5px solid;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%)
|
||||
1;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%) 1;
|
||||
text-align: left;
|
||||
font-family: 'sy-boldface';
|
||||
}
|
||||
@ -1227,8 +1146,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
align-items: center;
|
||||
margin: 15px 0;
|
||||
|
||||
.select {
|
||||
}
|
||||
.select {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1241,6 +1159,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
width: 166px;
|
||||
height: 40px;
|
||||
border-radius: 0;
|
||||
|
||||
::v-deep span {
|
||||
font-weight: 500;
|
||||
}
|
||||
@ -1264,6 +1183,7 @@ if (!router.currentRoute.value.query.type) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .el-popper {
|
||||
z-index: 9999 !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user