微信登录问卷表单
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppAskForm',
|
name: 'AppAskForm',
|
||||||
appName: '问卷表单',
|
appName: '问卷表单管理',
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="askForm">
|
<section class="askForm">
|
||||||
<template v-if="showDetail&&!isManager">
|
<template v-if="showDetail">
|
||||||
<form-detail/>
|
<form-detail/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="isManager">
|
|
||||||
<form-list ref="FormList"/>
|
|
||||||
</template>
|
|
||||||
<ai-loading v-else :tips="errMsg"/>
|
<ai-loading v-else :tips="errMsg"/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -14,22 +11,16 @@
|
|||||||
import AiLoading from "../../components/AiLoading";
|
import AiLoading from "../../components/AiLoading";
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
import FormDetail from "./formDetail";
|
import FormDetail from "./formDetail";
|
||||||
import FormList from "./formList";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "askForm",
|
name: "askForm",
|
||||||
components: {FormList, FormDetail, AiLoading},
|
appName: "问卷表单",
|
||||||
|
components: {FormDetail, AiLoading},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['openUser', 'user']),
|
...mapState(['openUser', 'user']),
|
||||||
showDetail() {
|
showDetail() {
|
||||||
return !!this.$route.query?.id
|
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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -65,14 +65,10 @@
|
|||||||
|
|
||||||
<script>
|
<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 {mapActions, mapState} from "vuex";
|
||||||
import UInput from "../../uview/components/u-input/u-input";
|
|
||||||
import AiTextarea from "../../components/AiTextarea";
|
import AiTextarea from "../../components/AiTextarea";
|
||||||
import AiUploader from "../../components/AiUploader";
|
import AiUploader from "../../components/AiUploader";
|
||||||
import AiSelect from "../../components/AiSelect";
|
import AiSelect from "../../components/AiSelect";
|
||||||
import URadio from "../../uview/components/u-radio/u-radio";
|
|
||||||
import AiLoading from "../../components/AiLoading";
|
import AiLoading from "../../components/AiLoading";
|
||||||
import AiResult from "../../components/AiResult";
|
import AiResult from "../../components/AiResult";
|
||||||
import AiImage from "../../components/AiImage";
|
import AiImage from "../../components/AiImage";
|
||||||
@@ -85,13 +81,9 @@ export default {
|
|||||||
AiImage,
|
AiImage,
|
||||||
AiResult,
|
AiResult,
|
||||||
AiLoading,
|
AiLoading,
|
||||||
URadio,
|
|
||||||
AiSelect,
|
AiSelect,
|
||||||
AiUploader,
|
AiUploader,
|
||||||
AiTextarea,
|
AiTextarea,
|
||||||
UInput,
|
|
||||||
UFormItem,
|
|
||||||
UForm
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['openUser', 'token']),
|
...mapState(['openUser', 'token']),
|
||||||
@@ -220,14 +212,9 @@ export default {
|
|||||||
this.checkUser = true
|
this.checkUser = true
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
let {query: {id}, hash} = this.$route,
|
let {query: {id}} = this.$route,
|
||||||
{openId} = this.openUser
|
{openId} = this.openUser
|
||||||
if (hash != "#form") {
|
if (openId) {
|
||||||
this.result = {
|
|
||||||
tips: "非法的调查问卷链接",
|
|
||||||
status: "error"
|
|
||||||
}
|
|
||||||
} else if (openId) {
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
|
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, {
|
||||||
params: {id, openId}
|
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>
|
|
||||||
@@ -37,14 +37,17 @@ export default {
|
|||||||
...mapActions(['getToken']),
|
...mapActions(['getToken']),
|
||||||
...mapMutations(['login']),
|
...mapMutations(['login']),
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.loginForm.validate().then(v => {
|
this.$refs.loginForm.validate(v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
this.getToken(this.form).then(() => {
|
this.getToken(this.form).then(() => {
|
||||||
uni.navigateBack({})
|
uni.navigateBack({})
|
||||||
}).catch(() => 0)
|
}).catch(() => 0)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs.loginForm.setRules(this.rules)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ const store = new Vuex.Store({
|
|||||||
actions: {
|
actions: {
|
||||||
getToken(state, params) {
|
getToken(state, params) {
|
||||||
const encryptByDES = password => {
|
const encryptByDES = password => {
|
||||||
let isIos = wx.getSystemInfoSync().system.toUpperCase === 'ios'
|
let isIos = uni.getSystemInfoSync().system.toUpperCase == 'ios'
|
||||||
let key = "thanks,villcloud"
|
let key = "thanks,villcloud"
|
||||||
let iv = CryptoJS.enc.Latin1.parse(key)
|
let iv = CryptoJS.enc.Latin1.parse(key)
|
||||||
let encrypted = CryptoJS.AES.encrypt(password, iv, {
|
let encrypted = CryptoJS.AES.encrypt(password, iv, {
|
||||||
|
|||||||
Reference in New Issue
Block a user