Skip to content

Commit

Permalink
fix: 修复边缘端映射bug
Browse files Browse the repository at this point in the history
  • Loading branch information
XieYongHong committed Jul 11, 2023
1 parent 5bd178f commit 9369028
Show file tree
Hide file tree
Showing 172 changed files with 12,091 additions and 3,429 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-SNAPSHOT .
docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-SNAPSHOT
docker build -t registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-TEST .
docker push registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-ui-vue:2.1.0-TEST
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"event-source-polyfill": "^1.0.31",
"global": "^4.4.0",
"jetlinks-store": "^0.0.3",
"jetlinks-ui-components": "^1.0.21",
"jetlinks-ui-components": "^1.0.24",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"less": "^4.1.3",
Expand All @@ -42,6 +42,7 @@
"v-clipboard3": "^0.1.4",
"vite-plugin-monaco-editor": "^1.1.0",
"vue": "^3.2.45",
"vue-cropper": "^1.0.9",
"vue-json-viewer": "^3.0.4",
"vue-router": "^4.1.6",
"vue3-json-viewer": "^2.2.2",
Expand Down
28 changes: 26 additions & 2 deletions plugin/jetlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ const matchComponents: IMatcher[] = [
pattern: /^Empty/,
styleDir: 'Empty'
},
{
pattern: /^PopconfirmModal/,
styleDir: 'PopconfirmModal'
},
{
pattern: /^Popconfirm/,
styleDir: 'Popconfirm'
Expand All @@ -215,7 +219,15 @@ const matchComponents: IMatcher[] = [
{
pattern: /^Notification/,
styleDir: 'Notification'
}
},
{
pattern: /^DataTable/,
styleDir: 'DataTable'
},
{
pattern: /^CheckButton/,
styleDir: 'CheckButton'
},
]

