diff --git a/.npmrc b/.npmrc index dfe2ca70..f408e702 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ always-auth=true -registry=http://registry.jetlinks.cn/ \ No newline at end of file +registry=https://registry.npmjs.org/ diff --git a/README.md b/README.md index d9709551..ee607b6f 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,18 @@ yarn dev:force 此处可以更改系统名称、主题色、系统logo、浏览器页签等 +#### 主题色 + +```javascript +// src/App.vue + +ConfigProvider.config({ + theme: { + primaryColor: "#315efb" + } +}) +``` + #### 2.默认配置 在代码根目录找到`config\config.ts`文件 diff --git a/package.json b/package.json index 85968eac..d6fd157d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.33", + "jetlinks-ui-components": "^1.0.34-2", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/App.vue b/src/App.vue index 8c6581c2..0c14af16 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,7 +15,11 @@ const system = useSystem(); const {configInfo} = storeToRefs(system); system.setDocumentTitle() - +ConfigProvider.config({ + theme: { + primaryColor: "#315efb" + } +}) \ No newline at end of file + diff --git a/src/main.ts b/src/main.ts index 4cc48040..4f371d2c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import store from './store' import components from './components' import router from './router' import './style.less' - +import 'ant-design-vue/dist/antd.variable.min.css' import dayjs from 'dayjs'; import 'dayjs/locale/zh-cn'; dayjs.locale('zh-cn'); diff --git a/src/store/system.ts b/src/store/system.ts index 97186d67..204a4298 100644 --- a/src/store/system.ts +++ b/src/store/system.ts @@ -89,4 +89,4 @@ export const useSystem = defineStore('system', { } } } -}) \ No newline at end of file +}) diff --git a/src/style.less b/src/style.less index b119250d..bfd73195 100644 --- a/src/style.less +++ b/src/style.less @@ -30,9 +30,9 @@ body { .ant-pro-top-nav-header { .ant-menu-item { - padding: 0 10px !important; - &:not(:first-child) { - margin-left: 8px !important; + padding: 0 14px !important; + &:first-child { + padding: 0 10px !important; } } } diff --git a/src/utils/utils.ts b/src/utils/utils.ts index c151afec..e313716c 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -71,8 +71,8 @@ export const isNoCommunity = !(localStorage.getItem(SystemConst.VERSION_CODE) == /** * 生成随机数 - * @param length - * @returns + * @param length + * @returns */ export const randomString = (length?: number) => { const tempLength = length || 32; @@ -87,8 +87,8 @@ export const randomString = (length?: number) => { /** * 时间戳转时分秒文本 - * @param time - * @returns + * @param time + * @returns */ export const timestampFormat = (time: number) => { let hour = 0; @@ -182,4 +182,4 @@ export const EventEmitter = { }) return this } -} \ No newline at end of file +} diff --git a/src/views/account/Center/index.vue b/src/views/account/Center/index.vue index 37bf2a66..2e9bf1cc 100644 --- a/src/views/account/Center/index.vue +++ b/src/views/account/Center/index.vue @@ -90,6 +90,7 @@ import { } from '@/utils/consts'; import { usePermissionStore } from '@/store/permission'; import RoleShow from './components/RoleShow/index.vue'; +import {isNoCommunity} from "@/utils/utils"; const imageTypes = reactive([ 'image/jpeg', @@ -103,7 +104,8 @@ const imageTypes = reactive([ const user = useUserInfo(); type KeyType = 'HomeView' | 'BindThirdAccount' | 'Subscribe' | 'StationMessage'; -const list: { key: KeyType; title: string }[] = [ +console.log(isNoCommunity) +const list: { key: KeyType; title: string }[] = isNoCommunity ? [ { key: 'HomeView', title: '首页视图', @@ -120,6 +122,19 @@ const list: { key: KeyType; title: string }[] = [ key: 'StationMessage', title: '站内信', }, +] : [ + { + key: 'HomeView', + title: '首页视图', + }, + { + key: 'Subscribe', + title: '我的订阅', + }, + { + key: 'StationMessage', + title: '站内信', + }, ]; const tabs = { diff --git a/src/views/device/DashBoard/index.vue b/src/views/device/DashBoard/index.vue index 46648324..a341ea3f 100644 --- a/src/views/device/DashBoard/index.vue +++ b/src/views/device/DashBoard/index.vue @@ -28,7 +28,7 @@ > diff --git a/src/views/device/Instance/Detail/ChildDevice/index.vue b/src/views/device/Instance/Detail/ChildDevice/index.vue index 854df7c9..ae3a834b 100644 --- a/src/views/device/Instance/Detail/ChildDevice/index.vue +++ b/src/views/device/Instance/Detail/ChildDevice/index.vue @@ -1,106 +1,60 @@ @@ -43,6 +50,7 @@ const props = defineProps({ type: Array as PropType<{ label: string; value: string }[]>, default: () => [], }, + hasPermission: String, }); const formItemContext = Form.useInjectFormItemContext(); diff --git a/src/views/device/components/Metadata/Base/components/ModelButton.vue b/src/views/device/components/Metadata/Base/components/ModelButton.vue index 49793ff0..98014d17 100644 --- a/src/views/device/components/Metadata/Base/components/ModelButton.vue +++ b/src/views/device/components/Metadata/Base/components/ModelButton.vue @@ -17,4 +17,4 @@ const props = defineProps({ \ No newline at end of file + diff --git a/src/views/device/components/Metadata/Base/components/Properties/Metrics/ValueItem.vue b/src/views/device/components/Metadata/Base/components/Properties/Metrics/ValueItem.vue index 28a7dca3..f587bcb2 100644 --- a/src/views/device/components/Metadata/Base/components/Properties/Metrics/ValueItem.vue +++ b/src/views/device/components/Metadata/Base/components/Properties/Metrics/ValueItem.vue @@ -120,7 +120,7 @@ const validator = (_: any, value: any) => { } const typeValidator = (_: any, value: any) => { - if (value === undefined) { + if (value === undefined || value === null) { return Promise.reject(validatorTip()) } if (type === 'string' && value?.length > 64) { @@ -146,7 +146,7 @@ const handleValueByType = (value: any, isRange: boolean = false) => { const confirm = () => { return new Promise((resolve, reject) => { - formRef.value.validate().then(() => { + formRef.value.validate().then((res) => { let value = props.value.range === true ? formData.rangeValue : formData.value if (['int', 'long'].includes(type)) { diff --git a/src/views/device/components/Metadata/Base/components/Properties/OtherSetting.vue b/src/views/device/components/Metadata/Base/components/Properties/OtherSetting.vue index 3ec50f62..36a95a79 100644 --- a/src/views/device/components/Metadata/Base/components/Properties/OtherSetting.vue +++ b/src/views/device/components/Metadata/Base/components/Properties/OtherSetting.vue @@ -51,8 +51,17 @@ /> - - + + + 配置 + @@ -88,6 +97,8 @@ const props = defineProps({ type: Object, default: () => ({}) }, + hasPermission: String, + tooltip: Object }) const fullRef = inject(FULL_CODE); @@ -225,4 +236,4 @@ watch(() => props.value, () => { \ No newline at end of file + diff --git a/src/views/iframe/index.vue b/src/views/iframe/index.vue index ad484457..32bfec8a 100644 --- a/src/views/iframe/index.vue +++ b/src/views/iframe/index.vue @@ -31,7 +31,7 @@ const handle = async (appId: string, url: string) => { let menuUrl: any = url; if (res.status === 200) { if (res.result.page.routeType === 'hash') { - menuUrl = `/#${url}`; + menuUrl = `#${url}`; } if (res.result.provider === 'internal-standalone') { const urlStandalone = `${res.result.page.baseUrl}/api/application/sso/${appId}/login?redirect=${menuUrl}?layout=false`; diff --git a/src/views/notice/Config/Detail/doc/Webhook.tsx b/src/views/notice/Config/Detail/doc/Webhook.tsx index 446205f6..721575a6 100644 --- a/src/views/notice/Config/Detail/doc/Webhook.tsx +++ b/src/views/notice/Config/Detail/doc/Webhook.tsx @@ -5,12 +5,12 @@ const Webhook = () => {

1. 概述

- webhook是一个接收HTTP请求的URL(本平台默认只支持HTTP - POST请求),实现了Webhook的第三方系统可以基于该URL订阅本平台系统信息,本平台按配置把特定的事件结果推送到指定的地址,便于系统做后续处理。 + WebHook是一个接收HTTP请求的URL(本平台默认只支持HTTP + POST请求),实现了WebHook的第三方系统可以基于该URL订阅本平台系统信息,本平台按配置把特定的事件结果推送到指定的地址,便于系统做后续处理。

2.通知配置说明

-

1、Webhook

-
Webhook地址。
+

1、WebHook

+
WebHook地址。

2、请求头

diff --git a/src/views/notice/Config/Detail/index.vue b/src/views/notice/Config/Detail/index.vue index 18f1e73b..cc09d862 100644 --- a/src/views/notice/Config/Detail/index.vue +++ b/src/views/notice/Config/Detail/index.vue @@ -278,12 +278,12 @@