feat: 网络组件详情 表单共享配置基本样式
This commit is contained in:
parent
91ae45d227
commit
6acc522ed5
|
@ -13,4 +13,20 @@ export const start = (data: object) =>
|
|||
|
||||
export const supports = () => server.get(`/network/config/supports`);
|
||||
|
||||
export const query = (data: Object) => server.post(`/network/config/_query`, data);
|
||||
export const query = (data: Object) =>
|
||||
server.post(`/network/config/_query`, data);
|
||||
|
||||
export const providers = () => server.get(`/gateway/device/providers`);
|
||||
|
||||
export const resourcesCurrent = () =>
|
||||
server.get(`/network/resources/alive/_current`);
|
||||
|
||||
export const resourceClusters = () => server.get(`network/resources/clusters`);
|
||||
|
||||
export const resourceClustersById = (id: string) =>
|
||||
server.get(`/network/resources/alive/${id}`);
|
||||
|
||||
export const allResources = () => server.get(`/network/resources/alive/_all`);
|
||||
|
||||
export const certificates = () =>
|
||||
server.get(`/network/certificate/_query/no-paging?paging=false`);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,82 @@
|
|||
export const FormStates = {
|
||||
name: '',
|
||||
type: 'UDP',
|
||||
shareCluster: true,
|
||||
parserType: '',
|
||||
configuration: {
|
||||
port: '',
|
||||
host: '0.0.0.0',
|
||||
publicPort: '',
|
||||
publicHost: '',
|
||||
remoteHost: '',
|
||||
remotePort: '',
|
||||
secure: false,
|
||||
username: '',
|
||||
password: '',
|
||||
topicPrefix: '',
|
||||
maxMessageSize: '',
|
||||
certId: '',
|
||||
privateKeyAlias: '',
|
||||
clientId: '',
|
||||
parserConfiguration: {
|
||||
delimited: '',
|
||||
lang: '',
|
||||
script: '',
|
||||
size: '',
|
||||
length: '',
|
||||
offset: '',
|
||||
little: '',
|
||||
},
|
||||
},
|
||||
description: '',
|
||||
};
|
||||
|
||||
const VisibleMost = [
|
||||
'COAP_SERVER',
|
||||
'MQTT_SERVER',
|
||||
'WEB_SOCKET_SERVER',
|
||||
'TCP_SERVER',
|
||||
'UDP',
|
||||
'HTTP_SERVER',
|
||||
];
|
||||
|
||||
export const VisibleData = {
|
||||
parserType: ['TCP_SERVER'],
|
||||
// configuration: {
|
||||
port: VisibleMost,
|
||||
host: VisibleMost,
|
||||
publicPort: VisibleMost,
|
||||
publicHost: VisibleMost,
|
||||
remoteHost: ['MQTT_CLIENT'],
|
||||
remotePort: ['MQTT_CLIENT'],
|
||||
secure: ['TCP_SERVER', 'UDP', 'COAP_SERVER'],
|
||||
username: ['MQTT_CLIENT'],
|
||||
password: ['MQTT_CLIENT'],
|
||||
topicPrefix: ['MQTT_CLIENT'],
|
||||
maxMessageSize: ['MQTT_SERVER', 'MQTT_CLIENT'],
|
||||
// certId: '',
|
||||
// privateKeyAlias: '',
|
||||
clientId: ['MQTT_CLIENT'],
|
||||
// parserConfiguration: {
|
||||
delimited: ['DELIMITED'],
|
||||
lang: ['SCRIPT'],
|
||||
script: ['SCRIPT'],
|
||||
size: ['FIXED_LENGTH'],
|
||||
length: ['LENGTH_FIELD'],
|
||||
offset: ['LENGTH_FIELD'],
|
||||
little: ['LENGTH_FIELD'],
|
||||
// },
|
||||
|
||||
// },
|
||||
};
|
||||
|
||||
export const ParserTypeOptions = [
|
||||
{ value: 'DIRECT', label: '不处理' },
|
||||
{ value: 'DELIMITED', label: '分隔符' },
|
||||
{ value: 'SCRIPT', label: '自定义脚本' },
|
||||
{ value: 'FIXED_LENGTH', label: '固定长度' },
|
||||
{ value: 'LENGTH_FIELD', label: '长度字段' },
|
||||
];
|
||||
|
||||
export const isVisible = (LastName: string, dependencies: string | boolean) =>
|
||||
VisibleData[LastName].includes(dependencies);
|
|
@ -357,36 +357,32 @@ const getActions = (
|
|||
};
|
||||
|
||||
const handlAdd = () => {
|
||||
// router.push({
|
||||
// path: `/iot/link/certificate/detail/:id`,
|
||||
// query: { view: false },
|
||||
// });
|
||||
router.push({
|
||||
path: `/iot/link/type/detail/:id`,
|
||||
query: { view: false },
|
||||
});
|
||||
};
|
||||
|
||||
const handlEye = (id: string) => {
|
||||
console.log(111, id);
|
||||
|
||||
// router.push({
|
||||
// path: `/iot/link/certificate/detail/${id}`,
|
||||
// query: { view: true },
|
||||
// });
|
||||
router.push({
|
||||
path: `/iot/link/type/detail/${id}`,
|
||||
query: { view: true },
|
||||
});
|
||||
};
|
||||
|
||||
const handlEdit = (id: string) => {
|
||||
console.log(111, id);
|
||||
|
||||
// router.push({
|
||||
// path: `/iot/link/certificate/detail/${id}`,
|
||||
// query: { view: false },
|
||||
// });
|
||||
router.push({
|
||||
path: `/iot/link/type/detail/${id}`,
|
||||
query: { view: false },
|
||||
});
|
||||
};
|
||||
|
||||
const handlDelete = async (id: string) => {
|
||||
// const res = await remove(id);
|
||||
// if (res.success) {
|
||||
// message.success('操作成功');
|
||||
// tableRef.value.reload();
|
||||
// }
|
||||
const res = await remove(id);
|
||||
if (res.success) {
|
||||
message.success('操作成功');
|
||||
tableRef.value.reload();
|
||||
}
|
||||
};
|
||||
|
||||
const getDetails = (slotProps: Partial<Record<string, any>>) => {
|
||||
|
|
Loading…
Reference in New Issue