Commit 3a2b867cd925b9c58f36168326df954de8ea002d

Authored by xp.Huang
2 parents a46ea76c 3104e128

Merge branch 'ft-dev' into 'main'

fix:发现打包问题,原因是ant-design-vue有些样式没找到

See merge request huang/yun-teng-iot-front!73
@@ -111,14 +111,11 @@ @@ -111,14 +111,11 @@
111 const getPersonalDetailValue: any = ref({}); 111 const getPersonalDetailValue: any = ref({});
112 const avatarUrl: any = ref(''); 112 const avatarUrl: any = ref('');
113 const getBackendV: any = ref({}); 113 const getBackendV: any = ref({});
114 - const retryFormData: any = ref({});  
115 - // const retryDefaultData: any = ref({});  
116 const [registerDesc] = useDescription({ 114 const [registerDesc] = useDescription({
117 title: '个人详情', 115 title: '个人详情',
118 schema: schema, 116 schema: schema,
119 }); 117 });
120 118
121 - const [registerModal, { closeModal }] = useModalInner();  
122 const avatar = computed(() => { 119 const avatar = computed(() => {
123 const { avatar } = userStore.getUserInfo; 120 const { avatar } = userStore.getUserInfo;
124 return avatarUrl.value || avatar || defaultImage; 121 return avatarUrl.value || avatar || defaultImage;
@@ -130,25 +127,15 @@ @@ -130,25 +127,15 @@
130 showActionButtonGroup: false, 127 showActionButtonGroup: false,
131 schemas: formSchema, 128 schemas: formSchema,
132 }); 129 });
133 - //回显数据  
134 - const retryFieldsValue = async () => {  
135 - try {  
136 - // retryDefaultData.value = await personalGet(getUserInfo.userId);  
137 - const getUserInfo = await userInfo;  
138 - // const getUserInfo = userStore.getUserInfo;  
139 - retryFormData.value = getUserInfo;  
140 - setFieldsValue({  
141 - realName: retryFormData.value.realName,  
142 - phoneNumber: retryFormData.value.phoneNumber,  
143 - email: retryFormData.value.email,  
144 - });  
145 - } catch (e) {  
146 - return e;  
147 - }  
148 - };  
149 - // setTimeout(() => {  
150 - // retryFieldsValue();  
151 - // }, 3000); 130 +
  131 + const [registerModal, { closeModal }] = useModalInner(async (data) => {
  132 + setFieldsValue({
  133 + realName: data.userInfo.realName,
  134 + phoneNumber: data.userInfo.phoneNumber,
  135 + email: data.userInfo.email,
  136 + });
  137 + getPersonalDetailValue.value = data.userInfo;
  138 + });
