From 5ee4b641260a5414072f7fcc7bab5ad0bce795aa Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Wed, 3 Apr 2024 11:11:43 +0800 Subject: [PATCH] chore: cleanup --- src/api/device-manage/device/cloud-command.ts | 32 --- src/api/device-manage/device/index.ts | 78 ------ src/api/device-manage/device/types.ts | 46 ---- src/api/device-manage/group/index.ts | 64 ----- src/api/device-manage/group/types.ts | 12 - src/api/monitor-ops/log/index.ts | 18 -- src/api/monitor-ops/log/types.ts | 25 -- src/api/product/index.ts | 42 ---- src/api/product/model.ts | 68 ----- src/api/product/topic.ts | 29 --- src/api/product/types.ts | 120 --------- src/api/subscription/consumer/index.ts | 62 ----- src/api/subscription/consumer/types.ts | 18 -- src/api/subscription/list/index.ts | 44 ---- src/api/subscription/list/types.ts | 11 - .../device-manage/device/DeviceFormModal.vue | 55 ---- .../device/components/CloudCommand.vue | 104 -------- .../device/components/DeviceInfo.vue | 114 --------- .../device/components/MessageModal.vue | 59 ----- .../device/components/MqttParamsModal.vue | 77 ------ .../device/components/SendCommandModal.vue | 185 -------------- .../device/components/TopicList.vue | 53 ---- .../components/composables/useDeviceInfo.ts | 84 ------- .../composables/useDeviceProperties.ts | 27 -- .../device-manage/device/components/index.ts | 4 - src/views/device-manage/device/data.ts | 123 --------- src/views/device-manage/device/detail.vue | 39 --- src/views/device-manage/device/index.vue | 109 -------- .../group/components/BindingDeviceDrawer.vue | 101 -------- .../group/components/GroupFormModal.vue | 86 ------- .../group/components/GroupList.vue | 112 --------- .../device-manage/group/components/index.ts | 2 - src/views/device-manage/group/data.ts | 60 ----- src/views/device-manage/group/index.vue | 126 ---------- .../monitor-ops/log/MessageContentModal.vue | 62 ----- src/views/monitor-ops/log/data.ts | 127 ---------- src/views/monitor-ops/log/index.vue | 44 ---- src/views/product/ProductFormModal.vue | 55 ---- src/views/product/components/Model.vue | 138 ----------- .../components/ModelAttributeFormModal.vue | 234 ------------------ .../components/ModelServiceFormModal.vue | 79 ------ src/views/product/components/Subscription.vue | 56 ----- .../product/components/TopicFormModal.vue | 93 ------- src/views/product/components/TopicManage.vue | 145 ----------- .../composables/useModelAttribute.ts | 78 ------ .../components/composables/useModelService.ts | 41 --- src/views/product/components/index.ts | 3 - src/views/product/data.ts | 188 -------------- src/views/product/detail.vue | 96 ------- src/views/product/index.vue | 92 ------- .../consumer/ConsumerFormModal.vue | 65 ----- .../consumer/components/OnlineClient.vue | 34 --- .../consumer/components/Product.vue | 92 ------- .../subscription/consumer/components/index.ts | 2 - src/views/subscription/consumer/data.ts | 50 ---- src/views/subscription/consumer/detail.vue | 99 -------- src/views/subscription/consumer/index.vue | 91 ------- .../list/SubscriptionFormModal.vue | 59 ----- src/views/subscription/list/data.ts | 104 -------- src/views/subscription/list/index.vue | 86 ------- 60 files changed, 4402 deletions(-) delete mode 100644 src/api/device-manage/device/cloud-command.ts delete mode 100644 src/api/device-manage/device/index.ts delete mode 100644 src/api/device-manage/device/types.ts delete mode 100644 src/api/device-manage/group/index.ts delete mode 100644 src/api/device-manage/group/types.ts delete mode 100644 src/api/monitor-ops/log/index.ts delete mode 100644 src/api/monitor-ops/log/types.ts delete mode 100644 src/api/product/index.ts delete mode 100644 src/api/product/model.ts delete mode 100644 src/api/product/topic.ts delete mode 100644 src/api/product/types.ts delete mode 100644 src/api/subscription/consumer/index.ts delete mode 100644 src/api/subscription/consumer/types.ts delete mode 100644 src/api/subscription/list/index.ts delete mode 100644 src/api/subscription/list/types.ts delete mode 100644 src/views/device-manage/device/DeviceFormModal.vue delete mode 100644 src/views/device-manage/device/components/CloudCommand.vue delete mode 100644 src/views/device-manage/device/components/DeviceInfo.vue delete mode 100644 src/views/device-manage/device/components/MessageModal.vue delete mode 100644 src/views/device-manage/device/components/MqttParamsModal.vue delete mode 100644 src/views/device-manage/device/components/SendCommandModal.vue delete mode 100644 src/views/device-manage/device/components/TopicList.vue delete mode 100644 src/views/device-manage/device/components/composables/useDeviceInfo.ts delete mode 100644 src/views/device-manage/device/components/composables/useDeviceProperties.ts delete mode 100644 src/views/device-manage/device/components/index.ts delete mode 100644 src/views/device-manage/device/data.ts delete mode 100644 src/views/device-manage/device/detail.vue delete mode 100644 src/views/device-manage/device/index.vue delete mode 100644 src/views/device-manage/group/components/BindingDeviceDrawer.vue delete mode 100644 src/views/device-manage/group/components/GroupFormModal.vue delete mode 100644 src/views/device-manage/group/components/GroupList.vue delete mode 100644 src/views/device-manage/group/components/index.ts delete mode 100644 src/views/device-manage/group/data.ts delete mode 100644 src/views/device-manage/group/index.vue delete mode 100644 src/views/monitor-ops/log/MessageContentModal.vue delete mode 100644 src/views/monitor-ops/log/data.ts delete mode 100644 src/views/monitor-ops/log/index.vue delete mode 100644 src/views/product/ProductFormModal.vue delete mode 100644 src/views/product/components/Model.vue delete mode 100644 src/views/product/components/ModelAttributeFormModal.vue delete mode 100644 src/views/product/components/ModelServiceFormModal.vue delete mode 100644 src/views/product/components/Subscription.vue delete mode 100644 src/views/product/components/TopicFormModal.vue delete mode 100644 src/views/product/components/TopicManage.vue delete mode 100644 src/views/product/components/composables/useModelAttribute.ts delete mode 100644 src/views/product/components/composables/useModelService.ts delete mode 100644 src/views/product/components/index.ts delete mode 100644 src/views/product/data.ts delete mode 100644 src/views/product/detail.vue delete mode 100644 src/views/product/index.vue delete mode 100644 src/views/subscription/consumer/ConsumerFormModal.vue delete mode 100644 src/views/subscription/consumer/components/OnlineClient.vue delete mode 100644 src/views/subscription/consumer/components/Product.vue delete mode 100644 src/views/subscription/consumer/components/index.ts delete mode 100644 src/views/subscription/consumer/data.ts delete mode 100644 src/views/subscription/consumer/detail.vue delete mode 100644 src/views/subscription/consumer/index.vue delete mode 100644 src/views/subscription/list/SubscriptionFormModal.vue delete mode 100644 src/views/subscription/list/data.ts delete mode 100644 src/views/subscription/list/index.vue diff --git a/src/api/device-manage/device/cloud-command.ts b/src/api/device-manage/device/cloud-command.ts deleted file mode 100644 index 47d2f2b4..00000000 --- a/src/api/device-manage/device/cloud-command.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { CommandToDeviceData, GetCloudCommandLogsParams, MessageToDeviceData } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getCloudCommandLogs(params: GetCloudCommandLogsParams) { - return defHttp.get({ - url: '/cloud/logPage', - params, - }) -} - -export function getMessageContent(id: string) { - return defHttp.get({ - url: '/cloud/message', - params: { - id, - }, - }) -} - -export function sendMessageToDevice(data: MessageToDeviceData) { - return defHttp.post({ - url: '/cloud/sendMessage', - data, - }) -} - -export function sendCommandToDevice(data: CommandToDeviceData) { - return defHttp.post({ - url: '/cloud/sendCommand', - data, - }) -} diff --git a/src/api/device-manage/device/index.ts b/src/api/device-manage/device/index.ts deleted file mode 100644 index 5682289e..00000000 --- a/src/api/device-manage/device/index.ts +++ /dev/null @@ -1,78 +0,0 @@ -import type { Device, DevicePropertie, GetDeviceListParams } from './types' -import type { Topic } from '@/api/product/types' -import { defHttp } from '@/utils/http/axios' - -export function getDeviceList(params: GetDeviceListParams) { - return defHttp.get>({ - url: '/device/page', - params, - }) -} - -export function createDevice(data: Partial) { - return defHttp.post({ - url: '/device/save', - data, - }) -} - -export function updateDevice(data: Partial) { - return defHttp.post({ - url: '/device/update', - data, - }) -} - -export function deleteDevice(id: string) { - return defHttp.post({ - url: `/device/remove?id=${id}`, - }) -} - -export function getDeviceDetail(id: string) { - return defHttp.get({ - url: '/device/detail', - params: { - id, - }, - }) -} - -export function getDeviceProperties(modelId: string, deviceSn: string) { - return defHttp.get<{ - properties?: DevicePropertie[] - updateTime?: string - }>({ - url: '/device/properties', - params: { - deviceSn, - modelId, - }, - }) -} - -export function getDeviceTopicList(params: PageParam & { deviceId: string }) { - return defHttp.get>({ - url: '/device/topic/page', - params, - }) -} - -export function getMqttConnectParams(deviceId: string) { - return defHttp.get({ - url: '/device/mqttLinkInfo', - params: { - deviceId, - }, - }) -} - -export function getReportExample(productId: string, deviceSn: string) { - return defHttp.get({ - url: '/device/messageExample', - params: { - productId, - deviceSn, - }, - }) -} diff --git a/src/api/device-manage/device/types.ts b/src/api/device-manage/device/types.ts deleted file mode 100644 index 91667704..00000000 --- a/src/api/device-manage/device/types.ts +++ /dev/null @@ -1,46 +0,0 @@ -export interface GetDeviceListParams extends PageParam { - productId?: string - deviceSn?: string - deviceName?: string - isOnline?: BooleanFlag -} - -export interface Device { - id: string - productId: string - deviceSn: string - deviceName: string - deviceDesc: string - isOnline: BooleanFlag -} - -export interface DevicePropertie { - identifier: string - name: string - unit: string - value: string - sort: number -} - -export interface GetCloudCommandLogsParams extends PageParam { - messageType?: number -} - -export enum CloudCommandType { - Attribute = 1, - Command = 2, - Message = 3, -} - -export interface MessageToDeviceData { - deviceId: string - topic: string - message: string -} - -export interface CommandToDeviceData { - deviceId: string - modelId: string - itemId: string - value: string | number -} diff --git a/src/api/device-manage/group/index.ts b/src/api/device-manage/group/index.ts deleted file mode 100644 index a13f6c55..00000000 --- a/src/api/device-manage/group/index.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { DeviceGroup, GetdeviceListByGroupParams } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getDeviceGroupTree() { - return defHttp.get({ - url: '/deviceGroup/tree', - }) -} - -export function getDevicegroupDetail(id: string) { - return defHttp.get({ - url: '/deviceGroup/detail', - params: { - id, - }, - }) -} - -export function getDeviceListByGroup(params: GetdeviceListByGroupParams) { - return defHttp.get({ - url: '/device/pageByGroup', - params, - }) -} - -export function createDeviceGroup(data: Partial) { - return defHttp.post({ - url: '/deviceGroup/save', - data, - }) -} - -export function updateDeviceGroup(data: Partial) { - return defHttp.post({ - url: '/deviceGroup/update', - data, - }) -} - -export function deleteDevicegroup(id: string) { - return defHttp.post({ - url: `/deviceGroup/remove?id=${id}`, - }) -} - -export function bindingDeviceToGroup(deviceGroupId: string, deviceIds: string) { - return defHttp.post({ - url: '/deviceGroup/bindDevice', - data: { - deviceGroupId, - deviceIds, - }, - }) -} - -export function unbindingDeviceFromGroup(deviceGroupId: string, deviceIds: string) { - return defHttp.post({ - url: '/deviceGroup/unbindDevice', - data: { - deviceGroupId, - deviceIds, - }, - }) -} diff --git a/src/api/device-manage/group/types.ts b/src/api/device-manage/group/types.ts deleted file mode 100644 index efec1276..00000000 --- a/src/api/device-manage/group/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface DeviceGroup { - id: string - parentId: string - groupName: string - remark: string -} - -export interface GetdeviceListByGroupParams extends PageParam { - groupId?: string - productId?: string - deviceSn?: string -} diff --git a/src/api/monitor-ops/log/index.ts b/src/api/monitor-ops/log/index.ts deleted file mode 100644 index 3feadc3b..00000000 --- a/src/api/monitor-ops/log/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { GetLogListParams, Log, MessageContent } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getLogList(params: GetLogListParams) { - return defHttp.get>({ - url: '/device/log/page', - params, - }) -} - -export function getMessageContent(id: string) { - return defHttp.get({ - url: '/device/log/message', - params: { - id, - }, - }) -} diff --git a/src/api/monitor-ops/log/types.ts b/src/api/monitor-ops/log/types.ts deleted file mode 100644 index cbf18dda..00000000 --- a/src/api/monitor-ops/log/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface GetLogListParams extends PageParam { - productId: string - deviceSn: string - traceId: string - bizType: string - queryStartTime: string - queryEndTime: string -} - -export interface Log { - productId: string - deviceSn: string - traceId: string - messageId?: string - bizType: number - operation: string - createTime: string - code: number -} - -export interface MessageContent { - message: string - topic: string - createTime: string -} diff --git a/src/api/product/index.ts b/src/api/product/index.ts deleted file mode 100644 index d5de8d4b..00000000 --- a/src/api/product/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { SubScription } from '../subscription/list/types' -import type { GetProductListParmas, Product } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getProductList(params: GetProductListParmas) { - return defHttp.get>({ - url: '/product/page', - params, - }) -} - -export function getProductDetail(id: string) { - return defHttp.get({ - url: `/product/detail?id=${id}`, - }) -} - -export function createProduct(data: Partial) { - return defHttp.post({ - url: '/product/save', - data, - }) -} - -export function updateProduct(data: Partial) { - return defHttp.post({ - url: '/product/update', - data, - }) -} - -export function deleteProduct(id: string) { - return defHttp.post({ - url: `/product/remove?id=${id}`, - }) -} - -export function getAllProducts() { - return defHttp.get[]>({ - url: '/product/select', - }) -} diff --git a/src/api/product/model.ts b/src/api/product/model.ts deleted file mode 100644 index 63642e36..00000000 --- a/src/api/product/model.ts +++ /dev/null @@ -1,68 +0,0 @@ -import type { GetModelAttributeListParams, ModelAttribute, ModelAttributeWithForm, ModelService, SimpleAttribute } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getAllModelServices(productId: string) { - return defHttp.get({ - url: '/thingModel/select', - params: { - productId, - }, - }) -} - -export function createModelService(data: Partial) { - return defHttp.post({ - url: '/thingModel/save', - data, - }) -} - -export function updateModelService(data: Partial) { - return defHttp.post({ - url: '/thingModel/update', - data, - }) -} - -export function deleteModelService(id: string) { - return defHttp.post({ - url: `/thingModel/remove?id=${id}`, - }) -} - -export function getModelAttributeList(params: GetModelAttributeListParams) { - return defHttp.get>({ - url: '/thingModel/item/page', - params, - }) -} - -export function createModelAttribute(data: ModelAttributeWithForm) { - return defHttp.post({ - url: '/thingModel/item/save', - data, - }) -} - -export function updateModelAttribute(data: ModelAttributeWithForm) { - return defHttp.post({ - url: '/thingModel/item/update', - data, - }) -} - -export function deleteModelAttribute(id: string) { - return defHttp.post({ - url: `/thingModel/item/remove?id=${id}`, - }) -} - -export function getAllModelAttributes(productId: string, itemType: number) { - return defHttp.get({ - url: '/thingModel/item/queryList', - params: { - productId, - itemType, - }, - }) -} diff --git a/src/api/product/topic.ts b/src/api/product/topic.ts deleted file mode 100644 index 893fc562..00000000 --- a/src/api/product/topic.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { GetTopicListPrams, Topic } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getTopicList(params: GetTopicListPrams) { - return defHttp.get>({ - url: '/product/topic/page', - params, - }) -} - -export function createTopic(data: Partial) { - return defHttp.post({ - url: '/product/topic/save', - data, - }) -} - -export function updateTopic(data: Partial) { - return defHttp.post({ - url: '/product/topic/update', - data, - }) -} - -export function deleteTopic(id: string) { - return defHttp.post({ - url: `/product/topic/remove?id=${id}`, - }) -} diff --git a/src/api/product/types.ts b/src/api/product/types.ts deleted file mode 100644 index 48cd6cd9..00000000 --- a/src/api/product/types.ts +++ /dev/null @@ -1,120 +0,0 @@ -export interface GetProductListParmas extends PageParam { - productName?: string - networkType?: number - networkProtocol?: number - nodeType?: number - securityType?: number - dataType?: number -} - -export interface Product { - id: string - tenantId: string - uuid: string - productName: string - productDesc: string - productKey: string - productSecret: string - nodeType: number - networkType: number - networkProtocol: number - authType: number - securityType: number - dataType: number - tsl: string - isRelease: number -} - -export enum TopicType { - System = 1, - Custom = 2, -} - -export interface GetTopicListPrams extends PageParam { - productId?: string - topicCategory?: TopicType -} - -export interface Topic { - id: string - topic: string - topicType: number - enableScript: BooleanFlag - topicDesc: string - productId: string -} - -export interface ModelService { - id: string - productId: string - serviceId: string - tenantId: string - description: string -} - -export interface GetModelAttributeListParams extends PageParam { - productId?: string - modelId?: string -} - -export enum ModelAttributeDataTypesEnum { - Int32 = 'int32', - Float = 'float', - Bool = 'bool', - Text = 'text', -} - -export interface ModelAttribute { - id: string - name: string - itemType: number - identifier: string - modelId: string - modelName?: string - tenantId: string - method: string - sort: number - dataType: ModelAttributeDataTypesEnum - dataSpecs?: { - min?: number - max?: number - maxLength?: number - trueDesc?: string - falseDesc?: string - scale?: string - } -} - -export interface ModelAttributeWithForm { - id: string - name: string - itemType: number - identifier: string - dataType: ModelAttributeDataTypesEnum - min: number - max: number - maxLength: number - scale: number - unit: string - trueDesc: string - falseDesc: string - method: string - sort: number - modelId: string -} - -export interface SimpleAttribute { - dataType: ModelAttributeDataTypesEnum - itemType: number - modelId: string - modelName: string - name: string - dataSpecs: { - min: number - max: number - maxLength: number - trueDesc: string - falseDesc: string - scale: string - } -} diff --git a/src/api/subscription/consumer/index.ts b/src/api/subscription/consumer/index.ts deleted file mode 100644 index f10df17a..00000000 --- a/src/api/subscription/consumer/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { Consumer, GetConsumerListParams, Product } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getConsumerList(params: GetConsumerListParams) { - return defHttp.get>({ - url: '/server/consumer/page', - params, - }) -} - -export function createConsumer(data: Partial) { - return defHttp.post({ - url: '/server/consumer/save', - data, - }) -} - -export function updateConsumer(data: Partial) { - return defHttp.post({ - url: '/server/consumer/update', - data, - }) -} - -export function deleteConsumer(id: string) { - return defHttp.post({ - url: `/server/consumer/remove?id=${id}`, - }) -} - -export function getConsumerDetail(id: string) { - return defHttp.get({ - url: '/server/consumer/detail', - params: { - id, - }, - }) -} - -export function getOnlineClientList(consumerToken: string) { - return defHttp.get({ - url: '/server/client/list', - params: { - consumerToken, - }, - }) -} - -export function getSubscribeList(consumerId: string) { - return defHttp.get({ - url: '/server/consumer/subscribeList', - params: { - consumerId, - }, - }) -} - -export function disSubscription(consumerId: string, serverSubscribeId: string) { - return defHttp.post({ - url: `/server/consumer/unsubscription?consumerId=${consumerId}&serverSubscribeId=${serverSubscribeId}`, - }) -} diff --git a/src/api/subscription/consumer/types.ts b/src/api/subscription/consumer/types.ts deleted file mode 100644 index 35742dc8..00000000 --- a/src/api/subscription/consumer/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface GetConsumerListParams extends PageParam { - consumerName?: string -} - -export interface Consumer { - id: string - consumerName: string - consumerToken: string - createTime: string - subscribes: string -} - -export interface Product { - id: string - messageType: string - productId: string - tenantId: string -} diff --git a/src/api/subscription/list/index.ts b/src/api/subscription/list/index.ts deleted file mode 100644 index f8ee4511..00000000 --- a/src/api/subscription/list/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { GetSubscriptionListParams, SubScription } from './types' -import { defHttp } from '@/utils/http/axios' - -export function getSubscriptionList(params: GetSubscriptionListParams) { - return defHttp.get>({ - url: '/server/subscribe/page', - params, - }) -} - -export function createSubscription(data: Pick) { - return defHttp.post({ - url: '/server/subscribe/save', - data, - }) -} - -export function updateSubscription(data: Pick) { - return defHttp.post({ - url: '/server/subscribe/update', - data, - }) -} - -export function deleteSubscription(id: string) { - return defHttp.post({ - url: `/server/subscribe/remove?id=${id}`, - }) -} - -export function getAllSubscription() { - return defHttp.get({ - url: '/server/subscribe/select', - }) -} - -export function getSubscriptionDetail(id: string) { - return defHttp.get({ - url: '/server/consumer/detail', - params: { - id, - }, - }) -} diff --git a/src/api/subscription/list/types.ts b/src/api/subscription/list/types.ts deleted file mode 100644 index c1a66711..00000000 --- a/src/api/subscription/list/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface GetSubscriptionListParams extends PageParam { - productId?: string -} - -export interface SubScription { - id: string - messageType: string - productId: string - tenantId: string - createTime: string -} diff --git a/src/views/device-manage/device/DeviceFormModal.vue b/src/views/device-manage/device/DeviceFormModal.vue deleted file mode 100644 index 7afc2b8f..00000000 --- a/src/views/device-manage/device/DeviceFormModal.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/CloudCommand.vue b/src/views/device-manage/device/components/CloudCommand.vue deleted file mode 100644 index f901c310..00000000 --- a/src/views/device-manage/device/components/CloudCommand.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/DeviceInfo.vue b/src/views/device-manage/device/components/DeviceInfo.vue deleted file mode 100644 index a9600e4b..00000000 --- a/src/views/device-manage/device/components/DeviceInfo.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/MessageModal.vue b/src/views/device-manage/device/components/MessageModal.vue deleted file mode 100644 index 80e595a3..00000000 --- a/src/views/device-manage/device/components/MessageModal.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/MqttParamsModal.vue b/src/views/device-manage/device/components/MqttParamsModal.vue deleted file mode 100644 index d6aa0f43..00000000 --- a/src/views/device-manage/device/components/MqttParamsModal.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/SendCommandModal.vue b/src/views/device-manage/device/components/SendCommandModal.vue deleted file mode 100644 index 7c0dc6eb..00000000 --- a/src/views/device-manage/device/components/SendCommandModal.vue +++ /dev/null @@ -1,185 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/TopicList.vue b/src/views/device-manage/device/components/TopicList.vue deleted file mode 100644 index 745fed33..00000000 --- a/src/views/device-manage/device/components/TopicList.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/src/views/device-manage/device/components/composables/useDeviceInfo.ts b/src/views/device-manage/device/components/composables/useDeviceInfo.ts deleted file mode 100644 index 0f021d51..00000000 --- a/src/views/device-manage/device/components/composables/useDeviceInfo.ts +++ /dev/null @@ -1,84 +0,0 @@ -import type { Ref } from 'vue' -import { h } from 'vue' -import { Tag } from 'ant-design-vue' -import MqttParamsModal from '../MqttParamsModal.vue' -import MessageModal from '../MessageModal.vue' -import type { DescItem } from '@/components/Description' -import { getReportExample } from '@/api/device-manage/device' -import { usePermission } from '@/hooks/web/usePermission' -import type { Device } from '@/api/device-manage/device/types' - -export function useDeviceInfo(data: Ref) { - const { hasPermission } = usePermission() - - const scheam: DescItem[] = [ - { - field: 'productName', - label: '所属产品', - }, - { - field: 'deviceName', - label: '设备名称', - }, - { - field: 'deviceSn', - label: '设备序列号', - }, - { - field: 'deviceSecret', - label: '设备密钥', - }, - { - field: 'isActive', - label: '设备状态', - render(value) { - return h(Tag, { color: value ? 'green' : 'default' }, () => value ? '已激活' : '未激活') - }, - }, - { - field: 'isOnline', - label: '在线状态', - render(value) { - return h(Tag, { color: value ? 'green' : 'default' }, () => value ? '在线' : '离线') - }, - }, - { - field: 'createTime', - label: '创建时间', - }, - { - field: 'activeTime', - label: '激活时间', - }, - { - field: 'lastOnlineTime', - label: '最后上线时间', - }, - { - field: 'lastOfflineTime', - label: '最后离线时间', - }, - { - field: 'mqtt', - label: 'MQTT连接参数', - show: () => hasPermission('device_mqtt_params'), - render: () => h(MqttParamsModal, { deviceId: data.value!.id }), - }, - { - field: 'report', - label: '上报示例', - show: () => hasPermission('device_report_example'), - render: () => h(MessageModal, { - request: () => getReportExample(data.value!.productId, data.value!.deviceSn), - }), - }, - { - field: 'deviceDesc', - label: '设备描述', - }, - ] - - return { - scheam, - } -} diff --git a/src/views/device-manage/device/components/composables/useDeviceProperties.ts b/src/views/device-manage/device/components/composables/useDeviceProperties.ts deleted file mode 100644 index e19c55b9..00000000 --- a/src/views/device-manage/device/components/composables/useDeviceProperties.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { useAsyncState } from '@vueuse/core' -import { type MaybeRefOrGetter, toValue, watchEffect } from 'vue' -import { getDeviceProperties } from '@/api/device-manage/device' - -export function useDeviceProperties(modelId: MaybeRefOrGetter, deviceSn: MaybeRefOrGetter) { - const { state, execute, isLoading } = useAsyncState( - () => getDeviceProperties(toValue(modelId)!, toValue(deviceSn)!), - undefined, - { - immediate: false, - resetOnExecute: false, - }, - ) - - watchEffect(() => { - if (!toValue(modelId) || !toValue(deviceSn)) - return - - execute() - }) - - return { - isLoading, - deviceProperties: state, - reloadReviceProperties: execute, - } -} diff --git a/src/views/device-manage/device/components/index.ts b/src/views/device-manage/device/components/index.ts deleted file mode 100644 index 66066a05..00000000 --- a/src/views/device-manage/device/components/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as DeviceInfo } from './DeviceInfo.vue' -export { default as TopicList } from './TopicList.vue' -export { default as CloudCommand } from './CloudCommand.vue' -export { default as SendCommandModal } from './SendCommandModal.vue' diff --git a/src/views/device-manage/device/data.ts b/src/views/device-manage/device/data.ts deleted file mode 100644 index bd49e40e..00000000 --- a/src/views/device-manage/device/data.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { Tag } from 'ant-design-vue' -import type { Ref } from 'vue' -import { h } from 'vue' -import type { BasicColumn, FormSchema } from '@/components/Table' -import { getAllProducts } from '@/api/product' -import { getAllTenants } from '@/api/system/tenant' - -export const columns: BasicColumn[] = [ - { - title: '所属产品', - dataIndex: 'productName', - }, - { - title: '设备名称', - dataIndex: 'deviceName', - }, - { - title: '设备序列号', - dataIndex: 'deviceSn', - }, - { - title: '设备描述', - dataIndex: 'deviceDesc', - }, - { - title: '是否在线', - dataIndex: 'isOnline', - customRender({ value }) { - return h(Tag, { - color: value ? 'green' : 'default', - }, () => value ? '在线' : '离线') - }, - }, -] - -export const searchFormSchemas: FormSchema[] = [ - { - label: '所属租户', - field: 'tenantId', - component: 'ApiSelect', - componentProps: { - api: getAllTenants, - valueField: 'tenantId', - labelField: 'tenantName', - }, - colProps: { span: 6 }, - }, - { - label: '所属产品', - field: 'productId', - component: 'ApiSelect', - componentProps: { - api: getAllProducts, - valueField: 'id', - labelField: 'productName', - }, - colProps: { span: 6 }, - }, - { - label: '设备序列号', - field: 'deviceSn', - component: 'Input', - colProps: { span: 6 }, - }, - { - label: '设备名称', - field: 'deviceName', - component: 'Input', - colProps: { span: 6 }, - }, - { - label: '是否在线', - field: 'isOnline', - component: 'Select', - componentProps: { - options: [ - { label: '在线', value: 1 }, - { label: '离线', value: 0 }, - ], - }, - colProps: { span: 6 }, - }, -] - -export function getFormSchema(isUpdate: Ref): FormSchema[] { - return [ - { - field: 'id', - show: false, - component: 'Input', - }, - { - label: '设备名称', - field: 'deviceName', - component: 'Input', - required: true, - }, - { - label: '设备序列号', - field: 'deviceSn', - component: 'Input', - required: true, - ifShow: () => !isUpdate.value, - }, - { - label: '所属产品', - field: 'productId', - component: 'ApiSelect', - required: true, - ifShow: () => !isUpdate.value, - componentProps: { - api: getAllProducts, - valueField: 'id', - labelField: 'productName', - }, - }, - { - label: '设备描述', - field: 'deviceDesc', - component: 'InputTextArea', - }, - ] -} diff --git a/src/views/device-manage/device/detail.vue b/src/views/device-manage/device/detail.vue deleted file mode 100644 index 1c674b9e..00000000 --- a/src/views/device-manage/device/detail.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/src/views/device-manage/device/index.vue b/src/views/device-manage/device/index.vue deleted file mode 100644 index 9da1c6c3..00000000 --- a/src/views/device-manage/device/index.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - diff --git a/src/views/device-manage/group/components/BindingDeviceDrawer.vue b/src/views/device-manage/group/components/BindingDeviceDrawer.vue deleted file mode 100644 index fecdfddf..00000000 --- a/src/views/device-manage/group/components/BindingDeviceDrawer.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - diff --git a/src/views/device-manage/group/components/GroupFormModal.vue b/src/views/device-manage/group/components/GroupFormModal.vue deleted file mode 100644 index 996a0daa..00000000 --- a/src/views/device-manage/group/components/GroupFormModal.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/src/views/device-manage/group/components/GroupList.vue b/src/views/device-manage/group/components/GroupList.vue deleted file mode 100644 index d0c375fd..00000000 --- a/src/views/device-manage/group/components/GroupList.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/views/device-manage/group/components/index.ts b/src/views/device-manage/group/components/index.ts deleted file mode 100644 index 39614a1d..00000000 --- a/src/views/device-manage/group/components/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as GroupList } from './GroupList.vue' -export { default as BindingDeviceDrawer } from './BindingDeviceDrawer.vue' diff --git a/src/views/device-manage/group/data.ts b/src/views/device-manage/group/data.ts deleted file mode 100644 index 9f255d17..00000000 --- a/src/views/device-manage/group/data.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { h } from 'vue' -import { Tag } from 'ant-design-vue' -import type { BasicColumn, FormSchema } from '@/components/Table' -import { useSharedProducts } from '@/views/subscription/list/data' - -export function useColumns(): BasicColumn[] { - const { products } = useSharedProducts() - return [ - { - title: '所属产品', - dataIndex: 'productId', - customRender({ value }) { - return products.value.find(item => item.id === value)?.productName - }, - }, - { - title: '设备序列号', - dataIndex: 'deviceSn', - }, - { - title: '是否在线', - dataIndex: 'isOnline', - customRender({ value }) { - return h(Tag, { - color: value ? 'green' : 'default', - }, () => value ? '在线' : '离线') - }, - }, - ] -} - -export function useSearchFormSchemas(): FormSchema[] { - const { products } = useSharedProducts() - return [ - { - label: '所属产品', - field: 'productId', - component: 'Select', - componentProps: { - options: products as any, - showSearch: true, - fieldNames: { - label: 'productName', - value: 'id', - }, - }, - colProps: { - span: 8, - }, - }, - { - label: '设备序列号', - field: 'deviceSn', - component: 'Input', - colProps: { - span: 8, - }, - }, - ] -} diff --git a/src/views/device-manage/group/index.vue b/src/views/device-manage/group/index.vue deleted file mode 100644 index 6e4097d6..00000000 --- a/src/views/device-manage/group/index.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - diff --git a/src/views/monitor-ops/log/MessageContentModal.vue b/src/views/monitor-ops/log/MessageContentModal.vue deleted file mode 100644 index ffb1e466..00000000 --- a/src/views/monitor-ops/log/MessageContentModal.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - diff --git a/src/views/monitor-ops/log/data.ts b/src/views/monitor-ops/log/data.ts deleted file mode 100644 index 14e6f2f6..00000000 --- a/src/views/monitor-ops/log/data.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { h } from 'vue' -import { Tag } from 'ant-design-vue' -import dayjs from 'dayjs' -import type { BasicColumn, FormSchema } from '@/components/Table' -import { useSystemEnumStore } from '@/store/modules/systemEnum' -import { useSharedProducts } from '@/views/subscription/list/data' - -export function useColumns(): BasicColumn[] { - const { products } = useSharedProducts() - const { getSystemEnumLabel } = useSystemEnumStore() - - return [ - { - title: '所属产品', - dataIndex: 'productId', - customRender({ value }) { - return products.value.find(item => item.id === value)?.productName - }, - }, - { - title: '设备序列号', - dataIndex: 'deviceSn', - }, - { - title: 'TraceID', - dataIndex: 'traceId', - }, - { - title: '消息内容', - dataIndex: 'messageId', - width: 120, - }, - { - title: '业务类型', - dataIndex: 'bizType', - width: 150, - customRender({ value }) { - return h(Tag, () => getSystemEnumLabel('eDeviceLogBizType', value)) - }, - }, - { - title: '操作', - dataIndex: 'operation', - }, - { - title: '时间', - dataIndex: 'createTime', - }, - { - title: '状态', - dataIndex: 'code', - width: 120, - customRender({ value }) { - return h('b', { - style: { - color: value === 200 ? '#16a34a' : '#dc2626', - }, - }, value) - }, - }, - ] -} - -export function useSearchFormSchema(): FormSchema[] { - const { products } = useSharedProducts() - const { getSystemEnums } = useSystemEnumStore() - - return [ - { - field: 'productId', - label: '所属产品', - component: 'Select', - componentProps: { - options: products as any, - showSearch: true, - fieldNames: { - label: 'productName', - value: 'id', - }, - }, - colProps: { - span: 6, - }, - }, - { - field: 'deviceSn', - label: '设备序列号', - component: 'Input', - colProps: { - span: 6, - }, - }, - { - field: 'traceId', - label: 'TraceId', - component: 'Input', - colProps: { - span: 6, - }, - }, - { - field: 'bizType', - label: '业务类型', - component: 'Select', - componentProps: { - options: getSystemEnums('eDeviceLogBizType'), - }, - colProps: { - span: 6, - }, - }, - { - field: 'time', - label: '日志时间', - component: 'RangePicker', - componentProps: { - showTime: true, - disabledDate(current) { - return current && current > dayjs().endOf('day') - }, - }, - colProps: { - span: 6, - }, - }, - ] -} diff --git a/src/views/monitor-ops/log/index.vue b/src/views/monitor-ops/log/index.vue deleted file mode 100644 index a759a86c..00000000 --- a/src/views/monitor-ops/log/index.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/src/views/product/ProductFormModal.vue b/src/views/product/ProductFormModal.vue deleted file mode 100644 index 2469206c..00000000 --- a/src/views/product/ProductFormModal.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/src/views/product/components/Model.vue b/src/views/product/components/Model.vue deleted file mode 100644 index 19e2799a..00000000 --- a/src/views/product/components/Model.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - diff --git a/src/views/product/components/ModelAttributeFormModal.vue b/src/views/product/components/ModelAttributeFormModal.vue deleted file mode 100644 index 768a27b5..00000000 --- a/src/views/product/components/ModelAttributeFormModal.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - diff --git a/src/views/product/components/ModelServiceFormModal.vue b/src/views/product/components/ModelServiceFormModal.vue deleted file mode 100644 index 0eb833b9..00000000 --- a/src/views/product/components/ModelServiceFormModal.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - diff --git a/src/views/product/components/Subscription.vue b/src/views/product/components/Subscription.vue deleted file mode 100644 index 6de0e2b4..00000000 --- a/src/views/product/components/Subscription.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - diff --git a/src/views/product/components/TopicFormModal.vue b/src/views/product/components/TopicFormModal.vue deleted file mode 100644 index a15fc823..00000000 --- a/src/views/product/components/TopicFormModal.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - diff --git a/src/views/product/components/TopicManage.vue b/src/views/product/components/TopicManage.vue deleted file mode 100644 index e95376a3..00000000 --- a/src/views/product/components/TopicManage.vue +++ /dev/null @@ -1,145 +0,0 @@ - - - diff --git a/src/views/product/components/composables/useModelAttribute.ts b/src/views/product/components/composables/useModelAttribute.ts deleted file mode 100644 index a5db29be..00000000 --- a/src/views/product/components/composables/useModelAttribute.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { unref } from 'vue' -import type { MaybeRef, Ref } from 'vue' -import { useTable } from '@/components/Table' -import { deleteModelAttribute, getModelAttributeList } from '@/api/product/model' -import { useModal } from '@/components/Modal' -import type { ModelAttribute } from '@/api/product/types' -import { useMessage } from '@/hooks/web/useMessage' - -export function useModelAttribute(productId: MaybeRef, modelId: Ref) { - const [registerModelAttributeTable, { reload, setPagination }] = useTable({ - async api(params) { - if (!unref(modelId)) - return [] - - return getModelAttributeList({ - ...params, - productId: unref(productId), - modelId: unref(modelId), - }) - }, - columns: [ - { - title: '功能类型', - dataIndex: 'itemType', - customRender: ({ value }) => ({ 1: '属性', 2: '命令' }[value]), - }, - { - title: '功能名称', - dataIndex: 'name', - }, - { - title: '标识符', - dataIndex: 'identifier', - }, - { - title: '数据类型', - dataIndex: 'dataType', - }, - ], - bordered: true, - inset: true, - canResize: false, - actionColumn: { - width: 150, - title: '操作', - dataIndex: 'action', - fixed: 'right', - auth: ['product_model_attr_delete', 'product_model_attr_edit'], - }, - }) - - const [registerModelAttributeModal, { openModal: openModelAttributeModal }] = useModal() - - async function handleDeleteModelAttribute(id: string) { - try { - await deleteModelAttribute(id) - useMessage().createMessage.success('删除成功') - reload() - } - catch {} - } - - return { - registerModelAttributeTable, - registerModelAttributeModal, - openModelAttributeModal, - /** - * @param resetPageCurrent 是否重置分页 - */ - reloadModalAttribute(resetPageCurrent = false) { - if (resetPageCurrent) - setPagination({ current: 1 }) - - reload() - }, - handleDeleteModelAttribute, - } -} diff --git a/src/views/product/components/composables/useModelService.ts b/src/views/product/components/composables/useModelService.ts deleted file mode 100644 index 11f2cc72..00000000 --- a/src/views/product/components/composables/useModelService.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ref } from 'vue' -import { useAsyncState, watchOnce } from '@vueuse/core' -import { deleteModelService, getAllModelServices } from '@/api/product/model' -import { useMessage } from '@/hooks/web/useMessage' -import { useModal } from '@/components/Modal' -import type { ModelService } from '@/api/product/types' - -export function useModelService(productId: string, defaultModelId?: string) { - const selectedModelId = ref() - - const { state, execute } = useAsyncState(() => getAllModelServices(productId), [], { - resetOnExecute: false, - }) - - // 默认选择的 ModelId, 如果没有 defaultModelId 则是第一个元素的 Id - watchOnce(state, () => { - if (state.value.length > 0) - selectedModelId.value = defaultModelId || state.value[0].id - }) - - const [registerModelServiceModal, { openModal }] = useModal() - - async function handleDeleteModelService(id: string) { - try { - await deleteModelService(id) - useMessage().createMessage.success('删除成功') - execute() - } - catch {} - } - - return { - selectedModelId, - setSelectedModelId: (id: string) => selectedModelId.value = id, - reloadModelService: execute, - modelServiceList: state, - handleDeleteModelService, - registerModelServiceModal, - openModelServiceModal: openModal, - } -} diff --git a/src/views/product/components/index.ts b/src/views/product/components/index.ts deleted file mode 100644 index cf20d6d4..00000000 --- a/src/views/product/components/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as TopicManage } from './TopicManage.vue' -export { default as Model } from './Model.vue' -export { default as Subscription } from './Subscription.vue' diff --git a/src/views/product/data.ts b/src/views/product/data.ts deleted file mode 100644 index 327de5e5..00000000 --- a/src/views/product/data.ts +++ /dev/null @@ -1,188 +0,0 @@ -import type { Ref } from 'vue' -import type { BasicColumn, FormSchema } from '@/components/Table' -import { useSystemEnumStoreWithOut } from '@/store/modules/systemEnum' - -const { getSystemEnumLabel, getSystemEnums } = useSystemEnumStoreWithOut() - -export const columns: BasicColumn[] = [ - { - title: '产品名称', - dataIndex: 'productName', - }, - { - title: '产品标识', - dataIndex: 'productKey', - }, - { - title: '节点类型', - dataIndex: 'nodeType', - customRender: ({ value }) => getSystemEnumLabel('eProductNodeType', value), - }, - { - title: '联网方式', - dataIndex: 'networkType', - customRender: ({ value }) => getSystemEnumLabel('eNetworkType', value), - }, - { - title: '鉴权方式', - dataIndex: 'authType', - customRender: ({ value }) => getSystemEnumLabel('eAuthType', value), - }, - { - title: '安全类型', - dataIndex: 'securityType', - customRender: ({ value }) => getSystemEnumLabel('eProductSecurityType', value), - }, - { - title: '通信协议', - dataIndex: 'networkProtocol', - customRender: ({ value }) => getSystemEnumLabel('eNetworkProtocol', value), - }, - { - title: '数据格式', - dataIndex: 'dataType', - customRender: ({ value }) => getSystemEnumLabel('eDataType', value), - }, - { - title: '创建时间', - dataIndex: 'createTime', - width: 200, - }, -] - -export const searchFormSchemas: FormSchema[] = [ - { - label: '产品名称', - field: 'productName', - component: 'Input', - colProps: { span: 6 }, - }, - { - label: '联网方式', - field: 'networkType', - component: 'Select', - componentProps: { - options: getSystemEnums('eNetworkType'), - }, - colProps: { span: 6 }, - }, - { - label: '通信协议', - field: 'networkProtocol', - component: 'Select', - componentProps: { - options: getSystemEnums('eNetworkProtocol'), - }, - colProps: { span: 6 }, - }, - { - label: '节点类型', - field: 'nodeType', - component: 'Select', - componentProps: { - options: getSystemEnums('eProductNodeType'), - }, - colProps: { span: 6 }, - }, - { - label: '安全类型', - field: 'securityType', - component: 'Select', - componentProps: { - options: getSystemEnums('eProductSecurityType'), - }, - colProps: { span: 6 }, - }, - { - label: '数据格式', - field: 'dataType', - component: 'Select', - componentProps: { - options: getSystemEnums('eDataType'), - }, - colProps: { span: 6 }, - }, -] - -export function getFormSchema(isUpdate: Ref): FormSchema[] { - return [ - { - field: 'id', - show: false, - component: 'Input', - }, - { - label: '产品名称', - field: 'productName', - required: true, - component: 'Input', - }, - { - label: '联网方式', - field: 'networkType', - component: 'Select', - componentProps: { - options: getSystemEnums('eNetworkType'), - }, - }, - { - label: '通信协议', - field: 'networkProtocol', - component: 'Select', - componentProps: { - options: getSystemEnums('eNetworkProtocol'), - }, - ifShow: () => !isUpdate.value, - }, - { - label: '节点类型', - field: 'nodeType', - required: true, - component: 'Select', - componentProps: { - options: getSystemEnums('eProductNodeType'), - }, - ifShow: () => !isUpdate.value, - }, - { - label: '安全类型', - field: 'securityType', - component: 'Select', - componentProps: { - options: getSystemEnums('eProductSecurityType'), - }, - ifShow: () => !isUpdate.value, - }, - { - label: '鉴权方式', - field: 'authType', - required: true, - component: 'Select', - componentProps: { - options: getSystemEnums('eAuthType'), - }, - ifShow: () => !isUpdate.value, - }, - { - label: '数据格式', - field: 'dataType', - required: true, - component: 'Select', - componentProps: { - options: getSystemEnums('eDataType'), - }, - ifShow: () => !isUpdate.value, - }, - { - label: '产品描述', - field: 'productDesc', - component: 'InputTextArea', - }, - ] -} - -export enum ProductTabEnums { - TopicManage = '1', - Model = '2', - Subscription = '3', -} diff --git a/src/views/product/detail.vue b/src/views/product/detail.vue deleted file mode 100644 index ead6b75c..00000000 --- a/src/views/product/detail.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - diff --git a/src/views/product/index.vue b/src/views/product/index.vue deleted file mode 100644 index 4cc56301..00000000 --- a/src/views/product/index.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - diff --git a/src/views/subscription/consumer/ConsumerFormModal.vue b/src/views/subscription/consumer/ConsumerFormModal.vue deleted file mode 100644 index c7374e1b..00000000 --- a/src/views/subscription/consumer/ConsumerFormModal.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/src/views/subscription/consumer/components/OnlineClient.vue b/src/views/subscription/consumer/components/OnlineClient.vue deleted file mode 100644 index 4578b3c6..00000000 --- a/src/views/subscription/consumer/components/OnlineClient.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/src/views/subscription/consumer/components/Product.vue b/src/views/subscription/consumer/components/Product.vue deleted file mode 100644 index f2c98696..00000000 --- a/src/views/subscription/consumer/components/Product.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - diff --git a/src/views/subscription/consumer/components/index.ts b/src/views/subscription/consumer/components/index.ts deleted file mode 100644 index eda7e295..00000000 --- a/src/views/subscription/consumer/components/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as OnlineClient } from './OnlineClient.vue' -export { default as Product } from './Product.vue' diff --git a/src/views/subscription/consumer/data.ts b/src/views/subscription/consumer/data.ts deleted file mode 100644 index 0d9020c3..00000000 --- a/src/views/subscription/consumer/data.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { BasicColumn, FormSchema } from '@/components/Table' -import { getAllSubscription } from '@/api/subscription/list' - -export const columns: BasicColumn[] = [ - { - title: '消费组名称', - dataIndex: 'consumerName', - }, - { - title: '消费组 Token', - dataIndex: 'consumerToken', - }, - { - title: '创建时间', - dataIndex: 'createTime', - }, -] - -export const searchFormSchema: FormSchema[] = [ - { - field: 'consumerName', - label: '消费组名称', - component: 'Input', - colProps: { - span: 6, - }, - }, -] - -export const formSchema: FormSchema[] = [ - { - field: 'consumerName', - fields: ['id'], - label: '消费组名称', - required: true, - component: 'Input', - }, - { - field: 'subscribeIds', - label: '订阅', - required: true, - component: 'ApiSelect', - componentProps: { - api: getAllSubscription, - mode: 'multiple', - valueField: 'id', - labelField: 'productName', - }, - }, -] diff --git a/src/views/subscription/consumer/detail.vue b/src/views/subscription/consumer/detail.vue deleted file mode 100644 index 17c6f469..00000000 --- a/src/views/subscription/consumer/detail.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - diff --git a/src/views/subscription/consumer/index.vue b/src/views/subscription/consumer/index.vue deleted file mode 100644 index 32112427..00000000 --- a/src/views/subscription/consumer/index.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/src/views/subscription/list/SubscriptionFormModal.vue b/src/views/subscription/list/SubscriptionFormModal.vue deleted file mode 100644 index abee291a..00000000 --- a/src/views/subscription/list/SubscriptionFormModal.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/src/views/subscription/list/data.ts b/src/views/subscription/list/data.ts deleted file mode 100644 index 21b14d14..00000000 --- a/src/views/subscription/list/data.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { h } from 'vue' -import type { Ref } from 'vue' -import { Space, Tag } from 'ant-design-vue' -import { createSharedComposable, useAsyncState } from '@vueuse/core' -import type { BasicColumn, FormSchema } from '@/components/Table' -import { useSystemEnumStore } from '@/store/modules/systemEnum' -import { getAllProducts } from '@/api/product' - -export const useSharedProducts = createSharedComposable(() => { - const { state } = useAsyncState(getAllProducts, []) - return { products: state } -}) - -export function useColumns(): BasicColumn[] { - const { getSystemEnums } = useSystemEnumStore() - const { products } = useSharedProducts() - - return [ - { - title: '产品名称', - dataIndex: 'productId', - customRender({ value }) { - return products.value.find(item => item.id === value)?.productName - }, - }, - { - title: '推送消息类型', - dataIndex: 'messageType', - customRender({ value }) { - const values = value.split(',') - const types = getSystemEnums('eSubscribeMessageType') - return h( - Space, - () => types - .map(item => values.includes(item.value.toString()) ? item.label : null) - .filter(Boolean) - .map(name => h(Tag, () => name)), - ) - }, - }, - { - title: '创建时间', - dataIndex: 'createTime', - }, - ] -} - -export function useSearchFormSchema(productId?: string): FormSchema[] { - const { products } = useSharedProducts() - - return [ - { - field: 'productId', - label: '产品名称', - component: 'Select', - componentProps: { - options: products as any, - showSearch: true, - fieldNames: { - label: 'productName', - value: 'id', - }, - }, - defaultValue: productId || undefined, - colProps: { - span: 6, - }, - }, - ] -} - -export function useFormSchema(isUpload: Ref): FormSchema[] { - const { products } = useSharedProducts() - const { getSystemEnums } = useSystemEnumStore() - - return [ - { - field: 'productId', - fields: ['id'], - label: '产品名称', - required: true, - component: 'ApiSelect', - componentProps: { - options: products as any, - showSearch: true, - fieldNames: { - label: 'productName', - value: 'id', - }, - }, - dynamicDisabled: () => isUpload.value, - }, - { - field: 'messageType', - label: '推送消息类型', - required: true, - component: 'Select', - componentProps: { - mode: 'multiple', - options: getSystemEnums('eSubscribeMessageType'), - }, - }, - ] -} diff --git a/src/views/subscription/list/index.vue b/src/views/subscription/list/index.vue deleted file mode 100644 index 38f7c23f..00000000 --- a/src/views/subscription/list/index.vue +++ /dev/null @@ -1,86 +0,0 @@ - - -