From 96787070ea5bca0407dd8d377373b3e66b2597fe Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Mon, 30 Jan 2023 17:06:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?update:=20=E5=88=A0=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/BasicLayout.tsx | 9 ++------- src/components/Layout/components/Header/Header.tsx | 1 - src/components/Layout/components/Header/index.tsx | 7 +------ src/components/Layout/components/SiderMenu/SiderMenu.tsx | 6 ------ src/utils/comm.ts | 2 -- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/components/Layout/BasicLayout.tsx b/src/components/Layout/BasicLayout.tsx index d091510a..18cfcdf2 100644 --- a/src/components/Layout/BasicLayout.tsx +++ b/src/components/Layout/BasicLayout.tsx @@ -7,21 +7,16 @@ import { provide } from 'vue' -import type { DefineComponent, ExtractPropTypes, PropType, CSSProperties, Plugin, App } from 'vue' +import type { ExtractPropTypes, PropType, CSSProperties} from 'vue' import { Layout } from 'ant-design-vue' -import useConfigInject from 'ant-design-vue/es/_util/hooks/useConfigInject' -import { defaultSettingProps, defaultSettings } from './defaultSetting' -import type { PureSettings } from './defaultSetting' +import { defaultSettingProps } from './defaultSetting' import type { BreadcrumbProps, RouteContextProps } from './RouteContext' import type { BreadcrumbRender, CollapsedButtonRender, CustomRender, - FooterRender, - HeaderContentRender, HeaderRender, MenuContentRender, MenuExtraRender, - MenuFooterRender, MenuHeaderRender, MenuItemRender, RightContentRender, diff --git a/src/components/Layout/components/Header/Header.tsx b/src/components/Layout/components/Header/Header.tsx index f3ff3654..8d7de6d7 100644 --- a/src/components/Layout/components/Header/Header.tsx +++ b/src/components/Layout/components/Header/Header.tsx @@ -8,7 +8,6 @@ import { defaultSettingProps } from 'components/Layout/defaultSetting' import PropTypes from 'ant-design-vue/es/_util/vue-types' import { CustomRender, MenuDataItem, ProProps, RightContentRender, WithFalse } from 'components/Layout/typings' import './index.less' -import { omit } from 'lodash-es' import { RouteRecordRaw } from 'vue-router' import { clearMenuItem } from 'components/Layout/utils' diff --git a/src/components/Layout/components/Header/index.tsx b/src/components/Layout/components/Header/index.tsx index ad2a8461..c4bfc014 100644 --- a/src/components/Layout/components/Header/index.tsx +++ b/src/components/Layout/components/Header/index.tsx @@ -1,13 +1,8 @@ -import type { ExtractPropTypes, PropType } from 'vue' -import PropTypes from 'ant-design-vue/es/_util/vue-types'; -import type { MenuDataItem, WithFalse, ProProps, CustomRender, RightContentRender } from '../../typings' -import { siderMenuProps } from '../SiderMenu/SiderMenu' -import { defaultSettingProps } from 'components/Layout/defaultSetting' +import type { ExtractPropTypes } from 'vue' import Header, { headerProps } from './Header' import { useRouteContext } from 'components/Layout/RouteContext' import type { RouteRecordRaw } from 'vue-router' import { clearMenuItem } from 'components/Layout/utils' -import DefaultSetting from '../../../../../config/config' import { Layout } from 'ant-design-vue' export const headerViewProps = { diff --git a/src/components/Layout/components/SiderMenu/SiderMenu.tsx b/src/components/Layout/components/SiderMenu/SiderMenu.tsx index 29587b4a..89496a93 100644 --- a/src/components/Layout/components/SiderMenu/SiderMenu.tsx +++ b/src/components/Layout/components/SiderMenu/SiderMenu.tsx @@ -18,10 +18,6 @@ import './SiderMenu.less' import { computed } from 'vue' import { omit } from 'lodash-es' -export type PrivateSiderMenuProps = { - matchMenuKeys?: string[]; -} - const { Sider } = Layout export const defaultRenderLogo = (logo?: CustomRender, logoStyle?: CSSProperties): CustomRender => { @@ -89,7 +85,6 @@ const SiderMenu: FunctionalComponent = (props, { slots, emit}) = const { collapsed, collapsedWidth = 48, - menuExtraRender = false, menuContentRender = false, collapsedButtonRender = defaultRenderCollapsedButton, } = props; @@ -97,7 +92,6 @@ const SiderMenu: FunctionalComponent = (props, { slots, emit}) = const context = useRouteContext(); const sSideWidth = computed(() => (props.collapsed ? props.collapsedWidth : props.siderWidth)); - const extraDom = menuExtraRender && menuExtraRender(props); const handleSelect = ($event: string[]) => { if (props.onSelect) { diff --git a/src/utils/comm.ts b/src/utils/comm.ts index addc6a11..be44886c 100644 --- a/src/utils/comm.ts +++ b/src/utils/comm.ts @@ -1,7 +1,5 @@ import type { Slots } from 'vue' import { TOKEN_KEY } from '@/utils/variable' -import { Terms } from 'components/Search/types' -import { urlReg } from '@/utils/regular' /** * 静态图片资源处理 From 9da85995756042cf3e64854559d37e0768202331 Mon Sep 17 00:00:00 2001 From: xiongqian <2167232911@qq.com> Date: Mon, 30 Jan 2023 17:19:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/device/device-type-3.png | Bin 0 -> 1829 bytes src/api/device/category.ts | 2 +- src/api/device/product.ts | 73 ++- src/router/menu.ts | 7 +- .../Category/components/modifyModal/index.vue | 135 +++-- src/views/device/Category/index.vue | 46 +- src/views/device/Instance/index.vue | 464 ++++++++++------ src/views/device/Product/ChooseCard/index.vue | 313 +++++++++++ src/views/device/Product/Save/index.vue | 386 ++++++++++++++ src/views/device/Product/index.vue | 498 ++++++++++++++++++ src/views/device/Product/typings.d.ts | 12 + src/views/init-home/index.vue | 2 +- 12 files changed, 1701 insertions(+), 237 deletions(-) create mode 100644 public/images/device/device-type-3.png create mode 100644 src/views/device/Product/ChooseCard/index.vue create mode 100644 src/views/device/Product/Save/index.vue create mode 100644 src/views/device/Product/index.vue diff --git a/public/images/device/device-type-3.png b/public/images/device/device-type-3.png new file mode 100644 index 0000000000000000000000000000000000000000..3561237e70b88989cb0079de46a2a1befb57fc15 GIT binary patch literal 1829 zcmV+=2io|FP)>lXf00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`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FQV71$2aK>Db62Wy@KK5xNu3 z4uF*$A^imC3^N8gQT2)q+WbHTo=(IklpEG2&_oM=Tcf~i~Un%q7chf0Zk!v;)@y;>v z!F^e>(e|3v?pusILc|3T?GvJ);lAbki~5S^@Q>|xYu2uWle+OS4{oP{KFs+1PQhTI zQGZ3;DR$~JFj=4I!--2B=^Fg5*aDIyWyFB9jeuV1r@`Y1x*}#Avr9n>vgL!V6zln52vFZBj`|oS6XI~Z9o@@qmZdkvR2=mp+JHd@rUp1UL6^r@7-KSke+GOPJ@OT0WfoKpgArI+}IDGC6Ih$DN&gLebU|9j$6&u5+v9PBip3KV_Q?nml@wm^(hF$(-XB3djfzPV+@ zR-(Q0kxfI_He@>Kso)F~cd?=6g91Di$W9>V0%=8ZX!OTck03s`7#*MT@Rad?2##oO TVX3|?00000NkvXXu0mjfVDV!8 literal 0 HcmV?d00001 diff --git a/src/api/device/category.ts b/src/api/device/category.ts index d18e3587..53c93ec4 100644 --- a/src/api/device/category.ts +++ b/src/api/device/category.ts @@ -16,7 +16,7 @@ export const queryTree = (params?: Record) => server.post server.put(`/device/category/${id}`, data) + export const updateTree = (id:string,data: any,) => server.put(`/device/category/${id}`, data) /** * 根据Id删除数据 diff --git a/src/api/device/product.ts b/src/api/device/product.ts index 6f318dcf..17100b3f 100644 --- a/src/api/device/product.ts +++ b/src/api/device/product.ts @@ -1,5 +1,5 @@ import server from '@/utils/request' -import { DeviceMetadata, ProductItem } from '@/views/device/Product/typings' +import { DeviceMetadata, ProductItem, DepartmentItem } from '@/views/device/Product/typings' /** * 根据条件查询产品(不带翻页) @@ -40,6 +40,73 @@ export const detail = (id: string) => server.get(`/device-product/$ /** * 产品分类 - * @param data + * @param data 查询条件 */ -export const category = (data: any) => server.post('/device/category/_tree', data) \ No newline at end of file +export const category = (data: any) => server.post('/device/category/_tree', data) + +/** + * 获取网关类型 + */ + export const getProviders = () => server.get('/gateway/device/providers') + + /** + * 查询所属部门 + * @param params 查询条件 + */ + export const queryOrgThree = (params?: Record) => server.post('/organization/_all/tree', params) + + /** + * 获取接入方式 + * @param data 查询条件 + */ + export const queryGatewayList = (data: any) => server.post('/gateway/device/_query/no-paging', data) + + /** + * 查询产品列表(分页) + * @param data 查询条件 + */ + export const queryProductList = (data: any) => server.post('/device-product/_query', data) + + /** + * 启用产品 + * @param productId 产品ID + * @param data + * @returns + */ +export const _deploy = (productId: string) => server.post(`/device-product/${productId}/deploy`) + +/** + * 禁用产品 + * @param productId 产品ID + * @param data + * @returns + */ +export const _undeploy = (productId: string) => server.post(`/device-product/${productId}/undeploy`) + +/** + * 新增产品 + * @param data + * @returns + */ +export const addProduct = (data:any) => server.post('/device-product',data) + +/** + * 修改产品 + * @param id 产品ID + * @param data + * @returns + */ +export const editProduct = (data: any) => server.patch('/device-product', data) + +/** + * 删除产品 + * @param id 产品ID + */ +export const deleteProduct = (id: string) => server.patch(`/device-product/${id}`) + +/** + * 检测产品Id唯一性 + * @param id 产品ID + */ + export const queryProductId = (id: string) => server.post(`/device-product/${id}/exists`) + \ No newline at end of file diff --git a/src/router/menu.ts b/src/router/menu.ts index 78683b84..fbc5fc7e 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -141,5 +141,10 @@ export default [ { path: '/iot/device/Category', component: () => import('@/views/device/Category/index.vue') - } + } , + // 产品 + { + path: '/iot/device/Product', + component: () => import('@/views/device/Product/index.vue') + } ] \ No newline at end of file diff --git a/src/views/device/Category/components/modifyModal/index.vue b/src/views/device/Category/components/modifyModal/index.vue index ea420fa9..371b7900 100644 --- a/src/views/device/Category/components/modifyModal/index.vue +++ b/src/views/device/Category/components/modifyModal/index.vue @@ -13,23 +13,24 @@ > - - + + - + @@ -37,6 +38,7 @@ v-model:value="formModel.description" show-count :maxlength="200" + placeholder="请输入说明" /> @@ -44,10 +46,12 @@ \ No newline at end of file +}; + diff --git a/src/views/device/Product/ChooseCard/index.vue b/src/views/device/Product/ChooseCard/index.vue new file mode 100644 index 00000000..a60c1753 --- /dev/null +++ b/src/views/device/Product/ChooseCard/index.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue new file mode 100644 index 00000000..1c928ba6 --- /dev/null +++ b/src/views/device/Product/Save/index.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue new file mode 100644 index 00000000..c5d6d505 --- /dev/null +++ b/src/views/device/Product/index.vue @@ -0,0 +1,498 @@ + + + + + diff --git a/src/views/device/Product/typings.d.ts b/src/views/device/Product/typings.d.ts index d7b9c831..3cdffb00 100644 --- a/src/views/device/Product/typings.d.ts +++ b/src/views/device/Product/typings.d.ts @@ -177,3 +177,15 @@ type ObserverMetadata = { subscribe: (data: any) => void; next: (data: any) => void; }; + +// 部门 +export type DepartmentItem = { + id: string; + name: string; + path: string; + sortIndex: number; + level: number; + code: string; + parentId: string; + children: DepartmentItem[]; +}; \ No newline at end of file diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue index 20585ac9..896f2983 100644 --- a/src/views/init-home/index.vue +++ b/src/views/init-home/index.vue @@ -801,7 +801,7 @@ const rulesFrom = ref({ { required: true, message: '请输入系统名称', - trigger: 'blur', + trigger: 'change', }, ], headerTheme: [ From 9a82577e9c9749cc0eeac4dc1f63e704a2b73851 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Mon, 30 Jan 2023 17:30:12 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E7=BB=91=E5=AE=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/notice/Config/SyncUser/index.vue | 285 +++++++++++++-------- 1 file changed, 176 insertions(+), 109 deletions(-) diff --git a/src/views/notice/Config/SyncUser/index.vue b/src/views/notice/Config/SyncUser/index.vue index f6f76166..1fc23686 100644 --- a/src/views/notice/Config/SyncUser/index.vue +++ b/src/views/notice/Config/SyncUser/index.vue @@ -1,103 +1,125 @@