清理组件残余
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<template v-if="showDetail">
|
||||
<form-detail/>
|
||||
</template>
|
||||
<ai-result v-else :tips="errMsg" :status="errStatus"/>
|
||||
<AiResult v-else :tips="errMsg" :status="errStatus"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -93,12 +93,12 @@
|
||||
<div class="add-form__footer">
|
||||
<div class="add-form__footer--item-wrapper">
|
||||
<div class="add-form__footer--item" @click="toPreview">
|
||||
<image :src="`${$cdn}sass/preview.png`">
|
||||
<span>预览</span>
|
||||
<image :src="`${$cdn}sass/preview.png`"/>
|
||||
<span>预览</span>
|
||||
</div>
|
||||
<div class="add-form__footer--item" @click="toSetting">
|
||||
<image :src="`${$cdn}sass/setting.png`">
|
||||
<span>设置</span>
|
||||
<image :src="`${$cdn}sass/setting.png`"/>
|
||||
<span>设置</span>
|
||||
</div>
|
||||
</div>
|
||||
<div @click="onConfirm">立即发布</div>
|
||||
@@ -123,16 +123,16 @@
|
||||
</div>
|
||||
<div class="detail" v-if="isShowConfig">
|
||||
<component
|
||||
:is="component"
|
||||
:index="filedIndex"
|
||||
:filed="filed"
|
||||
@change="onChange"
|
||||
:targetListData="targetList"
|
||||
:formData="form"
|
||||
:filedType="filedType"
|
||||
@back="isShowConfig = false"
|
||||
:id="id"
|
||||
:formConfig="formConfig">
|
||||
:is="component"
|
||||
:index="filedIndex"
|
||||
:filed="filed"
|
||||
@change="onChange"
|
||||
:targetListData="targetList"
|
||||
:formData="form"
|
||||
:filedType="filedType"
|
||||
@back="isShowConfig = false"
|
||||
:id="id"
|
||||
:formConfig="formConfig">
|
||||
</component>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,7 +143,6 @@ import draggable from 'vuedraggable'
|
||||
import FiledConfig from './FiledConfig'
|
||||
import FormSetting from './FormSetting'
|
||||
import PreviewForm from './PreviewForm'
|
||||
import AiBack from "../../../components/AiBack";
|
||||
|
||||
export default {
|
||||
props: ['params'],
|
||||
@@ -187,7 +186,6 @@ export default {
|
||||
},
|
||||
|
||||
components: {
|
||||
AiBack,
|
||||
draggable,
|
||||
PreviewForm,
|
||||
FormSetting,
|
||||
@@ -656,32 +654,32 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.add-form__footer--item-wrapper {
|
||||
.add-form__footer--item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
.add-form__footer--item-wrapper {
|
||||
.add-form__footer--item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
|
||||
image {
|
||||
display: block;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
image {
|
||||
display: block;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
span {
|
||||
display: block;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28px;
|
||||
|
||||
&:active {
|
||||
background: #eee;
|
||||
}
|
||||
&:active {
|
||||
background: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add-form__btn {
|
||||
display: flex;
|
||||
|
||||
@@ -147,8 +147,6 @@ export default {
|
||||
mounted () {
|
||||
if (this.index !== '') {
|
||||
this.config = this.filed
|
||||
this.index = this.index
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="form">
|
||||
<ai-top-fixed>
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入标题" :show-action="false" search-icon-color="#ccc" v-model="search.title"
|
||||
@search="isMore = false, search.current = 1, getList()"/>
|
||||
</ai-top-fixed>
|
||||
</AiTopFixed>
|
||||
<scroll-view show-scrollbar scroll-y @scrolltolower="getList" class="form-list">
|
||||
<div class="form-item" v-for="(item, index) in list" :key="index"
|
||||
@click="showPopup(item)">
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 30rpx"></div>
|
||||
<ai-empty v-if="!list.length && isMore"></ai-empty>
|
||||
<AiEmpty v-if="!list.length && isMore"></AiEmpty>
|
||||
</scroll-view>
|
||||
<u-popup v-model="isShow" :closeable="false" mode="bottom" :z-index="11">
|
||||
<div class="popup">
|
||||
@@ -86,14 +86,10 @@
|
||||
|
||||
<script>
|
||||
import {mapActions} from 'vuex'
|
||||
import AiTopFixed from "../../../components/AiTopFixed";
|
||||
import AiEmpty from "../../../components/AiEmpty";
|
||||
import AiOpenData from "../../../components/AiOpenData";
|
||||
|
||||
export default {
|
||||
name: 'formList',
|
||||
label: '表单列表',
|
||||
components: {AiEmpty, AiTopFixed, AiOpenData},
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
|
||||
@@ -66,10 +66,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AiBack from "../../../components/AiBack";
|
||||
|
||||
export default {
|
||||
components: {AiBack},
|
||||
props: ['formData', 'targetListData'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
<add-list ref="addList" v-if="currIndex === 1" @change="onChange"></add-list>
|
||||
<list ref="list" v-if="currIndex === 0" @change="onChange"></list>
|
||||
</div>
|
||||
<ai-tabbar :active.sync="currIndex" :list="tabBar"/>
|
||||
<AiTabbar :active.sync="currIndex" :list="tabBar"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddList from './AddList.vue'
|
||||
import List from './List.vue'
|
||||
import AiTabbar from "../../../components/AiTabbar";
|
||||
|
||||
export default {
|
||||
name: 'AppAskForm',
|
||||
@@ -24,7 +23,6 @@ export default {
|
||||
},
|
||||
|
||||
components: {
|
||||
AiTabbar,
|
||||
AddList,
|
||||
List
|
||||
},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<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>
|
||||
<div flex class="scorePane">
|
||||
<div>成绩</div>
|
||||
<div class="fill"><em v-html="score"/> 分</div>
|
||||
</div>
|
||||
</template>
|
||||
</ai-result>
|
||||
</AiResult>
|
||||
<template v-else-if="form.id">
|
||||
<image v-if="form.headPicture" class="headPicture" :src="form.headPicture"/>
|
||||
<b class="title">{{ form.title || "标题" }}</b>
|
||||
@@ -22,14 +22,14 @@
|
||||
<textarea v-model="op.fieldValue" :disabled="isResult" :placeholder="op.fieldInfo.placeholder"/>
|
||||
</template>
|
||||
<template v-else-if="op.fieldType=='upload'">
|
||||
<ai-uploader @list="v=>op.fieldValue=v.map(e=>e.url)" :def="op.fieldValue" :disabled="isResult"
|
||||
preview action="/admin/file/add2"/>
|
||||
<AiUploader @list="v=>op.fieldValue=v.map(e=>e.url)" :def="op.fieldValue" :disabled="isResult"
|
||||
preview action="/admin/file/add2"/>
|
||||
</template>
|
||||
<u-row v-else-if="op.fieldType=='radio'">
|
||||
<radio-group @change="({detail})=>op.fieldValue=detail.value">
|
||||
<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"/>
|
||||
<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>
|
||||
</radio-group>
|
||||
@@ -39,19 +39,19 @@
|
||||
<div class="option" flex v-for="option in op.fieldInfo.options" :key="option.label">
|
||||
<checkbox :value="option.label" :disabled="isResult"
|
||||
: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>
|
||||
</checkbox-group>
|
||||
</u-row>
|
||||
<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="label fill" v-if="op.fieldValue">{{ op.fieldValue.toString() }}</div>
|
||||
<i class="fill" v-else>请选择</i>
|
||||
<u-icon name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
</ai-select>
|
||||
</AiSelect>
|
||||
</template>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
@@ -59,33 +59,17 @@
|
||||
<div class="bottomBtn" @tap="handleSubmit">提交</div>
|
||||
</div>
|
||||
</template>
|
||||
<ai-loading v-else tips="调查问卷加载中..."/>
|
||||
<AiLoading v-else tips="调查问卷加载中..."/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
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 {
|
||||
name: "formDetail",
|
||||
inject: {root: {}},
|
||||
components: {
|
||||
AiBack,
|
||||
AiImage,
|
||||
AiResult,
|
||||
AiLoading,
|
||||
AiSelect,
|
||||
AiUploader,
|
||||
AiTextarea,
|
||||
},
|
||||
computed: {
|
||||
...mapState(['openUser', 'token']),
|
||||
isExam() {
|
||||
@@ -126,7 +110,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitShow(){
|
||||
emitShow() {
|
||||
document.title = this.form.title || "调查问卷"
|
||||
},
|
||||
getForm() {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<ai-back/>
|
||||
<AiBack/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user