Commit fbfd0b98c531379303090be4d7ebd1dae03ad7fd

Authored by fengtao
2 parents 8148e16a 5366af27

Merge branch 'main' into ft-dev

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