20260418
This commit is contained in:
parent
1ed30f7ebe
commit
1eeca994ab
@ -21,7 +21,8 @@ function hasPermission(roles, route) {
|
|||||||
*/
|
*/
|
||||||
export function filterAsyncRoutes(routes, roles) {
|
export function filterAsyncRoutes(routes, roles) {
|
||||||
const res = []
|
const res = []
|
||||||
const data = JSON.parse(getLoginData())?.menuRole || 1
|
const loginData = getLoginData()
|
||||||
|
const data = loginData?.menuRole || 1
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
const tmp = { ...route }
|
const tmp = { ...route }
|
||||||
if (hasPermission(roles, tmp)) {
|
if (hasPermission(roles, tmp)) {
|
||||||
|
|||||||
@ -20,6 +20,7 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
SET_LOGIN_DATA: (state, data) => {
|
SET_LOGIN_DATA: (state, data) => {
|
||||||
state.loginData = data
|
state.loginData = data
|
||||||
|
console.log(state, data.udpPage)
|
||||||
setLoginData(data)
|
setLoginData(data)
|
||||||
},
|
},
|
||||||
SET_KEY: (state, key) => {
|
SET_KEY: (state, key) => {
|
||||||
|
|||||||
@ -15,11 +15,14 @@ export function setToken(token) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getLoginData() {
|
export function getLoginData() {
|
||||||
return Cookies.get(LoginData)
|
const data = Cookies.get(LoginData)
|
||||||
|
return data ? JSON.parse(data) : null
|
||||||
|
// return Cookies.get(LoginData)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setLoginData(data) {
|
export function setLoginData(data) {
|
||||||
return Cookies.set(LoginData, data)
|
// return Cookies.set(LoginData, data)
|
||||||
|
return Cookies.set(LoginData, JSON.stringify(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getKey() {
|
export function getKey() {
|
||||||
|
|||||||
@ -4,15 +4,19 @@
|
|||||||
{{ $t("route.agreement") }}
|
{{ $t("route.agreement") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pageCon pageCon2">
|
<div class="pageCon pageCon2">
|
||||||
<el-tabs v-model="selectIndex" style="margin-top: 15px">
|
<el-tabs
|
||||||
|
v-model="selectIndex"
|
||||||
|
style="margin-top: 15px"
|
||||||
|
>
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="(item, index) in tabOptions"
|
v-for="(item, index) in tabOptions"
|
||||||
:key="index"
|
:key="item.key"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
|
:name="item.key"
|
||||||
/>
|
/>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-form
|
<el-form
|
||||||
v-show="selectIndex === '2'"
|
v-show="selectIndex === '0'"
|
||||||
class="detail-form agree-form"
|
class="detail-form agree-form"
|
||||||
label-width="180px"
|
label-width="180px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
@ -94,7 +98,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form
|
<el-form
|
||||||
v-show="selectIndex === '0'"
|
v-show="selectIndex === '2'"
|
||||||
class="detail-form agree-form"
|
class="detail-form agree-form"
|
||||||
label-width="180px"
|
label-width="180px"
|
||||||
label-position="right"
|
label-position="right"
|
||||||
@ -225,6 +229,7 @@
|
|||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { deviceInfo, deviceEdit } from '@/api/index.js'
|
import { deviceInfo, deviceEdit } from '@/api/index.js'
|
||||||
import { encryptData, decryptData } from '@/utils/encryption/entrypt'
|
import { encryptData, decryptData } from '@/utils/encryption/entrypt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Agreement',
|
name: 'Agreement',
|
||||||
data() {
|
data() {
|
||||||
@ -258,7 +263,7 @@ export default {
|
|||||||
key: '1'
|
key: '1'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
selectIndex: '0',
|
selectIndex: '2',
|
||||||
formUDPData: {
|
formUDPData: {
|
||||||
udp: '',
|
udp: '',
|
||||||
id: '',
|
id: '',
|
||||||
@ -312,9 +317,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters(['udpPage']) // 获取到 'on' 或 'off'
|
||||||
'udpPage'
|
|
||||||
])
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.udpPage === 'off') {
|
if (this.udpPage === 'off') {
|
||||||
@ -408,7 +411,7 @@ export default {
|
|||||||
this.formHTTPData.httpPort = res.data.httpPort
|
this.formHTTPData.httpPort = res.data.httpPort
|
||||||
this.formHTTPData.webPort = res.data.webPort
|
this.formHTTPData.webPort = res.data.webPort
|
||||||
|
|
||||||
console.log('data', res.data)
|
// console.log('data', res.data)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
@ -420,7 +423,7 @@ export default {
|
|||||||
const portRegex = /^(1\d{4}|[2-4]\d{4}|49999)$/
|
const portRegex = /^(1\d{4}|[2-4]\d{4}|49999)$/
|
||||||
const portRegex2 = /^(?:[2-9]\d{0,3}|1\d{0,3}|9999)$/
|
const portRegex2 = /^(?:[2-9]\d{0,3}|1\d{0,3}|9999)$/
|
||||||
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
|
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
|
||||||
if (this.selectIndex === '2') {
|
if (this.selectIndex === '0') {
|
||||||
param = {
|
param = {
|
||||||
...this.formUDPData
|
...this.formUDPData
|
||||||
}
|
}
|
||||||
@ -509,7 +512,7 @@ export default {
|
|||||||
}
|
}
|
||||||
param.sipPassword = encryptData(param.sipPassword)
|
param.sipPassword = encryptData(param.sipPassword)
|
||||||
param.sipPassword2 = encryptData(param.sipPassword2)
|
param.sipPassword2 = encryptData(param.sipPassword2)
|
||||||
} else if (this.selectIndex === '0') {
|
} else if (this.selectIndex === '2') {
|
||||||
param = {
|
param = {
|
||||||
...this.formONVIFData
|
...this.formONVIFData
|
||||||
}
|
}
|
||||||
@ -597,7 +600,7 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(param)
|
// console.log(param)
|
||||||
deviceEdit(param).then((res) => {
|
deviceEdit(param).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -611,6 +614,9 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
changeTab(item, index) {
|
||||||
|
console.log(item, index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,7 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (files.size / 1024 / 1024 > 5) {
|
if (files.size / 1024 / 1024 > 30) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$i18n.t('table.fileSizeTip')
|
message: this.$i18n.t('table.fileSizeTip')
|
||||||
|
|||||||
@ -39,8 +39,8 @@
|
|||||||
v-model="formData.aiVol"
|
v-model="formData.aiVol"
|
||||||
:step="1"
|
:step="1"
|
||||||
:max="10"
|
:max="10"
|
||||||
@change="aiVolChange"
|
|
||||||
style="width: 120px;"
|
style="width: 120px;"
|
||||||
|
@change="aiVolChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.aoVol')" style="margin-left: 12px;">
|
<el-form-item :label="$t('table.aoVol')" style="margin-left: 12px;">
|
||||||
@ -48,8 +48,8 @@
|
|||||||
v-model="formData.aoVol"
|
v-model="formData.aoVol"
|
||||||
:step="1"
|
:step="1"
|
||||||
:max="10"
|
:max="10"
|
||||||
@change="aoVolChange"
|
|
||||||
style="width: 120px;"
|
style="width: 120px;"
|
||||||
|
@change="aoVolChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -255,7 +255,7 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (files.size / 1024 / 1024 > 5) {
|
if (files.size / 1024 / 1024 > 30) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$i18n.t('table.fileSizeTip')
|
message: this.$i18n.t('table.fileSizeTip')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user