Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-outbound
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 d3a43214
authored
Jan 03, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交接龙
1 parent
204aee9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
374 additions
and
58 deletions
src/components/glsx-combi-form/index.vue
src/views/solitaire/add.vue
src/views/solitaire/addJS/add.js
src/views/solitaire/index.vue
src/components/glsx-combi-form/index.vue
View file @
d3a4321
This diff is collapsed.
Click to expand it.
src/views/solitaire/add.vue
View file @
d3a4321
<
template
>
<div
class=
"box"
>
<div
class=
"title"
>
{{
title
}}
</div>
<glsx-combi-form
ref=
"formRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"configForm"
:formData=
"formData"
:formRules=
"rule"
>
</glsx-combi-form>
<div
class=
"content"
>
<div
class=
"title"
>
{{
title
}}
</div>
<el-scrollbar
class=
"form-box"
>
<glsx-combi-form
class=
"from"
ref=
"formRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"configForm"
:formData=
"formData"
:formRules=
"rule"
>
<div
slot=
"posterImg"
class=
"edit-tips"
>
图片大小10M
</div>
<template
#
endTimeType
>
<div
v-if=
"configForm.endTimeType == 1"
class=
"item-box"
>
<el-date-picker
v-model=
"configForm.endTime"
type=
"datetime"
placeholder=
"选择日期时间"
:picker-options=
"afterRangePickerOptions"
value-format=
"yyyy-MM-dd HH:mm:ss"
class=
"end-time"
>
</el-date-picker>
</div>
</
template
>
<
template
#
showTime
>
<el-date-picker
v-model=
"configForm.winningTime"
type=
"datetime"
placeholder=
"选择日期时间"
:picker-options=
"afterRangePickerOptions"
value-format=
"yyyy-MM-dd HH:mm:ss"
class=
"end-time"
>
</el-date-picker>
</
template
>
<
template
#
groupType
>
<div
v-if=
"configForm.groupType == 1"
class=
"item-box"
>
<div
class=
"label"
>
群聊列表:
</div>
<el-select
v-model=
"configForm.groupList"
multiple
placeholder=
"请选择"
filterable
multiple-limit=
"5"
class=
"options"
collapse-tags
>
<el-option
v-for=
"item in groupList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</div>
</
template
>
</glsx-combi-form>
</el-scrollbar>
</div>
<GLFooter>
<el-button
@
click=
"$router.go(-1)"
size=
"medium"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirm"
size=
"medium"
>
确定
</el-button>
</GLFooter>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
formData
,
rule
,
afterRangePickerOptions
}
from
'./addJS/add.js'
export
default
{
name
:
''
,
data
()
{
return
{
afterRangePickerOptions
,
title
:
this
.
$route
.
query
.
$title
,
configForm
:
{
filtration
:
1
,
activityDetail
:
''
},
rule
:
{
name
:
[{
required
:
true
,
message
:
'请输入问卷名称'
,
trigger
:
'change'
}],
merchantId
:
[{
required
:
true
,
message
:
'请选择所属渠道'
,
trigger
:
'change'
}],
cardTitle
:
[{
required
:
true
,
message
:
'请输入卡片标题'
,
trigger
:
'change'
}],
cardCover
:
[{
required
:
true
,
message
:
'请上传卡片封面'
,
trigger
:
'change'
}],
activityDetail
:
''
,
merchantId
:
''
,
posterImg
:
''
,
maxNumber
:
9
,
winningNumber
:
0
,
endTimeType
:
0
,
endTime
:
''
,
winningTime
:
''
,
groupType
:
0
,
groupList
:
[]
},
formData
:
[
{
label
:
'群接龙种类'
,
type
:
'radio'
,
name
:
'filtration'
,
optionList
:
[
{
text
:
'猜数字'
,
id
:
1
},
],
optionId
:
'id'
,
optionLabel
:
'text'
,
},
{
label
:
'群接龙说明'
,
name
:
'activityDetail'
,
type
:
'textBox'
,
excludeMenus
:
[
'video'
,
'code'
],
boxHeight
:
240
},
{
label
:
'群接龙种类'
,
type
:
'radio'
,
name
:
'filtration'
,
optionList
:
[
{
text
:
'猜数字'
,
id
:
1
},
],
optionId
:
'id'
,
optionLabel
:
'text'
,
},
],
rule
,
formData
,
groupList
:
[],
}
},
watch
:
{
'configForm.maxNumber'
(
n
)
{
this
.
configForm
.
winningNumber
=
0
this
.
formData
.
find
(
e
=>
e
.
name
==
'winningNumber'
).
optionList
.
map
(
i
=>
{
i
.
isDisabled
=
i
.
optionId
>
n
})
},
'configForm.groupType'
(
n
)
{
if
(
n
==
1
&&
!
this
.
configForm
.
merchantId
)
{
this
.
configForm
.
groupType
=
0
this
.
showError
()
}
}
},
mounted
()
{
console
.
log
()
},
methods
:
{
handleConfirm
()
{
},
showError
(
message
)
{
this
.
$message
.
error
(
message
||
'请先选择所属渠道!'
)
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.box
{
background-color
:
#fff
;
.box
{
position
:
absolute
;
width
:
100%
;
height
:
calc
(
100vh
-
48px
);
top
:
0
;
left
:
0
;
.content
{
height
:
calc
(
100%
-
88px
);
background-color
:
#fff
;
border-radius
:
0
4px
4px
4px
;
margin
:
16px
;
.form-box
{
width
:
100%
;
height
:
calc
(
100%
-
59px
);
box-sizing
:
border-box
;
.from
{
margin-top
:
30px
;
/deep/.activity-img
{
width
:
104px
;
height
:
104px
;
}
/
deep
/
.muti-imgs
{
.img-w-h,
.img-btns
{
width
:
106px
;
height
:
106px
;
}
}
}
/
deep
/
.el-scrollbar__wrap
{
&::-webkit-scrollbar
{
width
:
0
;
height
:
0
;
color
:
transparent
;
}
}
}
}
.title
{
font-weight
:
500
;
font-size
:
16px
;
color
:
#333333
;
line-height
:
28px
;
padding
:
15px
20px
;
border-bottom
:
1px
solid
#e5e5e5
;
background-color
:
#fff
;
}
.edit-tips
{
font-size
:
14px
;
color
:
#999999
;
}
.item-box
{
width
:
480px
;
height
:
52px
;
background
:
#f9f9f9
;
display
:
flex
;
align-items
:
center
;
padding-left
:
20px
;
box-sizing
:
border-box
;
.end-time,
.options
{
width
:
284px
;
/deep/.el-input
{
width
:
100%
!important
;
}
/
deep
/
.el-tag--info
{
max-width
:
50%
;
}
}
}
}
</
style
>
\ No newline at end of file
src/views/solitaire/addJS/add.js
0 → 100644
View file @
d3a4321
const
generateOptionsArray
=
function
(
count
=
9
)
{
return
Array
.
from
({
length
:
count
},
(
_
,
index
)
=>
({
optionId
:
Number
(
index
+
1
),
optionLabel
:
Number
(
index
+
1
)
}))
}
export
const
formData
=
[
{
label
:
'群接龙种类'
,
type
:
'radio'
,
name
:
'filtration'
,
optionList
:
[
{
text
:
'猜数字'
,
id
:
1
},
],
optionId
:
'id'
,
optionLabel
:
'text'
,
},
{
label
:
'群接龙说明'
,
name
:
'activityDetail'
,
type
:
'textBox'
,
excludeMenus
:
[
'video'
,
'code'
,
'table'
],
boxHeight
:
240
},
{
label
:
'所属渠道'
,
name
:
'merchantId'
,
type
:
'select'
,
width
:
'432px'
,
// multiple: true,
// attrs: {
// multipleLimit: 10
// },
noFilter
:
false
,
optionList
:
[],
optionId
:
'confId'
,
optionLabel
:
'confName'
},
{
label
:
'卡片标题'
,
name
:
'name'
,
type
:
'input'
,
maxlength
:
100
},
{
label
:
'海报图片'
,
name
:
'posterImg'
,
type
:
'upload'
,
width
:
'320px'
,
limitSize
:
10
,
maxPhotoNum
:
1
,
suffixSlot
:
'posterImg'
,
beforeLoading
:
true
,
handleUpload
:
async
(
e
,
file
,
targetItem
,
config
,
_this
)
=>
{
try
{
const
{
result
:
imgFile
}
=
e
.
target
,
arrBase64
=
imgFile
.
split
(
','
)[
1
],
str
=
file
.
name
.
split
(
'.'
),
base64
=
str
.
at
(
-
1
)
+
'@'
+
arrBase64
,
res
=
await
_this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
,
fileType
:
'image'
})
_this
.
$loading
().
close
()
if
(
res
)
{
config
[
targetItem
.
name
]
=
res
_this
.
formRef
().
validateField
(
targetItem
.
name
)
}
else
throw
'上传失败'
}
catch
(
error
)
{
_this
.
$loading
().
close
()
_this
.
$message
(
error
)
}
}
},
{
label
:
'数字上限'
,
name
:
'maxNumber'
,
type
:
'select'
,
optionList
:
generateOptionsArray
(),
optionId
:
'optionId'
,
optionLabel
:
'optionLabel'
,
},
{
label
:
'中奖数字'
,
name
:
'winningNumber'
,
type
:
'select'
,
optionList
:
[
{
optionId
:
0
,
optionLabel
:
'随机'
},
...
generateOptionsArray
()
],
optionId
:
'optionId'
,
optionLabel
:
'optionLabel'
,
},
{
label
:
'接龙结束时间'
,
type
:
'radio'
,
name
:
'endTimeType'
,
optionList
:
[
{
text
:
'无限制'
,
id
:
0
},
{
text
:
'选择时间'
,
id
:
1
},
],
optionId
:
'id'
,
optionLabel
:
'text'
,
suffixSlot
:
'endTimeType'
,
},
{
label
:
'接龙开奖时间'
,
addHtml
:
'showTime'
},
{
label
:
'转发群限制'
,
type
:
'radio'
,
name
:
'groupType'
,
optionList
:
[
{
text
:
'无限制'
,
id
:
0
},
{
text
:
'限制群'
,
id
:
1
},
],
optionId
:
'id'
,
optionLabel
:
'text'
,
suffixSlot
:
'groupType'
,
},
]
export
const
rule
=
{
name
:
[{
required
:
true
,
message
:
'请输入问卷名称'
,
trigger
:
'change'
}],
merchantId
:
[{
required
:
true
,
message
:
'请选择所属渠道'
,
trigger
:
'change'
}],
cardTitle
:
[{
required
:
true
,
message
:
'请输入卡片标题'
,
trigger
:
'change'
}],
cardCover
:
[{
required
:
true
,
message
:
'请上传卡片封面'
,
trigger
:
'change'
}],
}
export
const
afterRangePickerOptions
=
{
disabledDate
(
time
)
{
let
oneDay
=
60
*
60
*
24
*
1000
;
return
time
.
getTime
()
<
Date
.
now
()
-
oneDay
},
}
// computed: {
// afterRangePickerOptions () {
// //这里判断是不是今天
// let newVal = new Date(this.configForm.endTime)
// let selectableRange = '00:00:00 - 23:59:59' //默认的时间范围
// if (
// newVal &&
// newVal.getFullYear() == new Date().getFullYear() &&
// newVal.getMonth() == new Date().getMonth() &&
// newVal.getDate() == new Date().getDate()
// ) {
// //如果为今天,则限制当前时间前的时间+1分钟不能选择。
// selectableRange = new Date().getHours() + ':' + (new Date().getMinutes() + 1) + ':00 - 23:59:59'
// }
// return {
// selectableRange,
// disabledDate (time) {
// // 只能选大于当前截止时间的
// return time.getTime() < Date.now() - 8.64e7
// }
// }
// }
// }
\ No newline at end of file
src/views/solitaire/index.vue
View file @
d3a4321
...
...
@@ -145,8 +145,8 @@ export default {
}
,
noFilter
:
false
,
optionList
:
[],
optionId
:
'
confId
'
,
optionLabel
:
'
confName
'
optionId
:
'
value
'
,
optionLabel
:
'
label
'
}
,
{
label
:
'创建时间'
,
...
...
@@ -155,7 +155,7 @@ export default {
isClear
:
true
,
valueFormat
:
'yyyy-MM-dd'
,
customPickerOptions
:
{
disabledDate
(
date
)
{
disabledDate
(
date
)
{
const
yesterday
=
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()))
return
date
>
yesterday
}
...
...
@@ -341,6 +341,9 @@ export default {
.
sticky
{
position
:
relative
;
z
-
index
:
2
;
/deep/
.
el
-
tag
--
info
{
max
-
width
:
50
%
;
}
&-
btns
{
position
:
absolute
;
right
:
0
;
...
...
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