Compare commits

...

6 Commits

Author SHA1 Message Date
qingjiao
5627b466bf 20260421 2026-04-21 09:38:24 +08:00
qingjiao
bc09fd7b6e 20260420 2026-04-20 18:10:39 +08:00
qingjiao
34a9cadc02 20260418 2026-04-18 17:54:13 +08:00
qingjiao
1eeca994ab 20260418 2026-04-18 14:06:33 +08:00
qingjiao
1ed30f7ebe 20260417 2026-04-17 18:03:29 +08:00
qingjiao
714dd6de29 20260325 2026-03-25 16:47:40 +08:00
15 changed files with 302 additions and 111 deletions

1
git Normal file
View File

@ -0,0 +1 @@
git commit -m "20260418" --no-verify

View File

@ -109,7 +109,7 @@
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": ""
} }
}, },
"repository": { "repository": {

View File

@ -2,7 +2,7 @@
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect"> <span v-if="item.redirect==='noRedirect'||index === levelList.length - 1" class="no-redirect">
{{ generateTitle(item.meta.title) }} {{ generateTitle(item.meta.title) }}
</span> </span>
<a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a> <a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a>

View File

@ -11,7 +11,7 @@ export default {
factorySetting: 'System Management', factorySetting: 'System Management',
profile: 'Profile', profile: 'Profile',
urlTitle: 'Network Broadcast Terminal', urlTitle: 'Network Broadcast Terminal',
operationLog: 'Operation Log' operationLog: 'Operation Log',
}, },
navbar: { navbar: {
dashboard: 'Dashboard', dashboard: 'Dashboard',
@ -25,22 +25,22 @@ export default {
logIn: 'Login', logIn: 'Login',
register: 'Register', register: 'Register',
logCancel: 'Cancel', logCancel: 'Cancel',
username: 'UserName', username: 'Username',
password: 'Password', password: 'Password',
any: 'any', any: 'any',
thirdparty: 'Or connect with', thirdparty: 'Or connect with',
thirdpartyTips: thirdpartyTips:
'Can not be simulated on local, so please combine you own business simulation! ! !', 'Can not be simulated on local, so please combine you own business simulation!',
confirmLogout: 'Confirm Logout', confirmLogout: 'Confirm Logout',
loggedOut: loggedOut:
'You have been logged out, you can cancel to stay on this page or log in again!', 'You have been logged out, you can cancel to stay on this page or log in again!',
toLogin: 'To Login', toLogin: 'To Login',
changePassword: 'Change Password', changePassword: 'Change Password',
changePasswordTip: changePasswordTip:
'Detected that the password is too weak or has expired. Please modify the password before logging in', 'Detected that the password is too weak or has expired. Please modify the password before logging in.',
changePasswordMsg: changePasswordMsg:
'Password expired, please modify the password before logging in!', 'Password expired, please modify the password before logging in.',
upDateMsg: 'Firmware is being upgraded, please wait for a while。' upDateMsg: 'Firmware is being updated, please wait for a while.'
}, },
table: { table: {
productName: 'Product Name', productName: 'Product Name',
@ -51,20 +51,20 @@ export default {
deviceIP: 'Terminal IP', deviceIP: 'Terminal IP',
gatewal: 'Gateway', gatewal: 'Gateway',
suonetMask: 'Subnet Mask', suonetMask: 'Subnet Mask',
storageSpaces: 'Storage Spaces', storageSpaces: 'Storage Capacity',
serverIP: 'Server IP', serverIP: 'Server IP',
corverCommandDort: 'Server Command Port', corverCommandDort: 'Server Port',
deviceCommandPort: 'Terminal Command Port', deviceCommandPort: 'Terminal Port',
deviceStreamPort: 'Terminal Code Stream Port', deviceStreamPort: 'Terminal Stream Port',
macAddress: 'MAC Address', macAddress: 'MAC Address',
serverPort: 'Server Port', serverPort: 'Server Port',
isEmpty: ' cannot be empty', isEmpty: ' cannot be empty.',
isRight: ' is invalid.', isRight: ' is invalid.',
isRight1: ' is out of range (10000-49999).', isRight1: ' is out of range (10000-49999).',
isRight2: ' is out of range (1000-9999).', isRight2: ' is out of range (1000-9999).',
isRight3: ' is out of range (1-9999).', isRight3: ' is out of range (1-9999).',
open: 'Enable', open: 'Enable',
close: 'Disable', close: 'Close',
save: 'Save', save: 'Save',
submit: 'Submit', submit: 'Submit',
toTop: 'Back to top', toTop: 'Back to top',
@ -77,8 +77,8 @@ export default {
factorySettings: 'Restore Factory Settings', factorySettings: 'Restore Factory Settings',
routerRestart: 'Reboot The Device', routerRestart: 'Reboot The Device',
SIPserver: 'SIP Server IP', SIPserver: 'SIP Server IP',
SIPUserName: 'SIP UserName', SIPUserName: 'SIP Username',
SIPPassword: 'SIP PassWord', SIPPassword: 'SIP Password',
programTip: programTip:
'Tip: the total size of uploaded files cannot exceed the capacity of the device storage space!', 'Tip: the total size of uploaded files cannot exceed the capacity of the device storage space!',
firmwareUpdateTip: firmwareUpdateTip:
@ -86,12 +86,12 @@ export default {
factoryTip: factoryTip:
'After returning to the factory setting, the configuration of the device will return to the factory state. Please use with caution!', 'After returning to the factory setting, the configuration of the device will return to the factory state. Please use with caution!',
routerRestartTips: routerRestartTips:
'The device is about to reboot. Are you sure to continue', 'The device is about to reboot. Are you sure to continue!',
programDeteleTip: 'Confirm to delete this file', programDeteleTip: 'Confirm to delete this file!',
logDeteleTip: 'Confirm to delete this log', logDeteleTip: 'Confirm to delete this log!',
freeSpace: 'Free Space', freeSpace: 'Available Space',
chooseFile: 'Upgrade File', chooseFile: 'Upgrade File',
microphoneSwitch: 'Microphone Switch', microphoneSwitch: 'Microphone Input',
factorySettingsTips: factorySettingsTips:
'The default IP address of the device in the factory state is 192.168.1.108. After the restoration, you need to log in again.', 'The default IP address of the device in the factory state is 192.168.1.108. After the restoration, you need to log in again.',
fileUpload: 'File uploading...', fileUpload: 'File uploading...',
@ -142,13 +142,13 @@ export default {
fileSurplusSizeTip: 'Insufficient remaining storage space', fileSurplusSizeTip: 'Insufficient remaining storage space',
upDateTip: 'Please select a file before upgrading!', upDateTip: 'Please select a file before upgrading!',
audio: 'Audio Format', audio: 'Audio Format',
playStatus: 'Playing status', playStatus: 'Status',
aoVol: 'Play Volume', aoVol: 'Play Volume',
aiVol: 'Recording Volume', aiVol: 'Recording Volume',
auth: 'Authentication', auth: 'Authentication',
httpAuth: 'Http Authentication', httpAuth: 'HTTP Authentication',
warningTitle: 'Alarm File', warningTitle: 'Alarm File',
warningFormTitle: 'AlarmIn', warningFormTitle: 'AlarmIn',
@ -165,10 +165,10 @@ export default {
sleCode: 'Login expired, please login again.', // 402code sleCode: 'Login expired, please login again.', // 402code
lllCode: 'The password is too weak, please change it.', // 600code lllCode: 'The password is too weak, please change it.', // 600code
llyCode: 'The firmware is being updated, please wait.', // 601code llyCode: 'The firmware is being updated, please wait.', // 601code
lleCode: '用户登录名称/密码错误.', // 602code lleCode: 'The username or password is incorrect.', // 602code
llsCode: 'Too many failed login attempts, the account has been locked (30 minutes).', // 603code llsCode: 'Too many failed login attempts, the account has been locked (30 minutes).', // 603code
llssCode: 'The account has been logged in elsewhere. Do you want to force logout?.', // 604code llssCode: 'The account has been logged in elsewhere. Do you want to force login?', // 604code
lylCode: 'The old password is wrong.', // 610code lylCode: 'The old password is incorrect.', // 610code
lyyCode: 'The new password must be different from the old password.', // 611code lyyCode: 'The new password must be different from the old password.', // 611code
lelCode: 'The file upload failed because it cannot be played.', // 620code lelCode: 'The file upload failed because it cannot be played.', // 620code
leyCode: 'The file upload failed because a file with the same name already exists.', // 621code leyCode: 'The file upload failed because a file with the same name already exists.', // 621code
@ -177,19 +177,27 @@ export default {
lessCode: 'Failed to rename, please avoid using special characters.', // 624Code lessCode: 'Failed to rename, please avoid using special characters.', // 624Code
lewCode: 'Failed to delete, because the file is playing.', // 625Code lewCode: 'Failed to delete, because the file is playing.', // 625Code
lslCode: '节目文件开始播放失败,节目已在播放中.', // 630code lslCode: 'Failed to start playing, because the file is already playing.', // 630code
lsyCode: '节目文件停止播放失败,节目未在播放中.', // 631code lsyCode: 'Failed to stop playing, because the file is not playing.', // 631code
lsslCode: 'The firmware update has not started.', // 640code lsslCode: 'The firmware update has not started.', // 640code
lssyCode: 'The firmware is being updated, please wait.', // 641code lssyCode: 'The firmware is being updated, please wait.', // 641code
lsseCode: 'The firmware update completed, the device will reboot soon.', // 642code lsseCode: 'The firmware update completed, the device will reboot soon.', // 642code
lssCode: 'Failed to update the firmware, because the file cannot be parsed.', // 643code lssCode: 'Failed to update the firmware, because the file cannot be parsed.', // 643code
lsssCode: 'Failed to update the firmware, because the file version is too low.', // 644code lsssCode: 'Failed to update the firmware, because the file version is too low.', // 644code
WAN_IP_AddressIP: 'WAN DomainName', WAN_IP_AddressIP: 'NAT DomainName',
WAN_IP_Address: 'WAN IP address', WAN_IP_Address: 'NAT IP address',
WAN_IP_DomainName: 'WAN domain name', WAN_IP_DomainName: 'NAT domain name',
WAN_IP_Type: 'WAN Type', WAN_IP_Type: 'NAT Type',
WAN_Port: 'WAN Port', WAN_Port: 'NAT Port',
WAN_RTSP_Port: 'WAN RTSP Port' WAN_RTSP_Port: 'NAT RTSP Port',
httpPort: 'HTTP Port',
webPort: 'Web Port',
rtspPort: 'RTSP Port',
rtpPort: 'RTP Port',
portConflict: ' Conflict',
PortNumbersCannotBeTheSame: 'The ports cannot be the same',
SIP_Port:'SIP Port',
SIP_RTP_Port:'SIP RTP Port'
}, },
theme: { theme: {
change: 'Change Theme', change: 'Change Theme',
@ -218,20 +226,20 @@ export default {
password2: 'Confirm Password', password2: 'Confirm Password',
update: 'Update', update: 'Update',
oldPassword: 'Please enter your old password', oldPassword: 'Please enter your old password',
newPassword: 'Please enter a new password', newPassword: 'Please enter a new password!',
newPassword2: 'Please enter the new password again', newPassword2: 'Please enter the new password again!',
passwordDifferent: 'The two password entered is inconsistent', passwordDifferent: 'The two password entered is inconsistent!',
newAndOldPassword: newAndOldPassword:
'Operation exception: the new password is the same as the old password', 'Operation exception: the new password is the same as the old password.',
updatePasswordSuccess: 'User password updated successfully', updatePasswordSuccess: 'Password updated successfully.',
passwordLengthError: 'Enter a password of at least 8 digits', passwordLengthError: 'Enter a password of at least 8 digits.',
passwordStrongError: passwordStrongError:
'The Password strength is insufficient. Please ensure that the length is at least 8 digits and at most 16 digits, and must contain at least three of numbers, Minuscule, uppercase letters, and special symbols!', 'The Password strength is insufficient. Please ensure that the length is at least 8 digits and at most 16 digits, and must contain at least three of numbers, Minuscule, uppercase letters, and special symbols!',
confirmPassword: 'Confirm Password', confirmPassword: 'Confirm Password',
inputusername: 'Please enter your username!', inputusername: 'Please enter the username!',
inputpassword: 'Please enter the password', inputpassword: 'Please enter the password!',
inputpassword2: 'Please enter the password again', inputpassword2: 'Please enter the password again!',
registerSuccess: 'User registration successful', registerSuccess: 'User registration successful!',
gologin: 'Do you want to login' gologin: 'Do you want to login?'
} }
} }

View File

@ -11,7 +11,7 @@ export default {
factorySetting: 'Sistema', factorySetting: 'Sistema',
profile: 'Usuário', profile: 'Usuário',
urlTitle: 'Corneta Khomp', urlTitle: 'Corneta Khomp',
operationLog: 'Registros' operationLog: 'Registros',
}, },
navbar: { navbar: {
dashboard: 'Configurações', dashboard: 'Configurações',
@ -63,7 +63,7 @@ export default {
isRight2: 'está fora do intervalo (1000-9999).', isRight2: 'está fora do intervalo (1000-9999).',
isRight3: 'está fora do intervalo (1-9999).', isRight3: 'está fora do intervalo (1-9999).',
open: 'Ativar', open: 'Ativar',
close: 'Desativar', close: 'Fechar',
save: 'Salvar', save: 'Salvar',
submit: 'Enviar', submit: 'Enviar',
toTop: 'Voltar ao topo', toTop: 'Voltar ao topo',
@ -184,12 +184,20 @@ export default {
lsseCode: 'A atualização do firmware foi concluída, o dispositivo será reiniciado em breve.', // 642code lsseCode: 'A atualização do firmware foi concluída, o dispositivo será reiniciado em breve.', // 642code
lssCode: 'Falha ao atualizar o firmware, porque o arquivo não pode ser analisado.', // 643code lssCode: 'Falha ao atualizar o firmware, porque o arquivo não pode ser analisado.', // 643code
lsssCode: 'Falha ao atualizar o firmware, porque a versão do arquivo é muito baixa.', // 644code lsssCode: 'Falha ao atualizar o firmware, porque a versão do arquivo é muito baixa.', // 644code
WAN_IP_AddressIP: 'Nome de domínio de rede ampla', WAN_IP_AddressIP: 'Endereço IP NAT',
WAN_IP_Address: 'Endereço IP de rede ampla', WAN_IP_Address: 'Endereço IP NAT',
WAN_IP_DomainName: 'Nome de domínio de rede de longa distância', WAN_IP_DomainName: 'nome de domínio NAT',
WAN_IP_Type: 'Formato de rede de longa distância', WAN_IP_Type: 'Tipo de NAT',
WAN_Port: 'Número da porta pública', WAN_Port: 'Porta NAT',
WAN_RTSP_Port: 'Porta RTSP pública' WAN_RTSP_Port: 'RTSP Porta NAT',
httpPort: 'Porta HTTP',
webPort: 'Porta WEB',
rtspPort: 'Porta RTSP',
rtpPort: 'Porta RTP',
portConflict: ' Conflito',
PortNumbersCannotBeTheSame: 'As portas não podem ser iguais',
SIP_Port:'Porta SIP',
SIP_RTP_Port:'Porta SIP RTP',
}, },
theme: { theme: {
change: 'Mudar Tema', change: 'Mudar Tema',

View File

@ -181,7 +181,15 @@ export default {
WAN_IP_DomainName: '广域网域名', WAN_IP_DomainName: '广域网域名',
WAN_IP_Type: '广域网格式', WAN_IP_Type: '广域网格式',
WAN_Port: '公网端口号', WAN_Port: '公网端口号',
WAN_RTSP_Port: '公网RTSP端口号' WAN_RTSP_Port: '公网RTSP端口号',
httpPort: 'http端口',
webPort: 'Web端口',
rtspPort: 'RTSP端口',
rtpPort: 'RTP端口',
portConflict: ' 冲突',
PortNumbersCannotBeTheSame: '端口号不能相同',
SIP_Port:'SIP端口',
SIP_RTP_Port:'SIP RTP端口',
}, },
theme: { theme: {
change: '换肤', change: '换肤',

View File

@ -56,6 +56,9 @@ export default {
// TODO: refactor with render function // TODO: refactor with render function
this.onlyOneChild = null this.onlyOneChild = null
return {} return {}
},
mounted() {
}, },
methods: { methods: {
hasOneShowingChild(children = [], parent) { hasOneShowingChild(children = [], parent) {

View File

@ -12,7 +12,12 @@
:collapse-transition="false" :collapse-transition="false"
mode="vertical" mode="vertical"
> >
<sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" /> <sidebar-item
v-for="route in filteredRoutes"
:key="route.path"
:item="route"
:base-path="route.path"
/>
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
</div> </div>
@ -26,11 +31,21 @@ import variables from '@/styles/variables.scss'
export default { export default {
components: { SidebarItem, Logo }, components: { SidebarItem, Logo },
mounted(){
console.log(this.permission_routes);
// if(this.alarmPage === 'off'){
//
// }
},
computed: { computed: {
...mapGetters([ ...mapGetters([
'permission_routes', 'permission_routes',
'sidebar' 'sidebar',
'alarmPage'
]), ]),
filteredRoutes() {
return this.permission_routes
},
activeMenu() { activeMenu() {
const route = this.$route const route = this.$route
const { meta, path } = route const { meta, path } = route

View File

@ -29,6 +29,7 @@
import ScrollPane from './ScrollPane' import ScrollPane from './ScrollPane'
import { generateTitle } from '@/utils/i18n' import { generateTitle } from '@/utils/i18n'
import path from 'path' import path from 'path'
import { mapGetters } from 'vuex'
export default { export default {
components: { ScrollPane }, components: { ScrollPane },
@ -42,6 +43,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters([
'alarmPage'
]),
visitedViews() { visitedViews() {
return this.$store.state.tagsView.visitedViews return this.$store.state.tagsView.visitedViews
}, },

View File

@ -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)) {

View File

@ -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)
setLoginData(data) setLoginData(data)
}, },
SET_KEY: (state, key) => { SET_KEY: (state, key) => {
@ -55,7 +56,10 @@ const actions = {
commit('SET_TOKEN', data.token) commit('SET_TOKEN', data.token)
commit('SET_NAME', username) commit('SET_NAME', username)
data.menuRole = 1 data.menuRole = 1
if (data.alarmPage === 'off') data.menuRole = 2 if (data.alarmPage !== 'off') {
data.menuRole = 2
// console.log('data.alarmPage',data.alarmPage)
}
commit('SET_LOGIN_DATA', data) commit('SET_LOGIN_DATA', data)
if (response.code === 200) { if (response.code === 200) {
resolve() resolve()

View File

@ -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() {

View File

@ -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"
@ -44,14 +48,6 @@
<el-form-item :label="$t('table.deviceStreamPort')"> <el-form-item :label="$t('table.deviceStreamPort')">
<el-input v-model="formUDPData.corestreamPort" /> <el-input v-model="formUDPData.corestreamPort" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('table.httpAuth')">
<el-radio v-model="formUDPData.httpApiAuth" label="on">{{
$t("table.open")
}}</el-radio>
<el-radio v-model="formUDPData.httpApiAuth" label="off">{{
$t("table.close")
}}</el-radio>
</el-form-item>
<el-form-item label="SSH"> <el-form-item label="SSH">
<el-radio v-model="formUDPData.ssh" label="on">{{ <el-radio v-model="formUDPData.ssh" label="on">{{
$t("table.open") $t("table.open")
@ -100,9 +96,15 @@
<svg-icon :icon-class="sip2PasswordType === 'password' ? 'eye' : 'eye-open'" /> <svg-icon :icon-class="sip2PasswordType === 'password' ? 'eye' : 'eye-open'" />
</span> </span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('table.SIP_Port')">
<el-input v-model="formSIPData.sipPort" type="number" :min="1" :max="65535"/>
</el-form-item>
<el-form-item :label="$t('table.SIP_RTP_Port')">
<el-input v-model="formSIPData.sipRtpPort" type="number" :min="1" :max="65535"/>
</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"
@ -144,7 +146,7 @@
<el-select <el-select
v-model="formONVIFData.rtspAudioType" v-model="formONVIFData.rtspAudioType"
style="width:350px;" style="width:350px;"
placeholder="请选择" placeholder="Please select"
@change="selectChange" @change="selectChange"
> >
<el-option <el-option
@ -163,6 +165,12 @@
$t("table.close") $t("table.close")
}}</el-radio> }}</el-radio>
</el-form-item> </el-form-item>
<el-form-item :label="$t('table.rtspPort')">
<el-input v-model="formONVIFData.rtspPort" type="number" :min="0" :max="65535" />
</el-form-item>
<el-form-item :label="$t('table.rtpPort')">
<el-input v-model="formONVIFData.rtpPort" type="number" :min="0" :max="65535" />
</el-form-item>
<el-form-item :label="$t('table.WAN_IP_Type')"> <el-form-item :label="$t('table.WAN_IP_Type')">
<el-select <el-select
v-model="formONVIFData.wanType" v-model="formONVIFData.wanType"
@ -190,6 +198,28 @@
<el-input v-model="formONVIFData.wanRTSPPort" type="number" :min="0" :max="65535" /> <el-input v-model="formONVIFData.wanRTSPPort" type="number" :min="0" :max="65535" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form
v-show="selectIndex === '3'"
class="detail-form agree-form"
label-width="180px"
label-position="right"
:model="formHTTPData"
>
<el-form-item :label="$t('table.webPort')">
<el-input v-model="formHTTPData.webPort" type="number" :min="0" :max="65535" />
</el-form-item>
<el-form-item :label="$t('table.httpPort')">
<el-input v-model="formHTTPData.httpPort" type="number" :min="0" :max="65535" />
</el-form-item>
<el-form-item :label="$t('table.httpAuth')">
<el-radio v-model="formHTTPData.httpApiAuth" label="on">{{
$t("table.open")
}}</el-radio>
<el-radio v-model="formHTTPData.httpApiAuth" label="off">{{
$t("table.close")
}}</el-radio>
</el-form-item>
</el-form>
<el-button <el-button
type="primary" type="primary"
style="width: 10%; margin-left: 40%;margin-top: 20px;" style="width: 10%; margin-left: 40%;margin-top: 20px;"
@ -205,6 +235,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() {
@ -222,6 +253,10 @@ export default {
{ {
label: 'UDP', label: 'UDP',
key: '0' key: '0'
},
{
label: 'HTTP',
key: '3'
} }
], ],
NetType: [ NetType: [
@ -234,7 +269,7 @@ export default {
key: '1' key: '1'
} }
], ],
selectIndex: '0', selectIndex: '2',
formUDPData: { formUDPData: {
udp: '', udp: '',
id: '', id: '',
@ -243,7 +278,6 @@ export default {
serverPort: '', serverPort: '',
instructPort: '', instructPort: '',
corestreamPort: '', corestreamPort: '',
httpApiAuth: '',
ssh: '' ssh: ''
}, },
formSIPData: { formSIPData: {
@ -253,7 +287,9 @@ export default {
sipAddress: '', sipAddress: '',
sipUsername: '', sipUsername: '',
sipPassword: '', sipPassword: '',
sipPassword2: '' sipPassword2: '',
sipPort: '',
sipRtpPort:''
}, },
formONVIFData: { formONVIFData: {
onvif: '', onvif: '',
@ -270,7 +306,14 @@ export default {
wanOnvifPort: '', wanOnvifPort: '',
wanRTSPPort: '', wanRTSPPort: '',
wanDomainName: '', wanDomainName: '',
wanType: '0' wanType: '0',
rtspPort: '',
rtpPort: ''
},
formHTTPData: {
httpPort: '',
webPort: '',
httpApiAuth: ''
}, },
sipPasswordType: 'password', sipPasswordType: 'password',
@ -282,9 +325,7 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(['udpPage']) // 'on' 'off'
'udpPage'
])
}, },
mounted() { mounted() {
if (this.udpPage === 'off') { if (this.udpPage === 'off') {
@ -343,7 +384,6 @@ export default {
this.formUDPData.serverPort = res.data.serverPort this.formUDPData.serverPort = res.data.serverPort
this.formUDPData.instructPort = res.data.instructPort this.formUDPData.instructPort = res.data.instructPort
this.formUDPData.corestreamPort = res.data.corestreamPort this.formUDPData.corestreamPort = res.data.corestreamPort
this.formUDPData.httpApiAuth = res.data.httpApiAuth
this.formUDPData.ssh = res.data.ssh this.formUDPData.ssh = res.data.ssh
this.formSIPData.sip = res.data.sip this.formSIPData.sip = res.data.sip
@ -354,6 +394,8 @@ export default {
res.data.sipPassword = decryptData(res.data.sipPassword) res.data.sipPassword = decryptData(res.data.sipPassword)
this.formSIPData.sipPassword = res.data.sipPassword this.formSIPData.sipPassword = res.data.sipPassword
this.formSIPData.sipPassword2 = res.data.sipPassword this.formSIPData.sipPassword2 = res.data.sipPassword
this.formSIPData.sipPort = res.data.sipPort
this.formSIPData.sipRtpPort = res.data.sipRtpPort
this.formONVIFData.onvif = res.data.onvif this.formONVIFData.onvif = res.data.onvif
this.formONVIFData.id = res.data.id this.formONVIFData.id = res.data.id
@ -366,6 +408,8 @@ export default {
this.formONVIFData.rtspAudioTypeArr = res.data.rtspAudioTypeArr this.formONVIFData.rtspAudioTypeArr = res.data.rtspAudioTypeArr
this.formONVIFData.rtspAudioType = res.data.rtspAudioType this.formONVIFData.rtspAudioType = res.data.rtspAudioType
this.formONVIFData.onvifAuth = res.data.onvifAuth this.formONVIFData.onvifAuth = res.data.onvifAuth
this.formONVIFData.rtspPort = res.data.rtspPort
this.formONVIFData.rtpPort = res.data.rtpPort
this.formONVIFData.wanIP = res.data.wanIP this.formONVIFData.wanIP = res.data.wanIP
this.formONVIFData.wanOnvifPort = res.data.wanOnvifPort this.formONVIFData.wanOnvifPort = res.data.wanOnvifPort
@ -373,6 +417,11 @@ export default {
this.formONVIFData.wanDomainName = res.data.wanDomainName this.formONVIFData.wanDomainName = res.data.wanDomainName
this.formONVIFData.wanType = res.data.wanType this.formONVIFData.wanType = res.data.wanType
this.formHTTPData.httpApiAuth = res.data.httpApiAuth
this.formHTTPData.httpPort = res.data.httpPort
this.formHTTPData.webPort = res.data.webPort
// console.log('data', res.data)
this.$forceUpdate() this.$forceUpdate()
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
@ -384,7 +433,56 @@ 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') { const ports = [
this.formHTTPData.webPort,
this.formHTTPData.httpPort,
this.formONVIFData.onvifPort,
this.formONVIFData.rtspPort,
this.formONVIFData.rtpPort,
this.formSIPData.sipPort,
this.formSIPData.sipRtpPort
]
console.log('ports', ports)
// 使 HashMap - O(n)
const portNames = ['webPort', 'httpPort', 'onvifPort', 'rtspPort', 'rtpPort', 'sipPort', 'sipRtpPort']
const portMap = new Map()
const conflicts = []
for (let i = 0; i < ports.length; i++) {
const portValue = Number(ports[i])
//
if (ports[i] === '' || ports[i] === null || ports[i] === undefined || isNaN(portValue)) {
continue
}
//
if (portMap.has(portValue)) {
const existingPort = portMap.get(portValue)
conflicts.push({
port1: { name: existingPort.name, value: existingPort.value, index: existingPort.index },
port2: { name: portNames[i], value: ports[i], index: i }
})
} else {
// Map
portMap.set(portValue, { name: portNames[i], value: ports[i], index: i })
}
}
//
if (conflicts.length > 0) {
const conflictMessages = conflicts.map(item =>
`${item.port1.name}(${item.port1.value}) & ${item.port2.name}(${item.port2.value})`
)
this.$message({
type: 'warning',
message: this.$i18n.t('table.PortNumbersCannotBeTheSame') + ' : ' + conflictMessages.join(', ')
})
return
}
if (this.selectIndex === '0') {
param = { param = {
...this.formUDPData ...this.formUDPData
} }
@ -444,7 +542,8 @@ export default {
}) })
return return
} }
} else if (this.selectIndex === '1') { }
else if (this.selectIndex === '1') {
param = { param = {
...this.formSIPData ...this.formSIPData
} }
@ -473,7 +572,8 @@ 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
} }
@ -528,8 +628,41 @@ export default {
}) })
return return
} }
if (!param.rtspPort) {
this.$message({
type: 'warning',
message: this.$i18n.t('table.rtspPort') + this.$i18n.t('table.isEmpty')
})
return
} }
console.log(param) if (!param.rtpPort) {
this.$message({
type: 'warning',
message: this.$i18n.t('table.rtpPort') + this.$i18n.t('table.isEmpty')
})
return
}
}
else if (this.selectIndex === '3') {
param = {
...this.formHTTPData
}
if (!param.webPort) {
this.$message({
type: 'warning',
message: this.$i18n.t('table.webPort') + this.$i18n.t('table.isEmpty')
})
return
}
if (!param.httpPort) {
this.$message({
type: 'warning',
message: this.$i18n.t('table.httpPort') + this.$i18n.t('table.isEmpty')
})
return
}
}
// console.log(param)
deviceEdit(param).then((res) => { deviceEdit(param).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$message({ this.$message({
@ -543,10 +676,14 @@ export default {
}) })
} }
}) })
},
changeTab(item, index) {
console.log(item, index)
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.agree-form .el-form-item { .agree-form .el-form-item {
width: 50%; width: 50%;
@ -565,7 +702,6 @@ export default {
z-index: 99; z-index: 99;
} }
} }
.pageCon2{ .pageCon2{
padding-bottom: 120px; padding-bottom: 120px;
} }

View File

@ -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')

View File

@ -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')