Skip to content

Commit

Permalink
style: 完善部分限制字数输入框的限制提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 11, 2024
1 parent 6e9b322 commit bb246f4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/types/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
CronForm: typeof import('./../components/GenCron/CronForm/index.vue')['default']
CronModel: typeof import('./../components/GenCron/CronModel/index.vue')['default']
DateRangePicker: typeof import('./../components/DateRangePicker/index.vue')['default']
DayForm: typeof import('./../components/GenCron/CronForm/component/day-form.vue')['default']
GiCellAvatar: typeof import('./../components/GiCell/GiCellAvatar.vue')['default']
GiCellGender: typeof import('./../components/GiCell/GiCellGender.vue')['default']
GiCellStatus: typeof import('./../components/GiCell/GiCellStatus.vue')['default']
Expand All @@ -27,6 +30,7 @@ declare module 'vue' {
GiTable: typeof import('./../components/GiTable/index.vue')['default']
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default']
HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default']
Icon403: typeof import('./../components/icons/Icon403.vue')['default']
Icon404: typeof import('./../components/icons/Icon404.vue')['default']
Icon500: typeof import('./../components/icons/Icon500.vue')['default']
Expand All @@ -35,12 +39,17 @@ declare module 'vue' {
IconTreeAdd: typeof import('./../components/icons/IconTreeAdd.vue')['default']
IconTreeReduce: typeof import('./../components/icons/IconTreeReduce.vue')['default']
JsonPretty: typeof import('./../components/JsonPretty/index.vue')['default']
MinuteForm: typeof import('./../components/GenCron/CronForm/component/minute-form.vue')['default']
MonthForm: typeof import('./../components/GenCron/CronForm/component/month-form.vue')['default']
ParentView: typeof import('./../components/ParentView/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SecondForm: typeof import('./../components/GenCron/CronForm/component/second-form.vue')['default']
TextCopy: typeof import('./../components/TextCopy/index.vue')['default']
Verify: typeof import('./../components/Verify/index.vue')['default']
VerifyPoints: typeof import('./../components/Verify/Verify/VerifyPoints.vue')['default']
VerifySlide: typeof import('./../components/Verify/Verify/VerifySlide.vue')['default']
WeekForm: typeof import('./../components/GenCron/CronForm/component/week-form.vue')['default']
YearForm: typeof import('./../components/GenCron/CronForm/component/year-form.vue')['default']
}
}
2 changes: 1 addition & 1 deletion src/views/schedule/job/JobAddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</a-col>
<a-col v-bind="colProps">
<a-form-item label="任务名称" field="jobName">
<a-input v-model.trim="form.jobName" placeholder="请输入任务名称" :max-length="64" />
<a-input v-model.trim="form.jobName" placeholder="请输入任务名称" :max-length="64" show-word-limit />
</a-form-item>
</a-col>
</a-row>
Expand Down
11 changes: 8 additions & 3 deletions src/views/system/config/components/BasicSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,20 @@
</template>
</a-form-item>
<a-form-item class="input-item" field="SITE_TITLE" :label="siteConfig.SITE_TITLE.name">
<a-input v-model.trim="form.SITE_TITLE" placeholder="请输入网站标题" :max-length="18" />
<a-input v-model.trim="form.SITE_TITLE" placeholder="请输入系统标题" :max-length="18" show-word-limit />
</a-form-item>
<a-form-item class="input-item" field="SITE_DESCRIPTION" :label="siteConfig.SITE_DESCRIPTION.name">
<a-input v-model.trim="form.SITE_DESCRIPTION" placeholder="请输入网站描述" :max-length="18" />
<a-textarea
v-model.trim="form.SITE_DESCRIPTION"
placeholder="请输入系统描述"
:auto-size="{ minRows: 1, maxRows: 3 }"
/>
</a-form-item>
<a-form-item class="input-item" field="SITE_COPYRIGHT" :label="siteConfig.SITE_COPYRIGHT.name">
<a-input v-model.trim="form.SITE_COPYRIGHT" placeholder="请输入版权信息" />
</a-form-item>
<a-form-item class="input-item" field="SITE_BEIAN" :label="siteConfig.SITE_BEIAN.name">
<a-input v-model.trim="form.SITE_BEIAN" placeholder="请输入备案信息" style="width: 100%;" />
<a-input v-model.trim="form.SITE_BEIAN" placeholder="请输入备案号" :max-length="30" show-word-limit style="width: 100%;" />
</a-form-item>
<div style="margin-top: 20px">
<a-space>
Expand Down Expand Up @@ -124,6 +128,7 @@ const { form } = useForm({
})
const rules: FormInstance['rules'] = {
SITE_TITLE: [{ required: true, message: '请输入系统标题' }],
SITE_DESCRIPTION: [{ required: true, message: '请输入系统描述' }],
SITE_COPYRIGHT: [{ required: true, message: '请输入版权信息' }]
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/system/notice/NoticeAddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a-row :gutter="16">
<a-col :span="24">
<a-form-item label="标题" field="title">
<a-input v-model="form.title" placeholder="请输入标题" allow-clear :max-length="150" style="width: 100%" />
<a-input v-model="form.title" placeholder="请输入标题" allow-clear :max-length="150" show-word-limit style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
Expand Down
4 changes: 4 additions & 0 deletions src/views/system/notice/page/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const columns: Columns = reactive([
label: '标题',
field: 'title',
type: 'input',
props: {
maxLength: 150,
showWordLimit: true
},
rules: [{ required: true, message: '请输入标题' }]
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/views/system/user/UserAddDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
>
<a-form ref="formRef" :model="form" :rules="rules" size="large" auto-label-width>
<a-form-item label="用户名" field="username">
<a-input v-model.trim="form.username" placeholder="请输入用户名" :max-length="64" />
<a-input v-model.trim="form.username" placeholder="请输入用户名" :max-length="64" show-word-limit />
</a-form-item>
<a-form-item label="昵称" field="nickname">
<a-input v-model.trim="form.nickname" placeholder="请输入昵称" :max-length="30" />
<a-input v-model.trim="form.nickname" placeholder="请输入昵称" :max-length="30" show-word-limit />
</a-form-item>
<a-form-item v-if="!isUpdate" label="密码" field="password">
<a-input-password v-model.trim="form.password" placeholder="请输入密码" :max-length="32" />
<a-input-password v-model.trim="form.password" placeholder="请输入密码" :max-length="32" show-word-limit />
</a-form-item>
<a-form-item label="手机号码" field="phone">
<a-input v-model.trim="form.phone" placeholder="请输入手机号码" :max-length="11" />
Expand Down

0 comments on commit bb246f4

Please sign in to comment.