Commit 3104e1283b45cffa4853477bfc6eadc863b64f2a
1 parent
b7b0c278
fix:发现打包问题,原因是ant-design-vue有些样式没找到
Showing
13 changed files
with
66 additions
and
56 deletions
| ... | ... | @@ -111,14 +111,11 @@ |
| 111 | 111 | const getPersonalDetailValue: any = ref({}); |
| 112 | 112 | const avatarUrl: any = ref(''); |
| 113 | 113 | const getBackendV: any = ref({}); |
| 114 | - const retryFormData: any = ref({}); | |
| 115 | - // const retryDefaultData: any = ref({}); | |
| 116 | 114 | const [registerDesc] = useDescription({ |
| 117 | 115 | title: '个人详情', |
| 118 | 116 | schema: schema, |
| 119 | 117 | }); |
| 120 | 118 | |
| 121 | - const [registerModal, { closeModal }] = useModalInner(); | |
| 122 | 119 | const avatar = computed(() => { |
| 123 | 120 | const { avatar } = userStore.getUserInfo; |
| 124 | 121 | return avatarUrl.value || avatar || defaultImage; |
| ... | ... | @@ -130,25 +127,15 @@ |
| 130 | 127 | showActionButtonGroup: false, |
| 131 | 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 | 139 | const handleSubmit = async () => { |
| 153 | 140 | const getUserInfo = await userInfo; |
| 154 | 141 | getPersonalValue.value = await validate(); |
| ... | ... | @@ -160,29 +147,10 @@ |
| 160 | 147 | closeModal(); |
| 161 | 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 | 150 | const compHeight = computed(() => { |
| 182 | 151 | return 1000; |
| 183 | 152 | }); |
| 184 | 153 | return { |
| 185 | - retryFieldsValue, | |
| 186 | 154 | uploadApi, |
| 187 | 155 | compHeight, |
| 188 | 156 | updateAvatar, | ... | ... |
| ... | ... | @@ -53,13 +53,13 @@ |
| 53 | 53 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 54 | 54 | import { useDesign } from '/@/hooks/web/useDesign'; |
| 55 | 55 | import { useModal } from '/@/components/Modal'; |
| 56 | - | |
| 57 | 56 | import headerImg from '/@/assets/images/header.jpg'; |
| 58 | 57 | import { propTypes } from '/@/utils/propTypes'; |
| 59 | 58 | import { openWindow } from '/@/utils'; |
| 60 | - | |
| 61 | 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 | 63 | type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal'; |
| 64 | 64 | |
| 65 | 65 | export default defineComponent({ |
| ... | ... | @@ -75,6 +75,7 @@ |
| 75 | 75 | theme: propTypes.oneOf(['dark', 'light']), |
| 76 | 76 | }, |
| 77 | 77 | setup() { |
| 78 | + const userInfo = getAuthCache(USER_INFO_KEY); | |
| 78 | 79 | const { proxy } = getCurrentInstance(); |
| 79 | 80 | const personalRef = ref(null); |
| 80 | 81 | const { prefixCls } = useDesign('header-user-dropdown'); |
| ... | ... | @@ -123,8 +124,9 @@ |
| 123 | 124 | |
| 124 | 125 | const openPersonalFunc = () => { |
| 125 | 126 | setTimeout(() => { |
| 126 | - openModalPersonal(true); | |
| 127 | - proxy.$refs.personalRef.retryFieldsValue(); | |
| 127 | + openModalPersonal(true, { | |
| 128 | + userInfo, | |
| 129 | + }); | |
| 128 | 130 | }, 10); |
| 129 | 131 | }; |
| 130 | 132 | ... | ... |
| ... | ... | @@ -128,6 +128,8 @@ |
| 128 | 128 | import { columns } from './props'; |
| 129 | 129 | import { isAdmin } from '/@/enums/roleEnum'; |
| 130 | 130 | import { getTenantExpireTimeList } from '/@/api/dashboard'; |
| 131 | + import 'ant-design-vue/es/anchor-link/style/index'; | |
| 132 | + | |
| 131 | 133 | export default defineComponent({ |
| 132 | 134 | components: { |
| 133 | 135 | Card, | ... | ... |
| ... | ... | @@ -25,6 +25,7 @@ export const step1Schemas: FormSchema[] = [ |
| 25 | 25 | component: 'Input', |
| 26 | 26 | componentProps: { |
| 27 | 27 | placeholder: '设备名称', |
| 28 | + maxLength: 30, | |
| 28 | 29 | }, |
| 29 | 30 | rules: DeviceNameMaxLength, |
| 30 | 31 | }, |
| ... | ... | @@ -268,7 +269,7 @@ export const step2Schemas: FormSchema[] = [ |
| 268 | 269 | required: true, |
| 269 | 270 | ifShow: false, |
| 270 | 271 | componentProps: { |
| 271 | - maxLength: 64, | |
| 272 | + maxLength: 0, | |
| 272 | 273 | }, |
| 273 | 274 | }, |
| 274 | 275 | { |
| ... | ... | @@ -298,6 +299,9 @@ export const step2Schemas: FormSchema[] = [ |
| 298 | 299 | required: true, |
| 299 | 300 | rules: DeviceUserNameMaxLength, |
| 300 | 301 | ifShow: false, |
| 302 | + componentProps: { | |
| 303 | + maxLength: 255, | |
| 304 | + }, | |
| 301 | 305 | }, |
| 302 | 306 | { |
| 303 | 307 | label: '密码', |
| ... | ... | @@ -446,7 +450,7 @@ export const TokenSchemas: FormSchema[] = [ |
| 446 | 450 | required: true, |
| 447 | 451 | ifShow: false, |
| 448 | 452 | componentProps: { |
| 449 | - maxLength: 64, | |
| 453 | + maxLength: 0, | |
| 450 | 454 | }, |
| 451 | 455 | }, |
| 452 | 456 | { |
| ... | ... | @@ -476,6 +480,9 @@ export const TokenSchemas: FormSchema[] = [ |
| 476 | 480 | required: true, |
| 477 | 481 | ifShow: false, |
| 478 | 482 | rules: DeviceUserNameMaxLength, |
| 483 | + componentProps: { | |
| 484 | + maxLength: 255, | |
| 485 | + }, | |
| 479 | 486 | }, |
| 480 | 487 | { |
| 481 | 488 | label: '密码', | ... | ... |
| ... | ... | @@ -203,6 +203,9 @@ export const alarmSchemasForm: FormSchema[] = [ |
| 203 | 203 | field: 'details', |
| 204 | 204 | label: '详情', |
| 205 | 205 | component: 'InputTextArea', |
| 206 | + componentProps: { | |
| 207 | + maxLength: 255, | |
| 208 | + }, | |
| 206 | 209 | }, |
| 207 | 210 | ]; |
| 208 | 211 | |
| ... | ... | @@ -213,12 +216,18 @@ export const childDeviceSchemas: FormSchema[] = [ |
| 213 | 216 | label: '设备配置', |
| 214 | 217 | component: 'Select', |
| 215 | 218 | colProps: { span: 12 }, |
| 219 | + componentProps: { | |
| 220 | + maxLength: 255, | |
| 221 | + }, | |
| 216 | 222 | }, |
| 217 | 223 | { |
| 218 | 224 | field: 'icon', |
| 219 | 225 | label: '设备名称', |
| 220 | 226 | component: 'Input', |
| 221 | 227 | colProps: { span: 12 }, |
| 228 | + componentProps: { | |
| 229 | + maxLength: 255, | |
| 230 | + }, | |
| 222 | 231 | }, |
| 223 | 232 | ]; |
| 224 | 233 | export const childDeviceColumns: BasicColumn[] = [ | ... | ... |
| ... | ... | @@ -42,6 +42,8 @@ |
| 42 | 42 | import { Steps, Step } from 'ant-design-vue'; |
| 43 | 43 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 44 | 44 | import { credentialTypeEnum } from '../../config/data'; |
| 45 | + import 'ant-design-vue/es/step/style/index'; | |
| 46 | + | |
| 45 | 47 | export default defineComponent({ |
| 46 | 48 | name: 'DeviceModal', |
| 47 | 49 | components: { | ... | ... |
| ... | ... | @@ -117,6 +117,7 @@ |
| 117 | 117 | import { formSchema as enableClearSchema } from './step/cpns/enablerule/config'; |
| 118 | 118 | import { formSchema as detailClearSchema } from './step/cpns/detailtemplate/config'; |
| 119 | 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 | 122 | export default defineComponent({ |
| 122 | 123 | name: 'ConfigDrawer', | ... | ... |
| ... | ... | @@ -2,6 +2,17 @@ |
| 2 | 2 | <div class="step1"> |
| 3 | 3 | <div class="step1-form"> |
| 4 | 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 | 16 | </div> |
| 6 | 17 | </div> |
| 7 | 18 | </template> |
| ... | ... | @@ -10,6 +21,8 @@ |
| 10 | 21 | import { BasicForm, useForm } from '/@/components/Form'; |
| 11 | 22 | import { step1Schemas } from './data'; |
| 12 | 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 | 27 | export default defineComponent({ |
| 15 | 28 | components: { |
| ... | ... | @@ -18,6 +31,7 @@ |
| 18 | 31 | [Input.name]: Input, |
| 19 | 32 | [Input.Group.name]: Input.Group, |
| 20 | 33 | [Divider.name]: Divider, |
| 34 | + CropperAvatar, | |
| 21 | 35 | }, |
| 22 | 36 | emits: ['next', 'resetFunc'], |
| 23 | 37 | setup(_, { emit }) { |
| ... | ... | @@ -45,7 +59,7 @@ |
| 45 | 59 | const customResetFunc = async () => { |
| 46 | 60 | await resetFields(); |
| 47 | 61 | }; |
| 48 | - return { register, resetFieldsFunc, customResetFunc }; | |
| 62 | + return { register, resetFieldsFunc, customResetFunc, uploadApi }; | |
| 49 | 63 | }, |
| 50 | 64 | }); |
| 51 | 65 | </script> | ... | ... |
| ... | ... | @@ -11,9 +11,9 @@ |
| 11 | 11 | <a-button @click="fireResourceError" type="primary"> |
| 12 | 12 | {{ t('sys.errorLog.fireResourceError') }} |
| 13 | 13 | </a-button> |
| 14 | - <a-button @click="fireAjaxError" type="primary"> | |
| 14 | + <!-- <a-button @click="fireAjaxError" type="primary"> | |
| 15 | 15 | {{ t('sys.errorLog.fireAjaxError') }} |
| 16 | - </a-button> | |
| 16 | + </a-button> --> | |
| 17 | 17 | </template> |
| 18 | 18 | <template #action="{ record }"> |
| 19 | 19 | <TableAction |
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 37 | 37 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 38 | 38 | import { useErrorLogStore } from '/@/store/modules/errorLog'; |
| 39 | - import { fireErrorApi } from '/@/api/demo/error'; | |
| 39 | + // import { fireErrorApi } from '/@/api/demo/error'; | |
| 40 | 40 | import { getColumns } from './data'; |
| 41 | 41 | import { cloneDeep } from 'lodash-es'; |
| 42 | 42 | |
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 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 | 92 | </script> | ... | ... |