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 fd96ceca
authored
Oct 19, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
问卷需求
1 parent
a01ed0b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
336 additions
and
31 deletions
src/views/questionnaire/add.vue
src/views/questionnaire/components/DataTable/index.vue
src/views/questionnaire/components/StepOne/index.vue
src/views/questionnaire/components/StepTwo/EditQuestions.vue
src/views/questionnaire/components/StepTwo/index.vue
src/views/questionnaire/index.vue
src/views/questionnaire/add.vue
View file @
fd96cec
...
...
@@ -77,7 +77,9 @@ export default {
if
(
valid
)
this
.
step
=
2
})
}
else
{
console
.
log
(
stepOne
.
configForm
,
stepTwo
.
configForm
)
stepTwo
.
formRef
().
validate
(
valid
=>
{
if
(
valid
)
console
.
log
(
stepOne
.
configForm
,
stepTwo
.
configForm
)
})
}
}
...
...
src/views/questionnaire/components/DataTable/index.vue
0 → 100644
View file @
fd96cec
<
template
>
<GLDialog
mode=
"big"
bigTitle=
"数据"
:hasFooter=
"false"
:before-close=
"handleClose"
:visible
.
sync=
"dataObj.show"
>
<GLTable
:tableData=
"tableData"
:noDataImg=
"url"
:tableParams=
"tableParams"
:tableTotal=
"tableTotal"
:pageConf=
"pageConf"
>
</GLTable>
</GLDialog>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
url
from
'@/assets/empty.png'
export
default
{
name
:
''
,
props
:
{
dataObj
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
data
()
{
return
{
url
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'count'
},
tableParams
:
{
listName
:
'data'
,
tableOption
:
false
,
tableColumns
:
[
{
label
:
'导入时间'
,
prop
:
'exportTime'
,
minWidth
:
180
},
{
label
:
'状态'
,
prop
:
'statusStr'
,
minWidth
:
100
,
},
{
label
:
'微信昵称'
,
prop
:
'wechatName'
,
minWidth
:
100
},
]
},
tableData
:
[],
tableTotal
:
0
}
},
mounted
()
{
},
watch
:
{
'dataObj'
(
n
)
{
if
(
n
.
id
)
this
.
refreshTable
()
}
},
methods
:
{
async
refreshTable
(
pageCon
)
{
pageCon
&&
(
this
.
pageConfig
=
pageCon
)
const
params
=
{
redEnvelopeId
:
this
.
dataObj
.
id
,
pageSize
:
10
,
pageNum
:
1
,
...
this
.
pageConfig
}
const
{
data
,
count
}
=
await
this
.
$apis
.
redenvelope
.
getActivityRedEnvelopeLinkDetailPage
(
params
)
this
.
tableData
=
data
||
[]
this
.
tableTotal
=
count
||
0
},
handleClose
()
{
this
.
$emit
(
'update:dataObj'
,
{})
},
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.link
{
/deep/.el-form-item--small
{
width
:
fit-content
;
}
}
</
style
>
\ No newline at end of file
src/views/questionnaire/components/StepOne/index.vue
View file @
fd96cec
...
...
@@ -286,6 +286,20 @@ export default {
height
:
100%
;
}
}
/
deep
/
.activity-img
{
margin-bottom
:
30px
;
&::before
{
content
:
'图片大小10M以内'
;
display
:
block
;
font-size
:
14px
;
color
:
#999999
;
position
:
absolute
;
left
:
0
;
line-height
:
20px
;
bottom
:
-30px
;
width
:
200px
;
}
}
.tabs
{
height
:
36px
;
background
:
#f8f8f8
;
...
...
src/views/questionnaire/components/StepTwo/EditQuestions.vue
0 → 100644
View file @
fd96cec
This diff is collapsed.
Click to expand it.
src/views/questionnaire/components/StepTwo/index.vue
View file @
fd96cec
<
template
>
<el-scrollbar
class=
"step-box"
>
<div
class=
"step-content"
>
1
<el-form
ref=
"formRef"
label-width=
"154px"
:rules=
"rule"
:model=
"configForm"
>
<el-form-item
label=
"问卷标题:"
prop=
"activityName"
class=
"m-t-20"
>
<el-input
style=
"width:432px"
size=
"small"
v-model=
"configForm.activityName"
placeholder=
"请输入"
maxlength=
"8"
></el-input>
</el-form-item>
<el-form-item
label=
"问卷说明:"
prop=
"activityTime"
class=
"m-t-20"
>
<el-input
style=
"width:580px"
type=
"textarea"
rows=
"3"
v-model=
"configForm.activityTime"
placeholder=
"请输入"
maxlength=
"50"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label=
"题目配置:"
prop=
"activityImg"
class=
"m-t-20"
>
<div
class=
"config-box"
>
<template
v-for=
"(i,index) in configForm.activityImg"
>
<template>
<div
:key=
"index"
class=
"item"
>
<div
:class=
"['label',
{'required':i.required}]">
{{
i
.
title
}}
:
</div>
<template
v-if=
"i.type == 1"
>
<el-radio-group
v-model=
"i.itemValue"
class=
"radio"
>
<template
v-for=
"(item,ind) in i.data"
>
<template>
<el-radio
:key=
"ind"
:label=
"item"
>
{{
item
}}
</el-radio>
</
template
>
</template>
</el-radio-group>
</template>
<
template
v-if=
"i.type == 2"
>
<el-checkbox-group
v-model=
"i.itemValue"
>
<template
v-for=
"(item,ind) in i.data"
>
<template>
<el-checkbox
:label=
"item"
:key=
"ind"
></el-checkbox>
</
template
>
</template>
</el-checkbox-group>
</template>
<
template
v-if=
"i.type == 3"
>
<el-input
style=
"width:580px"
v-model=
"i.itemValue"
placeholder=
"请输入"
type=
"textarea"
:autosize=
"
{ minRows: 3,maxRows:3}"
:maxlength="i.data"
show-word-limit
>
</el-input>
</
template
>
<
template
v-if=
"i.type == 4"
>
<el-select
v-model=
"i.itemValue"
placeholder=
"请选择"
style=
"width:432px;"
>
<el-option
v-for=
"(item,ind) in i.data"
:key=
"ind"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
</
template
>
<
template
v-if=
"i.type == 5"
>
<el-cascader
v-model=
"i.itemValue"
:options=
"i.data"
style=
"width:432px;"
></el-cascader>
</
template
>
</div>
</template>
</template>
<el-button
icon=
"el-icon-plus"
size=
"small"
@
click=
"showEditQuestions = true"
>
添加题目
</el-button>
</div>
</el-form-item>
</el-form>
</div>
<!--
<input
type=
"file"
@
change=
"handleFileUpload"
accept=
".xlsx"
/>
-->
<edit-questions
:show
.
sync=
"showEditQuestions"
@
addQuestions=
"addQuestions"
/>
</el-scrollbar>
</template>
<
script
type=
'text/ecmascript-6'
>
import
*
as
XLSX
from
'xlsx'
import
EditQuestions
from
'./EditQuestions.vue'
export
default
{
name
:
'StepTwo'
,
components
:
{
EditQuestions
},
data
()
{
return
{
configForm
:
{
activityName
:
''
,
activityTime
:
''
,
activityImg
:
[],
},
rule
:
{
activityName
:
[{
required
:
true
,
message
:
'请输入问卷标题'
,
trigger
:
'change'
}],
activityTime
:
[{
required
:
true
,
message
:
'请输入问卷说明'
,
trigger
:
'change'
}],
activityImg
:
[{
required
:
true
,
message
:
'请添加题目'
,
trigger
:
'change'
}],
},
showEditQuestions
:
true
}
},
mounted
()
{
},
methods
:
{
handleFileUpload
(
event
)
{
const
[
file
]
=
event
.
target
.
files
if
(
file
)
{
const
reader
=
new
FileReader
()
reader
.
onload
=
e
=>
{
try
{
const
data
=
e
.
target
.
result
if
(
data
)
{
const
workbook
=
XLSX
.
read
(
data
,
{
type
:
'array'
}),
[
firstSheetName
]
=
workbook
.
SheetNames
,
worksheet
=
workbook
.
Sheets
[
firstSheetName
]
this
.
parsedData
=
XLSX
.
utils
.
sheet_to_json
(
worksheet
,
{
header
:
1
})
console
.
table
(
this
.
parsedData
)
}
else
throw
'数据不能为空'
}
catch
(
error
)
{
this
.
$message
.
error
(
error
||
'读取文件时出错'
)
}
}
reader
.
readAsArrayBuffer
(
file
)
}
formRef
()
{
return
this
.
$refs
.
formRef
},
addQuestions
(
params
)
{
this
.
configForm
.
activityImg
.
push
(
params
)
}
}
}
</
script
>
...
...
@@ -59,9 +172,41 @@ export default {
height
:
0
;
color
:
transparent
;
}
.el-form-item__content
{
width
:
calc
(
100%
-
154px
);
}
}
.step-content
{
padding-top
:
32px
;
}
.config-box
{
width
:
100%
;
}
.item
{
width
:
870px
;
background
:
#f9f9f9
;
display
:
flex
;
margin-bottom
:
16px
;
padding
:
20px
;
.label
{
font-size
:
14px
;
color
:
#333333
;
width
:
154px
;
display
:
flex
;
justify-content
:
flex-end
;
}
.required
{
&::before
{
content
:
'*'
;
color
:
#eb4e4e
;
display
:
block
;
margin
:
2px
4px
0
0
;
}
}
.radio
{
line-height
:
22px
;
font-size
:
40px
;
}
}
}
</
style
>
\ No newline at end of file
src/views/questionnaire/index.vue
View file @
fd96cec
...
...
@@ -63,14 +63,32 @@
</span>
</GLTable>
</div>
<data-table
:dataObj
.
sync=
"dataObj"
/>
<GLDialog
title=
"结束"
@
onOk=
"handleDel"
@
onCancel=
"dialogVisible = false"
:visible
.
sync=
"dialogVisible"
mode=
"small"
>
<
template
#
default
>
<div
class=
"over-box"
>
<div
class=
"el-icon-warning"
></div>
请确认是否结束该调查问卷?
<div
class=
"tips"
>
结束后,客户点击将提示:问卷活动已结束
</div>
</div>
</
template
>
</GLDialog>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
import
url
from
'@/assets/empty.png'
import
*
as
dayjs
from
'dayjs
'
import
DataTable
from
'./components/DataTable/index.vue
'
export
default
{
name
:
'RedEnvelopeConfig'
,
components
:
{
DataTable
},
data
()
{
return
{
url
,
...
...
@@ -142,10 +160,12 @@ export default {
type
:
'text'
,
},
listeners
:
{
click
:
row
=>
this
.
showEditFu
n
(
row
)
click
:
row
=>
this
.
overQiestio
n
(
row
)
}
},
],
dataObj
:
{},
dialogVisible
:
false
}
},
mounted
()
{
...
...
@@ -158,6 +178,18 @@ export default {
this
.
searchForm
=
this
.
$options
.
data
.
call
(
this
).
searchForm
this
.
handleSearch
()
},
jumpDetail
(
row
)
{
this
.
dataObj
=
{
show
:
true
,
id
:
22
}
},
overQiestion
(
row
)
{
this
.
dialogVisible
=
true
},
handleDel
(){
this
.
dialogVisible
=
false
}
}
}
</
script
>
...
...
@@ -209,4 +241,22 @@ export default {
width
:
200px
;
height
:
200px
;
}
/
deep
/
.over-box
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
height
:
100%
;
font-size
:
16px
;
color
:
#333333
;
gap
:
8px
;
.el-icon-warning
{
font-size
:
48px
;
color
:
#e6a23c
;
}
.tips
{
font-size
:
14px
;
color
:
#666666
;
}
}
</
style
>
\ No newline at end of file
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