From 31d9859f10c0b5b36ea319568b459cd7f50d48fc Mon Sep 17 00:00:00 2001 From: Chopper Date: Tue, 19 Oct 2021 14:20:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C=E5=87=A0?= =?UTF-8?q?=E4=B8=AA=E7=BB=86=E8=8A=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/utils/regular.js | 10 ++++++--- manager/src/views/customWords/index.vue | 11 +++++----- .../views/page/article-manage/hotWords.vue | 21 +++++++++++++++---- manager/src/views/seller/bill/bill-detail.vue | 12 +++++------ .../sys/message/noticeMessageTemplate.vue | 9 +++++--- seller/src/views/shop/bill/billDetail.vue | 2 +- 6 files changed, 42 insertions(+), 23 deletions(-) diff --git a/manager/src/utils/regular.js b/manager/src/utils/regular.js index 1ef4ce13..2668a233 100644 --- a/manager/src/utils/regular.js +++ b/manager/src/utils/regular.js @@ -62,10 +62,14 @@ export const TEL = /0\d{2,3}-\d{7,8}/ // 正整数 export const INTEGER = { - pattern: /^[0-9]\d{0,10}|0$/, - message:'请输入正整数' + pattern: /^[0-9]\d{0,10}|0$/, + message:'请输入正整数' + } +// 正整数 +export const NUMBER = { + pattern: /^(\-|\+)?\d{0,10}$/, + message:'请输入数字' } - export const VARCHAR5 = { pattern:/^.{1,5}$/, message:'长度应该限制在1-5个字符' diff --git a/manager/src/views/customWords/index.vue b/manager/src/views/customWords/index.vue index 5856769a..d65a580a 100644 --- a/manager/src/views/customWords/index.vue +++ b/manager/src/views/customWords/index.vue @@ -35,7 +35,7 @@ :width="500" >
- + @@ -56,6 +56,8 @@ import { insertCustomWords, updateCustomWords } from "@/api/index"; + +import { regular } from "@/utils"; export default { name: "customWords", data() { @@ -79,11 +81,8 @@ export default { // 表单验证规则 formValidate: { name: [ - { - required: true, - message: "请输入自定义分词", - trigger: "blur", - }, + regular.REQUIRED, + regular.VARCHAR20 ], }, submitLoading: false, // 添加或编辑提交状态 diff --git a/manager/src/views/page/article-manage/hotWords.vue b/manager/src/views/page/article-manage/hotWords.vue index bc04dc3b..eb991489 100644 --- a/manager/src/views/page/article-manage/hotWords.vue +++ b/manager/src/views/page/article-manage/hotWords.vue @@ -20,11 +20,12 @@ -
- + + - + @@ -39,6 +40,7 @@