Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-admin-discuss
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-admin-discuss
提交
ec205d47
提交
ec205d47
编写于
9月 19, 2019
作者:
qingzhong.ren@picahealth.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
静态部分
上级
61a868a9
变更
1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
838 行增加
和
545 行删除
+838
-545
question-list.vue
src/views/question-naire/question-list.vue
+838
-545
未找到文件。
src/views/question-naire/question-list.vue
浏览文件 @
ec205d47
<
template
>
<
template
>
<div
class=
"question-wrap"
>
<div
class=
"question-wrap"
>
<bread-crumb
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
>
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
>
</bread-crumb>
</bread-crumb>
<div
class=
"question-content screenSet"
id=
"screenSet"
>
<div
class=
"question-content screenSet"
id=
"screenSet"
>
<el-row
:gutter=
"30"
class=
"row"
type=
"flex"
style=
"margin-top: 10px;"
>
<el-row
:gutter=
"30"
class=
"row"
type=
"flex"
style=
"margin-top: 10px;"
>
<el-form
ref=
"serchForm"
:model=
"searchParam"
label-width=
"75px"
label-suffix=
":"
style=
"width:100%;"
>
<el-form
ref=
"serchForm"
:model=
"searchParam"
label-width=
"75px"
label-suffix=
":"
style=
"width:100%;"
>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"问卷名称"
>
<el-form-item
label=
"问卷名称"
>
<el-input
v-model=
"searchParam.name"
size=
"mini"
placeholder=
"请输入问卷名称"
></el-input>
<el-input
v-model=
"searchParam.name"
size=
"mini"
placeholder=
"请输入问卷名称"
></el-input>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<el-form-item
label=
"状态"
>
<el-form-item
label=
"状态"
>
<el-select
clearable
v-model=
"searchParam.status"
size=
"mini"
placeholder=
"请选择问卷状态"
>
<el-select
clearable
v-model=
"searchParam.status"
size=
"mini"
placeholder=
"请选择问卷状态"
>
<el-option
<el-option
v-for=
"(item,
index) in statuSelect"
v-for=
"(item,
index) in statuSelect"
:key=
"index"
:key=
"index"
:label=
"item.label"
:label=
"item.label"
:value=
"item.value"
>
:value=
"item.value"
>
</el-option>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
style=
"text-align:right;padding:0 30px 15px 0;"
>
<el-col
:span=
"12"
style=
"text-align:right;padding:0 30px 15px 0;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"search(1)"
>
查询
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"search(1)"
<el-button
type=
"default"
size=
"small"
@
click=
"reseat"
>
重置
</el-button>
>
查询
</el-button
>
<el-button
type=
"default"
size=
"small"
@
click=
"reseat"
>
重置
</el-button
>
</el-col>
</el-col>
</el-form>
</el-form>
</el-row>
</el-row>
<el-button
class=
"add-question"
type=
"primary"
size=
"small"
@
click=
"addQuestion"
>
新增问卷
</el-button>
<el-button
<el-table
class=
"add-question"
:data=
"tableData"
type=
"primary"
style=
"width: 100%"
v-loading=
"loading"
>
size=
"small"
<el-table-column
prop=
"id"
label=
"问卷编号"
min-width=
"50"
align=
"center"
></el-table-column>
@
click=
"addQuestion"
<el-table-column
prop=
"name"
label=
"问卷名称"
min-width=
"100"
align=
"center"
></el-table-column>
>
新增问卷
</el-button
>
<el-table
:data=
"tableData"
style=
"width: 100%"
v-loading=
"loading"
>
<el-table-column
prop=
"id"
label=
"问卷编号"
min-width=
"50"
align=
"center"
></el-table-column>
<el-table-column
prop=
"name"
label=
"问卷名称"
min-width=
"100"
align=
"center"
></el-table-column>
<el-table-column
label=
"最后修改人"
min-width=
"50"
align=
"center"
>
<el-table-column
label=
"最后修改人"
min-width=
"50"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
modifiedId
|
modifyType
(
modifyArray
)
}}
</span>
<span>
{{
scope
.
row
.
modifiedId
|
modifyType
(
modifyArray
)
}}
</span>
...
@@ -51,11 +83,33 @@
...
@@ -51,11 +83,33 @@
<span>
{{
scope
.
row
.
status
|
questionStatus
}}
</span>
<span>
{{
scope
.
row
.
status
|
questionStatus
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
min-width=
"200"
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
min-width=
"200"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"editQuestion(scope.row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
v-if=
"scope.row.status == 1"
size=
"small"
@
click=
"onAndDownLine(scope.row)"
>
上线
</el-button>
type=
"primary"
<el-button
type=
"primary"
v-if=
"scope.row.status == 2"
size=
"small"
@
click=
"onAndDownLine(scope.row)"
>
下线
</el-button>
size=
"small"
@
click=
"editQuestion(scope.row)"
>
编辑
</el-button
>
<el-button
type=
"primary"
v-if=
"scope.row.status == 1"
size=
"small"
@
click=
"onAndDownLine(scope.row)"
>
上线
</el-button
>
<el-button
type=
"primary"
v-if=
"scope.row.status == 2"
size=
"small"
@
click=
"onAndDownLine(scope.row)"
>
下线
</el-button
>
<!--
<el-button
type=
"primary"
size=
"small"
@
click=
"reviewQuestion(scope.row)"
>
查看题库
</el-button>
-->
<!--
<el-button
type=
"primary"
size=
"small"
@
click=
"reviewQuestion(scope.row)"
>
查看题库
</el-button>
-->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -76,7 +130,8 @@
...
@@ -76,7 +130,8 @@
:page-sizes=
"[15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]"
:page-sizes=
"[15, 30, 50, 100, 200, 500, 700, 1000, 1500, 2000]"
:page-size=
"searchParam.pageSize"
:page-size=
"searchParam.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"totalRows"
>
:total=
"totalRows"
>
</el-pagination>
</el-pagination>
</div>
</div>
</div>
</div>
...
@@ -86,20 +141,42 @@
...
@@ -86,20 +141,42 @@
:title=
"questionTitle"
:title=
"questionTitle"
:visible
.
sync=
"discussEditVisible"
:visible
.
sync=
"discussEditVisible"
:close-on-click-modal=
"false"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
>
:close-on-press-escape=
"false"
<el-form
ref=
"questionForm"
:rules=
"rules"
:model=
"questionEditList"
label-width=
"220px"
label-suffix=
":"
size=
"mini"
>
>
<el-form
ref=
"questionForm"
:rules=
"rules"
:model=
"questionEditList"
label-width=
"220px"
label-suffix=
":"
size=
"mini"
>
<el-form-item>
<el-form-item>
<el-radio-group
v-model=
"questionEditList.showType"
style=
"margin-left: -65px;"
>
<el-radio-group
v-model=
"questionEditList.showType"
style=
"margin-left: -65px;"
>
<el-radio
:label=
"1"
>
单题显示
</el-radio>
<el-radio
:label=
"1"
>
单题显示
</el-radio>
<el-radio
:label=
"2"
>
平铺显示
</el-radio>
<el-radio
:label=
"2"
>
平铺显示
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"问卷标题"
prop=
"name"
>
<el-form-item
label=
"问卷标题"
prop=
"name"
>
<el-input
v-model=
"questionEditList.name"
maxlength=
"10"
placeholder=
"标题最多10字符"
style=
"width: 300px;"
></el-input>
<el-input
v-model=
"questionEditList.name"
maxlength=
"30"
placeholder=
"标题最多30字符"
style=
"width: 300px;"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"题库导入"
prop=
"fileName"
>
<el-form-item
label=
"题库导入"
prop=
"fileName"
>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-input
class=
"form-input"
:placeholder=
"excelFileName"
v-model=
"fileName"
disabled
style=
"width: 99%;"
/>
<el-input
class=
"form-input"
:placeholder=
"excelFileName"
v-model=
"fileName"
disabled
style=
"width: 99%;"
/>
</el-col>
</el-col>
<el-col
:span=
"10"
>
<el-col
:span=
"10"
>
<el-upload
<el-upload
...
@@ -108,10 +185,13 @@
...
@@ -108,10 +185,13 @@
action=
"#"
action=
"#"
accept=
".xlsx"
accept=
".xlsx"
:before-upload=
"beforeImport"
:before-upload=
"beforeImport"
:limit=
"1"
>
:limit=
"1"
>
<el-button
type=
"primary"
size=
"mini"
>
导入题库
</el-button>
<el-button
type=
"primary"
size=
"mini"
>
导入题库
</el-button>
</el-upload>
</el-upload>
<el-button
type=
"default"
size=
"mini"
@
click=
"uploadTemplate"
>
模板下载
</el-button>
<el-button
type=
"default"
size=
"mini"
@
click=
"uploadTemplate"
>
模板下载
</el-button
>
</el-col>
</el-col>
</el-form-item>
</el-form-item>
<el-form-item
label=
"下一题按钮"
v-if=
"questionEditList.showType == 1"
>
<el-form-item
label=
"下一题按钮"
v-if=
"questionEditList.showType == 1"
>
...
@@ -122,12 +202,21 @@
...
@@ -122,12 +202,21 @@
class=
"avatar-uploader"
class=
"avatar-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload_1"
>
:before-upload=
"beforeAvatarUpload_1"
>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
</el-upload>
</el-upload>
<div
class=
"uploat-content"
>
<div
class=
"uploat-content"
>
<img
v-if=
"questionEditList.nextDisableClickUrl"
:src=
"questionEditList.nextDisableClickUrl"
class=
"bg-img"
>
<img
<img
v-if=
"!questionEditList.nextDisableClickUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164003674.png"
>
v-if=
"questionEditList.nextDisableClickUrl"
:src=
"questionEditList.nextDisableClickUrl"
class=
"bg-img"
/>
<img
v-if=
"!questionEditList.nextDisableClickUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164003674.png"
/>
</div>
</div>
</div>
</div>
<div
class=
"submit-btn"
>
<div
class=
"submit-btn"
>
...
@@ -137,12 +226,21 @@
...
@@ -137,12 +226,21 @@
class=
"avatar-uploader"
class=
"avatar-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload_2"
>
:before-upload=
"beforeAvatarUpload_2"
>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
</el-upload>
</el-upload>
<div
class=
"uploat-content"
>
<div
class=
"uploat-content"
>
<img
v-if=
"questionEditList.nextClickUrl"
:src=
"questionEditList.nextClickUrl"
class=
"bg-img"
>
<img
<img
v-if=
"!questionEditList.nextClickUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164015812.png"
>
v-if=
"questionEditList.nextClickUrl"
:src=
"questionEditList.nextClickUrl"
class=
"bg-img"
/>
<img
v-if=
"!questionEditList.nextClickUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164015812.png"
/>
</div>
</div>
</div>
</div>
</el-form-item>
</el-form-item>
...
@@ -152,13 +250,42 @@
...
@@ -152,13 +250,42 @@
<el-radio
:label=
"2"
>
图片
</el-radio>
<el-radio
:label=
"2"
>
图片
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"副标题"
v-if=
"questionEditList.showType == 2 && questionEditList.headStyle == 1"
>
<el-form-item
<el-input
v-model=
"questionEditList.subheading"
maxlength=
"20"
placeholder=
"副标题最多20字符"
style=
"width: 300px;"
></el-input>
label=
"副标题"
v-if=
"
questionEditList.showType == 2 && questionEditList.headStyle == 1
"
>
<el-input
v-model=
"questionEditList.subheading"
maxlength=
"20"
placeholder=
"副标题最多20字符"
style=
"width: 300px;"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"问卷导言"
v-if=
"questionEditList.showType == 2"
>
<el-form-item
label=
"问卷导言"
v-if=
"questionEditList.showType == 2"
>
<el-input
v-model=
"questionEditList.questionIntro"
maxlength=
"210"
placeholder=
"最多210字符"
style=
"width: 300px;"
></el-input>
<el-input
v-model=
"questionEditList.questionIntro"
maxlength=
"210"
placeholder=
"最多210字符"
style=
"width: 300px;"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"问卷起始时间"
v-if=
"questionEditList.showType == 2 && questionEditList.headStyle == 1"
>
<el-form-item
label=
"基本信息"
v-if=
"questionEditList.showType == 2"
>
<el-checkbox
v-for=
"(item, index) in questionEditList.baseInfoList"
:label=
"item.typeValue"
:key=
"index"
v-model=
"item.checked"
>
{{ item.typeName }}
</el-checkbox
>
</el-form-item>
<el-form-item
label=
"问卷起始时间"
v-if=
"
questionEditList.showType == 2 && questionEditList.headStyle == 1
"
>
<el-date-picker
<el-date-picker
type=
"datetime"
type=
"datetime"
placeholder=
"开始时间"
placeholder=
"开始时间"
...
@@ -178,19 +305,34 @@
...
@@ -178,19 +305,34 @@
>
>
</el-date-picker>
</el-date-picker>
</el-form-item>
</el-form-item>
<div
v-if=
"questionEditList.showType == 2 && questionEditList.headStyle == 2"
>
<div
v-if=
"
questionEditList.showType == 2 && questionEditList.headStyle == 2
"
>
<el-form-item
class=
"submit-btn"
label=
"头图"
>
<el-form-item
class=
"submit-btn"
label=
"头图"
>
<el-upload
<el-upload
v-model=
"questionEditList.headDiagramUrl"
v-model=
"questionEditList.headDiagramUrl"
class=
"avatar-uploader"
class=
"avatar-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload_4"
>
:before-upload=
"beforeAvatarUpload_4"
<el-button
class=
"head-btn"
size=
"mini"
type=
"primary"
>
上传
</el-button>
>
<el-button
class=
"head-btn"
size=
"mini"
type=
"primary"
>
上传
</el-button
>
</el-upload>
</el-upload>
<div
class=
"uploat-content"
>
<div
class=
"uploat-content"
>
<img
v-if=
"questionEditList.headDiagramUrl"
:src=
"questionEditList.headDiagramUrl"
class=
"head-bg-img"
>
<img
<img
v-if=
"!questionEditList.headDiagramUrl"
class=
"head-bg-img"
src=
"../../assets/image/default.png"
>
v-if=
"questionEditList.headDiagramUrl"
:src=
"questionEditList.headDiagramUrl"
class=
"head-bg-img"
/>
<img
v-if=
"!questionEditList.headDiagramUrl"
class=
"head-bg-img"
src=
"../../assets/image/default.png"
/>
</div>
</div>
</el-form-item>
</el-form-item>
</div>
</div>
...
@@ -200,73 +342,135 @@
...
@@ -200,73 +342,135 @@
class=
"avatar-uploader"
class=
"avatar-uploader"
action=
"#"
action=
"#"
:show-file-list=
"false"
:show-file-list=
"false"
:before-upload=
"beforeAvatarUpload_3"
>
:before-upload=
"beforeAvatarUpload_3"
>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
<el-button
size=
"mini"
type=
"primary"
>
上传
</el-button>
</el-upload>
</el-upload>
<div
class=
"uploat-content"
>
<div
class=
"uploat-content"
>
<img
v-if=
"questionEditList.submitButtomUrl"
:src=
"questionEditList.submitButtomUrl"
class=
"bg-img"
>
<img
<img
v-if=
"!questionEditList.submitButtomUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164026451.png"
>
v-if=
"questionEditList.submitButtomUrl"
:src=
"questionEditList.submitButtomUrl"
class=
"bg-img"
/>
<img
v-if=
"!questionEditList.submitButtomUrl"
class=
"bg-img"
src=
"https://files.yunqueyi.com/image/png/common/20190408164026451.png"
/>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"问卷填写完毕提示文案"
prop=
"promptCopy"
>
<el-form-item
label=
"问卷填写完毕提示文案"
prop=
"promptCopy"
>
<el-input
v-model=
"questionEditList.promptCopy"
maxlength=
"40"
style=
"width: 300px;"
></el-input>
<el-input
<span
style=
"font-size:12px;"
>
标题最多40字符
</span>
v-model=
"questionEditList.promptCopy"
maxlength=
"40"
style=
"width: 300px;"
></el-input>
<span
style=
"font-size:12px;"
>
限40字符
</span>
</el-form-item>
<el-form-item
label=
"登录权限控制"
v-if=
"questionEditList.showType == 2"
>
<div
class=
"login-auth"
>
<el-checkbox
v-for=
"(item, index) in questionEditList.loginAuthList"
:label=
"item.typeValue"
:key=
"index"
v-model=
"item.checked"
>
{{ item.typeName }}
</el-checkbox
>
</div>
</el-form-item>
<el-form-item
label=
"问卷填写次数"
v-if=
"questionEditList.showType == 2"
>
<el-radio
v-model=
"questionEditList.limitNumFlag"
label=
"0"
>
<el-input
v-model=
"questionEditList.limitNum"
controls-position=
"right"
:min=
"1"
style=
"width: 100px;"
@
blur=
"checkLimitNum"
@
focus=
"questionEditList.limitNumFlag = '0'"
></el-input>
</el-radio>
<el-radio
v-model=
"questionEditList.limitNumFlag"
label=
"1"
>
不限制填写次数
</el-radio
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align:center;"
>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align:center;"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"submitQuestion"
style=
"width:120px;"
>
提交
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"submitQuestion"
style=
"width:120px;"
>
提交
</el-button
>
</div>
</div>
</el-dialog>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
BreadCrumb
from
'../../components/breadcrumb.vue'
import
BreadCrumb
from
"../../components/breadcrumb.vue"
;
import
*
as
commonUtil
from
'../../utils/utils'
import
*
as
commonUtil
from
"../../utils/utils"
;
import
{
getFilePath
,
doUpload
}
from
'../../utils/qiniu-util'
import
{
getFilePath
,
doUpload
}
from
"../../utils/qiniu-util"
;
import
{
QUESTION_UPLOAD_TEMPLATE
}
from
'../../utils/constants'
import
{
QUESTION_UPLOAD_TEMPLATE
}
from
"../../utils/constants"
;
let
vm
=
null
let
vm
=
null
;
export
default
{
export
default
{
components
:
{
components
:
{
BreadCrumb
BreadCrumb
},
},
data
()
{
data
()
{
return
{
return
{
curmbFirst
:
'组件'
,
curmbFirst
:
"组件"
,
curmbSecond
:
'问卷管理'
,
curmbSecond
:
"问卷管理"
,
questionTitle
:
'问卷新增/编辑'
,
questionTitle
:
"问卷新增/编辑"
,
discussEditVisible
:
false
,
discussEditVisible
:
false
,
excelFileName
:
''
,
excelFileName
:
""
,
fileName
:
''
,
fileName
:
""
,
fileArray
:
[],
fileArray
:
[],
tableData
:
[],
tableData
:
[],
totalRows
:
0
,
totalRows
:
0
,
loading
:
false
,
loading
:
false
,
searchParam
:
{
searchParam
:
{
name
:
''
,
name
:
""
,
status
:
''
,
status
:
""
,
pageSize
:
15
,
pageSize
:
15
,
pageNo
:
1
pageNo
:
1
},
},
modifyArray
:
[],
modifyArray
:
[],
questionEditList
:
{
questionEditList
:
{
id
:
''
,
id
:
""
,
showType
:
1
,
showType
:
1
,
name
:
''
,
name
:
""
,
nextDisableClickUrl
:
''
,
nextDisableClickUrl
:
""
,
nextClickUrl
:
''
,
nextClickUrl
:
""
,
submitButtomUrl
:
''
,
submitButtomUrl
:
""
,
promptCopy
:
''
,
promptCopy
:
""
,
headDiagramUrl
:
''
,
headDiagramUrl
:
""
,
headStyle
:
1
,
headStyle
:
1
,
subheading
:
''
,
subheading
:
""
,
questionIntro
:
''
,
baseInfoList
:
[],
//基本信息
startDate
:
''
,
questionIntro
:
""
,
endDate
:
''
startDate
:
""
,
endDate
:
""
,
loginAuthList
:
[],
//登录权限控制
limitNumFlag
:
"0"
,
//填写次数flag
limitNum
:
1
//填写次数
},
},
endDateOpt
:
{
endDateOpt
:
{
disabledData
:
(
time
)
=>
{
disabledData
:
time
=>
{
if
(
this
.
questionEditList
.
endDate
!=
""
&&
this
.
questionEditList
.
endDate
!=
null
)
{
if
(
return
time
.
getTime
()
>
new
Date
(
this
.
questionEditList
.
startDate
).
getTime
();
this
.
questionEditList
.
endDate
!=
""
&&
this
.
questionEditList
.
endDate
!=
null
)
{
return
(
time
.
getTime
()
>
new
Date
(
this
.
questionEditList
.
startDate
).
getTime
()
);
}
}
}
}
},
},
...
@@ -278,251 +482,332 @@ export default {
...
@@ -278,251 +482,332 @@ export default {
}
}
},
},
rules
:
{
rules
:
{
name
:
[
name
:
[{
required
:
true
,
message
:
"请输入问卷标题"
,
trigger
:
"blur"
}],
{
required
:
true
,
message
:
'请输入问卷标题'
,
trigger
:
'blur'
}
],
promptCopy
:
[
promptCopy
:
[
{
required
:
true
,
message
:
'请输入问卷填写完毕提示文案'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
"请输入问卷填写完毕提示文案"
,
trigger
:
"blur"
}
]
]
},
},
statuSelect
:
[
statuSelect
:
[
{
{
label
:
'下线'
,
label
:
"下线"
,
value
:
1
value
:
1
},{
},
label
:
'上线'
,
{
label
:
"上线"
,
value
:
2
value
:
2
}
}
]
]
}
};
},
},
created
()
{
created
()
{
vm
=
this
vm
=
this
;
vm
.
search
()
vm
.
search
();
vm
.
getAllModify
()
vm
.
getAllModify
();
},
},
// 挂载到Dom完成时
// 挂载到Dom完成时
mounted
:
function
()
{
mounted
:
function
()
{
commonUtil
.
resizeHeight
()
commonUtil
.
resizeHeight
();
},
},
methods
:
{
methods
:
{
// 查询
// 查询
search
(
flag
)
{
search
(
flag
)
{
if
(
flag
)
vm
.
searchParam
.
pageNo
=
1
if
(
flag
)
vm
.
searchParam
.
pageNo
=
1
;
vm
.
GET
(
'/campaign/adminQuestionnaire/queryList'
,
vm
.
searchParam
).
then
((
res
)
=>
{
vm
.
GET
(
"/campaign/adminQuestionnaire/queryList"
,
vm
.
searchParam
).
then
(
if
(
res
.
code
==
'000000'
)
{
res
=>
{
vm
.
tableData
=
res
.
data
.
questionnaireList
if
(
res
.
code
==
"000000"
)
{
vm
.
totalRows
=
res
.
data
.
total
vm
.
tableData
=
res
.
data
.
questionnaireList
;
vm
.
totalRows
=
res
.
data
.
total
;
}
}
})
}
);
},
},
handleSizeChange
(
value
)
{
handleSizeChange
(
value
)
{
vm
.
searchParam
.
pageSize
=
value
vm
.
searchParam
.
pageSize
=
value
;
vm
.
search
()
vm
.
search
();
},
},
handleCurrentChange
(
value
)
{
handleCurrentChange
(
value
)
{
vm
.
searchParam
.
pageNo
=
value
vm
.
searchParam
.
pageNo
=
value
;
vm
.
search
()
vm
.
search
();
},
},
reseat
()
{
reseat
()
{
vm
.
searchParam
.
name
=
''
vm
.
searchParam
.
name
=
""
;
vm
.
searchParam
.
status
=
''
vm
.
searchParam
.
status
=
""
;
vm
.
search
()
vm
.
search
();
},
},
// 获取所有修改人
// 获取所有修改人
getAllModify
()
{
getAllModify
()
{
vm
.
GET
(
'/campaign/adminQuestionnaire/getAllUser'
).
then
((
res
)
=>
{
vm
.
GET
(
"/campaign/adminQuestionnaire/getAllUser"
).
then
(
res
=>
{
if
(
res
.
code
==
'000000'
)
{
if
(
res
.
code
==
"000000"
)
{
vm
.
modifyArray
=
res
.
data
vm
.
modifyArray
=
res
.
data
;
}
}
})
});
},
},
// 新增问卷
// 新增问卷
addQuestion
()
{
addQuestion
()
{
vm
.
discussEditVisible
=
true
vm
.
discussEditVisible
=
true
;
if
(
vm
.
$refs
.
questionForm
!==
undefined
)
{
if
(
vm
.
$refs
.
questionForm
!==
undefined
)
{
vm
.
$refs
.
questionForm
.
resetFields
();
vm
.
$refs
.
questionForm
.
resetFields
();
}
}
vm
.
questionEditList
=
Object
.
assign
({},{
vm
.
questionEditList
=
Object
.
assign
(
id
:
''
,
{},
{
id
:
""
,
showType
:
1
,
showType
:
1
,
name
:
''
,
name
:
""
,
nextDisableClickUrl
:
''
,
nextDisableClickUrl
:
""
,
nextClickUrl
:
''
,
nextClickUrl
:
""
,
submitButtomUrl
:
''
,
submitButtomUrl
:
""
,
promptCopy
:
''
,
promptCopy
:
"您已成功提交问卷,感谢您的参与!"
,
headDiagramUrl
:
''
,
headDiagramUrl
:
""
,
headStyle
:
1
,
headStyle
:
1
,
subheading
:
''
,
subheading
:
""
,
questionIntro
:
''
,
baseInfoList
:
[
startDate
:
''
,
{
endDate
:
''
typeName
:
"姓名"
,
});
typeValue
:
"name"
,
vm
.
fileName
=
''
checked
:
true
vm
.
fileArray
=
[]
},
vm
.
excelFileName
=
''
{
typeName
:
"手机号"
,
typeValue
:
"mobile"
,
checked
:
false
},
{
typeName
:
"地址"
,
typeValue
:
"address"
,
checked
:
false
}
],
questionIntro
:
""
,
startDate
:
""
,
endDate
:
""
,
loginAuthList
:
[
{
typeName
:
"云鹊医app"
,
typeValue
:
"1"
,
checked
:
true
},
{
typeName
:
"云鹊医h5"
,
typeValue
:
"2"
,
checked
:
false
}
],
limitNumFlag
:
"0"
,
limitNum
:
1
}
);
vm
.
fileName
=
""
;
vm
.
fileArray
=
[];
vm
.
excelFileName
=
""
;
},
},
// 编辑
// 编辑
editQuestion
(
row
)
{
editQuestion
(
row
)
{
if
(
vm
.
$refs
.
questionForm
!==
undefined
)
{
if
(
vm
.
$refs
.
questionForm
!==
undefined
)
{
vm
.
$refs
.
questionForm
.
resetFields
();
vm
.
$refs
.
questionForm
.
resetFields
();
}
}
vm
.
discussEditVisible
=
true
vm
.
discussEditVisible
=
true
;
vm
.
excelFileName
=
''
vm
.
excelFileName
=
""
;
vm
.
fileName
=
''
vm
.
fileName
=
""
;
vm
.
fileArray
=
[]
vm
.
fileArray
=
[];
vm
.
GET
(
'/campaign/adminQuestionnaire/getQuestionnaireById'
,{
id
:
row
.
id
}).
then
((
res
)
=>
{
vm
.
GET
(
"/campaign/adminQuestionnaire/getQuestionnaireById"
,
{
if
(
res
.
code
==
'000000'
)
{
id
:
row
.
id
vm
.
questionEditList
=
Object
.
assign
({},
res
.
data
)
}).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
console
.
log
(
res
.
data
);
vm
.
questionEditList
=
Object
.
assign
({},
res
.
data
);
vm
.
questionEditList
.
limitNumFlag
=
res
.
data
.
limitNum
<
1
?
"0"
:
"1"
;
}
}
})
});
},
},
// 上线/下线
// 上线/下线
onAndDownLine
(
row
)
{
onAndDownLine
(
row
)
{
let
req
=
null
let
req
=
null
;
if
(
row
.
status
==
1
)
{
if
(
row
.
status
==
1
)
{
req
=
{
req
=
{
id
:
row
.
id
,
id
:
row
.
id
,
status
:
2
status
:
2
}
};
}
else
{
}
else
{
req
=
{
req
=
{
id
:
row
.
id
,
id
:
row
.
id
,
status
:
1
status
:
1
};
}
}
vm
.
GET
(
"/campaign/adminQuestionnaire/upperOrLowerShip"
,
req
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
vm
.
search
();
}
}
vm
.
GET
(
'/campaign/adminQuestionnaire/upperOrLowerShip'
,
req
).
then
((
res
)
=>
{
});
if
(
res
.
code
==
'000000'
)
{
vm
.
search
()
}
})
},
},
// 导入题库
// 导入题库
beforeImport
(
file
)
{
beforeImport
(
file
)
{
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
let
arr
=
file
.
type
.
split
(
'/'
);
let
arr
=
file
.
type
.
split
(
"/"
);
let
ext
=
"."
+
arr
[
1
];
let
ext
=
"."
+
arr
[
1
];
let
reader
=
new
FileReader
();
let
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
reader
.
onload
=
function
(
e
)
{
let
fileJson
=
{
let
fileJson
=
{
fileName
:
file
.
name
,
fileName
:
file
.
name
,
file
:
e
.
target
.
result
.
substr
(
e
.
target
.
result
.
indexOf
(
"base64,"
)
+
7
),
file
:
e
.
target
.
result
.
substr
(
e
.
target
.
result
.
indexOf
(
"base64,"
)
+
7
),
ext
:
ext
ext
:
ext
};
};
vm
.
fileArray
=
[{
vm
.
fileArray
=
[
{
base64
:
fileJson
base64
:
fileJson
}];
}
];
vm
.
fileName
=
file
.
name
;
vm
.
fileName
=
file
.
name
;
vm
.
excelFileName
=
file
.
name
;
vm
.
excelFileName
=
file
.
name
;
vm
.
$message
.
info
(
'读取完毕'
);
vm
.
$message
.
info
(
"读取完毕"
);
};
};
reader
.
readAsDataURL
(
file
);
reader
.
readAsDataURL
(
file
);
},
},
// 模板下载
// 模板下载
uploadTemplate
()
{
uploadTemplate
()
{
window
.
location
.
href
=
QUESTION_UPLOAD_TEMPLATE
window
.
location
.
href
=
QUESTION_UPLOAD_TEMPLATE
;
},
},
// 置灰不可点图片上传
// 置灰不可点图片上传
beforeAvatarUpload_1
(
file
)
{
beforeAvatarUpload_1
(
file
)
{
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
vm
.
imgDoUpload
(
file
,
1
,
50
,
750
,
100
)
vm
.
imgDoUpload
(
file
,
1
,
50
,
750
,
100
);
},
},
// 点亮图片上传
// 点亮图片上传
beforeAvatarUpload_2
(
file
)
{
beforeAvatarUpload_2
(
file
)
{
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
vm
.
imgDoUpload
(
file
,
2
,
50
,
750
,
100
)
vm
.
imgDoUpload
(
file
,
2
,
50
,
750
,
100
);
},
},
// 提交图片上传
// 提交图片上传
beforeAvatarUpload_3
(
file
)
{
beforeAvatarUpload_3
(
file
)
{
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
vm
.
imgDoUpload
(
file
,
3
,
50
,
750
,
100
)
vm
.
imgDoUpload
(
file
,
3
,
50
,
750
,
100
);
},
},
// 头图图片上传
// 头图图片上传
beforeAvatarUpload_4
(
file
)
{
beforeAvatarUpload_4
(
file
)
{
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
if
(
commonUtil
.
isEmptyUtils
(
file
))
return
;
vm
.
imgDoUpload
(
file
,
4
,
100
,
750
,
468
)
vm
.
imgDoUpload
(
file
,
4
,
1024
,
750
,
-
1
);
},
},
imgDoUpload
(
file
,
urlType
,
size
,
w
,
h
)
{
imgDoUpload
(
file
,
urlType
,
size
,
w
,
h
)
{
const
isSize
=
file
.
size
/
1024
<
size
;
const
isSize
=
file
.
size
/
1024
<
size
;
if
(
!
isSize
)
{
if
(
!
isSize
)
{
vm
.
$message
.
info
(
'上传图片要小于'
+
size
+
'k'
)
if
(
size
/
1024
)
{
vm
.
$message
.
info
(
"上传图片要小于"
+
size
/
1024
+
"M"
);
}
else
{
vm
.
$message
.
info
(
"上传图片要小于"
+
size
+
"k"
);
}
return
;
return
;
}
}
var
_img
=
new
FileReader
()
var
_img
=
new
FileReader
();
_img
.
readAsDataURL
(
file
)
_img
.
readAsDataURL
(
file
);
_img
.
onload
=
function
(
theFile
)
{
_img
.
onload
=
function
(
theFile
)
{
let
image
=
new
Image
()
let
image
=
new
Image
();
image
.
src
=
theFile
.
target
.
result
image
.
src
=
theFile
.
target
.
result
;
image
.
onload
=
function
()
{
image
.
onload
=
function
()
{
let
_this
=
this
let
_this
=
this
;
if
(
_this
.
width
!=
w
||
_this
.
height
!=
h
)
{
let
uploadFlag
=
false
;
vm
.
$message
.
info
(
"上传图片尺寸应为"
+
w
+
"*"
+
h
+
",请重新上传"
)
if
(
h
==
-
1
)
{
}
else
{
if
(
_this
.
width
!=
w
)
{
vm
.
$message
.
info
(
'开始上传'
);
vm
.
$message
.
info
(
"上传图片宽度应为"
+
w
+
",请重新上传"
);
doUpload
(
vm
,
file
,
getFilePath
(
file
,
null
),
'preview4'
,
'progress1'
,
1
).
then
(
function
(
path
)
{
}
else
{
if
(
urlType
==
1
)
{
uploadFlag
=
true
;
vm
.
questionEditList
.
nextDisableClickUrl
=
path
.
fullPath
}
else
if
(
urlType
==
2
)
{
vm
.
questionEditList
.
nextClickUrl
=
path
.
fullPath
}
else
if
(
urlType
==
3
)
{
vm
.
questionEditList
.
submitButtomUrl
=
path
.
fullPath
}
else
{
vm
.
questionEditList
.
headDiagramUrl
=
path
.
fullPath
}
vm
.
$message
.
success
(
'上传成功'
)
});
}
}
}
else
{
if
(
_this
.
width
!=
w
||
_this
.
height
!=
h
)
{
vm
.
$message
.
info
(
"上传图片尺寸应为"
+
w
+
"*"
+
h
+
",请重新上传"
);
}
else
{
uploadFlag
=
true
;
}
}
if
(
uploadFlag
)
{
vm
.
$message
.
info
(
"开始上传"
);
doUpload
(
vm
,
file
,
getFilePath
(
file
,
null
),
"preview4"
,
"progress1"
,
1
).
then
(
function
(
path
)
{
if
(
urlType
==
1
)
{
vm
.
questionEditList
.
nextDisableClickUrl
=
path
.
fullPath
;
}
else
if
(
urlType
==
2
)
{
vm
.
questionEditList
.
nextClickUrl
=
path
.
fullPath
;
}
else
if
(
urlType
==
3
)
{
vm
.
questionEditList
.
submitButtomUrl
=
path
.
fullPath
;
}
else
{
vm
.
questionEditList
.
headDiagramUrl
=
path
.
fullPath
;
}
}
vm
.
$message
.
success
(
"上传成功"
);
});
}
}
};
};
},
},
// 提交
// 提交
submitQuestion
()
{
submitQuestion
()
{
let
req
=
{
let
req
=
{
model
:
vm
.
questionEditList
,
model
:
vm
.
questionEditList
,
fileArray
:
vm
.
fileArray
fileArray
:
vm
.
fileArray
};
if
(
vm
.
questionEditList
.
showType
==
1
)
{
// 单题显示
vm
.
questionEditList
.
subheading
=
""
;
vm
.
questionEditList
.
questionIntro
=
""
;
vm
.
questionEditList
.
headDiagramUrl
=
""
;
}
else
{
vm
.
questionEditList
.
nextDisableClickUrl
=
""
;
vm
.
questionEditList
.
nextClickUrl
=
""
;
if
(
vm
.
questionEditList
.
headStyle
==
1
)
{
// 文字
vm
.
questionEditList
.
headDiagramUrl
=
""
;
}
else
{
vm
.
questionEditList
.
subheading
=
""
;
vm
.
questionEditList
.
startDate
=
""
;
vm
.
questionEditList
.
endDate
=
""
;
}
}
if
(
vm
.
questionEditList
.
showType
==
1
)
{
// 单题显示
vm
.
questionEditList
.
subheading
=
''
vm
.
questionEditList
.
questionIntro
=
''
vm
.
questionEditList
.
headDiagramUrl
=
''
}
else
{
vm
.
questionEditList
.
nextDisableClickUrl
=
''
vm
.
questionEditList
.
nextClickUrl
=
''
if
(
vm
.
questionEditList
.
headStyle
==
1
)
{
// 文字
vm
.
questionEditList
.
headDiagramUrl
=
''
}
else
{
vm
.
questionEditList
.
subheading
=
''
vm
.
questionEditList
.
startDate
=
''
vm
.
questionEditList
.
endDate
=
''
}
}
if
(
!
vm
.
questionEditList
.
id
)
{
if
(
commonUtil
.
isEmptyList
(
vm
.
fileArray
))
{
vm
.
$message
.
info
(
"请导入题库"
);
return
;
}
}
if
(
!
vm
.
questionEditList
.
id
)
{
if
(
commonUtil
.
isEmptyList
(
vm
.
fileArray
))
{
vm
.
$message
.
info
(
'请导入题库'
)
return
}
}
vm
.
$refs
.
questionForm
.
validate
(
valid
=>
{
if
(
valid
)
{
commonUtil
.
openLoading
(
vm
);
vm
.
POST
(
"/campaign/adminQuestionnaire/insertOrUpdateQuestionnaire"
,
req
).
then
(
res
=>
{
commonUtil
.
closeLoading
(
vm
);
if
(
res
.
code
==
"000000"
)
{
vm
.
discussEditVisible
=
false
;
vm
.
search
();
}
else
{
vm
.
$message
.
info
(
res
.
message
);
}
}
vm
.
$refs
.
questionForm
.
validate
((
valid
)
=>
{
});
if
(
valid
)
{
commonUtil
.
openLoading
(
vm
)
vm
.
POST
(
'/campaign/adminQuestionnaire/insertOrUpdateQuestionnaire'
,
req
).
then
((
res
)
=>
{
commonUtil
.
closeLoading
(
vm
)
if
(
res
.
code
==
'000000'
)
{
vm
.
discussEditVisible
=
false
vm
.
search
()
}
else
{
vm
.
$message
.
info
(
res
.
message
)
}
}
})
});
},
// 校验输入数字为正整数
checkLimitNum
()
{
const
regexp
=
/^
[
1-9
]\d
*$/
;
if
(
!
regexp
.
test
(
vm
.
questionEditList
.
limitNum
))
{
vm
.
questionEditList
.
limitNum
=
1
;
}
}
})
}
}
}
}
}
}
;
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.question-wrap
{
.question-wrap
{
.question-content
{
.question-content
{
background
:
#fff
;
background
:
#fff
;
.add-question
{
.add-question
{
...
@@ -530,7 +815,7 @@ export default {
...
@@ -530,7 +815,7 @@ export default {
margin
:
10px
;
margin
:
10px
;
}
}
.table-empty
{
.table-empty
{
img
{
img
{
width
:
100px
;
width
:
100px
;
}
}
p
{
p
{
...
@@ -565,7 +850,15 @@ export default {
...
@@ -565,7 +850,15 @@ export default {
}
}
}
}
}
}
.login-auth
{
width
:
400px
;
.el-checkbox
{
display
:
inline-block
;
width
:
150px
;
text-align
:
left
;
}
}
}
}
</
style
>
</
style
>
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录