export interface JetlinksVueResolverOptions {
Expand Down Expand Up @@ -294,7 +306,19 @@ function getSideEffects(compName: string, options: JetlinksVueResolverOptions, _
}

const filterName = ['message', 'Notification']
const primitiveNames = ['AIcon','Affix', 'Anchor', 'AnchorLink', 'message', 'Notification', 'AutoComplete', 'AutoCompleteOptGroup', 'AutoCompleteOption', 'Alert', 'Avatar', 'AvatarGroup', 'BackTop', 'Badge', 'BadgeRibbon', 'Breadcrumb', 'BreadcrumbItem', 'BreadcrumbSeparator', 'Button', 'ButtonGroup', 'Calendar', 'Card', 'CardGrid', 'CardMeta', 'Collapse', 'CollapsePanel', 'Carousel', 'Cascader', 'Checkbox', 'CheckboxGroup', 'Col', 'Comment', 'ConfigProvider', 'DatePicker', 'MonthPicker', 'WeekPicker', 'RangePicker', 'QuarterPicker', 'Descriptions', 'DescriptionsItem', 'Divider', 'Dropdown', 'DropdownButton', 'Drawer', 'Empty', 'Form', 'FormItem', 'FormItemRest', 'Grid', 'Input', 'InputGroup', 'InputPassword', 'InputSearch', 'Textarea', 'Image', 'ImagePreviewGroup', 'InputNumber', 'Layout', 'LayoutHeader', 'LayoutSider', 'LayoutFooter', 'LayoutContent', 'List', 'ListItem', 'ListItemMeta', 'Menu', 'MenuDivider', 'MenuItem', 'MenuItemGroup', 'SubMenu', 'Mentions', 'MentionsOption', 'Modal', 'Statistic', 'StatisticCountdown', 'PageHeader', 'Pagination', 'Popconfirm', 'Popover', 'Progress', 'Radio', 'RadioButton', 'RadioGroup', 'Rate', 'Result', 'Row', 'Select', 'SelectOptGroup', 'SelectOption', 'Skeleton', 'SkeletonButton', 'SkeletonAvatar', 'SkeletonInput', 'SkeletonImage', 'Slider', 'Space', 'Spin', 'Steps', 'Step', 'Switch', 'Table', 'TableColumn', 'TableColumnGroup', 'TableSummary', 'TableSummaryRow', 'TableSummaryCell', 'Transfer', 'Tree', 'TreeNode', 'DirectoryTree', 'TreeSelect', 'TreeSelectNode', 'Tabs', 'TabPane', 'Tag', 'CheckableTag', 'TimePicker', 'TimeRangePicker', 'Timeline', 'TimelineItem', 'Tooltip', 'Typography', 'TypographyLink', 'TypographyParagraph', 'TypographyText', 'TypographyTitle', 'Upload', 'UploadDragger', 'LocaleProvider', 'ProTable', 'Search', 'AdvancedSearch', 'Ellipsis', 'MonacoEditor', 'ProLayout', 'ScrollTable', 'TableCard', 'Scrollbar', 'CardSelect', 'ColorPicker']
const primitiveNames = ['AIcon','Affix', 'Anchor', 'AnchorLink', 'message', 'Notification', 'AutoComplete', 'AutoCompleteOptGroup', 'AutoCompleteOption', 'Alert', 'Avatar', 'AvatarGroup', 'BackTop', 'Badge', 'BadgeRibbon', 'Breadcrumb', 'BreadcrumbItem', 'BreadcrumbSeparator', 'Button', 'ButtonGroup', 'Calendar', 'Card', 'CardGrid', 'CardMeta', 'Collapse', 'CollapsePanel', 'Carousel', 'Cascader', 'Checkbox', 'CheckboxGroup', 'Col', 'Comment', 'ConfigProvider', 'DatePicker', 'MonthPicker', 'WeekPicker', 'RangePicker', 'QuarterPicker', 'Descriptions', 'DescriptionsItem', 'Divider', 'Dropdown', 'DropdownButton', 'Drawer', 'Empty', 'Form', 'FormItem', 'FormItemRest', 'Grid', 'Input', 'InputGroup', 'InputPassword', 'InputSearch', 'Textarea', 'Image', 'ImagePreviewGroup', 'InputNumber', 'Layout', 'LayoutHeader', 'LayoutSider', 'LayoutFooter', 'LayoutContent', 'List', 'ListItem', 'ListItemMeta', 'Menu', 'MenuDivider', 'MenuItem', 'MenuItemGroup', 'SubMenu', 'Mentions', 'MentionsOption', 'Modal', 'Statistic', 'StatisticCountdown', 'PageHeader', 'Pagination', 'Popconfirm', 'Popover', 'Progress', 'Radio', 'RadioButton', 'RadioGroup', 'Rate', 'Result', 'Row', 'Select', 'SelectOptGroup', 'SelectOption', 'Skeleton', 'SkeletonButton', 'SkeletonAvatar', 'SkeletonInput', 'SkeletonImage', 'Slider', 'Space', 'Spin', 'Steps', 'Step', 'Switch', 'Table', 'TableColumn', 'TableColumnGroup', 'TableSummary', 'TableSummaryRow', 'TableSummaryCell', 'Transfer', 'Tree', 'TreeNode', 'DirectoryTree', 'TreeSelect', 'TreeSelectNode', 'Tabs', 'TabPane', 'Tag', 'CheckableTag', 'TimePicker', 'TimeRangePicker', 'Timeline', 'TimelineItem', 'Tooltip', 'Typography', 'TypographyLink', 'TypographyParagraph', 'TypographyText', 'TypographyTitle', 'Upload', 'UploadDragger', 'LocaleProvider', 'ProTable', 'Search', 'AdvancedSearch', 'Ellipsis', 'MonacoEditor', 'ProLayout', 'ScrollTable', 'TableCard', 'Scrollbar', 'CardSelect', 'ColorPicker', 'PopconfirmModal', 'DataTable',
'DataTableArray',
'DataTableString',
'DataTableInteger',
'DataTableDouble',
'DataTableBoolean',
'DataTableEnum',
'DataTableFile',
'DataTableDate',
'DataTableTypeSelect',
'DataTableObject',
'CheckButton',
]
const prefix = 'J'

let jetlinksNames: Set<string>
Expand Down
Binary file added public/images/apply/dingtalk-ent-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apply/internal-integrated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apply/internal-standalone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/apply/provider1.png
Binary file not shown.
Binary file removed public/images/apply/provider2.png
Binary file not shown.
Binary file removed public/images/apply/provider3.png
Binary file not shown.
Binary file removed public/images/apply/provider4.png
Binary file not shown.
Binary file removed public/images/apply/provider5.png
Binary file not shown.
Binary file added public/images/apply/third-party.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apply/wechat-miniapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/apply/wechat-webapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/device/matadataMap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/home-view/comprehensive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/home-view/device-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/home-view/device.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/home-view/ops-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/home/home-view/ops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/dingtalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/inside-mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/sms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/voice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice-rule/wechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/notice/inside-mail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/api/account/center.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ export const checkOldPassword_api = (password:string) => server.post(`/user/me/p
'Content-Type': 'text/plain'
}
});

// 我的订阅
// 查询当前用户可访问的通道配置
export const getAllNotice = () => server.get(`/notify/channel/all`);

35 changes: 20 additions & 15 deletions src/api/account/notificationRecord.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
import server from '@/utils/request'

// 获取记录列表
export const getList_api = (data: object): any => server.post(`/notifications/_query`, data)
export const getList_api = (data: any): any => server.post(`/notifications/_query`, data)
// 获取未读记录列表
export const getListByUnRead_api = (data: object): any => server.post(`/notifications/_query`, data)
// export const getListByUnRead_api = (data: any): any => server.post(`/notifications/_query`, data)
// 修改记录状态
export const changeStatus_api = (type: '_read' | '_unread', data: string[]): any => server.post(`/notifications/${type}`, data)

export const changeAllStatus = (type: '_read' | '_unread', data: string[]): any => server.post(`/notifications/${type}/provider`, data)

const encodeParams = (params: Record<string, any>) => {
let result = {}
for (const key in params) {
if (Object.prototype.hasOwnProperty.call(params, key)) {
const value = params[key];
if (key === 'terms') {
result['terms[0].column:'] = 0
result['terms[0].value'] = JSON.stringify(value[0])
} else result[key] = value
}
}

return result
};
// 查询告警记录详情
export const getDetail = (id: string): any => server.get(`/alarm/record/${id}`)

// const encodeParams = (params: Record<string, any>) => {
// let result = {}
// for (const key in params) {
// if (Object.prototype.hasOwnProperty.call(params, key)) {
// const value = params[key];
// if (key === 'terms') {
// result['terms[0].column:'] = 0
// result['terms[0].value'] = JSON.stringify(value[0])
// } else result[key] = value
// }
// }

// return result
// };
19 changes: 19 additions & 0 deletions src/api/account/notificationSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,22 @@ export const getAlarmList_api = () => server.post(`/alarm/config/_query/no-pagin
sorts: [{ name: 'createTime', order: 'desc' }],
paging: false,
});

