Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-discover
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a0b3ab93
authored
Jul 12, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
字段限制字数
1 parent
6dfbfaf2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
7 deletions
src/components/FormatInput/index.vue
src/components/index.js
src/views/case/add.vue
src/views/category/add.vue
src/views/category/components/pullDownNav.vue
src/views/channel/add.vue
src/views/goods/add.vue
src/components/FormatInput/index.vue
0 → 100644
View file @
a0b3ab9
<
template
>
<el-input
:value=
"value"
v-bind=
"$attrs"
v-on=
"
{...$listeners}" @blur="blurFn">
</el-input>
</
template
>
<
script
>
export
default
{
name
:
'FormatInput'
,
props
:
[
'value'
,
'precise'
,
'intDigit'
,
'maxVal'
,
'minVal'
],
data
()
{
return
{
}
},
watch
:{
value
:{
handler
(
nVal
,
oVal
){
this
.
inputFn
(
nVal
)
},
deep
:
true
}
},
mounted
(){
},
methods
:{
inputFn
(
e
){
e
=
e
?
String
(
e
)
:
''
this
.
intDigit
=
this
.
intDigit
||
6
this
.
precise
=
this
.
precise
||
2
let
value
=
e
if
(
this
.
maxVal
){
if
(
+
this
.
maxVal
<=
+
e
)
value
=
this
.
maxVal
//加等号是因为 '500' == '500.' 导致多了点
}
else
{
const
intDigitReg
=
this
.
intDigit
==
-
1
?
`(^\\d+)(\\.\\d+)?`
:
`(^\\d{
${
this
.
intDigit
}
})\\d+(\\.\\d+)?`
value
=
e
.
replace
(
/^0
\d
/g
,
'0'
).
replace
(
/
[^\d
.
]
/g
,
''
).
replace
(
/^
\.
/g
,
''
).
replace
(
new
RegExp
(
intDigitReg
,
'g'
),
'$1'
).
replace
(
'.'
,
'$#$'
)
.
replace
(
/
\.
/g
,
''
).
replace
(
'$#$'
,
'.'
).
replace
(
new
RegExp
(
`^(-)*(\\d+)\\.(\\d{
${
this
.
precise
}
}).*$`
),
this
.
intDigit
==
-
1
?
'$1$2'
:
'$1$2.$3'
)
}
this
.
$emit
(
'input'
,
value
)
},
blurFn
(
e
){
let
value
=
e
.
target
.
value
if
(
this
.
minVal
&&
+
this
.
minVal
>=
value
)
value
=
this
.
minVal
this
.
$emit
(
'input'
,
value
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
\ No newline at end of file
src/components/index.js
View file @
a0b3ab9
...
...
@@ -13,9 +13,11 @@ import glsxPreview from '@/components/preview/index.vue'
import
glsxCombiForm
from
'@/components/glsx-combi-form/index.vue'
import
bigView
from
'@/components/big-view/index.vue'
import
activityModel
from
'@/components/activity-model/index.vue'
import
FormatInput
from
'@/components/FormatInput/index.vue'
Vue
.
component
(
'glsx-combi-form'
,
glsxCombiForm
)
Vue
.
component
(
'glsx-dialog'
,
glsxDialog
)
Vue
.
component
(
'glsx-preview'
,
glsxPreview
)
Vue
.
component
(
'big-view'
,
bigView
)
Vue
.
component
(
'activity-model'
,
activityModel
)
\ No newline at end of file
Vue
.
component
(
'activity-model'
,
activityModel
)
Vue
.
component
(
'format-input'
,
FormatInput
)
\ No newline at end of file
src/views/case/add.vue
View file @
a0b3ab9
...
...
@@ -80,6 +80,8 @@ export default {
{
label
:
'案例名称'
,
name
:
'caseName'
,
maxlength
:
20
,
showLimit
:
true
,
type
:
'input'
,
isDisabled
:
false
},
...
...
src/views/category/add.vue
View file @
a0b3ab9
...
...
@@ -8,7 +8,7 @@
</div>
<div
slot=
"secondCategorySlot"
class=
"category-slot"
>
<div
class=
"category-item"
v-for=
"(item,index) in categoryList"
:key=
"index"
>
<el-input
placeholder=
"请输入"
maxLength=
"15"
v-model=
"item.name"
class=
"input"
></el-input>
<el-input
placeholder=
"请输入"
v-model=
"item.name"
class=
"input"
maxlength=
"20"
show-word-limit
></el-input>
<i
v-if=
"categoryList.length>1"
class=
"el-icon-delete del-icon"
@
click=
"delSecondCategory(index)"
></i>
</div>
<div
v-if=
"!routeInfo.id"
class=
"add-btn"
@
click=
"addCategory()"
>
...
...
src/views/category/components/pullDownNav.vue
View file @
a0b3ab9
...
...
@@ -6,7 +6,7 @@
<i
class=
"el-icon-close del-icon"
@
click
.
stop=
"delNav(item)"
></i>
</div>
</div>
<div
v-if=
"showInput"
class=
"input-area"
><el-input
maxLength=
"15"
ref=
"addInput"
@
blur=
"inputBlur"
v-model=
"addValue"
class=
"input"
></el-input></div>
<div
v-if=
"showInput"
class=
"input-area"
><el-input
maxlength=
"20"
show-word-limit
ref=
"addInput"
@
blur=
"inputBlur"
v-model=
"addValue"
class=
"input"
></el-input></div>
<div
v-else
class=
"nav-item add-icon"
style=
"cursor: pointer;"
@
click=
"addNav"
><i
class=
"el-icon-plus border"
></i></div>
<div
v-if=
"colList && colList.length"
class=
"nav-item pull-btn"
style=
"cursor: pointer;"
>
<i
class=
"el-icon-arrow-down border"
></i>
...
...
@@ -21,7 +21,7 @@
<div
class=
"menu-dialog-body"
>
<el-form
ref=
"menuRef"
label-width=
"154px"
:rules=
"navRules"
:model=
"navForm"
>
<el-form-item
label=
"名称:"
prop=
"name"
class=
"m-t-20"
>
<el-input
style=
"width: 284px;"
:size=
"size"
type=
"text"
v-model=
"navForm.name"
placeholder=
"请输入"
></el-input>
<el-input
maxlength=
"20"
show-word-limit
style=
"width: 284px;"
:size=
"size"
type=
"text"
v-model=
"navForm.name"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form>
</div>
...
...
src/views/channel/add.vue
View file @
a0b3ab9
...
...
@@ -5,10 +5,10 @@
<div
class=
"channel-content gl-form-page"
>
<el-form
ref=
"ruleForm1"
:model=
"channelForm"
label-width=
"154px"
size=
"small"
:rules=
"rules"
>
<el-form-item
label=
"频道名称:"
prop=
"channelName"
>
<el-input
v-model=
"channelForm.channelName"
></el-input>
<el-input
v-model=
"channelForm.channelName"
maxlength=
"20"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"频道子名称:"
prop=
"channelChildName"
>
<el-input
v-model=
"channelForm.channelChildName"
></el-input>
<el-input
v-model=
"channelForm.channelChildName"
maxlength=
"20"
show-word-limit
></el-input>
</el-form-item>
<span
v-if=
"channelForm.channelType == 1"
>
<el-form-item
label=
"频道主题:"
prop=
"channelStyle"
>
...
...
src/views/goods/add.vue
View file @
a0b3ab9
...
...
@@ -20,6 +20,7 @@
<div
class=
"money-wrap"
v-if=
"formObj.paymentType == 2"
>
<label
class=
"label"
for=
""
>
定金金额/元:
</label>
<el-input
:disabled=
"disabled"
v-model=
"formObj.depositPrice"
></el-input>
<format-input
:disabled=
"disabled"
:intDigit=
"4"
:precise=
"2"
v-model=
"formObj.depositPrice"
></format-input>
</div>
</div>
<div
slot=
"saleStoreSlot"
>
...
...
@@ -27,7 +28,7 @@
<template
v-if=
"merchantRequestList && merchantRequestList.length"
>
<GLTable
class=
"selected-table"
:hasPage=
"false"
ref=
"selectedRef"
:tableParams=
"selectedtableParams"
:tableData=
"merchantRequestList"
>
<div
slot=
"activityPriceSlot"
slot-scope=
"scope"
>
<
el-input
:disabled=
"disabled"
placeholder=
"请输入"
v-model=
"scope.scope.activityPrice"
/
>
<
format-input
:disabled=
"disabled"
:intDigit=
"6"
:precise=
"2"
placeholder=
"请输入"
v-model=
"scope.scope.activityPrice"
></format-input
>
</div>
<div
slot=
"retainagePriceSlot"
slot-scope=
"scope"
>
{{
retainagePriceFn
(
scope
.
scope
.
activityPrice
)
}}
...
...
@@ -105,6 +106,8 @@ export default {
{
label
:
'商品名称'
,
name
:
'goodsName'
,
maxlength
:
20
,
showLimit
:
true
,
type
:
'input'
,
isDisabled
:
false
},
...
...
@@ -283,6 +286,7 @@ export default {
methods
:{
retainagePriceFn
(
price
){
let
depositPrice
=
this
.
formObj
.
paymentType
==
1
?
0
:
this
.
formObj
.
depositPrice
if
(
this
.
formObj
.
paymentType
==
1
)
return
'--'
if
(
!
price
){
return
'待计算'
}
else
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment