new-map
parent
0bfaa3f9b5
commit
3e7dbd90c0
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 139 KiB |
|
|
@ -86,22 +86,23 @@ export const useUserStore = defineStore({
|
|||
params: LoginParams & {
|
||||
goHome?: boolean
|
||||
mode?: ErrorMessageMode
|
||||
homeRouter?: string
|
||||
},
|
||||
): Promise<UserInfo | null> {
|
||||
try {
|
||||
const { goHome = true, mode, ...loginParams } = params
|
||||
const { goHome = true, mode, homeRouter, ...loginParams } = params
|
||||
const data = await loginApi(loginParams, mode)
|
||||
const { token } = data
|
||||
this.setToken(token)
|
||||
|
||||
return this.afterLoginAction(goHome)
|
||||
return this.afterLoginAction(goHome, homeRouter)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
||||
return Promise.reject(error)
|
||||
}
|
||||
},
|
||||
async afterLoginAction(goHome?: boolean): Promise<UserInfo | null> {
|
||||
async afterLoginAction(goHome?: boolean, homeRouter?: string): Promise<UserInfo | null> {
|
||||
if (!this.getToken) return null
|
||||
const userInfo = await this.getUserInfoAction()
|
||||
|
||||
|
|
@ -118,7 +119,7 @@ export const useUserStore = defineStore({
|
|||
router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw)
|
||||
permissionStore.setDynamicAddedRoute(true)
|
||||
}
|
||||
goHome && (await router.replace(PageEnum.BASE_HOME))
|
||||
goHome && (await router.replace(homeRouter ?? PageEnum.BASE_HOME))
|
||||
}
|
||||
return userInfo
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@
|
|||
|
||||
<FormItem class="enter-x">
|
||||
<Button type="primary" size="large" block @click="handleLogin" :loading="loading">
|
||||
{{ t('sys.login.loginButton') }}
|
||||
登录后台
|
||||
</Button>
|
||||
<Button size="large" class="mt-4" block @click="handleLogin('/v')" :loading="loading">
|
||||
登录大屏
|
||||
</Button>
|
||||
<!-- <Button size="large" class="mt-4 enter-x" block @click="handleRegister">
|
||||
{{ t('sys.login.registerButton') }}
|
||||
|
|
@ -129,7 +132,7 @@
|
|||
|
||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
||||
|
||||
async function handleLogin() {
|
||||
async function handleLogin(e) {
|
||||
const data = await validForm()
|
||||
if (!data) return
|
||||
try {
|
||||
|
|
@ -138,6 +141,7 @@
|
|||
password: data.password,
|
||||
username: data.account,
|
||||
mode: 'none', //不要默认的错误提示
|
||||
homeRouter: e,
|
||||
})
|
||||
if (userInfo) {
|
||||
notification.success({
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
},
|
||||
})
|
||||
})
|
||||
|
||||
legendData = obj.legendData
|
||||
|
||||
setOptions({
|
||||
|
|
@ -134,7 +135,7 @@
|
|||
series: obj.series,
|
||||
})
|
||||
|
||||
// chartAmi()
|
||||
chartAmi()
|
||||
}
|
||||
|
||||
let timer: any = null
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
getData()
|
||||
}
|
||||
|
||||
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>)
|
||||
const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>)
|
||||
|
||||
async function getData() {
|
||||
const resData = await getMateriel({
|
||||
|
|
@ -72,6 +72,8 @@
|
|||
chartsInit()
|
||||
}
|
||||
|
||||
let legendData = [] as any
|
||||
|
||||
const chartsInit = () => {
|
||||
const obj = {
|
||||
legendData: [] as any,
|
||||
|
|
@ -109,6 +111,8 @@
|
|||
})
|
||||
})
|
||||
|
||||
legendData = obj.legendData
|
||||
|
||||
setOptions({
|
||||
grid: { left: '2%', right: '2%', top: '50px', bottom: '2%', containLabel: true },
|
||||
legend: {
|
||||
|
|
@ -180,6 +184,34 @@
|
|||
],
|
||||
series: obj.series,
|
||||
})
|
||||
|
||||
chartAmi()
|
||||
}
|
||||
|
||||
let timer: any = null
|
||||
function chartAmi() {
|
||||
let index = 0
|
||||
timer && clearInterval(timer)
|
||||
timer = setInterval(() => {
|
||||
const currentIndex = index % legendData.length
|
||||
// getInstance()?.dispatchAction({
|
||||
// type: 'legendUnSelect',
|
||||
// name: legendData[currentIndex],
|
||||
// })
|
||||
|
||||
// getInstance()?.dispatchAction({
|
||||
// type: 'legendSelect',
|
||||
// name: legendData[currentIndex],
|
||||
// })
|
||||
|
||||
getInstance()?.dispatchAction({
|
||||
type: 'showTip',
|
||||
seriesIndex: 0,
|
||||
dataIndex: currentIndex,
|
||||
})
|
||||
|
||||
index++
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
|
|||
|
|
@ -37,11 +37,18 @@
|
|||
</div>
|
||||
<div class="grid grid-cols-3 gap-x-6px my-10px">
|
||||
<div class="h-66px" v-for="item in list" :key="item.id">
|
||||
<VideoFlv
|
||||
<!-- <VideoFlv
|
||||
:url="item.url"
|
||||
:name="item.base_name"
|
||||
:screen="false"
|
||||
@click.prevent.stop="onChangeVideo(item)"
|
||||
/> -->
|
||||
<img
|
||||
:src="item.img"
|
||||
class="object-cover w-full h-full"
|
||||
alt=""
|
||||
srcset=""
|
||||
@click.prevent.stop="onChangeVideo(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -57,6 +64,9 @@
|
|||
import { getAgriculturalDeviceBasic, getDevices } from '/@/api/sys/other'
|
||||
import Box from './Box.vue'
|
||||
import VideoFlv from './VideoFlv.vue'
|
||||
import v01 from '../../../assets/images/v01.png'
|
||||
import v02 from '../../../assets/images/v02.png'
|
||||
import v03 from '../../../assets/images/v03.png'
|
||||
export default defineComponent({
|
||||
components: {
|
||||
Box,
|
||||
|
|
@ -103,13 +113,13 @@
|
|||
type: 1,
|
||||
status: 1,
|
||||
})
|
||||
Data.list = resData.map((e) => {
|
||||
// const { username, passage, ip, port, rtsp_url } = e.extends
|
||||
// const url = `rtsp://${username}:${passage}@${ip}:${port}${rtsp_url}`
|
||||
const url =
|
||||
'rtsp://admin:admin12345@183.222.79.115:9007/cam/realmonitor?channel=1&subtype=0'
|
||||
Data.list = resData.map((e, index) => {
|
||||
const { username, passage, ip, port, rtsp_url } = e.extends
|
||||
const url = `rtsp://${username}:${passage}@${ip}:${port}${rtsp_url}`
|
||||
// const url = 'rtsp://admin:admin12345@183.222.79.115:9007/cam/realmonitor?channel=1&subtype=0'
|
||||
return {
|
||||
...e,
|
||||
img: index == 0 ? v01 : index == 1 ? v02 : index == 2 ? v03 : v01,
|
||||
url: `ws://127.0.0.1:8100/rtsp?url=${window.btoa(url)}`,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -25,11 +25,14 @@
|
|||
|
||||
const { rootEmitter } = useVContext()
|
||||
|
||||
const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>)
|
||||
const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>)
|
||||
|
||||
const visualizationStore = useVisualizationStore()
|
||||
|
||||
let legendData = [] as any
|
||||
|
||||
function chatInit() {
|
||||
legendData = Data.list
|
||||
setOptions({
|
||||
grid: { left: '2%', right: '2%', top: '10%', bottom: '2%', containLabel: true },
|
||||
tooltip: {
|
||||
|
|
@ -97,6 +100,34 @@
|
|||
},
|
||||
],
|
||||
})
|
||||
|
||||
chartAmi()
|
||||
}
|
||||
|
||||
let timer: any = null
|
||||
function chartAmi() {
|
||||
let index = 0
|
||||
timer && clearInterval(timer)
|
||||
timer = setInterval(() => {
|
||||
const currentIndex = index % legendData.length
|
||||
// getInstance()?.dispatchAction({
|
||||
// type: 'legendUnSelect',
|
||||
// name: legendData[currentIndex],
|
||||
// })
|
||||
|
||||
// getInstance()?.dispatchAction({
|
||||
// type: 'legendSelect',
|
||||
// name: legendData[currentIndex],
|
||||
// })
|
||||
|
||||
getInstance()?.dispatchAction({
|
||||
type: 'showTip',
|
||||
seriesIndex: 0,
|
||||
dataIndex: currentIndex,
|
||||
})
|
||||
|
||||
index++
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
async function getData() {
|
||||
|
|
|
|||
|
|
@ -321,4 +321,16 @@
|
|||
.aim-spin {
|
||||
animation: spin 2s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<DZWZ width="440px" height="353px" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 flex ml-15px justify-between bg-[#162126] bg-opacity-60">
|
||||
<div class="flex-1 flex ml-15px justify-between bg-[#162126] bg-opacity-40">
|
||||
<div class="bg-[#10272f] bg-opacity-00">
|
||||
<NYQK />
|
||||
<NCZQS class="mt-20px" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue