fix: bug#18002、17889、17665、17684

* fix: 放开设备区版中运维cpu、jvm

* fix: 添加产品物模型规则TS,添加 tcp粘拆包TS

* fix: bug#17584

* fix: bug#17605、规则属性脚本提示语

* fix: 系统管理菜单管理

* fix: tcp粘拆包TS

* fix: 产品物模型规则TS

* fix: bug#17631、17625、17578

* fix: bug#17631、17625、17578

* fix: 优化jetlinks-ui-components按需引入插件

* fix: bug#17651、17633、视频分享点位bug及样式

* fix: bug#17651、17633、视频分享点位bug及样式

* fix: 视频屏蔽RTC


* fix: bug#17668

* fix: 视频屏蔽RTC

* fix: 修改组件按需引入插件

* fix: bug#17687

 fix: bug#17687

* fix: bug#17715、17705、17699、17696

* fix: bug#17696、17694、17693、17691、17676

* fix: bug#17715、17705、17699、17696

* fix: bug#17758

* fix: 提取ipv4和ipv6校验

* fix: bug#17758

* fix: 社区版优化告警,菜单

fix: 社区版优化告警,菜单

* fix: bug#18002、17889、17665、17684

* fix: bug#17781、17791、17847、17849、17666、17667、17670

* fix: bug#17617

* fix: bug#17665、17684

* fix: bug#17889

* fix: bug#18002
This commit is contained in:
XieYongHong 2023-09-08 19:07:44 +08:00 committed by GitHub
parent fa255488f2
commit ae4354f28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 358 additions and 227 deletions

View File

