微信登录问卷表单
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
export default {
|
||||
name: 'AppAskForm',
|
||||
appName: '问卷表单',
|
||||
appName: '问卷表单管理',
|
||||
|
||||
data () {
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
<template>
|
||||
<section class="askForm">
|
||||
<template v-if="showDetail&&!isManager">
|
||||
<template v-if="showDetail">
|
||||
<form-detail/>
|
||||
</template>
|
||||
<template v-else-if="isManager">
|
||||
<form-list ref="FormList"/>
|
||||
</template>
|
||||
<ai-loading v-else :tips="errMsg"/>
|
||||
</section>
|
||||
</template>
|
||||
@@ -14,22 +11,16 @@
|
||||
import AiLoading from "../../components/AiLoading";
|
||||
import {mapState} from "vuex";
|
||||
import FormDetail from "./formDetail";
|
||||
import FormList from "./formList";
|
||||
|
||||
export default {
|
||||
name: "askForm",
|
||||
components: {FormList, FormDetail, AiLoading},
|
||||
appName: "问卷表单",
|
||||
components: {FormDetail, AiLoading},
|
||||
computed: {
|
||||
...mapState(['openUser', 'user']),
|
||||
showDetail() {
|
||||
return !!this.$route.query?.id
|
||||
},
|
||||
isManager() {
|
||||
let {hash, query: {preview}} = this.$route
|
||||
if (preview) return false
|
||||
else if (hash == "#dev") return true
|
||||
else return hash != '#form' && !!this.user.id
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -65,14 +65,10 @@
|
||||
|
||||
<script>
|
||||
|
||||
import UForm from "../../uview/components/u-form/u-form";
|
||||
import UFormItem from "../../uview/components/u-form-item/u-form-item";
|
||||
import {mapActions, mapState} from "vuex";
|
||||
import UInput from "../../uview/components/u-input/u-input";
|
||||
import AiTextarea from "../../components/AiTextarea";
|
||||
import AiUploader from "../../components/AiUploader";
|
||||
import AiSelect from "../../components/AiSelect";
|
||||
import URadio from "../../uview/components/u-radio/u-radio";
|
||||
import AiLoading from "../../components/AiLoading";
|
||||
import AiResult from "../../components/AiResult";
|
||||
import AiImage from "../../components/AiImage";
|
||||
@@ -85,13 +81,9 @@ export default {
|
||||
AiImage,
|
||||
AiResult,
|
||||
AiLoading,
|
||||
URadio,
|
||||
AiSelect,
|
||||
AiUploader,
|
||||
AiTextarea,
|
||||
UInput,
|
||||
UFormItem,
|
||||
UForm
|
||||
},
|
||||
computed: {
|
||||
...mapState(['openUser', 'token']),
|
||||
@@ -220,14 +212,9 @@ export default {
|
||||
this.checkUser = true
|
||||
return Promise.resolve()
|
||||
}
|
||||
let {query: {id}, hash} = this.$route,
|
||||
let {query: {id}} = this.$route,
|
||||
{openId} = this.openUser
|
||||
if (hash != "#form") {
|
||||
this.result = {
|
||||
tips: "非法的调查问卷链接",
|
||||
status: "error"
|
||||
}
|
||||
} else if (openId) {
|
||||
if (openId) {
|
||||
return new Promise(resolve => {
|
||||
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
|
||||
params: {id, openId}
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
<template>
|
||||
<section class="formList">
|
||||
<ai-top-fixed>
|
||||
<u-search placeholder="请输入标题" :show-action="false" search-icon-color="#ccc" v-model="search.title" @search="page.current=1,getList()"/>
|
||||
</ai-top-fixed>
|
||||
<div class="mainPane">
|
||||
<div class="formBox column" flex v-for="op in list" :key="op.id">
|
||||
<div flex>
|
||||
<div class="fill column" flex>
|
||||
<b class="title">{{ op.title }}</b>
|
||||
<div class="info wrap" flex>
|
||||
<span v-html="op.createUserName"/>
|
||||
<span v-html="op.createUnitName"/>
|
||||
<span v-html="op.createTime"/>
|
||||
<span v-html="$dict.getLabel('questionnaireType',op.type)"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="split"/>
|
||||
<div flex class="column submitCount">
|
||||
<b>{{ op.dataCount }}</b>
|
||||
<div>答卷数量</div>
|
||||
</div>
|
||||
</div>
|
||||
<div flex class="bottom">
|
||||
<div class="dot" :style="{background:$dict.getColor('questionnaireStatus',op.status)}"/>
|
||||
<div>{{ $dict.getLabel("questionnaireStatus", op.status) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AiTopFixed from "../../components/AiTopFixed";
|
||||
|
||||
export default {
|
||||
name: "formList",
|
||||
components: {AiTopFixed},
|
||||
data() {
|
||||
return {
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
search: {title: ""},
|
||||
list: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.$http.post("/app/appquestionnairetemplate/list", null, {
|
||||
params: {...this.page, ...this.search}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
if (this.page.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else this.list = res.data.records
|
||||
this.page.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
reachBottom() {
|
||||
if (this.page.total > this.list.length) {
|
||||
this.page.current++
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$dict.load("questionnaireStatus", 'questionnaireType')
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.formList {
|
||||
min-height: 100%;
|
||||
background: #F3F6F9;
|
||||
|
||||
::v-deep .mainPane {
|
||||
padding: 24px 24px 126px;
|
||||
|
||||
.formBox {
|
||||
width: 100%;
|
||||
min-height: 220px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
& > div {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
b {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 32px;
|
||||
color: #333;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
|
||||
span {
|
||||
white-space: nowrap;
|
||||
padding: 0 16px;
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #D1D2D5;
|
||||
margin-bottom: 4px;
|
||||
|
||||
&:first-of-type {
|
||||
border-left: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin-top: 30px;
|
||||
font-size: 26px;
|
||||
|
||||
.dot {
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
background: #3CB300;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.submitCount {
|
||||
width: 118px;
|
||||
|
||||
b {
|
||||
color: #1EA0FA;
|
||||
}
|
||||
|
||||
& > div {
|
||||
font-size: 22px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.split {
|
||||
width: 2px;
|
||||
background: #f5f5f5;
|
||||
margin: 0 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user