diff --git a/package.json b/package.json
index 581ec969..7670fcf5 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"event-source-polyfill": "^1.0.31",
"global": "^4.4.0",
"jetlinks-store": "^0.0.3",
- "jetlinks-ui-components": "^1.0.18",
+ "jetlinks-ui-components": "^1.0.21",
"js-cookie": "^3.0.1",
"less": "^4.1.3",
"less-loader": "^11.1.0",
diff --git a/src/components/Metadata/MetricsParam/index.vue b/src/components/Metadata/MetricsParam/index.vue
index a830add2..5391cd3f 100644
--- a/src/components/Metadata/MetricsParam/index.vue
+++ b/src/components/Metadata/MetricsParam/index.vue
@@ -114,11 +114,11 @@ const handleAdd = () => {
const validateIndicator = (value: any) => {
if (value?.range) {
- if (!value?.value || !value?.value[0] || !value?.value[1]) {
+ if (!value?.value || (!value?.value[0] && value?.value[0] !== 0) || (!value?.value[1] && value?.value[1] !== 0)) {
return Promise.reject(new Error('请输入指标值'));
}
} else {
- if (!value?.value) {
+ if (!value?.value && value?.value !== 0) {
return Promise.reject(new Error('请输入指标值'));
}
}
diff --git a/src/views/account/NotificationSubscription/components/EditDialog.vue b/src/views/account/NotificationSubscription/components/EditDialog.vue
index f164c35f..ae2b02dd 100644
--- a/src/views/account/NotificationSubscription/components/EditDialog.vue
+++ b/src/views/account/NotificationSubscription/components/EditDialog.vue
@@ -46,7 +46,7 @@
:rules="[{ required: true, message: '请选择告警规则' }]"
>
item.label).join(','),
+ alarmConfigId: keys.length ? keys.join(',') : undefined,
+ alarmConfigName: items.length ? items.map((item) => item.label).join(',') : undefined,
};
}
diff --git a/src/views/device/Instance/Detail/Info/components/Tags/index.vue b/src/views/device/Instance/Detail/Info/components/Tags/index.vue
index 4316a707..8fc6b195 100644
--- a/src/views/device/Instance/Detail/Info/components/Tags/index.vue
+++ b/src/views/device/Instance/Detail/Info/components/Tags/index.vue
@@ -53,6 +53,6 @@ const findName = (item: any) => {
const _element = item.dataType.elements?.find((a: any) => a.value === item.value)
name = _element?.text
}
- return name
+ return name || item.value
}
diff --git a/src/views/device/components/Metadata/Base/Edit/BaseForm.vue b/src/views/device/components/Metadata/Base/Edit/BaseForm.vue
index 7660b5b7..6b48e943 100644
--- a/src/views/device/components/Metadata/Base/Edit/BaseForm.vue
+++ b/src/views/device/components/Metadata/Base/Edit/BaseForm.vue
@@ -47,10 +47,10 @@
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/link/Type/Detail/index.vue b/src/views/link/Type/Detail/index.vue
index 155aff62..2081e4be 100644
--- a/src/views/link/Type/Detail/index.vue
+++ b/src/views/link/Type/Detail/index.vue
@@ -209,7 +209,7 @@
/>
-
-
+ -->
+ changeHost(cluster.serverId, value, index)"
+ @valueChange="(value) => changeHost(cluster.serverId, value, index, true)"
+ />
([]);
const dynamicValidateForm = reactive<{ cluster: FormData2Type[] }>({
cluster: [{ ...cloneDeep(FormStates2), id: '1' }],
@@ -1178,7 +1189,7 @@ const filterPortOption = (input: string, option: any) => {
return JSON.stringify(option.label).indexOf(input) >= 0;
};
-const filterConfigByType = (data: any, type: string) => {
+const filterConfigByType = (data: any[], type: string) => {
let _temp = type;
if (TCPList.includes(type)) {
_temp = 'TCP';
@@ -1197,7 +1208,7 @@ const filterConfigByType = (data: any, type: string) => {
});
};
-const getPortOptions = (portOptions: object, index = 0) => {
+const getPortOptions = (portOptions: any, index = 0) => {
if (!portOptions) return;
const type = formData.value.type;
const host = dynamicValidateForm.cluster[index].configuration.host;
@@ -1227,40 +1238,57 @@ const changeType = (value: string) => {
const updateClustersListIndex = () => {
const { cluster } = dynamicValidateForm;
const filters = cluster?.map((item) => item.serverId);
- const newConfigRef = Store.get('configRef')?.filter(
+ const newConfigRef = shareCluster.value ? Store.get('configRef')?.filter(
(item: any) => !filters.includes(item.clusterNodeId),
- );
+ ) : configClustersList.value?.filter(
+ (item: any) => !filters.includes(item.id),
+ )
cluster.forEach((item, index) => {
- !item.serverId &&
- (clustersListIndex.value[index] = newConfigRef?.map((i: any) => ({
- value: i.clusterNodeId,
- lable: i.clusterNodeId,
- })));
+ clustersListIndex.value[index] = newConfigRef?.map((i: any) => {
+ if(shareCluster.value){
+ return {
+ value: i.clusterNodeId,
+ label: i.clusterNodeId,
+ }
+ } else {
+ return {
+ value: i.id,
+ label: i.name,
+ }
+ }
+ })
+ if(item.serverId) {
+ clustersListIndex.value[index].push({
+ value: item.serverId,
+ label: item.serverId
+ })
+ }
});
};
-const changeServerId = (value: string | undefined, index: number) => {
+const changeServerId = async (value: string | undefined, index: number) => {
const { configuration } = dynamicValidateForm.cluster[index];
configuration.host = undefined;
configuration.port = undefined;
- const checked = cloneDeep(portOptionsConst).find(
- (i: any) => i.clusterNodeId === value,
- );
- const checkedHost = [{ value: checked?.host, lable: checked?.host }];
- hostOptionsIndex.value[index] = checked ? checkedHost : [];
- updateClustersListIndex();
+ hostOptionsIndex.value[index] = [];
+ if(value){
+ updateClustersListIndex();
+ }
};
const changeHost = (
serverId: string | undefined,
value: string | undefined,
index: number,
+ flag?: boolean
) => {
const { configuration } = dynamicValidateForm.cluster[index];
- configuration.port = undefined;
- const checked = cloneDeep(portOptionsConst).find(
- (i: any) => i.clusterNodeId === serverId && i.host === value,
- );
- checked && getPortOptions([checked], index);
+ if(!flag){
+ configuration.port = undefined;
+ }
+ const checked = Store.get('resourcesClusters')?.[serverId || '']
+ if(checked){
+ getPortOptions(checked, index)
+ }
};
const changeParserType = (value: string | undefined, index: number) => {
@@ -1346,9 +1374,20 @@ const getCertificates = async () => {
const getResourcesCurrent = () => {
resourcesCurrent().then((resp) => {
if (resp.status === 200) {
- portOptionsConst = resp.result;
+ const clusterNodeId = resp.result?.[0]?.clusterNodeId
+ const resourcesClusters = Store.get('resourcesClusters') || {}
+ resourcesClusters[clusterNodeId] = resp.result
+ Store.set('resourcesClusters', resourcesClusters)
Store.set('configRef', resp.result);
- getPortOptions(portOptionsConst);
+ getPortOptions(Store.get('resourcesClusters')?.[clusterNodeId]);
+ }
+ });
+};
+
+const getResourcesClusters = () => {
+ resourceClusters().then((resp) => {
+ if (resp.status === 200) {
+ configClustersList.value = resp.result as any[]
}
});
};
@@ -1369,22 +1408,24 @@ const getDetail = () => {
...configuration,
};
- const configRef = Store.get('configRef').filter(
- (item: any) => item.host === '0.0.0.0',
- );
- getPortOptions(configRef); //更新端口
+ // const configRef = Store.get('configRef').filter(
+ // (item: any) => item.host === '0.0.0.0',
+ // );
+ // getPortOptions(configRef); //更新端口
} else {
dynamicValidateForm.cluster = cluster;
+ // const arr = cluster.map((item: any) => item.configuration.serverId)
//遍历数据更新对应的本地端口
- setTimeout(() => {
- cluster.forEach((item: any, index: number) => {
- const { host } = item.configuration;
- let configRef = Store.get('configRef').filter(
- (item: any) => item.host === host,
- );
- getPortOptions(configRef, index);
- });
- }, 0);
+ // setTimeout(() => {
+ // cluster.forEach((item: any, index: number) => {
+ // const { serverId } = item.configuration
+ // if(!resourcesClustersMap.get(serverId)){
+ // // await getResourcesClustersById(serverId)
+ // }
+ // const checked = resourcesClustersMap.get(serverId)
+ // getPortOptions(checked, index);
+ // });
+ // }, 0);
}
if (dynamicValidateForm.cluster.length === 1) {
@@ -1400,6 +1441,7 @@ onMounted(() => {
getSupports();
getCertificates();
getResourcesCurrent();
+ getResourcesClusters();
getDetail();
});
diff --git a/src/views/link/plugin/index.vue b/src/views/link/plugin/index.vue
index 15331fe8..8b8cf5b0 100644
--- a/src/views/link/plugin/index.vue
+++ b/src/views/link/plugin/index.vue
@@ -250,7 +250,7 @@ const getActions = (data: any) => {
message.success('操作成功!');
instanceRef.value?.reload();
} else {
- message.error('操作失败!');
+ message.error(resp?.message || '操作失败!');
}
},
},
diff --git a/src/views/media/Device/Channel/Save.vue b/src/views/media/Device/Channel/Save.vue
index d50f1212..c697fedd 100644
--- a/src/views/media/Device/Channel/Save.vue
+++ b/src/views/media/Device/Channel/Save.vue
@@ -247,6 +247,8 @@ watch(
const validateChannelId = async (_rule: Rule, value: string) => {
// ID非必填, 没有输入ID时, 不校验ID是否存在
if (!value) return;
+ // 编辑时不校验唯一性
+ if(!!formData.value?.id) return;
const { result } = await ChannelApi.validateField({
deviceId: route.query.id,
channelId: value,
diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue
index da25114b..f6b6e70a 100644
--- a/src/views/notice/Template/Detail/index.vue
+++ b/src/views/notice/Template/Detail/index.vue
@@ -944,6 +944,7 @@ const formRules = {
}
],
calledShowNumbers: [
+ { required: true, message: '请输入被叫显号' },
{ max: 64, message: '最多可输入64个字符' },
{
validator(_rule: Rule, value: string) {
diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue
index 9503d64d..b83831b8 100644
--- a/src/views/system/Department/device/index.vue
+++ b/src/views/system/Department/device/index.vue
@@ -13,8 +13,12 @@
:gridColumn="2"
:params="queryParams"
:rowSelection="{
+ // selectedRowKeys: table._selectedRowKeys.value,
+ // onChange:(keys:string[])=>table._selectedRowKeys.value = [...keys],
+ // onSelectNone: table.cancelSelect
selectedRowKeys: table._selectedRowKeys.value,
- onChange:(keys:string[])=>table._selectedRowKeys.value = [...keys],
+ onSelect: table.onSelect,
+ onSelectAll: table.onSelectAll,
onSelectNone: table.cancelSelect
}"
:columns="columns"
@@ -408,6 +412,43 @@ const table = {
table._selectedRowKeys.value = [];
table.selectedRows = [];
},
+ onSelect: (record: any, selected: boolean) => {
+ const arr = [...table._selectedRowKeys.value]
+ const _index = arr.findIndex(item => item === record?.id)
+ if (selected) {
+ if (!(_index > -1)) {
+ table._selectedRowKeys.value.push(record.id)
+ table.selectedRows.push(record)
+ }
+ } else {
+ if (_index > -1) { // 去掉数据
+ table._selectedRowKeys.value.splice(_index, 1)
+ table.selectedRows.splice(_index, 1)
+ }
+ }
+ },
+ onSelectAll: (selected: boolean, _: any[], changeRows: any) => {
+ if (selected) {
+ changeRows.map((i: any) => {
+ if (!table._selectedRowKeys.value.includes(i.id)) {
+ table._selectedRowKeys.value.push(i.id)
+ table.selectedRows.push(i)
+ }
+ })
+ } else {
+ const arr = changeRows.map((item: any) => item.id)
+ const _arr: string[] = [];
+ const _ids: string[] = [];
+ [...table.selectedRows].map((i: any) => {
+ if (!arr.includes(i?.id)) {
+ _arr.push(i)
+ _ids.push(i.id)
+ }
+ })
+ table._selectedRowKeys.value = _ids
+ table.selectedRows = _arr
+ }
+ },
// 获取并整理数据
getData: (params: object, parentId: string) =>
new Promise((resolve) => {
@@ -496,6 +537,7 @@ const table = {
},
clickEdit: (row?: any) => {
const ids = row ? [row.id] : [...table._selectedRowKeys.value];
+ if (ids.length < 1) return message.warning('请勾选需要编辑的数据');
if (row || table.selectedRows.length === 1) {
const permissionList =
row?.permission || table.selectedRows[0].permission;
diff --git a/src/views/system/Department/product/index.vue b/src/views/system/Department/product/index.vue
index c214af6c..ade1a372 100644
--- a/src/views/system/Department/product/index.vue
+++ b/src/views/system/Department/product/index.vue
@@ -14,7 +14,8 @@
:params="queryParams"
:rowSelection="{
selectedRowKeys: tableData._selectedRowKeys,
- onChange:(keys:string[])=>tableData._selectedRowKeys = [...keys],
+ onSelect: table.onSelect,
+ onSelectAll: table.onSelectAll,
onSelectNone: table.cancelSelect
}"
:columns="columns"
@@ -384,23 +385,59 @@ const table = {
},
// 选中
onSelectChange: (row: any) => {
- const selectedRowKeys = tableData._selectedRowKeys;
- const index = selectedRowKeys.indexOf(row.id);
+ const index = tableData._selectedRowKeys.indexOf(row.id);
if (index === -1) {
- selectedRowKeys.push(row.id);
+ tableData._selectedRowKeys.push(row.id);
tableData.selectedRows.push(row);
} else {
- selectedRowKeys.splice(index, 1);
+ tableData._selectedRowKeys.splice(index, 1);
tableData.selectedRows.splice(index, 1);
}
},
// 取消全选
cancelSelect: () => {
- console.log(1111);
+ // console.log(1111);
tableData._selectedRowKeys = [];
tableData.selectedRows = [];
},
+ onSelect: (record: any, selected: boolean) => {
+ const arr = [...tableData._selectedRowKeys]
+ const _index = arr.findIndex(item => item === record?.id)
+ if (selected) {
+ if (!(_index > -1)) {
+ tableData._selectedRowKeys.push(record.id)
+ tableData.selectedRows.push(record)
+ }
+ } else {
+ if (_index > -1) { // 去掉数据
+ tableData._selectedRowKeys.splice(_index, 1)
+ tableData.selectedRows.splice(_index, 1)
+ }
+ }
+ },
+ onSelectAll: (selected: boolean, _: any[], changeRows: any) => {
+ if (selected) {
+ changeRows.map((i: any) => {
+ if (!tableData._selectedRowKeys.includes(i.id)) {
+ tableData._selectedRowKeys.push(i.id)
+ tableData.selectedRows.push(i)
+ }
+ })
+ } else {
+ const arr = changeRows.map((item: any) => item.id)
+ const _arr: string[] = [];
+ const _ids: string[] = [];
+ [...tableData.selectedRows].map((i: any) => {
+ if (!arr.includes(i?.id)) {
+ _arr.push(i)
+ _ids.push(i.id)
+ }
+ })
+ tableData._selectedRowKeys = _ids
+ tableData.selectedRows = _arr
+ }
+ },
// 获取并整理数据
getData: (params: object, parentId: string) =>
new Promise((resolve) => {
diff --git a/src/views/system/Role/Detail/components/PermissTree.vue b/src/views/system/Role/Detail/components/PermissTree.vue
index cd89b113..d8846ded 100644
--- a/src/views/system/Role/Detail/components/PermissTree.vue
+++ b/src/views/system/Role/Detail/components/PermissTree.vue
@@ -150,6 +150,7 @@ const indeterminate = ref(false);
const selectAllChange = () => {
flatTableData.forEach((item) => {
item.granted = selectedAll.value;
+ item.indeterminate = false;
item.buttons?.forEach((button) => {
button.granted = selectedAll.value;
});
diff --git a/yarn.lock b/yarn.lock
index dd3db463..0bba6010 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3823,10 +3823,10 @@ jetlinks-store@^0.0.3:
resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz"
integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==
-jetlinks-ui-components@^1.0.18:
- version "1.0.20"
- resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.20.tgz#ca8df39e35e99cf0e124029609a8fc25f7f97b24"
- integrity sha512-McGHwvkwEKrb1Bp9EZzpQN3YQe790fkO0Z03pGsil+bZrZ7xqiEywESZtW3MIIRWo/6u+zwNQr4L4/ohvXRCpA==
+jetlinks-ui-components@^1.0.21:
+ version "1.0.21"
+ resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.21.tgz#e2dc28682db91b4b05332fb8ec76faa2a2f4dcd2"
+ integrity sha512-nlVGo2ze6e4YFPOyqS1GVCpaH9P4VGPMGYJIucTEjjMb/QqPmkwS7HcwyDX3kvb6Acb+dG5oQZlscMHIGqv0YQ==
dependencies:
"@vueuse/core" "^9.12.0"
"@vueuse/router" "^9.13.0"