diff --git a/components.d.ts b/components.d.ts index d3e76598..f0d011ba 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,6 +7,7 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AAlert: typeof import('ant-design-vue/es')['Alert'] ABadge: typeof import('ant-design-vue/es')['Badge'] AButton: typeof import('ant-design-vue/es')['Button'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] @@ -25,12 +26,16 @@ declare module '@vue/runtime-core' { AModal: typeof import('ant-design-vue/es')['Modal'] APagination: typeof import('ant-design-vue/es')['Pagination'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] + ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASpin: typeof import('ant-design-vue/es')['Spin'] + ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] + ATimePicker: typeof import('ant-design-vue/es')['TimePicker'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] + ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect'] AUpload: typeof import('ant-design-vue/es')['Upload'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'] diff --git a/src/api/bind.ts b/src/api/bind.ts index 88d88594..16766b81 100644 --- a/src/api/bind.ts +++ b/src/api/bind.ts @@ -1,4 +1,6 @@ -import { get } from '@/utils/request' +import { get, post } from '@/utils/request' // 三方应用账户信息 -export const applicationInfo = (code: string) => get(`/application/sso/bind-code/${code}`) \ No newline at end of file +export const applicationInfo = (code: string): any => get(`/application/sso/bind-code/${code}`) +// 立即绑定 +export const bindAccount = (code: string): any => post(`/application/sso/me/bind/${code}`) \ No newline at end of file diff --git a/src/api/link/accessConfig.js b/src/api/link/accessConfig.js new file mode 100644 index 00000000..0b972bb5 --- /dev/null +++ b/src/api/link/accessConfig.js @@ -0,0 +1,33 @@ +import server from '@/utils/request'; + +export const getProviders = () => server.get(`/gateway/device/providers`); + +export const detail = (id) => server.get(`/gateway/device/${id}`); + +export const getNetworkList = (networkType, data, params) => + server.get( + `/network/config/${networkType}/_alive?include=${params.include}`, + data, + ); + +export const getProtocolList = (transport, params) => + server.get(`/protocol/supports/${transport ? transport : ''}`, params); + +export const getConfigView = (id, transport) => + server.get(`/protocol/${id}/transport/${transport}`); + +export const getChildConfigView = (id) => + server.get(`/protocol/${id}/transports`); + +export const save = (data) => server.post(`/gateway/device`, data); + +export const update = (data) => server.patch(`/gateway/device`, data); + +export const list = (data) => + server.post(`/gateway/device/detail/_query`, data); + +export const undeploy = (id) => server.post(`/gateway/device/${id}/_shutdown`); + +export const deploy = (id) => server.post(`/gateway/device/${id}/_startup`); + +export const del = (id) => server.remove(`/gateway/device/${id}`); diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue index 7eda82d6..1cc26f6e 100644 --- a/src/components/CardBox/index.vue +++ b/src/components/CardBox/index.vue @@ -2,17 +2,10 @@
-
+
@@ -27,7 +20,7 @@ -
+
@@ -47,21 +40,12 @@ >
- - -
- -
- -
+ +
- - + + + + +
@@ -89,18 +87,26 @@ diff --git a/src/components/Form/FormBuilder.vue b/src/components/Form/FormBuilder.vue index d1a74645..cac91d0a 100644 --- a/src/components/Form/FormBuilder.vue +++ b/src/components/Form/FormBuilder.vue @@ -1,11 +1,252 @@ - \ No newline at end of file diff --git a/src/components/Table/old/index.module.less b/src/components/Table/old/index.module.less deleted file mode 100644 index 6c4c60cf..00000000 --- a/src/components/Table/old/index.module.less +++ /dev/null @@ -1,45 +0,0 @@ -.jtable-body { - width: 100%; - padding: 0 24px 24px; - background-color: white; - .jtable-body-header { - padding: 16px 0; - display: flex; - justify-content: space-between; - align-items: center; - .jtable-body-header-right { - display: flex; - gap: 8px; - .jtable-setting-item { - color: rgba(0, 0, 0, 0.75); - font-size: 16px; - cursor: pointer; - - &:hover { - color: @primary-color-hover; - } - - &.active { - color: @primary-color-active; - } - } - } - } - .jtable-content { - .jtable-card { - .jtable-card-items { - display: grid; - grid-gap: 26px; - // grid-template-columns: repeat(4, 1fr); - .jtable-card-item { - display: flex; - } - } - } - } - .jtable-pagination { - position: absolute; - right: 24px; - bottom: 24px; - } -} \ No newline at end of file diff --git a/src/components/Table/old/index.tsx b/src/components/Table/old/index.tsx deleted file mode 100644 index 39ac9e9c..00000000 --- a/src/components/Table/old/index.tsx +++ /dev/null @@ -1,168 +0,0 @@ -import { UnorderedListOutlined, AppstoreOutlined } from '@ant-design/icons-vue' -import styles from './index.module.less' -import { Pagination, Table, Empty } from 'ant-design-vue' -import type { TableProps } from 'ant-design-vue/es/table' - -enum ModelEnum { - TABLE = 'TABLE', - CARD = 'CARD', -} - -export declare type RequestData = { - code: string; - result: { - data: any[] | undefined; - pageIndex: number; - pageSize: number; - total: number; - }; - status: number; -} & Record; - -interface JTableProps extends TableProps{ - request: (params: Record & { - pageSize: number; - pageIndex: number; - }) => Promise>; - cardBodyClass: string; -} - -const JTable = defineComponent({ - name: 'JTable', - slots: [ - 'headerTitle', // 顶部左边插槽 - 'cardRender', // 卡片内容 - ], - emits: [ - 'modelChange', // 切换卡片和表格 - ], - props: { - cardBodyClass: '', - request: undefined, - columns: [] - } as any, - setup(props ,{ slots, emit }){ - const model = ref(ModelEnum.CARD); // 模式切换 - const column = ref(3); - console.log(props.columns, props.request) - const dataSource = ref([ - { - key: '1', - name: '胡彦斌', - age: 32, - address: '西湖区湖底公园1号', - }, - { - key: '2', - name: '胡彦祖1', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '3', - name: '胡彦斌', - age: 32, - address: '西湖区湖底公园1号', - }, - { - key: '4', - name: '胡彦祖1', - age: 42, - address: '西湖区湖底公园1号', - }, - { - key: '5', - name: '胡彦斌', - age: 32, - address: '西湖区湖底公园1号', - }, - { - key: '6', - name: '胡彦祖1', - age: 42, - address: '西湖区湖底公园1号', - }, - ]) - - // 请求数据 - - onMounted(() => { - - }) - - return () =>
-
-
- {/* 顶部左边插槽 */} - {slots.headerTitle && slots.headerTitle()} -
-
- {/* */} -
{ - model.value = ModelEnum.CARD - }}> - -
-
{ - model.value = ModelEnum.TABLE - }}> - -
- {/*
*/} -
-
- {/* content */} -
- { - model.value === ModelEnum.CARD ? -
- { - dataSource.value.length ? -
- { - dataSource.value.map(item => slots.cardRender ? -
{slots.cardRender(item)}
- : null) - } -
: -
- } -
: -
- - - } - - {/* 分页 */} - { - dataSource.value.length && -
- { - const min = 1 - const max = 1 - return `第 ${min} - ${max} 条/总共 ${total} 条` - }} - onChange={() => { - - }} - onShowSizeChange={() => { - - }} - /> -
- } - - } -}) - -export default JTable diff --git a/src/components/index.ts b/src/components/index.ts index 7bcdd04e..d3daf534 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -3,7 +3,8 @@ import AIcon from './AIcon' import PermissionButton from './PermissionButton/index.vue' import JTable from './Table/index.vue' import TitleComponent from "./TitleComponent/index.vue"; -import Form from './Form' +import Form from './Form'; +import CardBox from './CardBox/index.vue'; export default { install(app: App) { @@ -12,5 +13,6 @@ export default { .component('JTable', JTable) .component('TitleComponent', TitleComponent) .component('Form', Form) + .component('CardBox', CardBox) } } diff --git a/src/router/menu.ts b/src/router/menu.ts index 849e7459..be13bd40 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -59,6 +59,10 @@ export default [ path: '/link/certificate/detail/add', component: () => import('@/views/link/Certificate/Detail/index.vue') }, + { + path: '/link/accessConfig', + component: () => import('@/views/link/AccessConfig/index.vue') + }, { path: '/link/accessConfig/detail/add', component: () => import('@/views/link/AccessConfig/Detail/index.vue') diff --git a/src/style.css b/src/style.css index e69de29b..30cdc6c2 100644 --- a/src/style.css +++ b/src/style.css @@ -0,0 +1,4 @@ +.ant-form-item-required:before { + position: absolute; + right: -12px; +} \ No newline at end of file diff --git a/src/views/account/Center/bind/index.vue b/src/views/account/Center/bind/index.vue index 2f134ab1..a564e14a 100644 --- a/src/views/account/Center/bind/index.vue +++ b/src/views/account/Center/bind/index.vue @@ -4,7 +4,7 @@
第三方账户绑定
- \ No newline at end of file diff --git a/src/views/link/AccessConfig/components/Network.vue b/src/views/link/AccessConfig/components/Network.vue new file mode 100644 index 00000000..8bb9b232 --- /dev/null +++ b/src/views/link/AccessConfig/components/Network.vue @@ -0,0 +1,733 @@ + + + + + diff --git a/src/views/link/AccessConfig/components/Provider/index.vue b/src/views/link/AccessConfig/components/Provider/index.vue new file mode 100644 index 00000000..d73dad78 --- /dev/null +++ b/src/views/link/AccessConfig/components/Provider/index.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index 5ce2ef66..e1509f3b 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -1,11 +1,18 @@ diff --git a/src/views/link/Certificate/Detail/CertificateFile.vue b/src/views/link/Certificate/Detail/CertificateFile.vue index b6ffb26c..ae64c8f0 100644 --- a/src/views/link/Certificate/Detail/CertificateFile.vue +++ b/src/views/link/Certificate/Detail/CertificateFile.vue @@ -64,16 +64,14 @@ const handleChange = (info: UploadChangeParam) => { message.success('上传成功!'); const result = info.file.response?.result; keystoreBase64.value = result; - console.log(1114, result); loading.value = false; emit('change', result); emit('update:modelValue', result); } }; const textChange = (val: any) => { - val.name = props.name; - emit('change', val); - // emit('update:modelValue', val); + emit('change', keystoreBase64.value); + emit('update:modelValue', keystoreBase64.value); }; watch( diff --git a/src/views/link/Certificate/Detail/index.vue b/src/views/link/Certificate/Detail/index.vue index ec301a57..1cb904b1 100644 --- a/src/views/link/Certificate/Detail/index.vue +++ b/src/views/link/Certificate/Detail/index.vue @@ -10,10 +10,8 @@ :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" - @finish="onFinish" - :rules="formRules" > - + - + - + - + @@ -61,6 +63,8 @@ class="form-submit" html-type="submit" type="primary" + @click.prevent="onSubmit" + :loading="loading" >保存 @@ -89,7 +93,7 @@ diff --git a/src/views/link/Certificate/index.vue b/src/views/link/Certificate/index.vue index 757828d4..c289ab74 100644 --- a/src/views/link/Certificate/index.vue +++ b/src/views/link/Certificate/index.vue @@ -3,8 +3,11 @@ + + diff --git a/src/views/system/apiPage/components/ApiTest.vue b/src/views/system/apiPage/components/ApiTest.vue new file mode 100644 index 00000000..b0bb47d0 --- /dev/null +++ b/src/views/system/apiPage/components/ApiTest.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/apiPage/components/ChooseApi.vue b/src/views/system/apiPage/components/ChooseApi.vue new file mode 100644 index 00000000..24362336 --- /dev/null +++ b/src/views/system/apiPage/components/ChooseApi.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/views/system/apiPage/components/InputCard.vue b/src/views/system/apiPage/components/InputCard.vue new file mode 100644 index 00000000..c1742737 --- /dev/null +++ b/src/views/system/apiPage/components/InputCard.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/views/system/apiPage/components/LeftTree.vue b/src/views/system/apiPage/components/LeftTree.vue index acdd1f5a..cbae4bea 100644 --- a/src/views/system/apiPage/components/LeftTree.vue +++ b/src/views/system/apiPage/components/LeftTree.vue @@ -15,51 +15,62 @@ import { TreeProps } from 'ant-design-vue'; import { getTreeOne_api, getTreeTwo_api } from '@/api/system/apiPage'; +import { treeNodeTpye } from '../index'; -type treeNodeTpye = { - name: string; - url: string; - children?: treeNodeTpye[]; -}; const emits = defineEmits(['select']); -const treeData: TreeProps['treeData'] = ref([]); +const treeData = ref([]); const getTreeData = () => { let tree: treeNodeTpye[] = []; - getTreeOne_api().then((resp) => { - tree = resp.urls.map((item) => ({ + getTreeOne_api().then((resp: any) => { + tree = resp.urls.map((item: any) => ({ ...item, key: item.url, })); const allPromise = tree.map((item) => getTreeTwo_api(item.name)); Promise.all(allPromise).then((values) => { - values.forEach((item, i) => { - tree[i].children = combData(item.paths); + values.forEach((item: any, i) => { + tree[i].children = combData(item?.paths); }); - console.log(tree); - treeData.value = tree + treeData.value = tree; }); }); }; -const clickSelectItem = (key, { node }) => { - emits('select', node); +const clickSelectItem: TreeProps['onSelect'] = (key, node: any) => { + emits('select', node.node.dataRef); }; onMounted(() => { getTreeData(); }); -const combData = (dataSource: object): object[] => { - const apiList: object[] = []; +const combData = (dataSource: object) => { + const apiList: treeNodeTpye[] = []; const keys = Object.keys(dataSource); keys.forEach((key) => { const method = Object.keys(dataSource[key] || {})[0]; const name = dataSource[key][method].tags[0]; - let apiObj = apiList.find((item) => item.name === name); - if (!apiObj) { - apiObj = { name, link: key, methods: dataSource[key], key }; + let apiObj: treeNodeTpye | undefined = apiList.find( + (item) => item.name === name, + ); + if (apiObj) { + apiObj.apiList?.push({ + url: key, + method: dataSource[key], + }); + } else { + apiObj = { + name, + key: name, + apiList: [ + { + url: key, + method: dataSource[key], + }, + ], + }; apiList.push(apiObj); } }); @@ -68,4 +79,17 @@ const combData = (dataSource: object): object[] => { }; - + diff --git a/src/views/system/apiPage/index.d.ts b/src/views/system/apiPage/index.d.ts new file mode 100644 index 00000000..e206edd0 --- /dev/null +++ b/src/views/system/apiPage/index.d.ts @@ -0,0 +1,22 @@ +export type treeNodeTpye = { + name: string; + key: string; + link?: string; + apiList?: object[]; + children?: treeNodeTpye[]; +}; +export type methodType = { + [key: string]: object +} +export type apiObjType = { + url: string, + method: methodType +} + +export type apiDetailsType = { + url: string; + method: string; + summary: string; + parameters: []; + requestBody?: any; +} \ No newline at end of file diff --git a/src/views/system/apiPage/index.vue b/src/views/system/apiPage/index.vue index 92339a94..cb82abca 100644 --- a/src/views/system/apiPage/index.vue +++ b/src/views/system/apiPage/index.vue @@ -1,15 +1,78 @@ - \ No newline at end of file +