From 9e7e63f71395df68a6a4e546471bd4884447f554 Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Fri, 18 Aug 2023 18:07:34 +0800 Subject: [PATCH] merge: merge dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 登录加密 * fix: 登录加密功能 * fix: 树样式错乱bug修改 * fix: bug#17059 * fix: bug#17128 * fix: 17131 * fix: bug#17122 * fix: bug#17156 * fix: 修改bug * fix: bug#17056 * fix: bug#17005 * fix: 修改bug * fix: bug#17296 * fix: bug应用管理/集成菜单 * fix: bug#17299 * fix: bug#17148 * fix: bug#17392 * fix: bug#17416 * fix: bug#17417 * fix: bug#17418 * fix: bug#17421 * fix: bug#17556、17555 * fix: bug#17299 * fix: bug#17148 * fix: bug#17392 * fix: bug#17416 * fix: bug#17417 * fix: bug#17418 * fix: bug#17421 * fix: bug#17510 * fix: bug#17510 * fix: bug#17299 * fix: 修改tree样式 * fix: 修改样式 * fix: bug#17425 * fix: 跳转bug * fix: bug#17556、17555 * fix: 资产分配权限为空问题 * fix: 资产分配权限为空问题 * fix: bug#17557、17299 * fix: bug#17537,修复设备详情映射bug,修复数采仪表盘bug * fix: 资产分配权限为空问题 * fix: bug#17557、17299 * fix: 修改bug * fix: bug#17148 * fix: bug#17564 * fix: 数采仪表盘bug * fix: bug#17537 * fix: 设备详情bug * fix: 网关设备-远程控制兼容https * fix: bug网关设备跳转 * fix: bug网关设备跳转 * fix: 修复组织管理树编辑携带多余参数 * fix: 组织管理树提交bug * fix: 修复404页面 * fix: bug#17584 * fix: 组织管理树提交bug * fix: bug#17584 --- src/api/device/instance.ts | 7 + src/api/rule-engine/log.ts | 5 + src/router/index.ts | 2 +- .../DataCollect/Dashboard/components/Card.vue | 9 +- src/views/account/Center/bind/index.vue | 61 +++- .../ChildDevice/EdgeMap/PatchMapping.vue | 2 - .../Diagnose/Message/Function/EditTable.vue | 14 +- .../Diagnose/Message/Function/index.vue | 2 +- .../Instance/Detail/EdgeMap/PatchMapping.vue | 2 - .../Info/components/InklingModal/index.vue | 6 +- .../device/Instance/Detail/Info/index.vue | 3 +- .../device/components/Metadata/Base/Base.vue | 57 +++- .../components/Metadata/Base/columns.tsx | 10 +- .../Metadata/Base/components/DataType.vue | 18 +- .../Base/components/Events/ConfigParams.vue | 2 +- .../Base/components/Function/InputParams.vue | 2 +- .../Base/components/Function/OutputParams.vue | 14 +- .../components/Properties/OtherSetting.vue | 2 +- .../Metadata/Base/components/Source.vue | 96 ++++++- .../components/Metadata/Import/index.vue | 270 +++++++++++++++++- .../device/components/Metadata/index.vue | 18 +- src/views/edge/Device/Remote/index.vue | 9 +- src/views/init-home/Menu/index.vue | 2 +- src/views/iot-card/CardManagement/index.vue | 2 + .../AccessConfig/components/Media/GB28181.vue | 4 +- .../AccessConfig/components/Media/index.vue | 6 +- src/views/link/DashBoard/components/Cpu.vue | 5 +- src/views/link/DashBoard/components/Jvm.vue | 3 + src/views/link/plugin/index.vue | 1 + src/views/notice/Config/Detail/index.vue | 12 +- src/views/notice/Template/Detail/index.vue | 6 +- src/views/oauth/index.vue | 23 +- .../Alarm/Config/Io/Save/input.vue | 24 +- .../rule-engine/Alarm/Log/Detail/info.vue | 2 +- .../Alarm/Log/TabComponent/index.vue | 59 +++- .../DashBoard/components/TimeSelect.vue | 1 + src/views/rule-engine/DashBoard/index.vue | 7 +- .../rule-engine/Scene/Save/Device/Product.vue | 2 +- src/views/rule-engine/Scene/index.vue | 2 +- .../system/Apply/componenets/MenuDialog.vue | 82 +++--- .../components/AddDeviceOrProductDialog.vue | 40 ++- .../components/EditDepartmentDialog.vue | 3 + .../system/Department/components/LeftTree.vue | 15 +- .../user/components/AddBindUserDialog.vue | 2 + src/views/system/Menu/Detail/BasicInfo.vue | 1 + src/views/system/Menu/Setting/index.vue | 1 - .../Menu/components/ChooseIconDialog.vue | 10 + src/views/system/Menu/index.vue | 2 +- .../Platforms/Api/components/ChooseApi.vue | 1 + .../Platforms/Api/components/LeftTree.vue | 2 +- src/views/system/Platforms/Api/index.vue | 5 +- .../system/Role/components/AddDialog.vue | 6 +- 52 files changed, 766 insertions(+), 176 deletions(-) diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 11b27733..a4f189fd 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -4,6 +4,13 @@ import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable' import { DeviceInstance } from '@/views/device/Instance/typings' import { DeviceMetadata, UnitType } from '@/views/device/Product/typings'; +/** + * 重置设备继承产品的物模型规则 + * @param deviceId 设备ID + * @param productId 产品ID + */ +export const resetRule = (productId:string,deviceId:string,data:any) => server.remove(`/virtual/property/product/${productId}/${deviceId}/_batch`,{},{data}) + /** * 删除设备物模型 * @param deviceId 设备ID diff --git a/src/api/rule-engine/log.ts b/src/api/rule-engine/log.ts index cd9530c1..35ee09ad 100644 --- a/src/api/rule-engine/log.ts +++ b/src/api/rule-engine/log.ts @@ -10,6 +10,11 @@ export const getProductList = (parmas?:any) => server.get('/device/product/_qu */ export const getDeviceList = (parmas?:any) => server.get('/device-instance/_query/no-paging?paging=false',parmas); +/** + * 获取有设备的告警的产品名称 + */ +export const getAlarmProduct = (parmas:any) => server.post('/device-instance/_query',parmas) + /** * 获取组织列表 */ diff --git a/src/router/index.ts b/src/router/index.ts index 0f4ff104..ad252983 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -38,7 +38,7 @@ router.beforeEach((to, from, next) => { router.addRoute('base',{ path: '/:pathMatch(.*)', name: 'error', - component: () => NotFindPage + component: NotFindPage }) next({ ...to, replace: true }) diff --git a/src/views/DataCollect/Dashboard/components/Card.vue b/src/views/DataCollect/Dashboard/components/Card.vue index 630c53db..fa5679e1 100644 --- a/src/views/DataCollect/Dashboard/components/Card.vue +++ b/src/views/DataCollect/Dashboard/components/Card.vue @@ -61,22 +61,21 @@ const data: any = ref({ const pickerTimeChange = () => { data.value.time.type = undefined; - console.log(1); }; const getEcharts = async (val: any) => { loading.value = true; const resp: any = await dashboard(pointParams(val)); - if (resp.success) { - const x = resp.result + if (resp.success && resp?.result?.length) { + const x = resp.result .map((item: any) => item.data.timeString) .reverse(); const y = resp.result.map((item: any) => item.data.value).reverse(); handleOptions(x, y); } - setTimeout(() => { + setTimeout(()=>{ loading.value = false; - }, 300); + },300) }; const handleOptions = (x = [], y = []) => { diff --git a/src/views/account/Center/bind/index.vue b/src/views/account/Center/bind/index.vue index b9a7554b..3110619f 100644 --- a/src/views/account/Center/bind/index.vue +++ b/src/views/account/Center/bind/index.vue @@ -129,8 +129,9 @@ import { TOKEN_KEY } from '@/utils/variable' import { Form } from 'ant-design-vue' import { applicationInfo, bindAccount } from '@/api/bind' -import { code, authLogin, userDetail } from '@/api/login' +import { code, authLogin, userDetail , authLoginConfig} from '@/api/login' import { useSystem } from '@/store/system' +import {encrypt} from '@/utils/encrypt' const useForm = Form.useForm; const systemStore = useSystem(); @@ -175,15 +176,17 @@ const getUrlCode = () => { const bindUser = ref({ appName: '' }) const getAppInfo = async () => { const code = getUrlCode() - const { result } = await applicationInfo(code) - bindUser.value = result + const { result,success } = await applicationInfo(code) + bindUser.value = result || {} - if (result.applicationProvider === 'dingtalk-ent-app') { - bindUser.value.appName = '钉钉' - } else if (result.applicationProvider === 'wechat-webapp') { - bindUser.value.appName = '微信' - } else { - bindUser.value.appName = result.applicationName + if(success){ + if (result?.applicationProvider === 'dingtalk-ent-app') { + bindUser.value.appName = '钉钉' + } else if (result?.applicationProvider === 'wechat-webapp') { + bindUser.value.appName = '微信' + } else { + bindUser.value.appName = result?.applicationName + } } } @@ -239,7 +242,11 @@ const getCode = async () => { captcha.value.key = res.result?.key } - +const RsaConfig = reactive({ + enabled:false, //是否加密 + publicKey:'', //rsa公钥,使用此公钥对密码进行加密 + id:'' //密钥ID +}) /** * 登录并绑定账户 */ @@ -252,14 +259,25 @@ const handleLoginBind = () => { bindCode: code, expires: 3600000 } - + const resq:any = await authLoginConfig() + if(resq.status === 200){ + if(resq.result?.encrypt){ + RsaConfig.enabled = resq.result?.encrypt.enabled + RsaConfig.publicKey = resq.result?.encrypt.publicKey + RsaConfig.id = resq.result?.encrypt.id + } + } if (captcha.value.base64) { params.verifyKey = captcha.value.key } else { delete params.verifyCode } - - const res = await authLogin(params) + const data = { + ...params, + password:RsaConfig.enabled?encrypt(params.password,RsaConfig.publicKey):params.password, + encryptId:RsaConfig.enabled?RsaConfig.id:undefined + } + const res = await authLogin(data) console.log('res: ', res) if (res.success) { onlyMessage('登录成功') @@ -273,11 +291,26 @@ const handleLoginBind = () => { }) } + +const getQueryVariable = (): Map => { + const index = window.location.href.indexOf('?') + const paramsUrl = window.location.href.substr(index + 1) + const paramsArr = paramsUrl.split('#')?.[0] || '' + + const vars = paramsArr.split('&'); + const maps = new Map() + for (let i = 0; i < vars.length; i++) { + const pair = vars[i].split('='); + const [key, value] = pair + maps.set(key, value) + } + return maps; +} /** * 绑定成功跳转至页面url的: redirect */ const goRedirect = () => { - const urlParams = new URLSearchParams(window.location.hash) + const urlParams = getQueryVariable(); const redirectUrl = urlParams.get('redirect') || window.location.href.split('redirect=')?.[1] diff --git a/src/views/device/Instance/Detail/ChildDevice/EdgeMap/PatchMapping.vue b/src/views/device/Instance/Detail/ChildDevice/EdgeMap/PatchMapping.vue index 24c49726..646a51db 100644 --- a/src/views/device/Instance/Detail/ChildDevice/EdgeMap/PatchMapping.vue +++ b/src/views/device/Instance/Detail/ChildDevice/EdgeMap/PatchMapping.vue @@ -21,8 +21,6 @@ :load-data="onLoadData" @check="onCheck" v-model:expandedKeys="expandedKeys" - :showLine="{ showLeafIcon: false }" - :show-icon="true" />
diff --git a/src/views/device/Instance/Detail/Diagnose/Message/Function/EditTable.vue b/src/views/device/Instance/Detail/Diagnose/Message/Function/EditTable.vue index 7233a47c..171cc8dd 100644 --- a/src/views/device/Instance/Detail/Diagnose/Message/Function/EditTable.vue +++ b/src/views/device/Instance/Detail/Diagnose/Message/Function/EditTable.vue @@ -8,10 +8,13 @@