@ -10,7 +10,7 @@ export const updateMeInfo_api = (data:object) => server.put(`/user/detail`,data)
// 修改登录用户密码
export const updateMepsd_api = (data:object) => server.put(`/user/passwd`,data);
// 第三方账号解绑
export const unBind_api = (appId: string) => server.post(`/application/sso/${appId}/unbind/me`);
export const unBind_api = (appId: string) => server.post(`/application/sso/${appId}/unbind/me`,[]);
/**
*
* @param type

View File

@ -270,6 +270,11 @@ export const queryDeviceMapping = (deviceId: string, data?: any) => server.post(
*/
export const saveDeviceMapping = (deviceId: string, data: any) => server.post(`/edge/operations/${deviceId}/device-mapping-save-batch/invoke`, data)
/**
*
*/
export const deleteDeviceMapping = (deviceId: string, data:any) => server.post(`/edge/operations/${deviceId}/device-mapping-delete/invoke`, data)
/**
*
* @param data
@ -279,7 +284,7 @@ export const getProductListNoPage = (data: any) => server.post('/device/product/
/**
*
*/
export const editDevice = (parmas: any) => server.patch('/device-instance', parmas)
export const editDevice = (params: any) => server.patch('/device-instance', params)
/**
*

View File

@ -88,13 +88,12 @@ const subscribeNotice = () => {
const read = (type: string, data: any) => {
changeStatus_api('_read', [data.payload.id]).then((resp: any) => {
if (resp.status !== 200) return;
notification.close(data.payload.id);
getList();
if (type !== '_read') {
menuStory.routerPush('account/center', {
tabKey: 'StationMessage',
row: data.payload.detail,
row: data.payload,
});
}
});

View File

@ -17,12 +17,12 @@
<j-spin :spinning="loading">
<div class="content">
<j-scrollbar class="list" :max-height="450" v-if="list.length">
<template v-for="i in list" :key="i.id">
<template v-for="(i,index) in list" :key="i.id">
<NoticeItem
:data="i"
:type="item.key"
@action="emits('action')"
@refresh="onRefresh(item.key)"
@refresh="onRefresh(item.key,index)"
/>
</template>
<div
@ -86,6 +86,7 @@ const activeKey = ref<DataType>(props.tabs?.[0]?.key || 'alarm');
const menuStory = useMenuStore();
const route = useRoute();
const type = ref();
const userInfo = useUserInfo();
const getData = (type: string[]) => {
@ -107,6 +108,12 @@ const getData = (type: string[]) => {
termType: 'in',
column: 'topicProvider',
},
{
type: 'and',
value: 'unread',
termType: 'eq',
column: 'state',
},
],
},
],
@ -120,20 +127,21 @@ const getData = (type: string[]) => {
};
const onChange = (_key: string) => {
const type = props.tabs.find((item: any) => item.key === _key)?.type || [];
getData(type);
type.value = props.tabs.find((item: any) => item.key === _key)?.type || [];
getData(type.value);
};
onMounted(async () => {
onChange(props.tabs?.[0]?.key || "alarm");
});
const onRefresh = (id: string) => {
const onRefresh = (id: string,index:number) => {
const flag = cloneDeep(refreshObj.value[id]);
refreshObj.value = {
...refreshObj.value,
[id]: !flag,
};
getData(type.value)
};
const onMore = (key: string) => {

View File

@ -15,4 +15,10 @@ export const CronRegEx = new RegExp(
'^\\s*($|#|\\w+\\s*=|(\\?|\\*|(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?(?:,(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?)*)\\s+(\\?|\\*|(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?(?:,(?:[0-5]?\\d)(?:(?:-|\\/|\\,)(?:[0-5]?\\d))?)*)\\s+(\\?|\\*|(?:[01]?\\d|2[0-3])(?:(?:-|\\/|\\,)(?:[01]?\\d|2[0-3]))?(?:,(?:[01]?\\d|2[0-3])(?:(?:-|\\/|\\,)(?:[01]?\\d|2[0-3]))?)*)\\s+(\\?|\\*|(?:0?[1-9]|[12]\\d|3[01])(?:(?:-|\\/|\\,)(?:0?[1-9]|[12]\\d|3[01]))?(?:,(?:0?[1-9]|[12]\\d|3[01])(?:(?:-|\\/|\\,)(?:0?[1-9]|[12]\\d|3[01]))?)*)\\s+(\\?|\\*|(?:[1-9]|1[012])(?:(?:-|\\/|\\,)(?:[1-9]|1[012]))?(?:L|W)?(?:,(?:[1-9]|1[012])(?:(?:-|\\/|\\,)(?:[1-9]|1[012]))?(?:L|W)?)*|\\?|\\*|(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:-)(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?(?:,(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(?:(?:-)(?:JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?)*)\\s+(\\?|\\*|(?:[0-6])(?:(?:-|\\/|\\,|#)(?:[0-6]))?(?:L)?(?:,(?:[0-6])(?:(?:-|\\/|\\,|#)(?:[0-6]))?(?:L)?)*|\\?|\\*|(?:MON|TUE|WED|THU|FRI|SAT|SUN)(?:(?:-)(?:MON|TUE|WED|THU|FRI|SAT|SUN))?(?:,(?:MON|TUE|WED|THU|FRI|SAT|SUN)(?:(?:-)(?:MON|TUE|WED|THU|FRI|SAT|SUN))?)*)(|\\s)+(\\?|\\*|(?:|\\d{4})(?:(?:-|\\/|\\,)(?:|\\d{4}))?(?:,(?:|\\d{4})(?:(?:-|\\/|\\,)(?:|\\d{4}))?)*))$',
);
export const isCron = (value: string) => CronRegEx.test(value)
export const isCron = (value: string) => CronRegEx.test(value)
//ipv6
export const regIPv6 = new RegExp(/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/);
//ipv4
export const regIpv4 = new RegExp(/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/);

View File

@ -1,3 +1,4 @@
import { regIPv6,regIpv4 } from './regular'
/**
* +
* @param value
@ -24,4 +25,10 @@ export const testIP = (value: string) => {
const ip =
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/;
return ip.test(value);
};
};
/**
* Ipv4和Ipv6的地址
*/
export const testIpv4_6 = (value:string) => {
return regIpv4.test(value) || regIPv6.test(value)
}

View File

