Showing
22 changed files
with
137 additions
and
170 deletions
... | ... | @@ -8,14 +8,14 @@ VITE_PUBLIC_PATH = / |
8 | 8 | # Please note that no line breaks |
9 | 9 | |
10 | 10 | # 本地 |
11 | -# VITE_PROXY = [["/api","http://192.168.10.108:8080/api"]] | |
11 | +# VITE_PROXY = [["/api","http://192.168.10.113:8080/api"]] | |
12 | 12 | |
13 | 13 | # 线上 |
14 | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
15 | 15 | VITE_PROXY = [["/api","http://47.99.141.212:8080/api"]] |
16 | 16 | |
17 | 17 | # 实时数据的ws地址 |
18 | -VITE_WEB_SOCKET = ws://101.133.234.90:8080/api/ws/plugins/telemetry?token= | |
18 | +VITE_WEB_SOCKET = ws://47.99.141.212:8080/api/ws/plugins/telemetry?token= | |
19 | 19 | |
20 | 20 | # Delete console |
21 | 21 | VITE_DROP_CONSOLE = true | ... | ... |
... | ... | @@ -8,7 +8,7 @@ import { |
8 | 8 | SmsLoginParams, |
9 | 9 | } from './model/userModel'; |
10 | 10 | |
11 | -import { ErrorMessageMode } from '/#/axios'; | |
11 | +import type { ErrorMessageMode } from '/#/axios'; | |
12 | 12 | |
13 | 13 | enum Api { |
14 | 14 | Login = '/auth/login', |
... | ... | @@ -19,6 +19,8 @@ enum Api { |
19 | 19 | GetPermCode = '/role/me/permissions', |
20 | 20 | RefreshToken = '/auth/token', |
21 | 21 | SendLoginSmsCode = '/noauth/sendLoginSmsCode/', |
22 | + ResetCode = '/noauth/resetCode/', | |
23 | + ResetPassword = '/noauth/reset/', | |
22 | 24 | } |
23 | 25 | |
24 | 26 | /** |
... | ... | @@ -78,9 +80,17 @@ export function smsCodeLoginApi(params: SmsLoginParams, mode: ErrorMessageMode = |
78 | 80 | ); |
79 | 81 | } |
80 | 82 | |
81 | -export function forgetPasswordApi(params) { | |
83 | +// 密码重置验证码 | |
84 | +export function passwordResetCode(mobile) { | |
82 | 85 | return defHttp.post({ |
83 | - url: '', | |
84 | - params, | |
86 | + url: Api.ResetCode + mobile, | |
87 | + }); | |
88 | +} | |
89 | + | |
90 | +// 重置密码 | |
91 | +export function forgetPasswordApi(data) { | |
92 | + return defHttp.post({ | |
93 | + url: Api.ResetPassword + data.phoneNumber, | |
94 | + data, | |
85 | 95 | }); |
86 | 96 | } | ... | ... |
... | ... | @@ -45,6 +45,7 @@ |
45 | 45 | const lockStore = useLockStore(); |
46 | 46 | |
47 | 47 | const getRealName = computed(() => userStore.getUserInfo?.realName); |
48 | + console.log(getRealName); | |
48 | 49 | const [register, { closeModal }] = useModalInner(); |
49 | 50 | |
50 | 51 | const [registerForm, { validateFields, resetFields }] = useForm({ |
... | ... | @@ -95,7 +96,7 @@ |
95 | 96 | &__entry { |
96 | 97 | position: relative; |
97 | 98 | //height: 240px; |
98 | - padding: 130px 30px 30px 30px; | |
99 | + padding: 130px 30px 30px; | |
99 | 100 | border-radius: 10px; |
100 | 101 | } |
101 | 102 | |
... | ... | @@ -105,7 +106,6 @@ |
105 | 106 | left: calc(50% - 45px); |
106 | 107 | width: auto; |
107 | 108 | text-align: center; |
108 | - | |
109 | 109 | &-img { |
110 | 110 | width: 70px; |
111 | 111 | border-radius: 50%; |
... | ... | @@ -113,6 +113,9 @@ |
113 | 113 | |
114 | 114 | &-name { |
115 | 115 | margin-top: 5px; |
116 | + display: flex; | |
117 | + width: 100%; | |
118 | + // margin-left: -15px; | |
116 | 119 | } |
117 | 120 | } |
118 | 121 | ... | ... |
... | ... | @@ -85,6 +85,7 @@ |
85 | 85 | import { getAuthCache } from '/@/utils/auth'; |
86 | 86 | import { Upload } from 'ant-design-vue'; |
87 | 87 | import { PlusOutlined } from '@ant-design/icons-vue'; |
88 | + import { useUserStore } from '/@/store/modules/user'; | |
88 | 89 | import type { FileItem } from '/@/components/Upload/src/typing'; |
89 | 90 | |
90 | 91 | const schema: DescItem[] = [ |
... | ... | @@ -126,6 +127,7 @@ |
126 | 127 | const getBackendV: any = ref({}); |
127 | 128 | const getData: any = ref({}); |
128 | 129 | const updataPersonlData: any = ref({}); |
130 | + const userStore = useUserStore(); | |
129 | 131 | // const getUpdateUserInfo: any = ref({}); |
130 | 132 | const [registerDesc] = useDescription({ |
131 | 133 | title: '个人详情', |
... | ... | @@ -209,6 +211,8 @@ |
209 | 211 | getPersonalValue.value.username = getBackendV.value.username; |
210 | 212 | getPersonalValue.value.avatar = peresonalPic.value; |
211 | 213 | getData.value = await personalPut(getPersonalValue.value); |
214 | + console.log(getData.value.realName); | |
215 | + userStore.setUserInfo(getData.value); | |
212 | 216 | updatePersonalData.value = getData.value; |
213 | 217 | createMessage.success('修改成功'); |
214 | 218 | const setUpdateUserInfo = JSON.stringify(getData.value); | ... | ... |
... | ... | @@ -31,29 +31,10 @@ export const useLockStore = defineStore({ |
31 | 31 | }, |
32 | 32 | // Unlock |
33 | 33 | async unLock(password?: string) { |
34 | - const userStore = useUserStore(); | |
35 | 34 | if (this.lockInfo?.pwd === password) { |
36 | 35 | this.resetLockInfo(); |
37 | 36 | return true; |
38 | 37 | } |
39 | - const tryLogin = async () => { | |
40 | - try { | |
41 | - const username = userStore.getUserInfo?.username; | |
42 | - const res = await userStore.login({ | |
43 | - username, | |
44 | - password: password!, | |
45 | - goHome: false, | |
46 | - mode: 'none', | |
47 | - }); | |
48 | - if (res) { | |
49 | - this.resetLockInfo(); | |
50 | - } | |
51 | - return res; | |
52 | - } catch (error) { | |
53 | - return false; | |
54 | - } | |
55 | - }; | |
56 | - return await tryLogin(); | |
57 | 38 | }, |
58 | 39 | }, |
59 | 40 | }); | ... | ... |
... | ... | @@ -4,13 +4,7 @@ import { defineStore } from 'pinia'; |
4 | 4 | import { store } from '/@/store'; |
5 | 5 | import { RoleEnum } from '/@/enums/roleEnum'; |
6 | 6 | import { PageEnum } from '/@/enums/pageEnum'; |
7 | -import { | |
8 | - JWT_TOKEN_KEY, | |
9 | - REFRESH_TOKEN_KEY, | |
10 | - ROLES_KEY, | |
11 | - TOKEN_KEY, | |
12 | - USER_INFO_KEY, | |
13 | -} from '/@/enums/cacheEnum'; | |
7 | +import { JWT_TOKEN_KEY, REFRESH_TOKEN_KEY, ROLES_KEY, USER_INFO_KEY } from '/@/enums/cacheEnum'; | |
14 | 8 | import { getAuthCache, setAuthCache } from '/@/utils/auth'; |
15 | 9 | import { |
16 | 10 | LoginParams, | ... | ... |
... | ... | @@ -6,11 +6,6 @@ import { numberRule } from '/@/utils/rules'; |
6 | 6 | |
7 | 7 | export const columns: BasicColumn[] = [ |
8 | 8 | { |
9 | - title: '创建时间', | |
10 | - dataIndex: 'createTime', | |
11 | - width: 150, | |
12 | - }, | |
13 | - { | |
14 | 9 | title: '名称', |
15 | 10 | dataIndex: 'name', |
16 | 11 | width: 150, |
... | ... | @@ -26,10 +21,21 @@ export const columns: BasicColumn[] = [ |
26 | 21 | width: 100, |
27 | 22 | }, |
28 | 23 | { |
24 | + title: '默认配置', | |
25 | + dataIndex: 'default', | |
26 | + width: 100, | |
27 | + format: (text) => (text ? '是' : '否'), | |
28 | + }, | |
29 | + { | |
29 | 30 | title: '描述', |
30 | 31 | dataIndex: 'description', |
31 | 32 | width: 150, |
32 | 33 | }, |
34 | + { | |
35 | + title: '创建时间', | |
36 | + dataIndex: 'createTime', | |
37 | + width: 150, | |
38 | + }, | |
33 | 39 | ]; |
34 | 40 | |
35 | 41 | export const searchFormSchema: FormSchema[] = [ | ... | ... |
... | ... | @@ -22,6 +22,9 @@ |
22 | 22 | label: '设置为默认', |
23 | 23 | icon: 'ant-design:profile-outlined', |
24 | 24 | onClick: handleSetDefault.bind(null, record), |
25 | + ifShow: () => { | |
26 | + return record.default === false; | |
27 | + }, | |
25 | 28 | }, |
26 | 29 | { |
27 | 30 | label: '详情', |
... | ... | @@ -102,7 +105,7 @@ |
102 | 105 | bordered: true, |
103 | 106 | showIndexColumn: false, |
104 | 107 | actionColumn: { |
105 | - width: 200, | |
108 | + width: 250, | |
106 | 109 | title: '操作', |
107 | 110 | dataIndex: 'action', |
108 | 111 | slots: { customRender: 'action' }, | ... | ... |
... | ... | @@ -33,14 +33,6 @@ export const columns: BasicColumn[] = [ |
33 | 33 | width: 200, |
34 | 34 | }, |
35 | 35 | { |
36 | - title: '内容', | |
37 | - dataIndex: 'content', | |
38 | - width: 120, | |
39 | - format: (text: string, record: Recordable) => { | |
40 | - return !record.content ? '' : record.content.slice(3, record.content.length - 4); | |
41 | - }, | |
42 | - }, | |
43 | - { | |
44 | 36 | title: '发送者', |
45 | 37 | dataIndex: 'senderName', |
46 | 38 | width: 200, | ... | ... |
... | ... | @@ -5,23 +5,7 @@ |
5 | 5 | > |
6 | 6 | <div |
7 | 7 | :class="`${prefixCls}__unlock`" |
8 | - class=" | |
9 | - absolute | |
10 | - top-0 | |
11 | - left-1/2 | |
12 | - flex | |
13 | - pt-5 | |
14 | - h-16 | |
15 | - items-center | |
16 | - justify-center | |
17 | - sm:text-md | |
18 | - xl:text-xl | |
19 | - text-white | |
20 | - flex-col | |
21 | - cursor-pointer | |
22 | - transform | |
23 | - translate-x-1/2 | |
24 | - " | |
8 | + class="absolute top-0 left-1/2 flex pt-5 h-16 items-center justify-center sm:text-md xl:text-xl text-white flex-col cursor-pointer transform translate-x-1/2" | |
25 | 9 | @click="handleShowForm(false)" |
26 | 10 | v-show="showDate" |
27 | 11 | > |
... | ... | @@ -140,7 +124,7 @@ |
140 | 124 | } |
141 | 125 | |
142 | 126 | function goLogin() { |
143 | - userStore.logout(); | |
127 | + userStore.logout(true); | |
144 | 128 | lockStore.resetLockInfo(); |
145 | 129 | } |
146 | 130 | ... | ... |
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | import { CountdownInput } from '/@/components/CountDown'; |
41 | 41 | import { useI18n } from '/@/hooks/web/useI18n'; |
42 | 42 | import { useLoginState, useFormRules, LoginStateEnum } from './useLogin'; |
43 | - import { forgetPasswordApi } from '/@/api/sys/user'; | |
43 | + import { passwordResetCode, forgetPasswordApi } from '/@/api/sys/user'; | |
44 | 44 | const FormItem = Form.Item; |
45 | 45 | const { t } = useI18n(); |
46 | 46 | const { handleBackLogin, getLoginState, setLoginState } = useLoginState(); |
... | ... | @@ -58,22 +58,39 @@ |
58 | 58 | const getShow = computed(() => unref(getLoginState) === LoginStateEnum.RESET_PASSWORD); |
59 | 59 | |
60 | 60 | async function handleReset() { |
61 | - setLoginState(LoginStateEnum.LOGIN); | |
62 | 61 | const form = unref(formRef); |
63 | 62 | if (!form) return; |
63 | + const value = await form.validate(); | |
64 | + if (!value) return; | |
65 | + const { mobile, password, sms } = value; | |
66 | + try { | |
67 | + loading.value = true; | |
68 | + await forgetPasswordApi({ | |
69 | + phoneNumber: mobile, | |
70 | + userId: sms, | |
71 | + password, | |
72 | + }); | |
73 | + } catch (e) { | |
74 | + return; | |
75 | + } finally { | |
76 | + loading.value = false; | |
77 | + } | |
78 | + message.success('密码重置成功'); | |
64 | 79 | await form.resetFields(); |
80 | + setLoginState(LoginStateEnum.LOGIN); | |
65 | 81 | } |
66 | 82 | |
67 | 83 | async function sendLoginSms() { |
68 | 84 | const reg = |
69 | 85 | /^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/; |
70 | 86 | if (reg.test(formData.mobile)) { |
71 | - const sendRes = await forgetPasswordApi(formData.mobile); | |
72 | - if (!sendRes) { | |
73 | - message.error('发送失败'); | |
74 | - return false; | |
87 | + const sendRes = await passwordResetCode(formData.mobile); | |
88 | + console.log(sendRes); | |
89 | + if (sendRes === '') { | |
90 | + console.log('发送成功了'); | |
91 | + return true; | |
75 | 92 | } |
76 | - return true; | |
93 | + return false; | |
77 | 94 | } else { |
78 | 95 | message.error('请输入正确手机号码'); |
79 | 96 | } | ... | ... |
... | ... | @@ -60,10 +60,16 @@ |
60 | 60 | </ACol> |
61 | 61 | </ARow> |
62 | 62 | </Form> |
63 | + <Modal v-model:visible="visible" :footer="null" centered> | |
64 | + <template #title> | |
65 | + <CloseCircleFilled class="modal-icon-error" /><span class="ml-2">错误提示</span> | |
66 | + </template> | |
67 | + <span class="ml-2" style="color: red">用户名或密码不正确</span> | |
68 | + </Modal> | |
63 | 69 | </template> |
64 | 70 | <script lang="ts" setup> |
65 | 71 | import { reactive, ref, unref, computed } from 'vue'; |
66 | - import { Checkbox, Form, Input, Row, Col, Button } from 'ant-design-vue'; | |
72 | + import { Checkbox, Form, Input, Row, Col, Button, Modal } from 'ant-design-vue'; | |
67 | 73 | import LoginFormTitle from './LoginFormTitle.vue'; |
68 | 74 | |
69 | 75 | import { useI18n } from '/@/hooks/web/useI18n'; |
... | ... | @@ -74,6 +80,7 @@ |
74 | 80 | import { useDesign } from '/@/hooks/web/useDesign'; |
75 | 81 | import { getPlatForm } from '/@/api/oem/index'; |
76 | 82 | import { createLocalStorage } from '/@/utils/cache/index'; |
83 | + import { CloseCircleFilled } from '@ant-design/icons-vue'; | |
77 | 84 | |
78 | 85 | const ACol = Col; |
79 | 86 | const ARow = Row; |
... | ... | @@ -87,7 +94,7 @@ |
87 | 94 | const { setLoginState, getLoginState } = useLoginState(); |
88 | 95 | const { getFormRules } = useFormRules(); |
89 | 96 | const storage = createLocalStorage(); |
90 | - | |
97 | + const visible = ref(false); | |
91 | 98 | const formRef = ref(); |
92 | 99 | const loading = ref(false); |
93 | 100 | const rememberMe = ref(false); |
... | ... | @@ -100,6 +107,7 @@ |
100 | 107 | const { validForm } = useFormValid(formRef); |
101 | 108 | |
102 | 109 | const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN); |
110 | + | |
103 | 111 | async function handleLogin() { |
104 | 112 | const data = await validForm(); |
105 | 113 | if (!data) return; |
... | ... | @@ -113,7 +121,7 @@ |
113 | 121 | const userInfo = await userStore.login({ |
114 | 122 | password: data.password, |
115 | 123 | username: data.account, |
116 | - mode: 'none', //不要默认的错误提示 | |
124 | + mode: 'modal', //不要默认的错误提示 | |
117 | 125 | }); |
118 | 126 | if (userInfo) { |
119 | 127 | notification.success({ |
... | ... | @@ -132,12 +140,8 @@ |
132 | 140 | link.href = res.icon ?? '/favicon.ico'; |
133 | 141 | document.getElementsByTagName('head')[0].appendChild(link); |
134 | 142 | } |
135 | - } catch (error) { | |
136 | - createErrorModal({ | |
137 | - title: t('sys.api.errorTip'), | |
138 | - content: (error as unknown as Error).message || t('sys.api.networkExceptionMsg'), | |
139 | - getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body, | |
140 | - }); | |
143 | + } catch (error: any) { | |
144 | + visible.value = true; | |
141 | 145 | } finally { |
142 | 146 | loading.value = false; |
143 | 147 | } | ... | ... |
... | ... | @@ -10,23 +10,11 @@ export const schemas: FormSchema[] = [ |
10 | 10 | colProps: { |
11 | 11 | span: 24, |
12 | 12 | }, |
13 | + required: true, | |
13 | 14 | componentProps: { |
14 | 15 | maxLength: 100, |
15 | 16 | placeholder: '请输入公司名称', |
16 | 17 | }, |
17 | - dynamicRules: () => { | |
18 | - return [ | |
19 | - { | |
20 | - required: false, | |
21 | - validator: (_, value) => { | |
22 | - if (String(value).length > 100) { | |
23 | - return Promise.reject('字数不超过100个字'); | |
24 | - } | |
25 | - return Promise.resolve(); | |
26 | - }, | |
27 | - }, | |
28 | - ]; | |
29 | - }, | |
30 | 18 | }, |
31 | 19 | { |
32 | 20 | field: 'abbreviation', |
... | ... | @@ -148,23 +136,11 @@ export const schemas: FormSchema[] = [ |
148 | 136 | colProps: { |
149 | 137 | span: 24, |
150 | 138 | }, |
139 | + required: true, | |
151 | 140 | componentProps: { |
152 | 141 | maxLength: 100, |
153 | 142 | placeholder: '请输入详细地址', |
154 | 143 | }, |
155 | - dynamicRules: () => { | |
156 | - return [ | |
157 | - { | |
158 | - required: false, | |
159 | - validator: (_, value) => { | |
160 | - if (String(value).length > 100) { | |
161 | - return Promise.reject('字数不超过100个字'); | |
162 | - } | |
163 | - return Promise.resolve(); | |
164 | - }, | |
165 | - }, | |
166 | - ]; | |
167 | - }, | |
168 | 144 | }, |
169 | 145 | |
170 | 146 | { |
... | ... | @@ -174,23 +150,11 @@ export const schemas: FormSchema[] = [ |
174 | 150 | colProps: { |
175 | 151 | span: 24, |
176 | 152 | }, |
153 | + required: true, | |
177 | 154 | componentProps: { |
178 | 155 | maxLength: 25, |
179 | 156 | placeholder: '请输入联系人', |
180 | 157 | }, |
181 | - dynamicRules: () => { | |
182 | - return [ | |
183 | - { | |
184 | - required: false, | |
185 | - validator: (_, value) => { | |
186 | - if (String(value).length > 25) { | |
187 | - return Promise.reject('字数不超过25个字'); | |
188 | - } | |
189 | - return Promise.resolve(); | |
190 | - }, | |
191 | - }, | |
192 | - ]; | |
193 | - }, | |
194 | 158 | }, |
195 | 159 | { |
196 | 160 | field: 'tel', | ... | ... |
... | ... | @@ -3,15 +3,15 @@ |
3 | 3 | <Card class="tab-card" :bordered="false"> |
4 | 4 | <Tabs v-model:activeKey="activeKey" tab-position="left"> |
5 | 5 | <Tabs.TabPane key="企业信息" tab="企业信息" /> |
6 | - <Tabs.TabPane key="平台定制" tab="平台定制" /> | |
7 | - <Tabs.TabPane key="APP定制" tab="APP定制" /> | |
6 | + <Tabs.TabPane key="平台信息" tab="平台信息" /> | |
7 | + <Tabs.TabPane key="APP信息" tab="APP信息" /> | |
8 | 8 | </Tabs> |
9 | 9 | </Card> |
10 | 10 | |
11 | 11 | <div style="width: 100%"> |
12 | 12 | <Card class="card" :title="activeKey" :bordered="false" :bodyStyle="{ display: 'none' }" /> |
13 | 13 | <EnterpriseInfo v-if="activeKey === '企业信息'" /> |
14 | - <CVIDraw v-else-if="activeKey === '平台定制'" /> | |
14 | + <CVIDraw v-else-if="activeKey === '平台信息'" /> | |
15 | 15 | <AppDraw v-else /> |
16 | 16 | </div> |
17 | 17 | </div> | ... | ... |
... | ... | @@ -61,7 +61,7 @@ export const formSchema: FormSchema[] = [ |
61 | 61 | component: 'Checkbox', |
62 | 62 | renderComponentContent: () => { |
63 | 63 | return h('span', {}, [ |
64 | - h('span', {}, '隔离板芯容器的加工'), | |
64 | + h('span', {}, '隔离板芯容器中的加工'), | |
65 | 65 | h('span', { style: { color: 'grey' } }, '(每个独立租户需要单独的微服务)'), |
66 | 66 | ]); |
67 | 67 | }, |
... | ... | @@ -72,7 +72,7 @@ export const formSchema: FormSchema[] = [ |
72 | 72 | component: 'Checkbox', |
73 | 73 | renderComponentContent: () => { |
74 | 74 | return h('span', {}, [ |
75 | - h('span', {}, '在独立的ThingsBoard规则引擎中处理'), | |
75 | + h('span', {}, '在独立的规则引擎中处理'), | |
76 | 76 | h('span', { style: { color: 'grey' } }, '(每个独立租户需要单独的微服务)'), |
77 | 77 | ]); |
78 | 78 | }, | ... | ... |
... | ... | @@ -20,7 +20,7 @@ export const formSchema: FormSchema[] = [ |
20 | 20 | label: '最大设备数(0-无限制)', |
21 | 21 | component: 'InputNumber', |
22 | 22 | defaultValue: '0', |
23 | - colProps: { span: 24 }, | |
23 | + colProps: { span: 12 }, | |
24 | 24 | componentProps: { |
25 | 25 | placeholder: '请输入最大设备数(请输入数字)', |
26 | 26 | }, |
... | ... | @@ -29,9 +29,9 @@ export const formSchema: FormSchema[] = [ |
29 | 29 | field: 'maxAssets', |
30 | 30 | required: true, |
31 | 31 | defaultValue: '0', |
32 | - | |
32 | + ifShow: false, | |
33 | 33 | label: '最大资产数(0-无限制)', |
34 | - colProps: { span: 24 }, | |
34 | + colProps: { span: 12 }, | |
35 | 35 | component: 'InputNumber', |
36 | 36 | componentProps: { |
37 | 37 | placeholder: '请输入最大资产(请输入数字)', |
... | ... | @@ -43,7 +43,7 @@ export const formSchema: FormSchema[] = [ |
43 | 43 | defaultValue: '0', |
44 | 44 | |
45 | 45 | label: '最大客户数(0-无限制)', |
46 | - colProps: { span: 24 }, | |
46 | + colProps: { span: 12 }, | |
47 | 47 | component: 'InputNumber', |
48 | 48 | componentProps: { |
49 | 49 | placeholder: '请输入最大客户数(请输入数字)', |
... | ... | @@ -53,9 +53,9 @@ export const formSchema: FormSchema[] = [ |
53 | 53 | field: 'maxUsers', |
54 | 54 | required: true, |
55 | 55 | defaultValue: '0', |
56 | - | |
56 | + ifShow: false, | |
57 | 57 | label: '最大用户数(0-无限制)', |
58 | - colProps: { span: 24 }, | |
58 | + colProps: { span: 12 }, | |
59 | 59 | component: 'InputNumber', |
60 | 60 | componentProps: { |
61 | 61 | placeholder: '请输入最大用户数(请输入数字)', |
... | ... | @@ -65,9 +65,9 @@ export const formSchema: FormSchema[] = [ |
65 | 65 | field: 'maxDashboards', |
66 | 66 | required: true, |
67 | 67 | defaultValue: '0', |
68 | - | |
68 | + ifShow: false, | |
69 | 69 | label: '仪表板的最大数量(0-无限制)', |
70 | - colProps: { span: 24 }, | |
70 | + colProps: { span: 12 }, | |
71 | 71 | component: 'InputNumber', |
72 | 72 | componentProps: { |
73 | 73 | placeholder: '请输入仪表板的最大数量(请输入数字)', |
... | ... | @@ -77,9 +77,9 @@ export const formSchema: FormSchema[] = [ |
77 | 77 | field: 'maxRuleChains', |
78 | 78 | required: true, |
79 | 79 | defaultValue: '0', |
80 | - | |
80 | + ifShow: false, | |
81 | 81 | label: '最大规则链数(0-无限制)', |
82 | - colProps: { span: 24 }, | |
82 | + colProps: { span: 12 }, | |
83 | 83 | component: 'InputNumber', |
84 | 84 | componentProps: { |
85 | 85 | placeholder: '请输入最大规则链数(请输入数字)', |
... | ... | @@ -89,9 +89,9 @@ export const formSchema: FormSchema[] = [ |
89 | 89 | field: 'maxResourcesInBytes', |
90 | 90 | required: true, |
91 | 91 | defaultValue: '0', |
92 | - | |
92 | + ifShow: false, | |
93 | 93 | label: '以字节为单位的资源文件的最大总和(0-无限制)', |
94 | - colProps: { span: 24 }, | |
94 | + colProps: { span: 12 }, | |
95 | 95 | component: 'InputNumber', |
96 | 96 | componentProps: { |
97 | 97 | placeholder: '请输入(请输入数字)', |
... | ... | @@ -101,9 +101,9 @@ export const formSchema: FormSchema[] = [ |
101 | 101 | field: 'maxOtaPackagesInBytes', |
102 | 102 | required: true, |
103 | 103 | defaultValue: '0', |
104 | - | |
104 | + ifShow: false, | |
105 | 105 | label: 'Ota包文件大小的最大总和(字节)(0-无限制)', |
106 | - colProps: { span: 24 }, | |
106 | + colProps: { span: 12 }, | |
107 | 107 | component: 'InputNumber', |
108 | 108 | componentProps: { |
109 | 109 | placeholder: '请输入(请输入数字)', |
... | ... | @@ -115,7 +115,7 @@ export const formSchema: FormSchema[] = [ |
115 | 115 | defaultValue: '0', |
116 | 116 | |
117 | 117 | label: '最大传输消息数(0-无限制)', |
118 | - colProps: { span: 24 }, | |
118 | + colProps: { span: 12 }, | |
119 | 119 | component: 'InputNumber', |
120 | 120 | componentProps: { |
121 | 121 | placeholder: '请输入最大传输消息数(请输入数字)', |
... | ... | @@ -127,7 +127,7 @@ export const formSchema: FormSchema[] = [ |
127 | 127 | defaultValue: '0', |
128 | 128 | |
129 | 129 | label: '传输数据点的最大数量(0-无限制)', |
130 | - colProps: { span: 24 }, | |
130 | + colProps: { span: 12 }, | |
131 | 131 | component: 'InputNumber', |
132 | 132 | componentProps: { |
133 | 133 | placeholder: '请输入传输数据点的最大数量(请输入数字)', |
... | ... | @@ -137,9 +137,9 @@ export const formSchema: FormSchema[] = [ |
137 | 137 | field: 'maxREExecutions', |
138 | 138 | required: true, |
139 | 139 | defaultValue: '0', |
140 | - | |
140 | + ifShow: false, | |
141 | 141 | label: '最大规则引擎数(0-无限制)', |
142 | - colProps: { span: 24 }, | |
142 | + colProps: { span: 12 }, | |
143 | 143 | component: 'InputNumber', |
144 | 144 | componentProps: { |
145 | 145 | placeholder: '请输入最大规则引擎数(请输入数字)', |
... | ... | @@ -152,7 +152,7 @@ export const formSchema: FormSchema[] = [ |
152 | 152 | defaultValue: '0', |
153 | 153 | |
154 | 154 | label: '最大JavaScript执行数(0-不受限制)', |
155 | - colProps: { span: 24 }, | |
155 | + colProps: { span: 12 }, | |
156 | 156 | component: 'InputNumber', |
157 | 157 | componentProps: { |
158 | 158 | placeholder: '请输入最大JavaScript执行数(请输入数字)', |
... | ... | @@ -164,7 +164,7 @@ export const formSchema: FormSchema[] = [ |
164 | 164 | defaultValue: '0', |
165 | 165 | |
166 | 166 | label: '最大日存储数据点数(0-无限制)', |
167 | - colProps: { span: 24 }, | |
167 | + colProps: { span: 12 }, | |
168 | 168 | component: 'InputNumber', |
169 | 169 | componentProps: { |
170 | 170 | placeholder: '请输入最大日存储数据点数(请输入数字)', |
... | ... | @@ -175,11 +175,11 @@ export const formSchema: FormSchema[] = [ |
175 | 175 | required: true, |
176 | 176 | defaultValue: '0', |
177 | 177 | |
178 | - label: '默认存储 TTL 天数(0-无限制)', | |
179 | - colProps: { span: 24 }, | |
178 | + label: '默认存储天数(0-无限制)', | |
179 | + colProps: { span: 12 }, | |
180 | 180 | component: 'InputNumber', |
181 | 181 | componentProps: { |
182 | - placeholder: '请输入默认存储 TTL 天数(请输入数字)', | |
182 | + placeholder: '请输入默认存储天数(请输入数字)', | |
183 | 183 | }, |
184 | 184 | }, |
185 | 185 | { |
... | ... | @@ -187,11 +187,11 @@ export const formSchema: FormSchema[] = [ |
187 | 187 | required: true, |
188 | 188 | defaultValue: '0', |
189 | 189 | |
190 | - label: 'Alams TTL days(0-无限制)', | |
191 | - colProps: { span: 24 }, | |
190 | + label: '告警存储天数(0-无限制)', | |
191 | + colProps: { span: 12 }, | |
192 | 192 | component: 'InputNumber', |
193 | 193 | componentProps: { |
194 | - placeholder: '请输入Alarms TTL days(请输入数字)', | |
194 | + placeholder: '请输入告警存储天数(请输入数字)', | |
195 | 195 | }, |
196 | 196 | }, |
197 | 197 | { |
... | ... | @@ -199,19 +199,20 @@ export const formSchema: FormSchema[] = [ |
199 | 199 | required: true, |
200 | 200 | defaultValue: '0', |
201 | 201 | |
202 | - label: 'RPC TTL days(0-无限制)', | |
203 | - colProps: { span: 24 }, | |
202 | + label: 'RPC存储天数(0-无限制)', | |
203 | + colProps: { span: 12 }, | |
204 | 204 | component: 'InputNumber', |
205 | 205 | componentProps: { |
206 | - placeholder: '请输入RPC TTL days(请输入数字)', | |
206 | + placeholder: '请输入RPC存储天数(请输入数字)', | |
207 | 207 | }, |
208 | 208 | }, |
209 | 209 | { |
210 | + ifShow: false, | |
210 | 211 | field: 'maxRuleNodeExecutionsPerMessage', |
211 | 212 | required: true, |
212 | - defaultValue: '1', | |
213 | + defaultValue: '0', | |
213 | 214 | label: '每条消息的最大规则节点执行数(0-无限制)', |
214 | - colProps: { span: 24 }, | |
215 | + colProps: { span: 12 }, | |
215 | 216 | component: 'InputNumber', |
216 | 217 | componentProps: { |
217 | 218 | placeholder: '请输入每条消息的最大规则节点执行数(请输入数字)', |
... | ... | @@ -221,9 +222,9 @@ export const formSchema: FormSchema[] = [ |
221 | 222 | field: 'maxEmails', |
222 | 223 | required: true, |
223 | 224 | label: '发送的最大电子邮件数(0-无限制)', |
224 | - colProps: { span: 24 }, | |
225 | + colProps: { span: 12 }, | |
225 | 226 | defaultValue: '0', |
226 | - | |
227 | + ifShow: false, | |
227 | 228 | component: 'InputNumber', |
228 | 229 | componentProps: { |
229 | 230 | placeholder: '请输入发送的最大电子邮件数(请输入数字)', |
... | ... | @@ -233,9 +234,9 @@ export const formSchema: FormSchema[] = [ |
233 | 234 | field: 'maxSms', |
234 | 235 | required: true, |
235 | 236 | defaultValue: '0', |
236 | - | |
237 | + ifShow: false, | |
237 | 238 | label: '发送的最大短信数(0-无限制)', |
238 | - colProps: { span: 24 }, | |
239 | + colProps: { span: 12 }, | |
239 | 240 | component: 'InputNumber', |
240 | 241 | componentProps: { |
241 | 242 | placeholder: '请输入发送的最大短信数(请输入数字)', |
... | ... | @@ -247,7 +248,7 @@ export const formSchema: FormSchema[] = [ |
247 | 248 | defaultValue: '0', |
248 | 249 | |
249 | 250 | label: '创建的最大报警数 (0 - 无限制)', |
250 | - colProps: { span: 24 }, | |
251 | + colProps: { span: 12 }, | |
251 | 252 | component: 'InputNumber', |
252 | 253 | componentProps: { |
253 | 254 | placeholder: '请输入maxCreatedAlarms(请输入数字)', | ... | ... |
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | label: '设置该租户为默认', |
19 | 19 | icon: 'ant-design:eye-outlined', |
20 | 20 | onClick: handleDefault.bind(null, record), |
21 | + ifShow: !record.default, | |
21 | 22 | }, |
22 | 23 | { |
23 | 24 | label: '编辑', |
... | ... | @@ -32,6 +33,7 @@ |
32 | 33 | title: '是否确认删除', |
33 | 34 | confirm: handleDelete.bind(null, record), |
34 | 35 | }, |
36 | + ifShow: !record.default, | |
35 | 37 | }, |
36 | 38 | ]" |
37 | 39 | /> | ... | ... |
... | ... | @@ -15,9 +15,9 @@ |
15 | 15 | <TableAction |
16 | 16 | :actions="[ |
17 | 17 | { |
18 | - label: '短信激活', | |
18 | + label: '短信通知', | |
19 | 19 | icon: 'ant-design:send-outlined', |
20 | - tooltip: '发送激活短信', | |
20 | + tooltip: '发送通知短信', | |
21 | 21 | ifShow: record.phoneNumber != null && !record.hasPassword, |
22 | 22 | onClick: handleSendMsg.bind(null, record), |
23 | 23 | }, |
... | ... | @@ -131,9 +131,10 @@ |
131 | 131 | } |
132 | 132 | |
133 | 133 | function handleResetPassword(record: Recordable) { |
134 | - resetPassword(record.id); | |
135 | - createMessage.success('清空密码成功'); | |
136 | - handleSuccess(); | |
134 | + resetPassword(record.id).then(() => { | |
135 | + createMessage.success('清空密码成功'); | |
136 | + handleSuccess(); | |
137 | + }); | |
137 | 138 | } |
138 | 139 | function handleSendMsg(record: Recordable) { |
139 | 140 | const req = new SendResetPasswordEmailMsg(record.id, MessageTypeEnum.PHONE_MESSAGE); | ... | ... |