152 const handleSubmit = async () => { 139 const handleSubmit = async () => {
153 const getUserInfo = await userInfo; 140 const getUserInfo = await userInfo;
154 getPersonalValue.value = await validate(); 141 getPersonalValue.value = await validate();
@@ -160,29 +147,10 @@ @@ -160,29 +147,10 @@
160 closeModal(); 147 closeModal();
161 resetFields(); 148 resetFields();
162 }; 149 };
163 -  
164 - const getPersonalDetail = async () => {  
165 - try {  
166 - const getUserInfo = await userInfo;  
167 - getPersonalDetailValue.value = getUserInfo;  
168 - setTimeout(() => {  
169 - setFieldsValue({  
170 - realName: getPersonalDetailValue.value.realName,  
171 - phoneNumber: getPersonalDetailValue.value.phoneNumber,  
172 - email: getPersonalDetailValue.value.email,  
173 - });  
174 - }, 1000);  
175 - } catch (e) {  
176 - return e;  
177 - }  
178 - };  
179 - getPersonalDetail();  
180 -  
181 const compHeight = computed(() => { 150 const compHeight = computed(() => {
182 return 1000; 151 return 1000;
183 }); 152 });
184 return { 153 return {
185 - retryFieldsValue,  
186 uploadApi, 154 uploadApi,
187 compHeight, 155 compHeight,
188 updateAvatar, 156 updateAvatar,
@@ -53,13 +53,13 @@ @@ -53,13 +53,13 @@
53 import { useI18n } from '/@/hooks/web/useI18n'; 53 import { useI18n } from '/@/hooks/web/useI18n';
54 import { useDesign } from '/@/hooks/web/useDesign'; 54 import { useDesign } from '/@/hooks/web/useDesign';
55 import { useModal } from '/@/components/Modal'; 55 import { useModal } from '/@/components/Modal';
56 -  
57 import headerImg from '/@/assets/images/header.jpg'; 56 import headerImg from '/@/assets/images/header.jpg';
58 import { propTypes } from '/@/utils/propTypes'; 57 import { propTypes } from '/@/utils/propTypes';
59 import { openWindow } from '/@/utils'; 58 import { openWindow } from '/@/utils';
60 -  
61 import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; 59 import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
62 - 60 + import { USER_INFO_KEY } from '/@/enums/cacheEnum';
  61 + import { getAuthCache } from '/@/utils/auth';
  62 + import { useUserStore } from '/@/store/modules/user';
63 type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal'; 63 type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal';
64 64
65 export default defineComponent({ 65 export default defineComponent({
@@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
75 theme: propTypes.oneOf(['dark', 'light']), 75 theme: propTypes.oneOf(['dark', 'light']),
76 }, 76 },
77 setup() { 77 setup() {
  78 + const userInfo = getAuthCache(USER_INFO_KEY);
78 const { proxy } = getCurrentInstance(); 79 const { proxy } = getCurrentInstance();
79 const personalRef = ref(null); 80 const personalRef = ref(null);
80 const { prefixCls } = useDesign('header-user-dropdown'); 81 const { prefixCls } = useDesign('header-user-dropdown');
@@ -123,8 +124,9 @@ @@ -123,8 +124,9 @@
123 124
124 const openPersonalFunc = () => { 125 const openPersonalFunc = () => {
125 setTimeout(() => { 126 setTimeout(() => {
126 - openModalPersonal(true);  
127 - proxy.$refs.personalRef.retryFieldsValue(); 127 + openModalPersonal(true, {
  128 + userInfo,
  129 + });
128 }, 10); 130 }, 10);
129 }; 131 };
130 132
@@ -128,6 +128,8 @@ @@ -128,6 +128,8 @@
128 import { columns } from './props'; 128 import { columns } from './props';
129 import { isAdmin } from '/@/enums/roleEnum'; 129 import { isAdmin } from '/@/enums/roleEnum';
130 import { getTenantExpireTimeList } from '/@/api/dashboard'; 130 import { getTenantExpireTimeList } from '/@/api/dashboard';
  131 + import 'ant-design-vue/es/anchor-link/style/index';
  132 +
131 export default defineComponent({ 133 export default defineComponent({
132 components: { 134 components: {
133 Card, 135 Card,
@@ -25,6 +25,7 @@ export const step1Schemas: FormSchema[] = [ @@ -25,6 +25,7 @@ export const step1Schemas: FormSchema[] = [
25 component: 'Input', 25 component: 'Input',
26 componentProps: { 26 componentProps: {
27 placeholder: '设备名称', 27 placeholder: '设备名称',
  28 + maxLength: 30,
28 }, 29 },
29 rules: DeviceNameMaxLength, 30 rules: DeviceNameMaxLength,
30 }, 31 },
@@ -268,7 +269,7 @@ export const step2Schemas: FormSchema[] = [ @@ -268,7 +269,7 @@ export const step2Schemas: FormSchema[] = [
268 required: true, 269 required: true,
269 ifShow: false, 270 ifShow: false,
270 componentProps: { 271 componentProps: {
271 - maxLength: 64, 272 + maxLength: 0,
272 }, 273 },
273 }, 274 },
274 { 275 {
@@ -298,6 +299,9 @@ export const step2Schemas: FormSchema[] = [ @@ -298,6 +299,9 @@ export const step2Schemas: FormSchema[] = [
298 required: true, 299 required: true,
299 rules: DeviceUserNameMaxLength, 300 rules: DeviceUserNameMaxLength,
300 ifShow: false, 301 ifShow: false,
  302 + componentProps: {
  303 + maxLength: 255,
  304 + },
301 }, 305 },
302 { 306 {
303 label: '密码', 307 label: '密码',
@@ -446,7 +450,7 @@ export const TokenSchemas: FormSchema[] = [ @@ -446,7 +450,7 @@ export const TokenSchemas: FormSchema[] = [
446 required: true, 450 required: true,
447 ifShow: false, 451 ifShow: false,
448 componentProps: { 452 componentProps: {
449 - maxLength: 64, 453 + maxLength: 0,
450 }, 454 },
451 }, 455 },
452 { 456 {
@@ -476,6 +480,9 @@ export const TokenSchemas: FormSchema[] = [ @@ -476,6 +480,9 @@ export const TokenSchemas: FormSchema[] = [
476 required: true, 480 required: true,
477 ifShow: false, 481 ifShow: false,
478 rules: DeviceUserNameMaxLength, 482 rules: DeviceUserNameMaxLength,
  483 + componentProps: {
  484 + maxLength: 255,
  485 + },
479 }, 486 },
480 { 487 {
481 label: '密码', 488 label: '密码',
@@ -203,6 +203,9 @@ export const alarmSchemasForm: FormSchema[] = [ @@ -203,6 +203,9 @@ export const alarmSchemasForm: FormSchema[] = [
203 field: 'details', 203 field: 'details',
204 label: '详情', 204 label: '详情',
205 component: 'InputTextArea', 205 component: 'InputTextArea',
  206 + componentProps: {
  207 + maxLength: 255,
  208 + },
206 }, 209 },
207 ]; 210 ];
208 211
@@ -213,12 +216,18 @@ export const childDeviceSchemas: FormSchema[] = [ @@ -213,12 +216,18 @@ export const childDeviceSchemas: FormSchema[] = [
213 label: '设备配置', 216 label: '设备配置',
214 component: 'Select', 217 component: 'Select',
215 colProps: { span: 12 }, 218 colProps: { span: 12 },
  219 + componentProps: {
  220 + maxLength: 255,
  221 + },
216 }, 222 },
217 { 223 {
218 field: 'icon', 224 field: 'icon',
219 label: '设备名称', 225 label: '设备名称',
220 component: 'Input', 226 component: 'Input',
221 colProps: { span: 12 }, 227 colProps: { span: 12 },
  228 + componentProps: {
  229 + maxLength: 255,
  230 + },
222 }, 231 },
223 ]; 232 ];
224 export const childDeviceColumns: BasicColumn[] = [ 233 export const childDeviceColumns: BasicColumn[] = [
@@ -88,5 +88,8 @@ export const searchFormSchema: FormSchema[] = [ @@ -88,5 +88,8 @@ export const searchFormSchema: FormSchema[] = [
88 component: 'Input', 88 component: 'Input',
89 colProps: { span: 7 }, 89 colProps: { span: 7 },
90 rules: DeviceQueryUserNameMaxLength, 90 rules: DeviceQueryUserNameMaxLength,
  91 + componentProps: {
  92 + maxLength: 255,
  93 + },
91 }, 94 },
92 ]; 95 ];
@@ -42,6 +42,8 @@ @@ -42,6 +42,8 @@
42 import { Steps, Step } from 'ant-design-vue'; 42 import { Steps, Step } from 'ant-design-vue';
43 import { useMessage } from '/@/hooks/web/useMessage'; 43 import { useMessage } from '/@/hooks/web/useMessage';
44 import { credentialTypeEnum } from '../../config/data'; 44 import { credentialTypeEnum } from '../../config/data';
  45 + import 'ant-design-vue/es/step/style/index';
  46 +
45 export default defineComponent({ 47 export default defineComponent({
46 name: 'DeviceModal', 48 name: 'DeviceModal',
47 components: { 49 components: {
@@ -117,6 +117,7 @@ @@ -117,6 +117,7 @@
117 import { formSchema as enableClearSchema } from './step/cpns/enablerule/config'; 117 import { formSchema as enableClearSchema } from './step/cpns/enablerule/config';
118 import { formSchema as detailClearSchema } from './step/cpns/detailtemplate/config'; 118 import { formSchema as detailClearSchema } from './step/cpns/detailtemplate/config';
119 import { formSchema as echoFormClearSchema } from './step/cpns/alarmruleconditions/cpns/config'; 119 import { formSchema as echoFormClearSchema } from './step/cpns/alarmruleconditions/cpns/config';
  120 + import 'ant-design-vue/es/tab-pane/style/index.css';
120 121
121 export default defineComponent({ 122 export default defineComponent({
122 name: 'ConfigDrawer', 123 name: 'ConfigDrawer',
@@ -2,6 +2,17 @@ @@ -2,6 +2,17 @@
2 <div class="step1"> 2 <div class="step1">
3 <div class="step1-form"> 3 <div class="step1-form">
4 <BasicForm @register="register" /> 4 <BasicForm @register="register" />
  5 + <div>
  6 + <span>请上传图片</span>
  7 + <CropperAvatar
  8 + :uploadApi="uploadApi"
  9 + :value="avatar"
  10 + btnText="更换头像"
  11 + :btnProps="{ preIcon: 'ant-design:cloud-upload-outlined' }"
  12 + @change="updateAvatar"
  13 + width="150"
  14 + />
  15 + </div>
5 </div> 16 </div>
6 </div> 17 </div>
7 </template> 18 </template>
@@ -10,6 +21,8 @@ @@ -10,6 +21,8 @@
10 import { BasicForm, useForm } from '/@/components/Form'; 21 import { BasicForm, useForm } from '/@/components/Form';
11 import { step1Schemas } from './data'; 22 import { step1Schemas } from './data';
12 import { Select, Input, Divider } from 'ant-design-vue'; 23 import { Select, Input, Divider } from 'ant-design-vue';
  24 + import { CropperAvatar } from '/@/components/Cropper';
  25 + import { uploadApi } from '/@/api/personal/index';
13 26
14 export default defineComponent({ 27 export default defineComponent({
15 components: { 28 components: {
@@ -18,6 +31,7 @@ @@ -18,6 +31,7 @@
18 [Input.name]: Input, 31 [Input.name]: Input,
19 [Input.Group.name]: Input.Group, 32 [Input.Group.name]: Input.Group,
20 [Divider.name]: Divider, 33 [Divider.name]: Divider,
  34 + CropperAvatar,
21 }, 35 },
22 emits: ['next', 'resetFunc'], 36 emits: ['next', 'resetFunc'],
23 setup(_, { emit }) { 37 setup(_, { emit }) {
@@ -45,7 +59,7 @@ @@ -45,7 +59,7 @@
45 const customResetFunc = async () => { 59 const customResetFunc = async () => {
46 await resetFields(); 60 await resetFields();
47 }; 61 };
48 - return { register, resetFieldsFunc, customResetFunc }; 62 + return { register, resetFieldsFunc, customResetFunc, uploadApi };
49 }, 63 },
50 }); 64 });
51 </script> 65 </script>
@@ -48,7 +48,7 @@ export const step1Schemas: FormSchema[] = [ @@ -48,7 +48,7 @@ export const step1Schemas: FormSchema[] = [
48 // span: 8, 48 // span: 8,
49 // }, 49 // },
50 // componentProps: { 50 // componentProps: {
51 - // // api: uploadApi, 51 + // api: uploadApi,
52 // }, 52 // },
53 // }, 53 // },
54 { 54 {
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 import SmsLog from './item/SmsLog.vue'; 16 import SmsLog from './item/SmsLog.vue';
17 import EmailLog from './item/EmailLog.vue'; 17 import EmailLog from './item/EmailLog.vue';
18 import { achieveList } from './data'; 18 import { achieveList } from './data';
  19 + import 'ant-design-vue/es/tab-pane/style/index.css';
19 20
20 export default defineComponent({ 21 export default defineComponent({
21 components: { 22 components: {
@@ -97,6 +97,7 @@ export const formSchema: FormSchema[] = [ @@ -97,6 +97,7 @@ export const formSchema: FormSchema[] = [
97 component: 'Input', 97 component: 'Input',
98 componentProps: { 98 componentProps: {
99 placeholder: '请输入标题', 99 placeholder: '请输入标题',
  100 + maxLength: 200,
100 }, 101 },
101 rules: NotificationTitleMaxLength, 102 rules: NotificationTitleMaxLength,
102 }, 103 },
@@ -11,9 +11,9 @@ @@ -11,9 +11,9 @@
11 <a-button @click="fireResourceError" type="primary"> 11 <a-button @click="fireResourceError" type="primary">
12 {{ t('sys.errorLog.fireResourceError') }} 12 {{ t('sys.errorLog.fireResourceError') }}
13 </a-button> 13 </a-button>
14 - <a-button @click="fireAjaxError" type="primary"> 14 + <!-- <a-button @click="fireAjaxError" type="primary">
15 {{ t('sys.errorLog.fireAjaxError') }} 15 {{ t('sys.errorLog.fireAjaxError') }}
16 - </a-button> 16 + </a-button> -->
17 </template> 17 </template>
18 <template #action="{ record }"> 18 <template #action="{ record }">
19 <TableAction 19 <TableAction
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 import { useMessage } from '/@/hooks/web/useMessage'; 36 import { useMessage } from '/@/hooks/web/useMessage';
37 import { useI18n } from '/@/hooks/web/useI18n'; 37 import { useI18n } from '/@/hooks/web/useI18n';
38 import { useErrorLogStore } from '/@/store/modules/errorLog'; 38 import { useErrorLogStore } from '/@/store/modules/errorLog';
39 - import { fireErrorApi } from '/@/api/demo/error'; 39 + // import { fireErrorApi } from '/@/api/demo/error';
40 import { getColumns } from './data'; 40 import { getColumns } from './data';
41 import { cloneDeep } from 'lodash-es'; 41 import { cloneDeep } from 'lodash-es';
42 42
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 imgList.value.push(`${new Date().getTime()}.png`); 86 imgList.value.push(`${new Date().getTime()}.png`);
87 } 87 }
88 88
89 - async function fireAjaxError() {  
90 - await fireErrorApi();  
91 - } 89 + // async function fireAjaxError() {
  90 + // await fireErrorApi();
  91 + // }
92 </script> 92 </script>