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 4000a051
authored
Nov 09, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
11月底需求
1 parent
66a16fcb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
101 deletions
src/api/modules/questionnaire.js
src/views/questionnaire/add.vue
src/views/questionnaire/components/StepOne/CouponItem.vue
src/views/questionnaire/components/StepOne/EquityItem.vue
src/views/questionnaire/components/StepOne/RedEnvelopeItem.vue
src/views/questionnaire/components/StepOne/index.vue
src/views/questionnaire/components/StepTwo/index.vue
src/views/questionnaire/index.vue
src/api/modules/questionnaire.js
View file @
4000a05
...
@@ -25,10 +25,10 @@ export default {
...
@@ -25,10 +25,10 @@ export default {
})
})
},
},
/**
/**
*
结束调查问卷
*
更新调查问卷状态
*/
*/
closeQuestionnaire
(
params
)
{
updateQuestionnaireStatus
(
params
)
{
params
.
method
=
'marketing.api.activityQuestionnaireForm.
clos
e'
params
.
method
=
'marketing.api.activityQuestionnaireForm.
status.updat
e'
return
http
({
return
http
({
url
,
url
,
data
:
params
data
:
params
...
...
src/views/questionnaire/add.vue
View file @
4000a05
...
@@ -75,6 +75,7 @@ export default {
...
@@ -75,6 +75,7 @@ export default {
mounted
()
{
mounted
()
{
const
{
id
,
type
}
=
this
.
$route
.
query
const
{
id
,
type
}
=
this
.
$route
.
query
if
(
id
)
{
if
(
id
)
{
this
.
loading
=
true
this
.
fromId
=
id
this
.
fromId
=
id
this
.
disabled
=
!
type
this
.
disabled
=
!
type
this
.
getQuestionnaireDetail
()
this
.
getQuestionnaireDetail
()
...
@@ -84,6 +85,7 @@ export default {
...
@@ -84,6 +85,7 @@ export default {
},
},
methods
:
{
methods
:
{
async
getQuestionnaireDetail
()
{
async
getQuestionnaireDetail
()
{
try
{
const
data
=
await
this
.
$apis
.
questionnaire
.
getQuestionnaireDetail
({
const
data
=
await
this
.
$apis
.
questionnaire
.
getQuestionnaireDetail
({
id
:
this
.
fromId
id
:
this
.
fromId
}),
{
}),
{
...
@@ -94,6 +96,10 @@ export default {
...
@@ -94,6 +96,10 @@ export default {
}
=
this
}
=
this
this
.
setStepOneData
(
stepOne
,
data
)
this
.
setStepOneData
(
stepOne
,
data
)
this
.
setStepTwoData
(
stepTwo
,
data
)
this
.
setStepTwoData
(
stepTwo
,
data
)
this
.
loading
=
false
}
catch
(
error
)
{
setTimeout
(()
=>
this
.
$router
.
go
(
-
1
),
1.5e3
)
}
},
},
async
getUserInfoFieldList
()
{
async
getUserInfoFieldList
()
{
if
(
this
.
disabled
)
return
if
(
this
.
disabled
)
return
...
@@ -121,7 +127,10 @@ export default {
...
@@ -121,7 +127,10 @@ export default {
3
:
3
3
:
3
}[
data
.
activityType
]
}[
data
.
activityType
]
}
}
if
(
!
this
.
disabled
||
data
.
activityId
)
stepOne
.
getActivityList
()
if
(
!
this
.
disabled
||
data
.
activityId
)
{
stepOne
.
activityObj
.
flag
=
false
stepOne
.
getActivityList
()
}
},
},
setStepTwoData
(
stepTwo
,
res
)
{
setStepTwoData
(
stepTwo
,
res
)
{
stepTwo
.
configForm
=
{
stepTwo
.
configForm
=
{
...
@@ -130,14 +139,18 @@ export default {
...
@@ -130,14 +139,18 @@ export default {
questions
:
res
.
questions
,
questions
:
res
.
questions
,
}
}
res
.
questions
.
map
(
e
=>
{
res
.
questions
.
map
(
e
=>
{
let
{
type
,
option
}
=
e
,
let
{
type
,
option
,
maxLength
}
=
e
,
data
=
type
==
3
?
option
:
option
.
split
(
'\n'
)
data
=
void
0
if
(
type
!=
3
)
{
if
(
type
!=
3
)
{
data
=
option
.
split
(
'\n'
)
if
(
type
==
5
)
{
if
(
type
==
5
)
{
const
[,
two
,
three
]
=
data
[
0
].
split
(
'/'
)
const
[,
two
,
three
]
=
data
[
0
].
split
(
'/'
)
data
.
splice
(
0
,
1
)
data
.
splice
(
0
,
1
)
data
=
transformData
(
data
,
three
?
3
:
two
?
2
:
1
)
data
=
transformData
(
data
,
three
?
3
:
two
?
2
:
1
)
}
}
}
else
{
data
=
maxLength
option
=
maxLength
}
}
stepTwo
.
questionsList
.
push
({
stepTwo
.
questionsList
.
push
({
type
,
type
,
...
...
src/views/questionnaire/components/StepOne/CouponItem.vue
View file @
4000a05
<
template
>
<
template
>
<div
<div
@
click=
"chooseRed(data.id)"
@
click=
"chooseRed(data.id)"
:class=
"['item',
{'disabled':
readonly
},{'active':configForm.activityId == data.id}]"
:class=
"['item',
{'disabled':
disabled
},{'active':configForm.activityId == data.id}]"
>
>
<div
class=
"icon"
>
<div
class=
"icon"
>
<img
src=
"@/assets/red-radio.png"
/>
<img
src=
"@/assets/red-radio.png"
/>
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
}
},
},
readonly
:
Boolean
disabled
:
Boolean
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -51,8 +51,8 @@ export default {
...
@@ -51,8 +51,8 @@ export default {
methods
:
{
methods
:
{
chooseRed
(
id
)
{
chooseRed
(
id
)
{
const
{
activityId
}
=
this
.
configForm
,
const
{
activityId
}
=
this
.
configForm
,
{
readonly
}
=
this
{
disabled
}
=
this
if
(
readonly
)
return
if
(
disabled
)
return
if
(
activityId
&&
activityId
==
id
)
id
=
''
if
(
activityId
&&
activityId
==
id
)
id
=
''
this
.
$emit
(
'choose'
,
id
)
this
.
$emit
(
'choose'
,
id
)
}
}
...
...
src/views/questionnaire/components/StepOne/EquityItem.vue
View file @
4000a05
<
template
>
<
template
>
<div
<div
@
click=
"chooseRed(data.equityClassId)"
@
click=
"chooseRed(data.equityClassId)"
:class=
"['item',
{'disabled':
readonly
},{'active':configForm.activityId == data.equityClassId}]"
:class=
"['item',
{'disabled':
disabled
},{'active':configForm.activityId == data.equityClassId}]"
>
>
<div
class=
"icon"
>
<div
class=
"icon"
>
<img
src=
"@/assets/red-radio.png"
/>
<img
src=
"@/assets/red-radio.png"
/>
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
}
},
},
readonly
:
Boolean
disabled
:
Boolean
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -38,8 +38,8 @@ export default {
...
@@ -38,8 +38,8 @@ export default {
methods
:
{
methods
:
{
chooseRed
(
id
)
{
chooseRed
(
id
)
{
const
{
activityId
}
=
this
.
configForm
,
const
{
activityId
}
=
this
.
configForm
,
{
readonly
}
=
this
{
disabled
}
=
this
if
(
readonly
)
return
if
(
disabled
)
return
if
(
activityId
&&
activityId
==
id
)
id
=
''
if
(
activityId
&&
activityId
==
id
)
id
=
''
this
.
$emit
(
'choose'
,
id
)
this
.
$emit
(
'choose'
,
id
)
}
}
...
...
src/views/questionnaire/components/StepOne/RedEnvelopeItem.vue
View file @
4000a05
<
template
>
<
template
>
<div
<div
@
click=
"chooseRed(data.id)"
@
click=
"chooseRed(data.id)"
:class=
"['item',
{'disabled':
readonly
},{'active':configForm.activityId == data.id}]"
:class=
"['item',
{'disabled':
disabled
},{'active':configForm.activityId == data.id}]"
>
>
<div
class=
"icon"
>
<div
class=
"icon"
>
<img
src=
"@/assets/red-radio.png"
/>
<img
src=
"@/assets/red-radio.png"
/>
...
@@ -27,7 +27,7 @@ export default {
...
@@ -27,7 +27,7 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
}
}
,
}
,
readonly
:
Boolean
disabled
:
Boolean
}
,
}
,
data
()
{
data
()
{
return
{
return
{
...
@@ -39,8 +39,8 @@ export default {
...
@@ -39,8 +39,8 @@ export default {
methods
:
{
methods
:
{
chooseRed
(
id
)
{
chooseRed
(
id
)
{
const
{
activityId
}
=
this
.
configForm
,
const
{
activityId
}
=
this
.
configForm
,
{
readonly
}
=
this
{
disabled
}
=
this
if
(
readonly
)
return
if
(
disabled
)
return
if
(
activityId
&&
activityId
==
id
)
id
=
''
if
(
activityId
&&
activityId
==
id
)
id
=
''
this
.
$emit
(
'choose'
,
id
)
this
.
$emit
(
'choose'
,
id
)
}
}
...
...
src/views/questionnaire/components/StepOne/index.vue
View file @
4000a05
...
@@ -39,15 +39,15 @@
...
@@ -39,15 +39,15 @@
</template>
</template>
<
template
#
activity
>
<
template
#
activity
>
<div
class=
"tabs flex"
>
<div
class=
"tabs flex"
>
<template
v-for=
"(i,index) in tabsObj.data"
>
<template
v-for=
"(i,
index) in tabsObj.data"
>
<template>
<template>
<el-button
<el-button
type=
"text"
type=
"text"
@
click=
"changeActivity(index)"
@
click=
"changeActivity(index)"
:class=
"['tab',
{active:index == tabsObj.index
}]"
:class=
"['tab',
{ active: index == tabsObj.index
}]"
:key="index"
:key="index"
:disabled="index == 1 || disabled"
:disabled="index == 1 || disabled"
>
{{
i
}}
</el-button>
>
{{
i
}}
</el-button>
</
template
>
</
template
>
</template>
</template>
</div>
</div>
...
@@ -57,15 +57,17 @@
...
@@ -57,15 +57,17 @@
>
>
<
template
v-if=
"activityObj.flag"
>
<
template
v-if=
"activityObj.flag"
>
<template
v-if=
"activityObj.data.length"
>
<template
v-if=
"activityObj.data.length"
>
<template
v-for=
"(i,index) in activityObj.data"
>
<template
v-for=
"(i,
index) in activityObj.data"
>
<template>
<template>
<component
<component
:key=
"index"
:key=
"index"
:is=
"
{
:is=
"
0:'EquityItem',
{
2:'CouponItem',
0: 'EquityItem',
3:'RedEnvelopeItem'
2: 'CouponItem',
}[tabsObj.index]"
3: 'RedEnvelopeItem'
}[tabsObj.index]
"
:configForm="configForm"
:configForm="configForm"
:data="i"
:data="i"
:disabled="disabled"
:disabled="disabled"
...
@@ -81,7 +83,7 @@
...
@@ -81,7 +83,7 @@
</template>
</template>
<
template
v-else
>
<
template
v-else
>
<div
class=
"nothing"
>
<div
class=
"nothing"
>
<img
src=
"@/assets/activity-nothing.png"
>
<img
src=
"@/assets/activity-nothing.png"
/
>
<div>
暂无内容
</div>
<div>
暂无内容
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -93,7 +95,7 @@
...
@@ -93,7 +95,7 @@
</el-scrollbar>
</el-scrollbar>
</template>
</template>
<
script
type=
'text/ecmascript-6'
>
<
script
type=
"text/ecmascript-6"
>
import
{
getMerchantListMixin
}
from
'@/mixins'
import
{
getMerchantListMixin
}
from
'@/mixins'
import
EquityItem
from
'./EquityItem.vue'
import
EquityItem
from
'./EquityItem.vue'
import
CouponItem
from
'./CouponItem.vue'
import
CouponItem
from
'./CouponItem.vue'
...
@@ -149,6 +151,9 @@ export default {
...
@@ -149,6 +151,9 @@ export default {
maxPhotoNum
:
1
,
maxPhotoNum
:
1
,
suffixSlot
:
'cardCover'
,
suffixSlot
:
'cardCover'
,
handleUpload
:
async
(
e
,
file
,
targetItem
)
=>
{
handleUpload
:
async
(
e
,
file
,
targetItem
)
=>
{
let
loading
=
this
.
$loading
({
target
:
document
.
querySelector
(
'.activity-img'
),
})
try
{
try
{
const
imgFile
=
e
.
target
.
result
,
const
imgFile
=
e
.
target
.
result
,
arrBase64
=
imgFile
.
split
(
','
)[
1
],
arrBase64
=
imgFile
.
split
(
','
)[
1
],
...
@@ -158,8 +163,10 @@ export default {
...
@@ -158,8 +163,10 @@ export default {
if
(
res
)
{
if
(
res
)
{
this
.
configForm
[
targetItem
.
name
]
=
res
this
.
configForm
[
targetItem
.
name
]
=
res
this
.
formRef
().
validateField
(
targetItem
.
name
)
this
.
formRef
().
validateField
(
targetItem
.
name
)
loading
.
close
()
}
else
throw
'上传失败'
}
else
throw
'上传失败'
}
catch
(
error
)
{
}
catch
(
error
)
{
loading
.
close
()
this
.
$message
(
error
)
this
.
$message
(
error
)
}
}
}
}
...
@@ -197,6 +204,9 @@ export default {
...
@@ -197,6 +204,9 @@ export default {
this
.
formData
.
map
(
e
=>
{
this
.
formData
.
map
(
e
=>
{
e
.
isDisabled
=
n
e
.
isDisabled
=
n
})
})
},
'configForm.merchantId'
(
n
)
{
if
(
!
n
)
this
.
change
()
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -207,9 +217,12 @@ export default {
...
@@ -207,9 +217,12 @@ export default {
change
(
id
)
{
change
(
id
)
{
this
.
configForm
.
activityId
=
''
this
.
configForm
.
activityId
=
''
this
.
configForm
.
activityType
=
''
this
.
configForm
.
activityType
=
''
this
.
configForm
.
merchantName
=
this
.
merchantObj
.
data
.
find
(
e
=>
e
.
confId
==
id
).
confName
this
.
configForm
.
merchantName
=
''
this
.
activityObj
=
this
.
$options
.
data
.
call
(
this
).
activityObj
this
.
activityObj
=
this
.
$options
.
data
.
call
(
this
).
activityObj
if
(
id
)
{
this
.
configForm
.
merchantName
=
this
.
merchantObj
.
data
.
find
(
e
=>
e
.
confId
==
id
).
confName
this
.
getActivityList
()
this
.
getActivityList
()
}
else
this
.
activityObj
.
flag
=
true
},
},
formRef
()
{
formRef
()
{
return
this
.
$refs
.
formRef
.
$refs
.
formRef
return
this
.
$refs
.
formRef
.
$refs
.
formRef
...
@@ -275,19 +288,16 @@ export default {
...
@@ -275,19 +288,16 @@ export default {
}
}
},
},
choose
(
e
)
{
choose
(
e
)
{
console
.
log
(
e
)
const
{
index
}
=
this
.
tabsObj
const
{
index
}
=
this
.
tabsObj
this
.
configForm
.
activityId
=
e
this
.
configForm
.
activityId
=
e
this
.
configForm
.
activityType
=
e
?
index
==
0
?
1
:
index
:
''
this
.
configForm
.
activityType
=
e
?
index
==
0
?
1
:
index
:
''
console
.
log
(
this
.
configForm
)
}
}
},
},
}
}
</
script
>
</
script
>
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
"scss"
>
.step-box
{
.step-box
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
...
src/views/questionnaire/components/StepTwo/index.vue
View file @
4000a05
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
maxlength=
"50"
maxlength=
"50"
show-word-limit
show-word-limit
:disabled=
"disabled"
:disabled=
"disabled"
resize=
"none"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
...
@@ -50,14 +51,17 @@
...
@@ -50,14 +51,17 @@
<template>
<template>
<div
<div
:key=
"index"
:key=
"index"
class=
"item"
class=
"item
move
"
:ref=
"`item-$
{index}`"
:ref=
"`item-$
{index}`"
>
>
<div
:class=
"['label',
{ required: i.required }]">
{{
i
.
text
}}
:
</div>
<div
:class=
"['label',
{ required: i.required }]">
{{
i
.
text
}}
<span>
:
</span>
</div>
<template
v-if=
"i.type == 1"
>
<template
v-if=
"i.type == 1"
>
<el-radio-group
<el-radio-group
v-model=
"i.itemValue"
v-model=
"i.itemValue"
class=
"r
adio
"
class=
"r
esize
"
>
>
<template
v-for=
"(item, ind) in i.data"
>
<template
v-for=
"(item, ind) in i.data"
>
<template>
<template>
...
@@ -70,7 +74,7 @@
...
@@ -70,7 +74,7 @@
</el-radio-group>
</el-radio-group>
</template>
</template>
<
template
v-if=
"i.type == 2"
>
<
template
v-if=
"i.type == 2"
>
<el-checkbox-group
v-model=
"i.itemValue"
>
<el-checkbox-group
v-model=
"i.itemValue"
class=
"resize"
>
<template
v-for=
"(item, ind) in i.data"
>
<template
v-for=
"(item, ind) in i.data"
>
<template>
<template>
<el-checkbox
<el-checkbox
...
@@ -167,6 +171,7 @@
...
@@ -167,6 +171,7 @@
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
EditQuestions
from
'./EditQuestions.vue'
import
EditQuestions
from
'./EditQuestions.vue'
const
marginBottom
=
16
,
const
marginBottom
=
16
,
delay
=
(
ms
)
=>
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
)),
translateY
=
(
val
,
size
)
=>
`translateY(
${
val
}
px) `
translateY
=
(
val
,
size
)
=>
`translateY(
${
val
}
px) `
// ${size == 1 ? 'scale(1.01)' : ''}
// ${size == 1 ? 'scale(1.01)' : ''}
export
default
{
export
default
{
...
@@ -215,6 +220,7 @@ export default {
...
@@ -215,6 +220,7 @@ export default {
_this
.
questionsList
.
splice
(
index
,
0
,
questionsList
)
_this
.
questionsList
.
splice
(
index
,
0
,
questionsList
)
_this
.
configForm
.
questions
.
splice
(
index
,
0
,
questions
)
_this
.
configForm
.
questions
.
splice
(
index
,
0
,
questions
)
delList
.
pop
()
delList
.
pop
()
_this
.
formRef
().
validateField
(
'questions'
)
}
}
}
}
})
})
...
@@ -270,19 +276,35 @@ export default {
...
@@ -270,19 +276,35 @@ export default {
this
.
moveItem
(
questions
,
index
,
ind
)
this
.
moveItem
(
questions
,
index
,
ind
)
}
}
},
},
delItem
()
{
async
delItem
()
{
const
{
index
}
=
this
.
delObj
,
const
{
index
}
=
this
.
delObj
,
{
questionsList
,
configForm
:
{
questions
}
}
=
this
refs
=
this
.
$refs
,
{
questionsList
,
configForm
:
{
questions
}
}
=
this
,
items
=
[]
questionsList
.
map
((
_
,
i
)
=>
{
const
[
item
]
=
refs
[
`item-
${
i
}
`
]
item
.
className
=
'item move'
items
.
push
(
item
)
})
this
.
delList
.
push
({
this
.
delList
.
push
({
questionsList
:
questionsList
[
index
],
questionsList
:
questionsList
[
index
],
questions
:
questions
[
index
],
questions
:
questions
[
index
],
index
index
})
})
this
.
questionsList
.
splice
(
index
,
1
)
for
(
let
i
=
index
+
1
;
i
<
questionsList
.
length
;
i
++
)
{
this
.
configForm
.
questions
.
splice
(
index
,
1
)
items
[
i
].
style
.
transform
=
translateY
(
-
(
items
[
index
].
offsetHeight
+
marginBottom
))
}
items
[
index
].
className
=
'item move del'
this
.
delObj
=
{
this
.
delObj
=
{
show
:
false
show
:
false
}
}
await
delay
(
600
)
this
.
questionsList
.
splice
(
index
,
1
)
this
.
configForm
.
questions
.
splice
(
index
,
1
)
items
.
length
&&
items
.
map
(
e
=>
{
e
.
className
=
'item'
e
.
style
.
transform
=
''
})
},
},
controlDisabled
(
index
,
ind
)
{
controlDisabled
(
index
,
ind
)
{
const
{
questionsList
}
=
this
const
{
questionsList
}
=
this
...
@@ -300,8 +322,8 @@ export default {
...
@@ -300,8 +322,8 @@ export default {
}[
targetIndex
],
}[
targetIndex
],
elementToMove
=
array
[
originalIndex
],
elementToMove
=
array
[
originalIndex
],
items
=
[],
items
=
[],
moveUP
=
targetIndex
<
4
,
moveUP
=
targetIndex
<
4
delay
=
(
ms
)
=>
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
ms
))
if
(
moveElement
)
{
if
(
moveElement
)
{
const
refs
=
this
.
$refs
const
refs
=
this
.
$refs
// 获取所有元素的引用
// 获取所有元素的引用
...
@@ -324,10 +346,10 @@ export default {
...
@@ -324,10 +346,10 @@ export default {
targetEl
.
style
.
transform
=
translateY
(
originalOffsetHeight
)
targetEl
.
style
.
transform
=
translateY
(
originalOffsetHeight
)
}
else
{
}
else
{
//最前
//最前
originalEl
.
style
.
transform
=
translateY
(
-
originalOffsetTop
)
for
(
let
i
=
0
;
i
<
originalIndex
;
i
++
)
{
for
(
let
i
=
0
;
i
<
originalIndex
;
i
++
)
{
items
[
i
].
style
.
transform
=
translateY
(
originalOffsetHeight
)
items
[
i
].
style
.
transform
=
translateY
(
originalOffsetHeight
)
}
}
originalEl
.
style
.
transform
=
translateY
(
-
originalOffsetTop
)
}
}
}
else
{
}
else
{
if
(
moveUP
)
{
if
(
moveUP
)
{
...
@@ -336,22 +358,24 @@ export default {
...
@@ -336,22 +358,24 @@ export default {
targetEl
.
style
.
transform
=
translateY
(
-
originalOffsetHeight
)
targetEl
.
style
.
transform
=
translateY
(
-
originalOffsetHeight
)
}
else
{
}
else
{
//最后
//最后
originalEl
.
style
.
transform
=
translateY
(
targetOffsetTop
-
originalOffsetTop
-
Math
.
abs
(
targetOffsetHeight
-
originalOffsetHeight
))
let
lastMove
=
0
for
(
let
i
=
originalIndex
+
1
;
i
<
LENGTH
;
i
++
)
{
for
(
let
i
=
originalIndex
+
1
;
i
<
LENGTH
;
i
++
)
{
items
[
i
].
style
.
transform
=
translateY
(
-
originalOffsetHeight
)
items
[
i
].
style
.
transform
=
translateY
(
-
originalOffsetHeight
)
lastMove
+=
(
items
[
i
].
offsetHeight
+
marginBottom
)
}
}
originalEl
.
style
.
transform
=
translateY
(
lastMove
)
}
}
}
}
}
}
await
delay
(
500
)
await
delay
(
600
)
// 移动元素到新位置
array
.
splice
(
originalIndex
,
1
)
array
.
splice
(
newIndex
,
0
,
elementToMove
)
// 清空元素的样式和位置
// 清空元素的样式和位置
items
.
length
&&
items
.
map
(
e
=>
{
moveElement
&&
items
.
length
&&
items
.
map
(
e
=>
{
e
.
className
=
'item'
e
.
className
=
'item'
e
.
style
.
transform
=
''
e
.
style
.
transform
=
''
})
})
// 移动元素到新位置
array
.
splice
(
originalIndex
,
1
)
array
.
splice
(
newIndex
,
0
,
elementToMove
)
return
array
return
array
}
}
}
}
...
@@ -389,15 +413,18 @@ export default {
...
@@ -389,15 +413,18 @@ export default {
background
:
#f9f9f9
;
background
:
#f9f9f9
;
display
:
flex
;
display
:
flex
;
margin-bottom
:
16px
;
margin-bottom
:
16px
;
padding
:
20px
;
padding
:
20px
10px
20px
20px
;
position
:
relative
;
box-sizing
:
border-box
;
.label
{
.label
{
font-size
:
14px
;
font-size
:
14px
;
color
:
#333333
;
color
:
#333333
;
width
:
154px
;
width
:
154px
;
line-height
:
20px
;
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
flex-shrink
:
0
;
flex-shrink
:
0
;
word-break
:
break-all
;
white-space
:
break-spaces
;
}
}
/
deep
/
.el-radio__label
{
/
deep
/
.el-radio__label
{
word-break
:
break-all
;
word-break
:
break-all
;
...
@@ -411,15 +438,32 @@ export default {
...
@@ -411,15 +438,32 @@ export default {
margin
:
2px
4px
0
0
;
margin
:
2px
4px
0
0
;
}
}
}
}
.radio
{
.resize
{
line-height
:
22px
;
line-height
:
20px
;
font-size
:
40px
;
font-size
:
14px
;
}
}
.del
{
transform
:
translateX
(
-200%
);
}
.show
{
animation
:
show-item
0.25s
;
}
@keyframes
show-item
{
0
%
{
transform
:
translateX
(
-500%
);
}
100
%
{
transform
:
translateX
(
0
);
}
}
}
}
.control-box
{
.control-box
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
margin-left
:
auto
;
margin-left
:
auto
;
.el-button
{
border
:
none
;
}
.el-button
+
.el-button
{
.el-button
+
.el-button
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
...
...
src/views/questionnaire/index.vue
View file @
4000a05
...
@@ -83,32 +83,17 @@
...
@@ -83,32 +83,17 @@
<
/div
>
<
/div
>
<
data
-
table
:
dataObj
.
sync
=
"dataObj"
/>
<
data
-
table
:
dataObj
.
sync
=
"dataObj"
/>
<
GLDialog
<
GLDialog
title
=
"结束
"
:
title
=
"updateParams.title
"
@
onOk
=
"
overQiestion
"
@
onOk
=
"
updateQiestionStatus
"
@
onCancel
=
"
clos
eParams.show = false"
@
onCancel
=
"
updat
eParams.show = false"
:
visible
.
sync
=
"
clos
eParams.show"
:
visible
.
sync
=
"
updat
eParams.show"
mode
=
"small"
mode
=
"small"
>
>
<
template
#
default
>
<
template
#
default
>
<
div
class
=
"over-box"
>
<
div
class
=
"over-box"
>
<
div
class
=
"el-icon-warning"
><
/div
>
<
div
class
=
"el-icon-warning"
><
/div
>
请确认是否结束该调查问卷?
{{
updateParams
.
text
}}
<
div
class
=
"tips"
>
结束后,客户点击将提示:问卷活动已结束
<
/div
>
<
div
class
=
"tips"
>
{{
updateParams
.
tips
}}
<
/div
>
<
/div
>
<
/template
>
<
/GLDialog
>
<
GLDialog
title
=
"发布问卷"
@
onOk
=
"issueQiestion"
@
onCancel
=
"issueParmas.show = false"
:
visible
.
sync
=
"issueParmas.show"
mode
=
"small"
>
<
template
#
default
>
<
div
class
=
"over-box"
>
<
div
class
=
"el-icon-warning"
><
/div
>
请确认是否发布以下调查问卷?
<
div
class
=
"tips"
>
问卷名称:
{{
issueParmas
.
name
}}
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/GLDialog
>
<
/GLDialog
>
...
@@ -186,9 +171,9 @@ export default {
...
@@ -186,9 +171,9 @@ export default {
maxlength
:
100
,
maxlength
:
100
,
optionList
:
[
optionList
:
[
{
text
:
'全部'
,
id
:
'-1,0,1'
}
,
{
text
:
'全部'
,
id
:
'-1,0,1'
}
,
{
text
:
'已结束'
,
id
:
'-1'
}
,
{
text
:
'待发布'
,
id
:
'0'
}
,
{
text
:
'待发布'
,
id
:
'0'
}
,
{
text
:
'已发布'
,
id
:
'1'
}
,
{
text
:
'已发布'
,
id
:
'1'
}
,
{
text
:
'已结束'
,
id
:
'-1'
}
,
],
],
optionId
:
'id'
,
optionId
:
'id'
,
optionLabel
:
'text'
optionLabel
:
'text'
...
@@ -247,9 +232,13 @@ export default {
...
@@ -247,9 +232,13 @@ export default {
}
,
}
,
condition
:
row
=>
row
.
status
==
1
,
condition
:
row
=>
row
.
status
==
1
,
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
clos
eParams
=
{
click
:
row
=>
this
.
updat
eParams
=
{
show
:
true
,
show
:
true
,
id
:
row
.
id
id
:
row
.
id
,
title
:
'结束'
,
status
:
-
1
,
text
:
'请确认是否结束该调查问卷?'
,
tips
:
'结束后,客户点击将提示:问卷活动已结束'
}
}
}
}
}
,
}
,
...
@@ -261,10 +250,13 @@ export default {
...
@@ -261,10 +250,13 @@ export default {
}
,
}
,
condition
:
row
=>
row
.
status
==
0
,
condition
:
row
=>
row
.
status
==
0
,
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
issueParma
s
=
{
click
:
row
=>
this
.
updateParam
s
=
{
show
:
true
,
show
:
true
,
id
:
row
.
id
,
id
:
row
.
id
,
name
:
row
.
name
title
:
'发布问卷'
,
status
:
1
,
text
:
'请确认是否发布以下调查问卷?'
,
tips
:
`问卷名称:${row.name
}
`
}
}
}
}
}
,
}
,
...
@@ -308,10 +300,7 @@ export default {
...
@@ -308,10 +300,7 @@ export default {
}
,
}
,
],
],
dataObj
:
{
}
,
dataObj
:
{
}
,
closeParams
:
{
updateParams
:
{
show
:
false
}
,
issueParmas
:
{
show
:
false
show
:
false
}
,
}
,
copyParmas
:
{
copyParmas
:
{
...
@@ -336,11 +325,11 @@ export default {
...
@@ -336,11 +325,11 @@ export default {
...
row
...
row
}
}
}
,
}
,
async
overQiestion
()
{
async
updateQiestionStatus
()
{
const
{
id
}
=
this
.
clos
eParams
,
const
{
id
,
status
}
=
this
.
updat
eParams
,
res
=
await
this
.
$apis
.
questionnaire
.
closeQuestionnaire
({
id
}
)
res
=
await
this
.
$apis
.
questionnaire
.
updateQuestionnaireStatus
({
id
,
status
}
)
if
(
res
)
{
if
(
res
)
{
this
.
clos
eParams
=
{
this
.
updat
eParams
=
{
show
:
false
show
:
false
}
}
this
.
$message
({
this
.
$message
({
...
@@ -350,17 +339,6 @@ export default {
...
@@ -350,17 +339,6 @@ export default {
this
.
handleSearch
()
this
.
handleSearch
()
}
else
this
.
$message
.
error
(
'操作失败,请重试。'
)
}
else
this
.
$message
.
error
(
'操作失败,请重试。'
)
}
,
}
,
async
issueQiestion
()
{
// const
{
id
}
=
this
.
issueParmas
,
// res = await this.$apis.questionnaire.updateQuestionnaire(
{
// id,
// status: 1
//
}
)
// console.log(res)
this
.
issueParmas
=
{
show
:
false
}
}
,
async
copyQiestion
()
{
async
copyQiestion
()
{
this
.
copyParmas
=
{
this
.
copyParmas
=
{
show
:
false
show
:
false
...
...
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