// 判断获取当前用户绑定信
export const getIsBindThird = () => server.get(`/user/third-party/me`);

// 生成OAuth2授权URL
export const getWechatOAuth2 = (configId: string, templateId: string, url: string) => server.get(`/notifier/wechat/corp/${configId}/${templateId}/oauth2/binding-user-url?redirectUri=${url}`);

export const getDingTalkOAuth2 = (configId: string, url: string) => server.get(`/notifier/dingtalk/corp/${configId}/oauth2/binding-user-url?authCode=${url}`);

// 获取oauth2授权的用户绑定码

export const getUserBind = (type: 'wechat' | 'dingtalk', params: any) => server.get(`/notifier/${type}/corp/oauth2/user-bind-code`, params);

// 根据绑定码绑定当前用户
export const bindThirdParty = (type: string, provider: string, bindCode: string) => server.post(`/user/third-party/me/${type}/${provider}/${bindCode}/_bind`);




4 changes: 3 additions & 1 deletion src/api/comm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ export const systemVersion = () => server.get<{edition?: string}>('/system/versi
* @param data
* @returns
*/
export const queryDashboard = (data: Record<string, any>) => server.post(`/dashboard/_multi`, data)
export const queryDashboard = (data: Record<string, any>) => server.post(`/dashboard/_multi`, data)

export const fileUpload = (data: any) => server.post('/file/static', data)
17 changes: 13 additions & 4 deletions src/api/device/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const templateDownload = (productId: string, type: string) => server.get(
* @param type 文件类型
* @returns
*/
export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boolean) => `${BASE_API_PATH}/device-instance/${productId}/import?fileUrl=${fileUrl}&autoDeploy=${autoDeploy}&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`
export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boolean) => `${BASE_API_PATH}/device-instance/${productId}/import/_withlog?fileUrl=${fileUrl}&autoDeploy=${autoDeploy}&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}`

