From 80faeb5f0f22f88db2634027f0755836c23d1d25 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 9 Mar 2023 15:05:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E8=87=AA=E6=B5=8B?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/BootCardSmall.vue | 27 +++++-------------- .../components/ComprehensiveHome/index.vue | 5 +--- .../home/components/DevOpsHome/index.vue | 6 ++--- src/views/home/components/DeviceCountCard.vue | 18 ++++++++----- src/views/home/index.vue | 7 ++--- 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/src/views/home/components/BootCardSmall.vue b/src/views/home/components/BootCardSmall.vue index 1b2c3080..bc811cdb 100644 --- a/src/views/home/components/BootCardSmall.vue +++ b/src/views/home/components/BootCardSmall.vue @@ -28,34 +28,19 @@ diff --git a/src/views/home/components/ComprehensiveHome/index.vue b/src/views/home/components/ComprehensiveHome/index.vue index bd103aa4..7fdf7ecf 100644 --- a/src/views/home/components/ComprehensiveHome/index.vue +++ b/src/views/home/components/ComprehensiveHome/index.vue @@ -182,10 +182,7 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP3', label: '实时监控', - link: 'link/Dashboard', - params: { - save: true, - }, + link: 'link/DashBoard', image: '/images/home/guide-home6.png', }, ]; diff --git a/src/views/home/components/DevOpsHome/index.vue b/src/views/home/components/DevOpsHome/index.vue index 7b28a992..2aca3796 100644 --- a/src/views/home/components/DevOpsHome/index.vue +++ b/src/views/home/components/DevOpsHome/index.vue @@ -32,12 +32,12 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP1', label: '设备接入配置', - link: 'link/accessConfig', + link: 'link/AccessConfig', }, { english: 'STEP2', label: '日志排查', - link: 'link/Log', + link: 'Log', params: { key: 'system', }, @@ -45,7 +45,7 @@ const opsBootConfig: bootConfig[] = [ { english: 'STEP3', label: '实时监控', - link: 'link/dashboard', + link: 'link/DashBoard', params: { type: 'add', }, diff --git a/src/views/home/components/DeviceCountCard.vue b/src/views/home/components/DeviceCountCard.vue index a22e3483..e2b6cfce 100644 --- a/src/views/home/components/DeviceCountCard.vue +++ b/src/views/home/components/DeviceCountCard.vue @@ -26,13 +26,19 @@ const { jumpPage } = useMenuStore(); const projectNum = ref(0); const deviceNum = ref(0); +const menuPermission = useMenuStore().hasPermission; const getData = () => { - getDeviceCount_api().then((resp: any) => { - deviceNum.value = resp.result; - }); - getProductCount_api({}).then((resp: any) => { - projectNum.value = resp.result; - }); + // 有产品菜单权限则获取数据 + menuPermission('device/Product') && + getDeviceCount_api().then((resp: any) => { + deviceNum.value = resp.result; + }); + + // 有设备菜单权限则获取数据 + menuPermission('device/Instance') && + getProductCount_api({}).then((resp: any) => { + projectNum.value = resp.result; + }); }; getData(); diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 73a2948b..9ace54d0 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -52,9 +52,10 @@ const secureKey = ref(''); const setCurrentView = () => { getView_api().then((resp: any) => { if (resp.status === 200) { - if (resp.result) currentView.value = resp.result?.content; - else if (resp.result.username === 'admin') { - currentView.value = 'comprehensive'; + if (resp.result) { + if (resp.result.username === 'admin') + currentView.value = 'comprehensive'; + else currentView.value = resp.result?.content; } else currentView.value = 'init'; } }); From 37e381f961c0c4b35264fd01ba2b9dccdd23e93d Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 9 Mar 2023 17:28:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AIcon/index.tsx | 1 + .../Center/components/EditInfoDialog.vue | 27 ++++++++++-- .../Center/components/EditPasswordDialog.vue | 17 +++++--- src/views/account/Center/index.vue | 43 ++++++++++++++++--- .../components/EditDialog.vue | 19 +++++--- src/views/home/index.vue | 29 ++++++++++--- src/views/system/Platforms/Api/index.vue | 17 +++++--- 7 files changed, 119 insertions(+), 34 deletions(-) diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index e480afc3..390fe993 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -77,6 +77,7 @@ const iconKeys = [ 'CloudDownloadOutlined', 'PauseCircleOutlined',, 'FormOutlined', + 'EyeInvisibleOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/account/Center/components/EditInfoDialog.vue b/src/views/account/Center/components/EditInfoDialog.vue index fbbbd69d..dc39e839 100644 --- a/src/views/account/Center/components/EditInfoDialog.vue +++ b/src/views/account/Center/components/EditInfoDialog.vue @@ -5,6 +5,7 @@ @ok="handleOk" width="770px" @cancel="emits('update:visible', false)" + :confirmLoading="loading" > @@ -12,7 +13,10 @@ - + - + (); +const loading = ref(false) const form = ref(props.data); const formRef = ref(); const handleOk = () => { formRef.value?.validate().then(() => { + loading.value = true updateMeInfo_api(form.value).then((resp) => { if (resp.status === 200) { message.success('保存成功'); emits('ok'); emits('update:visible', false); } - }); + }).finally(()=>loading.value = false) }); }; diff --git a/src/views/account/Center/components/EditPasswordDialog.vue b/src/views/account/Center/components/EditPasswordDialog.vue index 768d3521..566f2bf0 100644 --- a/src/views/account/Center/components/EditPasswordDialog.vue +++ b/src/views/account/Center/components/EditPasswordDialog.vue @@ -4,6 +4,7 @@ title="重置密码" @ok="handleOk" width="520px" + :confirmLoading="loading" @cancel="emits('update:visible', false)" > @@ -11,7 +12,7 @@ label="旧密码" name="oldPassword" :rules="[ - { required: true }, + { required: true, message: '请输入密码' }, { validator: checkMothods.old, trigger: 'blur' }, ]" > @@ -24,7 +25,7 @@ label="密码" name="newPassword" :rules="[ - { required: true }, + { required: true,message:'请输入密码' }, { validator: checkMothods.new, trigger: 'blur' }, ]" > @@ -37,7 +38,7 @@ label="确认密码" name="confirmPassword" :rules="[ - { required: true }, + { required: true, message: '请输入确认密码' }, { validator: checkMothods.confirm, trigger: 'blur' }, ]" > @@ -63,6 +64,7 @@ const emits = defineEmits(['ok', 'update:visible']); const props = defineProps<{ visible: boolean; }>(); +const loading = ref(false) const formRef = ref(); const form = ref({ oldPassword: '', @@ -72,7 +74,7 @@ const form = ref({ const checkMothods = { old: async (_rule: Rule, value: string) => { - if (!value) return Promise.reject('请输入密码'); + if (!value) return Promise.reject(); try { const resp: any = await checkOldPassword_api(value); if (resp.status === 200 && !resp.result.passed) @@ -83,7 +85,7 @@ const checkMothods = { } }, new: async (_rule: Rule, value: string) => { - if (!value) return Promise.reject('请输入密码'); + if (!value) return Promise.reject(); else if ( form.value.confirmPassword && value !== form.value.confirmPassword @@ -99,7 +101,7 @@ const checkMothods = { } }, confirm: async (_rule: Rule, value: string) => { - if (!value) return Promise.reject('请输入确认密码'); + if (!value) return Promise.reject(); try { const resp: any = await validateField_api('password', value); @@ -114,6 +116,7 @@ const checkMothods = { const handleOk = () => { formRef.value?.validate().then(() => { + loading.value = true const params = { oldPassword: form.value.oldPassword, newPassword: form.value.newPassword, @@ -124,7 +127,7 @@ const handleOk = () => { emits('ok'); emits('update:visible', false); } - }); + }).finally(()=>loading.value = false) }); }; console.clear(); diff --git a/src/views/account/Center/index.vue b/src/views/account/Center/index.vue index 9d0a09ff..f3b392d0 100644 --- a/src/views/account/Center/index.vue +++ b/src/views/account/Center/index.vue @@ -8,10 +8,15 @@ style="width: 350px; justify-content: center" > +
+ +
+
@@ -51,11 +57,17 @@

注册时间

-

{{ moment(userInfo.createTime).format('YYYY-MM-DD HH:mm:ss') }}

+

+ {{ + moment(userInfo.createTime).format( + 'YYYY-MM-DD HH:mm:ss', + ) + }} +

电话

-

{{ userInfo.telephone }}

+

{{ userInfo.telephone || '-' }}

姓名

@@ -117,7 +129,7 @@ type="link" @click="editPasswordVisible = true" > - +
@@ -205,7 +217,7 @@ { + const imageTypes = ['jpg', 'png', 'jfif', 'pjp', 'pjpeg', 'jpeg']; + const typeBool = + imageTypes.filter((typeStr) => type.includes(typeStr)).length > 0; + const sizeBool = size < 4 * 1024 * 1024; + + (typeBool && sizeBool) || message.error('请上传正确格式的图片'); + return typeBool && sizeBool; + }, }); // 首页视图 const isApiUser = ref(); @@ -346,7 +367,7 @@ function getViews() { background-color: #f0f2f5; min-height: 100vh; .card { - margin: 24px; + margin: 16px 0; padding: 24px; background-color: #fff; position: relative; @@ -370,6 +391,18 @@ function getViews() { flex-wrap: wrap; .content-item { margin-right: 24px; + + .default-avatar { + background-color: #ccc; + color: #fff; + border-radius: 50%; + font-size: 70px; + width: 140px; + height: 140px; + display: flex; + justify-content: center; + align-items: center; + } .info-card { width: 25%; diff --git a/src/views/account/NotificationSubscription/components/EditDialog.vue b/src/views/account/NotificationSubscription/components/EditDialog.vue index b006439d..f164c35f 100644 --- a/src/views/account/NotificationSubscription/components/EditDialog.vue +++ b/src/views/account/NotificationSubscription/components/EditDialog.vue @@ -3,6 +3,7 @@ visible :title="props.data.id ? '编辑' : '新增'" width="865px" + :confirmLoading="loading" @ok="confirm" @cancel="emits('update:visible', false)" > @@ -92,6 +93,7 @@ const props = defineProps<{ data: rowType; }>(); +const loading = ref(false); const initForm = { subscribeName: '', topicConfig: {}, @@ -106,13 +108,16 @@ const form = ref({ const confirm = () => { formRef.value && formRef.value.validate().then(() => { - save_api(form.value).then((resp) => { - if (resp.status === 200) { - message.success('操作成功'); - emits('ok') - emits('update:visible', false); - } - }); + loading.value = true; + save_api(form.value) + .then((resp) => { + if (resp.status === 200) { + message.success('操作成功'); + emits('ok'); + emits('update:visible', false); + } + }) + .finally(() => (loading.value = false)); }); }; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 9ace54d0..72e5709a 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -17,12 +17,22 @@

基本信息

- clientId: - {{ clientId }} + clientId: + {{ clientId }}

- secureKey: - {{ secureKey }} + secureKey: + + {{ showKey ? secureKey : '****************' }} + +

@@ -47,7 +57,7 @@ const currentView = ref(''); const loading = ref(true); const clientId = useUserInfo().$state.userInfos.id; const secureKey = ref(''); - +const showKey = ref(false); // 获取选择的视图 const setCurrentView = () => { getView_api().then((resp: any) => { @@ -91,6 +101,15 @@ if (isNoCommunity) { p { margin: 0; font-size: 16px; + + .label { + font-weight: bold; + margin-right: 3px; + } + .value { + margin-right: 10px; + font-size: 14px; + } } } } diff --git a/src/views/system/Platforms/Api/index.vue b/src/views/system/Platforms/Api/index.vue index 5e4c3fe1..2a337461 100644 --- a/src/views/system/Platforms/Api/index.vue +++ b/src/views/system/Platforms/Api/index.vue @@ -3,7 +3,7 @@
- + .api-page-container { - .tree-content { - padding-bottom: 30px; - height: calc(100vh - 230px); - overflow-y: auto; - border-right: 1px solid #e9e9e9; + .content { + background-color: #fff; + padding: 24px; + margin: 0 !important; + .tree-content { + padding-bottom: 30px; + height: calc(100vh - 230px); + overflow-y: auto; + border-right: 1px solid #e9e9e9; + } } } From d2e7a410b7ccf0bb988cd47c1d5a619ed2806f61 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 9 Mar 2023 19:52:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E8=87=AA=E6=B5=8B=E3=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account/notificationRecord.ts | 2 +- src/components/Layout/components/Notice.vue | 16 ++++++++-- .../account/NotificationRecord/index.vue | 20 ++++++------ .../NotificationSubscription/index.vue | 32 +++++++++---------- .../components/ComprehensiveHome/index.vue | 21 +++++++++--- .../home/components/DeviceHome/index.vue | 8 ++--- 6 files changed, 59 insertions(+), 40 deletions(-) diff --git a/src/api/account/notificationRecord.ts b/src/api/account/notificationRecord.ts index 18217d85..58cb612f 100644 --- a/src/api/account/notificationRecord.ts +++ b/src/api/account/notificationRecord.ts @@ -1,7 +1,7 @@ import server from '@/utils/request' // 获取记录列表 -export const getList_api = (data:object): any =>server.get(`/notifications/_query`,encodeParams(data)) +export const getList_api = (data:object): any =>server.post(`/notifications/_query`,data) // 修改记录状态 export const changeStatus_api = (type:'_read'|'_unread',data:string[]): any =>server.post(`/notifications/${type}`,data) diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue index 07423bc1..58bba839 100644 --- a/src/components/Layout/components/Notice.vue +++ b/src/components/Layout/components/Notice.vue @@ -26,7 +26,7 @@ import { notification } from 'ant-design-vue'; import { changeStatus_api } from '@/api/account/notificationRecord'; import { useUserInfo } from '@/store/userInfo'; -const updateCount = computed(()=>useUserInfo().$state.alarmUpdateCount); +const updateCount = computed(() => useUserInfo().$state.alarmUpdateCount); const total = ref(0); const list = ref([]); @@ -50,10 +50,20 @@ const subscribeNotice = () => { const getList = () => { loading.value = true; const params = { - 'terms[0].column': 'state', - 'terms[0].value': 'unread', 'sorts[0].name': 'notifyTime', 'sorts[0].order': 'desc', + terms: [ + { + terms: [ + { + type: 'or', + value: 'unread', + termType: 'eq', + column: 'state', + }, + ], + }, + ], }; getList_api(params) .then((resp: any) => { diff --git a/src/views/account/NotificationRecord/index.vue b/src/views/account/NotificationRecord/index.vue index 84790dbc..a6d380d3 100644 --- a/src/views/account/NotificationRecord/index.vue +++ b/src/views/account/NotificationRecord/index.vue @@ -1,14 +1,17 @@