Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wanglei
2021-12-13 11:45:10 +08:00
8 changed files with 50 additions and 78 deletions

View File

@@ -3,7 +3,7 @@
<template v-if="showDetail"> <template v-if="showDetail">
<form-detail/> <form-detail/>
</template> </template>
<ai-result v-else :tips="errMsg" :status="errStatus"/> <AiResult v-else :tips="errMsg" :status="errStatus"/>
</section> </section>
</template> </template>

View File

@@ -93,12 +93,12 @@
<div class="add-form__footer"> <div class="add-form__footer">
<div class="add-form__footer--item-wrapper"> <div class="add-form__footer--item-wrapper">
<div class="add-form__footer--item" @click="toPreview"> <div class="add-form__footer--item" @click="toPreview">
<image :src="`${$cdn}sass/preview.png`"> <image :src="`${$cdn}sass/preview.png`"/>
<span>预览</span> <span>预览</span>
</div> </div>
<div class="add-form__footer--item" @click="toSetting"> <div class="add-form__footer--item" @click="toSetting">
<image :src="`${$cdn}sass/setting.png`"> <image :src="`${$cdn}sass/setting.png`"/>
<span>设置</span> <span>设置</span>
</div> </div>
</div> </div>
<div @click="onConfirm">立即发布</div> <div @click="onConfirm">立即发布</div>
@@ -123,16 +123,16 @@
</div> </div>
<div class="detail" v-if="isShowConfig"> <div class="detail" v-if="isShowConfig">
<component <component
:is="component" :is="component"
:index="filedIndex" :index="filedIndex"
:filed="filed" :filed="filed"
@change="onChange" @change="onChange"
:targetListData="targetList" :targetListData="targetList"
:formData="form" :formData="form"
:filedType="filedType" :filedType="filedType"
@back="isShowConfig = false" @back="isShowConfig = false"
:id="id" :id="id"
:formConfig="formConfig"> :formConfig="formConfig">
</component> </component>
</div> </div>
</div> </div>
@@ -143,7 +143,6 @@ import draggable from 'vuedraggable'
import FiledConfig from './FiledConfig' import FiledConfig from './FiledConfig'
import FormSetting from './FormSetting' import FormSetting from './FormSetting'
import PreviewForm from './PreviewForm' import PreviewForm from './PreviewForm'
import AiBack from "../../../components/AiBack";
export default { export default {
props: ['params'], props: ['params'],
@@ -187,7 +186,6 @@ export default {
}, },
components: { components: {
AiBack,
draggable, draggable,
PreviewForm, PreviewForm,
FormSetting, FormSetting,
@@ -656,32 +654,32 @@ export default {
} }
} }
.add-form__footer--item-wrapper { .add-form__footer--item-wrapper {
.add-form__footer--item { .add-form__footer--item {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
image { image {
display: block; display: block;
width: 48px; width: 48px;
height: 48px; height: 48px;
margin: 0 auto; margin: 0 auto;
} }
span { span {
display: block; display: block;
text-align: center; text-align: center;
color: #999; color: #999;
font-size: 28px; font-size: 28px;
&:active { &:active {
background: #eee; background: #eee;
}
} }
} }
} }
}
.add-form__btn { .add-form__btn {
display: flex; display: flex;

View File

@@ -147,8 +147,6 @@ export default {
mounted () { mounted () {
if (this.index !== '') { if (this.index !== '') {
this.config = this.filed this.config = this.filed
this.index = this.index
return false return false
} }

View File

@@ -1,9 +1,9 @@
<template> <template>
<div class="form"> <div class="form">
<ai-top-fixed> <AiTopFixed>
<u-search placeholder="请输入标题" :show-action="false" search-icon-color="#ccc" v-model="search.title" <u-search placeholder="请输入标题" :show-action="false" search-icon-color="#ccc" v-model="search.title"
@search="isMore = false, search.current = 1, getList()"/> @search="isMore = false, search.current = 1, getList()"/>
</ai-top-fixed> </AiTopFixed>
<scroll-view show-scrollbar scroll-y @scrolltolower="getList" class="form-list"> <scroll-view show-scrollbar scroll-y @scrolltolower="getList" class="form-list">
<div class="form-item" v-for="(item, index) in list" :key="index" <div class="form-item" v-for="(item, index) in list" :key="index"
@click="showPopup(item)"> @click="showPopup(item)">
@@ -28,7 +28,7 @@
</div> </div>
</div> </div>
<div style="height: 30rpx"></div> <div style="height: 30rpx"></div>
<ai-empty v-if="!list.length && isMore"></ai-empty> <AiEmpty v-if="!list.length && isMore"></AiEmpty>
</scroll-view> </scroll-view>
<u-popup v-model="isShow" :closeable="false" mode="bottom" :z-index="11"> <u-popup v-model="isShow" :closeable="false" mode="bottom" :z-index="11">
<div class="popup"> <div class="popup">
@@ -86,14 +86,10 @@
<script> <script>
import {mapActions} from 'vuex' import {mapActions} from 'vuex'
import AiTopFixed from "../../../components/AiTopFixed";
import AiEmpty from "../../../components/AiEmpty";
import AiOpenData from "../../../components/AiOpenData";
export default { export default {
name: 'formList', name: 'formList',
label: '表单列表', label: '表单列表',
components: {AiEmpty, AiTopFixed, AiOpenData},
data() { data() {
return { return {
search: { search: {

View File

@@ -66,10 +66,8 @@
</template> </template>
<script> <script>
import AiBack from "../../../components/AiBack";
export default { export default {
components: {AiBack},
props: ['formData', 'targetListData'], props: ['formData', 'targetListData'],
data() { data() {
return { return {

View File

@@ -4,14 +4,13 @@
<add-list ref="addList" v-if="currIndex === 1" @change="onChange"></add-list> <add-list ref="addList" v-if="currIndex === 1" @change="onChange"></add-list>
<list ref="list" v-if="currIndex === 0" @change="onChange"></list> <list ref="list" v-if="currIndex === 0" @change="onChange"></list>
</div> </div>
<ai-tabbar :active.sync="currIndex" :list="tabBar"/> <AiTabbar :active.sync="currIndex" :list="tabBar"/>
</div> </div>
</template> </template>
<script> <script>
import AddList from './AddList.vue' import AddList from './AddList.vue'
import List from './List.vue' import List from './List.vue'
import AiTabbar from "../../../components/AiTabbar";
export default { export default {
name: 'AppAskForm', name: 'AppAskForm',
@@ -24,7 +23,6 @@ export default {
}, },
components: { components: {
AiTabbar,
AddList, AddList,
List List
}, },

View File

@@ -1,13 +1,13 @@
<template> <template>
<section class="formDetail"> <section class="formDetail">
<ai-result v-if="result.tips" v-bind="result"> <AiResult v-if="result.tips" v-bind="result">
<template v-if="isExam" #extra> <template v-if="isExam" #extra>
<div flex class="scorePane"> <div flex class="scorePane">
<div>成绩</div> <div>成绩</div>
<div class="fill"><em v-html="score"/> </div> <div class="fill"><em v-html="score"/> </div>
</div> </div>
</template> </template>
</ai-result> </AiResult>
<template v-else-if="form.id"> <template v-else-if="form.id">
<image v-if="form.headPicture" class="headPicture" :src="form.headPicture"/> <image v-if="form.headPicture" class="headPicture" :src="form.headPicture"/>
<b class="title">{{ form.title || "标题" }}</b> <b class="title">{{ form.title || "标题" }}</b>
@@ -22,14 +22,14 @@
<textarea v-model="op.fieldValue" :disabled="isResult" :placeholder="op.fieldInfo.placeholder"/> <textarea v-model="op.fieldValue" :disabled="isResult" :placeholder="op.fieldInfo.placeholder"/>
</template> </template>
<template v-else-if="op.fieldType=='upload'"> <template v-else-if="op.fieldType=='upload'">
<ai-uploader @list="v=>op.fieldValue=v.map(e=>e.url)" :def="op.fieldValue" :disabled="isResult" <AiUploader @list="v=>op.fieldValue=v.map(e=>e.url)" :def="op.fieldValue" :disabled="isResult"
preview action="/admin/file/add2"/> preview action="/admin/file/add2"/>
</template> </template>
<u-row v-else-if="op.fieldType=='radio'"> <u-row v-else-if="op.fieldType=='radio'">
<radio-group @change="({detail})=>op.fieldValue=detail.value"> <radio-group @change="({detail})=>op.fieldValue=detail.value">
<div class="option" flex v-for="option in op.fieldInfo.options" :key="option.label"> <div class="option" flex v-for="option in op.fieldInfo.options" :key="option.label">
<radio :value="option.label" :disabled="isResult" :checked="op.fieldValue==option.label"/> <radio :value="option.label" :disabled="isResult" :checked="op.fieldValue==option.label"/>
<ai-image v-if="option.img" :src="option.img" preview/> <AiImage v-if="option.img" :src="option.img" preview/>
<div class="label fill">{{ option.label }}</div> <div class="label fill">{{ option.label }}</div>
</div> </div>
</radio-group> </radio-group>
@@ -39,19 +39,19 @@
<div class="option" flex v-for="option in op.fieldInfo.options" :key="option.label"> <div class="option" flex v-for="option in op.fieldInfo.options" :key="option.label">
<checkbox :value="option.label" :disabled="isResult" <checkbox :value="option.label" :disabled="isResult"
:checked="option.checked"/> :checked="option.checked"/>
<ai-image v-if="option.img" :src="option.img" preview/> <AiImage v-if="option.img" :src="option.img" preview/>
<div class="label fill">{{ option.label }}</div> <div class="label fill">{{ option.label }}</div>
</div> </div>
</checkbox-group> </checkbox-group>
</u-row> </u-row>
<template v-else-if="op.fieldType=='select'"> <template v-else-if="op.fieldType=='select'">
<ai-select @data="v=>op.fieldValue=v.map(e=>e.value)" :list="op.fieldInfo.options" :disabled="isResult"> <AiSelect @data="v=>op.fieldValue=v.map(e=>e.value)" :list="op.fieldInfo.options" :disabled="isResult">
<div class="option" flex> <div class="option" flex>
<div class="label fill" v-if="op.fieldValue">{{ op.fieldValue.toString() }}</div> <div class="label fill" v-if="op.fieldValue">{{ op.fieldValue.toString() }}</div>
<i class="fill" v-else>请选择</i> <i class="fill" v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/> <u-icon name="arrow-right" color="#ddd"/>
</div> </div>
</ai-select> </AiSelect>
</template> </template>
</u-form-item> </u-form-item>
</u-form> </u-form>
@@ -59,33 +59,17 @@
<div class="bottomBtn" @tap="handleSubmit">提交</div> <div class="bottomBtn" @tap="handleSubmit">提交</div>
</div> </div>
</template> </template>
<ai-loading v-else tips="调查问卷加载中..."/> <AiLoading v-else tips="调查问卷加载中..."/>
</section> </section>
</template> </template>
<script> <script>
import {mapState} from "vuex"; import {mapState} from "vuex";
import AiTextarea from "../../../components/AiTextarea";
import AiUploader from "../../../components/AiUploader";
import AiSelect from "../../../components/AiSelect";
import AiLoading from "../../../components/AiLoading";
import AiResult from "../../../components/AiResult";
import AiImage from "../../../components/AiImage";
import AiBack from "../../../components/AiBack";
export default { export default {
name: "formDetail", name: "formDetail",
inject: {root: {}}, inject: {root: {}},
components: {
AiBack,
AiImage,
AiResult,
AiLoading,
AiSelect,
AiUploader,
AiTextarea,
},
computed: { computed: {
...mapState(['openUser', 'token']), ...mapState(['openUser', 'token']),
isExam() { isExam() {
@@ -126,7 +110,7 @@ export default {
} }
}, },
methods: { methods: {
emitShow(){ emitShow() {
document.title = this.form.title || "调查问卷" document.title = this.form.title || "调查问卷"
}, },
getForm() { getForm() {

View File

@@ -28,7 +28,7 @@
</div> </div>
</div> </div>
</template> </template>
<ai-back/> <AiBack/>
</div> </div>
</template> </template>