From 20042786aad149804a1db4f3d92e81f706bcb6af Mon Sep 17 00:00:00 2001 From: Chopper Date: Wed, 22 Sep 2021 15:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E6=A8=A1=E5=9D=97=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=A7=E7=BB=AD=E5=AE=8C=E5=96=84=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=A0=A1=E9=AA=8C=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 3 +++ buyer/src/config/index.js | 16 ++++++++-------- manager/src/config/index.js | 16 ++++++++-------- manager/src/utils/regular.js | 14 ++++++++++++-- manager/src/views/goods-unit/index.vue | 12 ++++++------ manager/src/views/goods/goods-manage/spec.vue | 16 +++++++++++++++- 6 files changed, 52 insertions(+), 25 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 28a804d8..1c24890b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,4 +3,7 @@ + + \ No newline at end of file diff --git a/buyer/src/config/index.js b/buyer/src/config/index.js index 23784c11..2f4ad8ff 100644 --- a/buyer/src/config/index.js +++ b/buyer/src/config/index.js @@ -17,15 +17,15 @@ export default { * @description api请求基础路径 */ api_dev: { - // common: 'http://192.168.0.101:8890', - // buyer: 'http://192.168.0.101:8888', - // seller: 'http://192.168.0.101:8889', - // manager: 'http://192.168.0.101:8887' + common: 'http://192.168.0.100:8890', + buyer: 'http://192.168.0.100:8888', + seller: 'http://192.168.0.100:8889', + manager: 'http://192.168.0.100:8887' - common: 'https://common-api.pickmall.cn', - buyer: 'https://buyer-api.pickmall.cn', - seller: 'https://store-api.pickmall.cn', - manager: 'https://admin-api.pickmall.cn' + // common: 'https://common-api.pickmall.cn', + // buyer: 'https://buyer-api.pickmall.cn', + // seller: 'https://store-api.pickmall.cn', + // manager: 'https://admin-api.pickmall.cn' }, api_prod: { common: 'https://common-api.pickmall.cn', diff --git a/manager/src/config/index.js b/manager/src/config/index.js index a27badcf..1a28698c 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -17,14 +17,14 @@ export default { * @description api请求基础路径 */ api_dev: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" - // common: 'http://192.168.0.100:8890', - // buyer: 'http://192.168.0.100:8888', - // seller: 'http://192.168.0.100:8889', - // manager: 'http://192.168.0.100:8887' + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + // seller: "https://store-api.pickmall.cn", + // manager: "https://admin-api.pickmall.cn" + common: 'http://192.168.0.100:8890', + buyer: 'http://192.168.0.100:8888', + seller: 'http://192.168.0.100:8889', + manager: 'http://192.168.0.100:8887' }, api_prod: { common: "https://common-api.pickmall.cn", diff --git a/manager/src/utils/regular.js b/manager/src/utils/regular.js index 910dc40f..f55b197e 100644 --- a/manager/src/utils/regular.js +++ b/manager/src/utils/regular.js @@ -65,9 +65,19 @@ export const INTEGER = { message:'请输入正整数' } +export const VARCHAR5 = { + pattern:/^.{1,5}$/, + message:'长度应该限制在1-5个字符' +} + export const VARCHAR20 = { - pattern:/^.{3,20}$/, - message:'长度应该限制在3-20个字符' + pattern:/^.{1,20}$/, + message:'长度应该限制在1-20个字符' +} + +export const VARCHAR255 = { + pattern:/^.{1,255}$/, + message:'超出最大长度限制' } export const URL200 = { diff --git a/manager/src/views/goods-unit/index.vue b/manager/src/views/goods-unit/index.vue index e3e5e561..57f1131d 100644 --- a/manager/src/views/goods-unit/index.vue +++ b/manager/src/views/goods-unit/index.vue @@ -57,6 +57,9 @@ import { updateGoodsUnit, delGoodsUnit } from "@/api/index"; + +import {regular} from "@/utils"; + export default { name: "goods-unit", data() { @@ -79,12 +82,9 @@ export default { // 表单验证规则 formValidate: { name: [ - { - required: true, - message: "请输入计量单位", - trigger: "blur", - }, - ], + regular.REQUIRED, + regular.VARCHAR5 + ] }, submitLoading: false, // 添加或编辑提交状态 selectList: [], // 多选数据 diff --git a/manager/src/views/goods/goods-manage/spec.vue b/manager/src/views/goods/goods-manage/spec.vue index 913e5632..d6a5d76b 100644 --- a/manager/src/views/goods/goods-manage/spec.vue +++ b/manager/src/views/goods/goods-manage/spec.vue @@ -56,7 +56,8 @@ :mask-closable="false" :width="500" > -
+ @@ -92,6 +93,7 @@ import { delSpec } from "@/api/goods"; +import {regular} from "@/utils"; export default { name: "spec", components: {}, @@ -108,6 +110,17 @@ export default { sort: "createTime", // 默认排序字段 order: "asc", // 默认排序方式 }, + // 表单验证规则 + formValidate: { + specName: [ + regular.REQUIRED, + regular.VARCHAR20 + ], + specValue: [ + regular.REQUIRED, + regular.VARCHAR255 + ], + }, form: { // 添加或编辑表单对象初始化数据 specName: "", @@ -280,6 +293,7 @@ export default { this.modalType = 0; this.modalTitle = "添加"; this.$refs.form.resetFields(); + this.specValue = ''; delete this.form.id; this.modalVisible = true; },