/**
* 设备导出
Expand Down Expand Up @@ -576,14 +576,23 @@ export const getDeviceNumber = (data?:any) => server.post<number>('/device-insta
/**
* 导入映射设备
* @param productId
* @param data
* @param data/
*/
export const importDeviceByPlugin = (productId: string, data: any[]) => server.post(`/device/instance/plugin/${productId}/import`, data)

export const metadateMapById = (productId: string, data: ant[]) => server.patch(`/device/metadata/mapping/product/${productId}`, data)
export const metadataMapById = (type: 'device' | 'product', productId: string, data: any[]) => server.patch(`/device/metadata/mapping/${type}/${productId}`, data)

export const getMetadateMapById = (productId: string) => server.get(`/device/metadata/mapping/product/${productId}`)
export const getMetadataMapById = (type: 'device' | 'product', productId: string) => server.get(`/device/metadata/mapping/${type}/${productId}`)

export const getInkingDevices = (data: string[]) => server.post('/plugin/mapping/device/_all', data)

export const getProtocolMetadata = (id: string, transport: string) => server.get(`/protocol/${id}/${transport}/metadata`)

/**
* 规则属性
*/
export const saveDeviceVirtualProperty = (productId: string, deviceId: string, data: any[]) => server.patch(`/virtual/property/product/${productId}/${deviceId}/_batch`, data)

export const queryDeviceVirtualProperty = (productId: string, deviceId: string, propertyId: string) => server.get(`/virtual/property/product/${productId}/${deviceId}/${propertyId}`)


9 changes: 9 additions & 0 deletions src/api/device/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,12 @@ export const getMetadataDeviceConfig = (params: {
};
}) => server.get<Record<any, any>[]>(`/device/instance/${params.deviceId}/config-metadata/${params.metadata.type}/${params.metadata.id}/${params.metadata.dataType}`)

/**
* 规则属性
*/
export const saveProductVirtualProperty = (productId: string, data: any[]) => server.patch(`/virtual/property/product/${productId}/_batch`, data)

export const queryProductVirtualProperty = (productId: string, propertyId: string) => server.get(`/virtual/property/product/${productId}/${propertyId}`)



1 change: 1 addition & 0 deletions src/api/notice/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export default {
// 短信获取签名
getSigns: (id: any) => get(`/notifier/sms/aliyun/${id}/signs`),
getListByConfigId: (id: string, data: any): any => post(`/notifier/template/${id}/_query`, data),
getListVariableByConfigId: (id: string, data?: any): any => post(`/notifier/template/${id}/detail/_query`, data),
}
2 changes: 1 addition & 1 deletion src/api/system/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const changeApplyStatus_api = (id: string, data: any) => server.put(`/app
// 删除应用
export const delApply_api = (id: string) => server.remove(`/application/${id}`)


export const queryType = () => server.get(`/application/providers`)

// 获取组织列表
export const getDepartmentList_api = (params: any) => server.get(`/organization/_all/tree`, params);
Expand Down
26 changes: 26 additions & 0 deletions src/api/system/noticeRule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import server from '@/utils/request';

// 获取角色列表
export const queryRoleList = (data: any): Promise<any> => server.post(`/role/_query/`, data);

// 查询所有通道配置
export const queryChannelConfig = (): Promise<any> => server.get(`/notify/channel/all-for-save`);

// 查询通知通道类型
export const queryChannelProviders = (): Promise<any> => server.get(`/notify/channel/providers`);

// 保存通道配置
export const saveChannelConfig = (data: any[]): Promise<any> => server.patch(`/notify/channel`, data);

export const updateChannelConfig = (providerId: string, data: any[]): Promise<any> => server.patch(`/notify/channel/${providerId}`, data);

export const editChannelConfig = (providerId: string, data: any): Promise<any> => server.put(`/notify/channel/${providerId}`, data);

export const actionChannelConfig = (providerId: string, type: 'enable' | 'disable'): Promise<any> => server.post(`/notify/channel/${providerId}/${type}`);

export const deleteChannelConfig = (providerId: string): Promise<any> => server.remove(`/notify/channel/${providerId}`);

export const queryConfigVariables = (providerId: string): Promise<any> => server.get(`/notify/channel/${providerId}/variables`);



9 changes: 9 additions & 0 deletions src/components/CheckBoxButton/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template>
123
</template>

<script lang="ts" setup>
const props = defineProps({
// options:
})
</script>
Loading

0 comments on commit 9369028

Please sign in to comment.