@ -5,6 +5,7 @@
visible
@ok="handleClick"
@cancel="handleClose"
:confirmLoading="confirmLoading"
>
<div class="map-tree">
<div class="map-tree-top">
@ -99,6 +100,7 @@ const rightList = ref<any[]>([]);
const dataSource = ref<any[]>([]);
const loading = ref<boolean>(false);
const confirmLoading = ref(false)
const handleData = (data: any[], type: string) => {
data.forEach((item) => {
item.key = item.id;
@ -212,6 +214,7 @@ const _delete = (_key: string) => {
};
const handleClick = async () => {
confirmLoading.value = true
if (!rightList.value.length) {
onlyMessage('请选择采集器', 'warning');
} else {
@ -271,6 +274,7 @@ const handleClick = async () => {
}
}
}
confirmLoading.value = false
};
const handleClose = () => {
_emits('close');

View File

@ -280,7 +280,9 @@ const onSave = async () => {
{ deviceId: resq.result?.id, deviceName: formData.name }
]
}
const res = await saveDeviceMapping(instanceStore.current.id, params)
if(!instanceStore.current.parentId){
const res = await saveDeviceMapping(instanceStore.current.id, params)
}
const submitData = {
deviceId: instanceStore.current.parentId
? instanceStore.current.parentId

View File

@ -113,7 +113,7 @@
<script setup lang="ts">
import moment from 'moment';
import type { ActionsType } from '@/components/Table';
import {query, unbindDevice, unbindBatchDevice, queryByParent} from '@/api/device/instance';
import {query, unbindDevice, unbindBatchDevice, queryByParent , deleteDeviceMapping} from '@/api/device/instance';
import { useInstanceStore } from '@/store/instance';
import { storeToRefs } from 'pinia';
import BindChildDevice from './BindChildDevice/index.vue';
@ -241,6 +241,10 @@ const getActions = (data: Partial<Record<string, any>>): ActionsType[] => {
data.id,
{},
);
const res = await deleteDeviceMapping(
detail.value.id,
{ids:[data.id]}
)
if (resp.status === 200) {
childDeviceRef.value?.reload();
onlyMessage('操作成功!');
@ -282,6 +286,10 @@ const handleUnBind = async () => {
_selectedRowKeys.value,
);
if (resp.status === 200) {
const res = await deleteDeviceMapping(
detail.value.id,
{ids:[_selectedRowKeys.value]}
)
onlyMessage('操作成功!');
cancelSelect();
childDeviceRef.value?.reload();

View File

@ -210,7 +210,6 @@ import PatchMapping from './PatchMapping.vue';
import { onlyMessage } from '@/utils/comm';
import { cloneDeep } from 'lodash-es';
import { usePermissionStore } from '@/store/permission';
const columns = [
{
title: '名称',
@ -313,6 +312,14 @@ const handleSearch = async (_array: any[]) => {
Object.assign(item, metadataId);
return item
})
resp.result?.[0].forEach((item:any)=>{
const differ = array.every((i:any)=>{
return item.metadataId !== i.metadataId
})
if(!differ){
array.push(item)
}
})
// const array = resp.result?.[0].reduce((x: any, y: any) => {
// const metadataId = _metadata.find(
// (item: any) => item.metadataId === y.metadataId,
@ -324,6 +331,7 @@ const handleSearch = async (_array: any[]) => {
// }
// return x;
// }, _metadata);
console.log(array)
modelRef.dataSource = array;
}
}

View File

@ -272,6 +272,10 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
title: '说明',
dataIndex: 'description',
type: 'text',
form: {
rules: [
{ max: 20, message: '最多可输入20个字符' },
]},
doubleClick(record) {
if (isExtendsProduct(record.id, productNoEdit?.value, 'description')) {
return false
@ -370,6 +374,10 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
title: '说明',
dataIndex: 'description',
type: 'text',
form: {
rules: [
{ max: 20, message: '最多可输入20个字符' },
]},
doubleClick(record) {
if (isExtendsProduct(record.id, productNoEdit?.value, 'description')) {
return false
@ -573,6 +581,10 @@ export const useColumns = (type?: MetadataType, target?: 'device' | 'product', n
title: '说明',
dataIndex: 'description',
type: 'text',
form: {
rules: [
{ max: 20, message: '最多可输入20个字符' },
]},
doubleClick(record) {
if (isExtendsProduct(record.id, productNoEdit?.value, 'description')) {
return false

View File

@ -37,7 +37,7 @@
<AIcon type="EditOutlined" />
</j-button>
</j-popconfirm-modal>
<j-dropdown v-if="myValue === 'rule' && target === 'device' && showReset" :getPopupContainer="(triggerNode) => triggerNode.parentNode">
<j-dropdown v-if="myValue === 'rule' && target === 'device' && showReset" :getPopupContainer="(node) => fullRef || node" placement="bottom">
<span style="width: 20px;" @click.prevent>
<AIcon type="MoreOutlined" />
</span>
@ -100,7 +100,13 @@ import { resetRule } from '@/api/device/instance';
import { updata } from '@/api/rule-engine/configuration';
import { onlyMessage } from '@/utils/comm';
import { provide } from 'vue';
import { queryDeviceVirtualProperty } from '@/api/device/instance';
import {
queryProductVirtualProperty
} from '@/api/device/product';
import { useProductStore } from '@/store/product';
const instanceStore = useInstanceStore();
const productStore = useProductStore();
const PropertySource: { label: string; value: string }[] = isNoCommunity
? [
{
@ -133,6 +139,7 @@ type Emit = {
(e: 'update:value', data: Record<string, any>): void;
};
const fullRef = inject(FULL_CODE);
const showReset = ref(false);
const props = defineProps({
@ -243,6 +250,32 @@ const cancel = () => {
type.value = props.value?.expands?.type || [];
}
const handleSearch = async () => {
let resp: any = undefined;
if (props.target === 'product') {
resp = await queryProductVirtualProperty(
productStore.current?.id,
props.value?.id,
);
} else {
resp = await queryDeviceVirtualProperty(
instanceStore.current?.productId,
instanceStore.current?.id,
props.value?.id,
);
}
if (resp && resp.status === 200 && resp.result) {
const _triggerProperties = props.value?.expands?.virtualRule?.triggerProperties?.length ? props.value?.expands?.virtualRule?.triggerProperties : resp.result.triggerProperties
updateValue({
source: myValue.value,
virtualRule:{
triggerProperties: _triggerProperties?.length ? _triggerProperties : ['*'],
...resp.result.rule
}
});
}
};
watch(
() => props.value,
() => {
@ -261,6 +294,7 @@ onMounted(()=>{
item === props.value?.id ? showReset.value = true : ''
})
}
handleSearch()
})
</script>

View File

@ -43,6 +43,7 @@
:actions="getActions(slotProps, 'card')"
:status="slotProps.state?.value"
:statusText="slotProps.state?.text"
@click="handleView(slotProps.id)"
:statusNames="{
online: 'processing',
offline: 'error',
@ -63,7 +64,6 @@
<Ellipsis style="width: calc(100% - 100px)">
<span
style="font-size: 16px; font-weight: 600"
@click.stop="handleView(slotProps.id)"
>
{{ slotProps.name }}
</span>
@ -101,7 +101,7 @@
:key="i"
>
<PermissionButton
:disabled="o.disabled"
:disabled="o.disabled || item.state !== 'online'"
:popConfirm="o.popConfirm"
:tooltip="{
...o.tooltip,
@ -470,7 +470,7 @@ const getActions = (
},
icon: 'RedoOutlined',
popConfirm: {
title: '确认重置密码为P@ssw0rd',
title: '确认重置密码为Jetlinks123',
onConfirm: async () => {
restPassword(data.id).then((resp: any) => {
if (resp.status === 200) {

View File

@ -107,6 +107,7 @@
v-model:value="modalForm.publicPort"
placeholder="请输入公网端口"
style="width: 100%"
:precision="0"
/>
</j-form-item>
</j-col>
@ -131,6 +132,7 @@ import {
} from '@/api/initHome';
import { modalState } from '../data/interface';
import type { Rule } from 'ant-design-vue/es/form';
import { testIpv4_6 } from '@/utils/validate';
const formRef = ref();
/**
* 初始化数据状态
@ -143,6 +145,7 @@ const visible = ref<boolean>(false);
const modalForm = reactive<modalState>({
host: '0.0.0.0',
});
/**
* 校验官网地址
*/
@ -150,10 +153,7 @@ const validateUrl = async (_rule: Rule, value: string) => {
if (!value) {
return Promise.reject('请输入公网地址');
} else {
var reg = new RegExp(
/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,
);
if (!reg.test(value)) {
if (!testIpv4_6(value)) {
return Promise.reject('请输入正确的公网地址');
}
return Promise.resolve();

View File

@ -16,7 +16,9 @@ import BaseMenu, { USER_CENTER_MENU_DATA } from '../data/baseMenu'
import { getSystemPermission, updateMenus } from '@/api/initHome';
import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel';
import { isNoCommunity } from '@/utils/utils';
import {
systemVersion,
} from '@/api/login'
/**
* 获取菜单数据
@ -30,7 +32,12 @@ const menuDatas = reactive({
* 查询支持的协议
*/
const getProvidersFn = async () => {
if (!isNoCommunity) {
let version = ''
const req:any =await systemVersion()
if(req.success && req.result){
version = req.result.edition
}
if (version ==='community') {
return undefined
} else {
const res: any = await getProviders();

View File

@ -147,9 +147,8 @@
message: '请输入IP地址',
},
{
pattern:
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
message: '请输入正确的IP地址',
validator:validateUrl,
trigger: 'change',
},
]"
@ -341,10 +340,8 @@
'请输入公网 Host',
},
{
pattern:
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
message:
'请输入正确的IP地址',
validator:validateUrl,
trigger: 'change',
},
]"
>
@ -514,7 +511,8 @@ import { getResourcesCurrent, getClusters } from '@/api/link/accessConfig';
import { update, save } from '@/api/link/accessConfig';
import { onlyMessage } from '@/utils/comm';
import { isNumber } from 'lodash-es';
import type { Rule } from 'ant-design-vue/es/form';
import { testIpv4_6 } from '@/utils/validate';
interface Form2 {
clusterNodeId: string | undefined;
port: string | undefined;
@ -598,6 +596,16 @@ const rules = {
]
}
const validateUrl=async (_rule: Rule, value: string) => {
if (!value) {
return Promise.reject('请输入IP地址');
} else {
if (!testIpv4_6(value)) {
return Promise.reject('请输入正确的IP地址');
}
return Promise.resolve();
}
}
const removeCluster = (item: Form2) => {
let index = dynamicValidateForm.cluster.indexOf(item);
if (index !== -1) {

View File

@ -66,7 +66,7 @@
)
"
>
<j-radio-button :value="true"
<j-radio-button :value="true" :disabled="formData.type ==='MQTT_CLIENT'"
>共享配置</j-radio-button
>
<j-radio-button :value="false"
@ -283,6 +283,11 @@
cluster
.configuration
.port
"
:options="
portOptionsIndex[
index
]
"
placeholder="请选择本地端口"
allowClear
@ -291,7 +296,7 @@
filterPortOption
"
>
<j-select-option
<!-- <j-select-option
v-for="i in getPortList( portOptionsIndex[
index
], cluster
@ -300,7 +305,7 @@
:value="i.value"
>
{{ i.label }}
</j-select-option>
</j-select-option> -->
</j-select>
</j-form-item>
</j-col>
@ -1231,11 +1236,11 @@ const filterPortOption = (input: string, option: any) => {
return JSON.stringify(option.label).indexOf(input) >= 0;
};
const getPortList = (list: any[], id: string) => {
const keys = dynamicValidateForm?.cluster?.map?.(item => item.configuration?.port) || []
// console.log(dynamicValidateForm?.cluster, id, keys)
return (list || []).filter(item => item.value === id || !keys.includes(item.value) )
}
// const getPortList = (list: any[], id: string) => {
// const keys = dynamicValidateForm?.cluster?.map?.(item => item.configuration?.port) || []
// // console.log(dynamicValidateForm?.cluster, id, keys)
// return (list || []).filter(item => item.value === id || !keys.includes(item.value) )
// }
const filterConfigByType = (data: any[], type: string) => {
let _temp = type;
@ -1280,6 +1285,9 @@ const changeType = (value: string) => {
if (value !== 'MQTT_CLIENT') {
const { configuration } = dynamicValidateForm.cluster[0];
value && (configuration.host = '0.0.0.0');
}else{
formData.value.shareCluster = false
changeShareCluster(formData.value.shareCluster)
}
if(value ==='TCP_SERVER'){
getTs().then((res:any)=>{

View File

@ -108,7 +108,7 @@ export const Validator = {
regIpv4: new RegExp(
/^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))\.){3}(([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
),
regIPv6: new RegExp(/^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/),
regIPv6: new RegExp(/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/),
regDomain: new RegExp(
// /^https?:\/\/(([a-zA-Z0-9_-])+(\.)?)*(:\d+)?(\/((\.)?(\?)?=?&?[a-zA-Z0-9_-](\?)?)*)*$/i,
/^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,}$/

View File

@ -570,7 +570,7 @@
<script setup lang="ts">
import { getImage, onlyMessage } from '@/utils/comm';
import CascadeApi from '@/api/media/cascade';
import { regIPv6 } from '@/utils/regular'
const router = useRouter();
const route = useRoute();
@ -674,6 +674,8 @@ onMounted(() => {
const regDomain = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\.|$)){4}$/
// /[j-zA-Z0-9][-j-zA-Z0-9]{0,62}(\.[j-zA-Z0-9][-j-zA-Z0-9]{0,62})+\.?/;
const ipv6 = new RegExp(/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/)
/**
* 上级SIP地址 字段验证
* @param _
@ -701,8 +703,8 @@ const checkHost = (host: string, port: string | number | undefined) => {
return Promise.resolve();
} else if (!host) {
return Promise.reject(new Error('请输入IP 地址'));
} else if (host && !regDomain.test(host)) {
return Promise.reject(new Error('请输入0.0.0.0~255.255.255.255的IP地址'));
} else if (host && !regDomain.test(host) && !regIPv6.test(host)) {
return Promise.reject(new Error('请输入正确的IP地址'));
} else if (!port) {
return Promise.reject(new Error('请输入端口'));
} else if ((port && Number(port) < 1) || Number(port) > 65535) {

View File

@ -130,7 +130,7 @@
</template>
</MediaTool>
</div>
<Preset :data="data" @refresh="onRefresh" />
<Preset v-if='data.ptzType.value ===0 || data.ptzType.value === 1' :data="data" @refresh="onRefresh" />
</div>
</div>
<template #footer>

View File

@ -288,7 +288,7 @@ import { queryProviders, queryDetail, save, update } from '@/api/media/stream';
import type { FormInstance } from 'ant-design-vue';
import { FormDataType } from '../type';
import { testIpv4_6 } from '@/utils/validate';
const router = useRouter();
const route = useRoute();
const view = route.query.view as string;
@ -301,10 +301,6 @@ const options = ref([]);
const checked = ref(false);
const Validator = {
regIpv4: new RegExp(
/^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))\.){3}(([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
),
regIPv6: new RegExp(/^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/),
regDomain: new RegExp(
/^https?:\/\/(([a-zA-Z0-9_-])+(\.)?)*(:\d+)?(\/((\.)?(\?)?=?&?[a-zA-Z0-9_-](\?)?)*)*$/i,
),
@ -314,8 +310,7 @@ const Validator = {
const validateAddress = (_rule: any, value: string): Promise<any> =>
new Promise(async (resolve, reject) => {
if (
Validator.regIpv4.test(value) ||
Validator.regIPv6.test(value) ||
testIpv4_6(value) ||
Validator.regDomain.test(value)
) {
return resolve('');

View File

@ -86,7 +86,8 @@ import { getImage, onlyMessage } from '@/utils/comm';
import { queryLevel, saveLevel } from '@/api/rule-engine/config';
import { LevelItem } from './typing';
import Io from './Io/index.vue';
const list = ref([
import { isNoCommunity } from '@/utils/utils';
const list = isNoCommunity ?[
{
key: 'config',
tab: '告警级别',
@ -95,7 +96,12 @@ const list = ref([
key: 'io',
tab: '数据流转',
},
]);
] : [
{
key: 'config',
tab: '告警级别',
}
]
let levels = ref<LevelItem[]>([]);
let tab = ref<'io' | 'config' | string>('config');
const getAlarmLevel = () => {

View File

@ -1,176 +1,180 @@
<template>
<page-container>
<div class="manager-container">
<div class="left">
<j-input-search
v-model:value="leftData.searchValue"
placeholder="请输入"
style="margin-bottom: 24px"
/>
<!-- 使用v-if用于解决异步加载数据后不展开的问题 -->
<j-tree
v-if="leftData.treeData.length > 0"
defaultExpandAll
:tree-data="leftData.treeData"
v-model:selectedKeys="leftData.selectedKeys"
@select="onSelect"
:showLine="{ showLeafIcon: false }"
:show-icon="true"
>
<template #title="{ dataRef }">
<div
v-if="dataRef.root"
style="
justify-content: space-between;
display: flex;
align-items: center;
width: 200px;
"
>
<span>
{{ dataRef.title }}
</span>
<AIcon
type="PlusOutlined"
style="color: #1d39c4"
@click="addTable"
/>
</div>
<span v-else>
{{ dataRef.title }}
</span>
</template>
</j-tree>
</div>
<div class="right">
<div class="btns">
<j-button type="primary" @click="clickSave">保存</j-button>
</div>
<j-form ref="formRef" :model="table">
<j-table
:columns="columns"
:dataSource="table.data"
:pagination="false"
:scroll="{ y: 500 }"
<FullPage>
<div class="manager-container">
<div class="left">
<j-input-search
v-model:value="leftData.searchValue"
placeholder="请输入"
style="margin-bottom: 24px"
/>
<!-- 使用v-if用于解决异步加载数据后不展开的问题 -->
<j-tree
v-if="leftData.treeData.length > 0"
defaultExpandAll
:tree-data="leftData.treeData"
v-model:selectedKeys="leftData.selectedKeys"
@select="onSelect"
:showLine="{ showLeafIcon: false }"
:show-icon="true"
>
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'name'">
<j-form-item
:name="['data', index, 'name']"
:rules="[
{
max: 64,
message: '最多可输入64个字符',
},
{
required: true,
message: '请输入名称',
},
]"
<template #title="{ dataRef }">
<Ellipsis>
<div
v-if="dataRef.root"
style="
justify-content: space-between;
display: flex;
align-items: center;
width: 200px;
"
>
<j-input
:disabled="record.old_id"
v-model:value="record.name"
placeholder="请输入名称"
<span>
{{ dataRef.title }}
</span>
<AIcon
type="PlusOutlined"
style="color: #1d39c4"
@click="addTable"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'type'">
<j-form-item
:name="['data', index, 'type']"
:rules="[
{
max: 64,
message: '最多可输入64个字符',
},
{
required: true,
message: '请输入类型',
},
]"
>
<j-input
v-model:value="record.type"
placeholder="请输入类型"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'length'">
<j-form-item :name="['data', index, 'length']">
<j-input-number
v-model:value="record.length"
:min="0"
:max="99999"
style="width: 100%"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'scale'">
<j-form-item :name="['data', index, 'scale']">
<j-input-number
v-model:value="record.scale"
:min="0"
:max="99999"
style="width: 100%"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'notnull'">
<j-form-item
:name="['data', index, 'notnull']"
:rules="[
{
required: true,
message: '请选择是否不能为空',
},
]"
>
<j-radio-group
v-model:value="record.notnull"
button-style="solid"
>
<j-radio-button :value="true"
></j-radio-button
>
<j-radio-button :value="false"
></j-radio-button
>
</j-radio-group>
</j-form-item>
</template>
<template v-else-if="column.key === 'comment'">
<j-form-item :name="['data', index, 'comment']">
<j-input
v-model:value="record.comment"
placeholder="请输入说明"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'action'">
<PermissionButton
hasPermission="system/DataSource:delete"
type="link"
:tooltip="{ title: '删除' }"
:danger="true"
:popConfirm="{
title: `确认删除`,
onConfirm: () =>
clickDel(record, index),
}"
:disabled="record.status"
>
<AIcon type="DeleteOutlined" />
</PermissionButton>
</template>
</div>
<span v-else>
{{ dataRef.title }}
</span>
</Ellipsis>
</template>
</j-table>
</j-form>
</j-tree>
</div>
<div class="right">
<div class="btns">
<j-button type="primary" @click="clickSave">保存</j-button>
</div>
<j-form ref="formRef" :model="table">
<j-table
:columns="columns"
:dataSource="table.data"
:pagination="false"
:scroll="{ y: 500 }"
>
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'name'">
<j-form-item
:name="['data', index, 'name']"
:rules="[
{
max: 64,
message: '最多可输入64个字符',
},
{
required: true,
message: '请输入名称',
},
]"
>
<j-input
:disabled="record.old_id"
v-model:value="record.name"
placeholder="请输入名称"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'type'">
<j-form-item
:name="['data', index, 'type']"
:rules="[
{
max: 64,
message: '最多可输入64个字符',
},
{
required: true,
message: '请输入类型',
},
]"
>
<j-input
v-model:value="record.type"
placeholder="请输入类型"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'length'">
<j-form-item :name="['data', index, 'length']">
<j-input-number
v-model:value="record.length"
:min="0"
:max="99999"
style="width: 100%"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'scale'">
<j-form-item :name="['data', index, 'scale']">
<j-input-number
v-model:value="record.scale"
:min="0"
:max="99999"
style="width: 100%"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'notnull'">
<j-form-item
:name="['data', index, 'notnull']"
:rules="[
{
required: true,
message: '请选择是否不能为空',
},
]"
>
<j-radio-group
v-model:value="record.notnull"
button-style="solid"
>
<j-radio-button :value="true"
></j-radio-button
>
<j-radio-button :value="false"
></j-radio-button
>
</j-radio-group>
</j-form-item>
</template>
<template v-else-if="column.key === 'comment'">
<j-form-item :name="['data', index, 'comment']">
<j-input
v-model:value="record.comment"
placeholder="请输入说明"
/>
</j-form-item>
</template>
<template v-else-if="column.key === 'action'">
<PermissionButton
hasPermission="system/DataSource:delete"
type="link"
:tooltip="{ title: '删除' }"
:danger="true"
:popConfirm="{
title: `确认删除`,
onConfirm: () =>
clickDel(record, index),
}"
:disabled="record.status"
>
<AIcon type="DeleteOutlined" />
</PermissionButton>
</template>
</template>
</j-table>
</j-form>
<j-button class="add-row" @click="addRow">
<AIcon type="PlusOutlined" /> 新增行
</j-button>
<j-button class="add-row" @click="addRow">
<AIcon type="PlusOutlined" /> 新增行
</j-button>
</div>
</div>
</div>
</FullPage>
<j-modal
:visible="true"
v-if="dialog.visible"
@ -495,12 +499,15 @@ const checkName = (_: any, value: any) =>
padding: 24px;
background-color: #fff;
display: flex;
min-height: 500px;
height: 100%;
.left {
flex-basis: 280px;
padding: 0 24px;
box-sizing: border-box;
width:300px;
height:100%;
overflow-y: auto;
}
.right {
width: calc(100% - 280px);

View File

@ -85,7 +85,7 @@ import {
} from '@/utils/consts';
import { protocolList } from '@/utils/consts';
import { getProviders } from '@/api/data-collect/channel';
import { isNoCommunity } from '@/utils/utils';
const selectedKeys: any = ref([]);
const treeData = ref<any>([]);
const systemMenu: any = ref([]);
@ -120,10 +120,14 @@ const params = {
*/
let filterProtocolList: any[] = [];
const getProvidersFn = async () => {
const res: any = await getProviders();
filterProtocolList = protocolList.filter((item) => {
if(!isNoCommunity){
return
}else{
const res: any = await getProviders();
filterProtocolList = protocolList.filter((item) => {
return res.result?.find((val: any) => item.alias == val.id);
})
}
}
getProvidersFn();
function filterTree(nodes: Array<any>, selectedKeys: Array<any>) {

View File

@ -8,7 +8,7 @@
>
<div class="alert">
<AIcon type="InfoCircleOutlined" />
通过角色控制{{ name }}的所有的通知方式可被哪些用户订阅
通过角色控制哪些用户可以订阅{{ name }}下所有的通知方式
</div>
<Role v-model="_selectedRowKeys" :gridColumn="2" />
</j-modal>

View File

@ -63,7 +63,7 @@
<template v-if="current === 4">
<div class="alert">
<AIcon type="InfoCircleOutlined" />
已规定固定收信人的模板在当前页面将被过滤
通过角色控制哪些用户可以订阅从{{ name }}接收到{{ showName }}通知
</div>
<Role type="add" v-model="formModel.grant.role.idList" />
</template>

View File

@ -109,7 +109,7 @@
</j-button>
</j-form-item>
</j-form>
<div class="other">
<div class="other" v-if="bindings.length">
<j-divider plain>
<div class="other-text">
其他登录方式
@ -245,7 +245,7 @@ const codeUrl = ref('');
const codeConfig = ref(false);
const loading = ref(false);
const bindings = ref<any[]>();
const bindings = ref<any[]>([]);
// const basis = ref<any>({});
const defaultImg = getImage('/apply/internal-standalone.png');

View File

@ -97,6 +97,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.163:8844', //张季本地
// target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境
// target: 'http://192.168.32.5:8848', // 刘本地
ws: 'ws://192.168.33.46:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')