wangqing 4 years ago
parent
commit
9f9307109b
  1. BIN
      src/assets/images/form-bg.png
  2. 2
      src/assets/styles/form/home.scss
  3. 3
      src/components/generator/config.js
  4. 45
      src/components/parser/Parser.vue
  5. 15
      src/views/form/editor/RightPanel.vue
  6. 34
      src/views/form/editor/index.vue
  7. 27
      src/views/form/index.vue
  8. 32
      src/views/form/publish/index.vue
  9. 295
      src/views/form/setting/index.vue
  10. 27
      src/views/form/statistics/item.vue
  11. 40
      src/views/form/statistics/list.vue
  12. 17
      src/views/form/write/index.vue
  13. 4
      src/views/project/my/index.vue

BIN
src/assets/images/form-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

2
src/assets/styles/form/home.scss

@ -87,7 +87,7 @@ $lighterBlue: #1890ff;
}
.empty-info {
position: absolute;
top: 46%;
top: 36%;
left: 0;
right: 0;
text-align: center;

3
src/components/generator/config.js

@ -795,6 +795,7 @@ export const personalInfoComponents = [
layout: 'colFormItem',
span: 24,
showRegList: false,
regList: [],
document: 'https://element.eleme.cn/#/zh-CN/component/input'
},
placeholder: '请选择省市县',
@ -814,6 +815,7 @@ export const personalInfoComponents = [
layout: 'colFormItem',
span: 24,
showRegList: false,
regList: [],
document: 'https://element.eleme.cn/#/zh-CN/component/input'
},
placeholder: '请选择位置',
@ -833,6 +835,7 @@ export const personalInfoComponents = [
layout: 'colFormItem',
span: 24,
showRegList: false,
regList: [],
document: 'https://element.eleme.cn/#/zh-CN/component/input'
},
placeholder: '请验证手机号',

45
src/components/parser/Parser.vue

@ -31,6 +31,7 @@ const layouts = {
let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
if (config.showLabel === false) labelWidth = '0'
let label = config.label
//
if (formConfCopy.showNumber) {
label = scheme.serialNumber + ': ' + label
}
@ -257,25 +258,35 @@ function setValueLabel(event, config, scheme) {
let tagOptionKey = processType[config.tag]
if (tagOptionKey) {
if (event instanceof Array) {
//
let labelArr = new Array()
if(!event.includes(0)){
// other
this.$set(this[this.formConf.labelFormModel], `${scheme.__vModel__}other`, '')
//
document.querySelector('.'+config.tag).querySelector(".item-other-input").value = ""
}
event.forEach(item => {
//
if (item === 0) {
labelArr.push(this[this.formConf.labelFormModel][`${scheme.__vModel__}other`])
} else if (item) {
let {label} = getObject(_.get(scheme, tagOptionKey), 'value', item)
labelArr.push(label)
}
})
this.$set(this[this.formConf.labelFormModel], scheme.__vModel__, labelArr.join(','))
} else {
//
//
if (event == 0) {
console.log(this[this.formConf.labelFormModel][`${scheme.__vModel__}other`])
this.$set(this[this.formConf.labelFormModel], `${scheme.__vModel__}`, this[this.formConf.labelFormModel][`${scheme.__vModel__}other`])
// labelfieldfieldother
let item = _.find(_.get(scheme, tagOptionKey), {'value': event})
this.$set(this[this.formConf.labelFormModel], scheme.__vModel__, item.label)
this.$set(this[this.formConf.labelFormModel], `${scheme.__vModel__}other`,this[this.formConf.labelFormModel][`${scheme.__vModel__}other`])
} else {
let item = _.find(_.get(scheme, tagOptionKey), {'value': event})
this.$set(this[this.formConf.labelFormModel], scheme.__vModel__, item.label)
// other
this.$set(this[this.formConf.labelFormModel], `${scheme.__vModel__}other`,'')
//
document.querySelector('.'+config.tag).querySelector(".item-other-input").value = ""
}
}
} else if (config.tag === 'el-upload') {
@ -404,7 +415,25 @@ export default {
}, trigger: 'change'
})
}
//
const validateOtherInput = (rule, value, callback) => {
// 0
if (value == 0 || (Array.isArray(value) && value.includes(0))) {
if (!this[this.formConf.labelFormModel][`${rule.field}other`]) {
callback(new Error('请输入其他内容'))
} else {
callback()
}
} else {
callback()
}
}
if (Array.isArray(config.regList)) {
//
if (['RADIO', 'CHECKBOX'].includes(cur.typeId)) {
const required = {validator: validateOtherInput, message: cur.placeholder}
config.regList.push(required)
}
if (config.required) {
const required = {required: config.required, message: cur.placeholder}
if (Array.isArray(config.defaultValue)) {
@ -459,12 +488,14 @@ export default {
::v-deep .el-checkbox-group {
margin-left: 10px;
}
::v-deep .el-radio,
::v-deep .el-checkbox {
display: block;
min-height: 23px;
line-height: 23px;
}
::v-deep .el-radio__label,
::v-deep .el-checkbox__label {
font-size: 14px;
@ -475,10 +506,12 @@ export default {
vertical-align: middle;
display: inline-block;
}
::v-deep .item-other-input {
margin-left: 20px !important;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important;
}
::v-deep .item-other-input:focus {
outline: none !important;
}

15
src/views/form/editor/RightPanel.vue

@ -1404,9 +1404,16 @@ export default {
addSelectItem() {
let lastItem = _.last(this.activeData.__slot__.options);
this.activeData.__slot__.options.push({
label: '',
value: lastItem ? lastItem.value === 0 ? _.max(_.values(this.activeData.__slot__.options.map(item =>
item.value))) + 1 : lastItem.value + 1 : 1
label: "",
value: lastItem
? lastItem.value === 0
? _.max(
_.values(
this.activeData.__slot__.options.map((item) => item.value)
)
) + 1
: lastItem.value + 1
: 1,
});
},
async blukAddSelectItems() {
@ -1617,7 +1624,7 @@ export default {
.right-board {
width: 350px;
position: absolute;
right: 17px;
right: 0px;
top: 0;
padding-top: 3px;
background-color: #fff;

34
src/views/form/editor/index.vue

@ -37,7 +37,7 @@
<el-scrollbar class="center-scrollbar">
<el-row v-if="formConf" :gutter="formConf.gutter" class="center-board-row">
<el-row align="middle" justify="center" type="flex">
<el-col :span="20" class="text-center">
<el-col class="form-head-title">
<h4 class="form-name-text" contenteditable="true"
@blur="(event)=>{
this.formConf.title=event.target.innerText;
@ -48,7 +48,7 @@
</el-col>
</el-row>
<el-row align="middle" justify="center" type="flex">
<el-col :span="23">
<el-col class="form-head-desc">
<Tinymce v-if="editDescription" v-model="formConf.description"
placeholder="请输入表单描述"
@blur="editDescription=false" @input="saveProjectInfo"
@ -64,7 +64,7 @@
<!-- </p>-->
</el-col>
</el-row>
<el-divider />
<el-divider class="form-head-divider" />
<el-form
:disabled="formConf.disabled"
:label-position="formConf.labelPosition"
@ -89,7 +89,8 @@
/>
</draggable>
<div v-show="!drawingList.length" class="empty-info">
从左侧拖入或点选组件进行表单设计
<img style="width: 20%" src="@/assets/images/form-bg.png">
<p>从左侧拖入或点选组件进行表单设计</p>
</div>
</el-form>
</el-row>
@ -420,8 +421,33 @@ export default {
@import '@/assets/styles/form/index';
</style>
<style lang="scss" scoped>
.center-board {
.center-board-row {
margin-right: 10px;
}
.form-head-title {
padding: 0 10px;
text-align: center;
.form-name-text:hover{
border: 1px dashed #7b7b7b;
min-height: 100px;
}
}
.form-head-desc {
padding: 0 10px;
}
.form-head-divider {
margin-right: 10px;
margin-left: 10px;
width: auto;
}
}
</style>

27
src/views/form/index.vue

@ -1,29 +1,22 @@
<template>
<div class="form-index-container">
<el-card class="header-container">
<el-row align="middle" type="flex">
<el-col :span="2">
<el-row align="middle" type="flex" :gutter="5">
<i class="el-icon-back" @click="$router.back(-1)" />
</el-col>
<el-col :span="3" :md="6">
<img class="header-logo" src="@/assets/images/indexLogo.svg" @click="$router.push({path:'/home'})">
</el-col>
<el-col :span="1" :md="3">
<el-col />
<el-button type="primary" icon="el-icon-view" @click="previewDialogVisible=true">
预览
</el-button>
</el-col>
<el-col :span="2" :md="3">
<el-button type="success" icon="el-icon-folder-add" @click="saveProjectAsTemplateHandle">
保存为模板
</el-button>
</el-col>
</el-row>
</el-card>
<div class="main-container">
<div class="left-menu-container">
<el-menu :collapse="isCollapse" class="el-menu-vertical"
:default-active="defaultActiveMenu"
<el-menu :collapse="isCollapse" :default-active="defaultActiveMenu"
class="el-menu-vertical"
@select="menuSelectHandle"
>
<el-menu-item v-for="menuItem in menuItemList" :key="menuItem.route" :index="menuItem.route">
@ -40,20 +33,23 @@
</div>
<el-dialog
:visible.sync="previewDialogVisible"
destroy-on-close
fullscreen
>
<pre-view :preview-qrcode="true" />
<pre-view :key="previewKey" :preview-qrcode="true" />
</el-dialog>
</div>
</template>
<script>
import PreView from '@/views/form/preview'
export default {
name: 'NewIndex',
components: {PreView},
data() {
return {
previewKey: +new Date(),
previewDialogVisible: false,
defaultActiveMenu: 'editor',
projectKey: null,
@ -99,6 +95,10 @@ export default {
menuSelectHandle(index) {
this.$router.replace({path: index, query: {key: this.projectKey}})
},
openPreviewHandle() {
this.previewKey = +new Date()
this.previewDialogVisible = true
},
saveProjectAsTemplateHandle() {
this.$api.post('/user/project/template/save', {key: this.projectKey}).then(() => {
this.msgSuccess('保存成功')
@ -132,13 +132,14 @@ export default {
.header-container {
width: 100%;
height: 50px;
padding: 0 20px;
.el-icon-back {
font-size: 22px;
font-weight: 550;
cursor: pointer;
color: #000;
margin-left: 40px;
margin-right: 75px;
&:hover {
color: rgb(32, 160, 255);

32
src/views/form/publish/index.vue

@ -13,7 +13,22 @@
</div>
<div v-if="publishStatus" class="publish-finish-view">
<el-row :gutter="10" align="middle" type="flex">
<el-col :span="20">
<el-col>
<div>
<vue-qr v-if="writeLink" :callback="qrCodeGenSuccess" :size="194"
:text="writeLink"
/>
</div>
<div style="text-align: center;">
<el-link type="primary" @click="()=>{
this.downloadFile('qrcode.png',this.qrCodeUrl)
}"
>
下载分享二维码
</el-link>
</div>
</el-col>
<el-col style="margin-left: 75px;">
<div style="display: flex; justify-content: center;">
<div class="icon-view">
<i class="el-icon-check success-icon" />
@ -52,21 +67,6 @@
</el-col>
</el-row>
</el-col>
<el-col :span="6">
<div>
<vue-qr v-if="writeLink" :callback="qrCodeGenSuccess" :size="194"
:text="writeLink"
/>
</div>
<div style="text-align: center;">
<el-link type="primary" @click="()=>{
this.downloadFile('qrcode.png',this.qrCodeUrl)
}"
>
下载分享二维码
</el-link>
</div>
</el-col>
</el-row>
</div>
</div>

295
src/views/form/setting/index.vue

@ -1,11 +1,11 @@
<template>
<el-form ref="setting" :model="userProjectSettingData" :rules="settingRules">
<el-row class="project-setting-container" type="flex" justify="center" align="top">
<el-col :span="5" :offset="3" class="project-setting-view">
<el-row align="top" class="project-setting-container" justify="center" type="flex">
<el-col :offset="3" :span="5" class="project-setting-view">
<p class="project-setting-title">
提交设置
</p>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">显示提示图片</p>
</el-col>
@ -19,8 +19,8 @@
<div v-if="projectSetting.showPromptImg">
<div class="block">
<el-image
class="submit-prompt-img"
:src="userProjectSettingData.submitPromptImg"
class="submit-prompt-img"
fit="cover "
>
<div slot="error" class="image-slot">
@ -30,16 +30,16 @@
</div>
<el-upload
ref="logoUpload"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadSubmitPromptHandle"
:action="getUploadUrl"
:show-file-list="false"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
>
<el-button slot="trigger" size="small" type="text">请上传提示图片 *</el-button>
</el-upload>
</div>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">显示提示文字</p>
</el-col>
@ -56,13 +56,13 @@
<el-row v-if="projectSetting.showPromptText">
<el-col :span="20" class="setting-input">
<el-input v-model="userProjectSettingData.submitPromptText"
:show-word-limit="true"
:maxlength="50"
:show-word-limit="true"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">跳转网页地址</p>
</el-col>
@ -80,14 +80,14 @@
<el-col :span="20" class="setting-input">
<el-input
v-model="userProjectSettingData.submitJumpUrl"
placeholder="https://demo.tduckapp.com"
:show-word-limit="true"
:maxlength="50"
:show-word-limit="true"
placeholder="https://demo.tduckapp.com"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">公开反馈结果</p>
</el-col>
@ -105,7 +105,7 @@
<p class="project-setting-title">
回收设置
</p>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">只在微信中填写</p>
</el-col>
@ -116,7 +116,7 @@
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">定时收集表单</p>
</el-col>
@ -133,19 +133,19 @@
</el-col>
</el-row>
<div v-if="projectSetting.timingCollectForm">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">收集时间</p>
</el-col>
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionBeginTime"
type="datetime"
style="width: 100%; border: none;"
align="center"
class="collection-date-picker"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"
style="width: 100%; border: none;"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
@change="saveUserProjectSetting"
/>
</el-col>
@ -153,44 +153,44 @@
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionEndTime"
type="datetime"
align="center"
class="collection-date-picker"
placeholder="结束日期"
style="width: 100%; border: none;"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束日期"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">未启用提示语</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">停用后提示语</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedDeactivatePromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.timedDeactivatePromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
</div>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">定时定量表单</p>
</el-col>
@ -207,19 +207,19 @@
</el-col>
</el-row>
<div v-if="projectSetting.timingQuantitativeForm">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">收集时间</p>
</el-col>
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionBeginTime"
type="datetime"
style="width: 100%; border: none;"
align="center"
class="collection-date-picker"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"
style="width: 100%; border: none;"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
@change="saveUserProjectSetting"
/>
</el-col>
@ -227,73 +227,95 @@
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionEndTime"
type="datetime"
align="center"
class="collection-date-picker"
placeholder="结束日期"
style="width: 100%; border: none;"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束日期"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">未启用提示语</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">停用后提示语</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedDeactivatePromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.timedDeactivatePromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row v-if="projectSetting.timingQuantitativeForm" type="flex" align="middle">
<el-row v-if="projectSetting.timingQuantitativeForm" align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">定量表单填写数量</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedQuantitativeQuantity" class="setting-input"
style="width: 80%;"
oninput="value=value.replace(/[^\d]/g,'')"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
</div>
<div v-if="projectSetting.timingQuantitativeForm">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="8">
<p class="project-setting-sub-label">收集完成后提示</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.timedEndPromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.timedEndPromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
</div>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label ">
每个微信仅填写一次
</p>
</el-col>
<el-col :span="12">
<el-switch
v-model="userProjectSettingData.wxWriteOnce"
@change="()=>{
this.userProjectSettingData.recordWxUser=true
this.userProjectSettingData.wxWrite=true
this.saveUserProjectSetting()
}"
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">每人限制填写1次</p>
<p class="project-setting-label ">
每人限制填写1次
<el-tooltip class="item" content="根据IP地址限制填写" effect="dark" placement="top-start">
<i class="el-icon-warning" />
</el-tooltip>
</p>
</el-col>
<el-col :span="12">
<el-switch
@ -302,7 +324,7 @@
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">每人每天限制填写1次</p>
</el-col>
@ -314,22 +336,22 @@
</el-col>
</el-row>
<el-row v-if="userProjectSettingData.everyoneDayWriteOnce||userProjectSettingData.everyoneWriteOnce"
type="flex"
align="middle"
type="flex"
>
<el-col :span="8">
<p class="project-setting-sub-label">重复填写后提示</p>
</el-col>
<el-col :span="15">
<el-input v-model="userProjectSettingData.writeOncePromptText" class="setting-input"
style="width: 80%;"
<el-input v-model="userProjectSettingData.writeOncePromptText" :maxlength="50"
:show-word-limit="true"
:maxlength="50"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">新反馈提醒我</p>
</el-col>
@ -338,7 +360,7 @@
</el-col>
</el-row>
<div v-if="projectSetting.newFeedbackRemind">
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">发邮件提醒我</p>
</el-col>
@ -352,21 +374,21 @@
/>
</el-col>
</el-row>
<el-row v-if="projectSetting.newFeedbackRemindEmail" type="flex" align="middle">
<el-col :span="5" :offset="3">
<el-row v-if="projectSetting.newFeedbackRemindEmail" align="middle" type="flex">
<el-col :offset="3" :span="5">
<p class="project-setting-sub-label">请填写邮箱</p>
</el-col>
<el-col :span="12">
<el-form-item prop="newWriteNotifyEmail">
<el-input v-model="userProjectSettingData.newWriteNotifyEmail" class="setting-input"
style="width: 80%;"
placeholder="多个邮箱用 ; 隔开"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
</el-form-item>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">发微信提醒我</p>
</el-col>
@ -386,8 +408,8 @@
</p>
</el-col>
</el-row>
<el-row v-if="userProjectSettingData.newWriteNotifyWx" type="flex" align="middle">
<el-col :span="5" :offset="3">
<el-row v-if="userProjectSettingData.newWriteNotifyWx" align="middle" type="flex">
<el-col :offset="3" :span="5">
<p class="project-setting-sub-label">提醒人</p>
</el-col>
<el-col :span="12">
@ -398,17 +420,17 @@
</el-col>
</el-row>
</div>
<el-dialog title="微信扫描二维码订阅"
<el-dialog :visible.sync="dialogSubNotifyVisible"
title="微信扫描二维码订阅"
width="400px"
:visible.sync="dialogSubNotifyVisible"
>
<el-image
style="width: 150px; height: 150px;"
:src="subNotifyWxQrCode"
fit="fill"
style="width: 150px; height: 150px;"
/>
</el-dialog>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">记录微信用户个人信息</p>
</el-col>
@ -432,7 +454,7 @@
<p class="project-setting-title">
分享设置
</p>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">自定义分享图标</p>
</el-col>
@ -443,7 +465,7 @@
/>
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareIcon" type="flex" align="middle">
<el-row v-if="projectSetting.customizeShareIcon" align="middle" type="flex">
<el-col :span="10">
<p class="project-setting-label">
请上传分享图片 *
@ -453,16 +475,16 @@
<el-col :span="12">
<el-upload
ref="logoUpload"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadShareImgHandle"
:action="getUploadUrl"
:show-file-list="false"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
>
<div class="block">
<el-image
class="share-img"
:src="userProjectSettingData.shareImg"
class="share-img"
fit="cover "
>
<div slot="error" class="image-slot">
@ -473,7 +495,7 @@
</el-upload>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">自定义分享标题</p>
</el-col>
@ -484,8 +506,8 @@
/>
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareTitle" type="flex"
align="middle"
<el-row v-if="projectSetting.customizeShareTitle" align="middle"
type="flex"
>
<el-col :span="8">
<p class="project-setting-sub-label">请输入标题</p>
@ -493,13 +515,13 @@
<el-col :span="15">
<el-input
v-model="userProjectSettingData.shareTitle"
:show-word-limit="true"
:maxlength="50"
:show-word-limit="true"
class="setting-input" style="width: 80%;" @change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row type="flex" align="middle">
<el-row align="middle" type="flex">
<el-col :span="12">
<p class="project-setting-label">自定义分享描述</p>
</el-col>
@ -507,8 +529,8 @@
<el-switch v-model="projectSetting.customizeShareDesc" />
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareDesc" type="flex"
align="middle"
<el-row v-if="projectSetting.customizeShareDesc" align="middle"
type="flex"
>
<el-col :span="8">
<p class="project-setting-sub-label">请输入描述</p>
@ -516,8 +538,8 @@
<el-col :span="15">
<el-input
v-model="userProjectSettingData.shareDesc"
:show-word-limit="true"
:maxlength="50"
:show-word-limit="true"
class="setting-input" style="width: 80%;" @change="saveUserProjectSetting"
/>
</el-col>
@ -525,24 +547,27 @@
<div
v-if="userProjectSettingData.shareDesc||userProjectSettingData.shareTitle||userProjectSettingData.shareImg"
>
<p>通知卡片预览</p>
<div class="share-preview">
<div style="flex: 1" />
<div class="share-preview-msg">
<div>
<div class="share-preview-msg-box">
<p class="share-preview-msg-title">
{{ userProjectSettingData.shareTitle }}
</p>
<div class="share-preview-info">
<p class="share-preview-msg-desc">
{{ userProjectSettingData.shareDesc }}
</p>
<div class="share-preview-img-box">
<img v-if="userProjectSettingData.shareImg" :src="userProjectSettingData.shareImg" class="share-preview-img">
</div>
<div>
<img v-if="userProjectSettingData.shareImg" :src="userProjectSettingData.shareImg"
class="share-preview-img"
>
</div>
</div>
<div>
<img class="share-user-avatar" :src="getUserInfo.avatar">
<div class="share-preview-msg-angle" />
</div>
<div class="share-preview-avatar">
<img :src="getUserInfo.avatar" class="share-user-avatar">
</div>
</div>
</div>
@ -582,6 +607,7 @@ export default {
},
userProjectSettingData: {
submitPromptImg: '',
wxWriteOnce: false,
submitPromptText: '提交成功 !',
submitJumpUrl: '',
wxWrite: false,
@ -731,6 +757,7 @@ export default {
margin: 0;
background-color: #f7f7f7;
}
.project-setting-view {
height: 100%;
line-height: 20px;
@ -743,6 +770,7 @@ export default {
margin-right: 10px;
padding: 10px;
}
.project-setting-title {
color: rgba(16, 16, 16, 100);
font-size: 18px;
@ -750,12 +778,14 @@ export default {
font-weight: 550;
margin-left: 20px;
}
.project-setting-label {
color: rgba(16, 16, 16, 100);
font-size: 14px;
text-align: left;
line-height: 20px;
}
.project-setting-sub-label {
color: rgba(144, 147, 149, 100);
font-size: 14px;
@ -763,6 +793,7 @@ export default {
margin-left: 2px;
line-height: 20px;
}
.submit-prompt-img {
width: 80%;
height: 117px;
@ -772,14 +803,17 @@ export default {
justify-items: center;
justify-content: center;
}
.sub-user-view {
position: relative;
width: 60px;
cursor: pointer;
}
.sub-user-view:hover .sub-user-delete {
display: block;
}
.sub-user-delete {
position: absolute;
right: -6px;
@ -794,6 +828,7 @@ export default {
line-height: 18px;
display: none;
}
.share-img {
width: 123px;
height: 117px;
@ -803,68 +838,120 @@ export default {
justify-items: center;
justify-content: center;
}
.share-preview {
width: 360px;
height: 162px;
margin: 0 auto;
border-radius: 5px;
background-color: rgba(210, 210, 210, 42);
background-color: #0001;
border: 1px solid rgba(255, 255, 255, 100);
display: flex;
align-content: center;
align-items: center;
justify-content: space-around;
}
.share-preview-msg {
width: 210px;
height: 88px;
margin-right: 25px;
border-radius: 5px;
background-color: white;
color: rgba(16, 16, 16, 100);
box-shadow: 0 0 3px 0 rgba(157, 158, 162, 100);
padding: 5px;
padding: 7px 10px 10px;
display: flex;
align-items: center;
justify-items: center;
justify-content: center;
position: relative;
z-index: 1;
}
.share-preview-msg-box {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.share-preview-msg::after {
.share-preview-msg::after,.share-preview-msg-angle {
content: '';
border: 10px solid transparent;
border-left-color: #fff;
border: 8px solid transparent;
border-style: solid;
border-left-color: rgba(157, 158, 162, 0.397);
position: absolute;
right: -18px;
top: 5px;
right: -15px;
top: 16px;
width: 0;
z-index: -1;
}
.share-preview-msg-angle {
border: 7px solid transparent;
border-left-color: #ffffff;
right: -13px;
top: 17px;
z-index: 1;
}
.share-preview-msg-title {
line-height: 22px;
height: 25px;
margin: 3px;
margin: 0;
color: rgba(16, 16, 16, 100);
font-size: 14px;
text-align: left;
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.share-preview-info {
flex: 1;
display: flex;
margin-top: 5px;
}
.share-preview-msg-desc {
margin: 3px;
flex: 1;
height: 100%;
margin: 0;
color: rgba(144, 147, 153, 100);
font-size: 12px;
line-height: 20px;
height: 60px;
width: 155px;
text-align: left;
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.share-preview-img-box {
display: flex;
align-items: flex-end;
margin-left: 5px;
}
.share-preview-img {
width: 49px;
height: 46px;
margin-right: 5px;
}
.share-preview-avatar {
margin-right: 30px;
margin-top: -35px;
}
.share-user-avatar {
width: 49px;
height: 49px;
border-radius: 6px;
}
::v-deep .setting-input input {
border: none;
border-bottom: 1px solid rgba(187, 187, 187, 100);
@ -872,11 +959,13 @@ export default {
line-height: 20px;
height: 20px;
}
::v-deep .collection-date-picker input {
border: none;
border-bottom: 1px solid rgba(187, 187, 187, 100);
border-radius: 0;
}
::v-deep .el-form-item--mini.el-form-item,
.el-form-item--small.el-form-item {
margin: 0;

27
src/views/form/statistics/item.vue

@ -2,6 +2,15 @@
<div>
<div v-if="projectItemData.type=='UPLOAD'">
<div v-if="getItemValue['files']">
<!-- 图片文件渲染图片栏 -->
<template v-if="getItemValue['type'] == 'image'">
<span v-for="file in getItemValue['files']" :key="JSON.stringify(file)">
<el-image class="item-thumbnail-image-preview" :src="file.url" :preview-src-list="getItemValue['files'].map( img => img.url)" lazy />
</span>
</template>
<!-- 其他文件渲染文件下载链接 -->
<template v-else>
<el-link
v-for="file in getItemValue['files']"
@ -11,11 +20,15 @@
>
<span> {{ file.fileName }}</span>
</el-link>
</template>
</div>
<span v-else>/</span>
</div>
<div v-else-if="projectItemData.type=='SIGN_PAD'">
<el-image class="item-thumbnail-image-preview" :src="getItemValue || ''" :preview-src-list="[getItemValue || '']" lazy />
</div>
<div v-else>
{{ getItemValue ? getItemValue : '/' }}
{{ getItemValue || '/' }}
</div>
</div>
</template>
@ -43,6 +56,7 @@ export default {
},
computed: {
processData() {
console.log('数据', this.projectItemData)
return this.resultData ? this.resultData['processData'] : {}
},
getItemValue() {
@ -57,3 +71,14 @@ export default {
}
</script>
<style scoped>
.item-thumbnail-image-preview {
width: 106px;
height: 106px;
margin-right: 15px;
margin-bottom: 15px;
border: 1px solid #EBEEF5;
background: #0001;
}
</style>

40
src/views/form/statistics/list.vue

@ -47,6 +47,7 @@
{{ scope.row[col] }}
</template>
</el-table-column>
<el-table-column
v-for="col in otherCustomColumns"
:key="col" :label="projectItemColumns[col]"
@ -56,6 +57,16 @@
{{ scope.row['processData'][col] }}
</template>
</el-table-column>
<el-table-column
v-for="col in fixedFormTailColumns" :key="`t${col}`"
:label="fixedDefaultLabelFormTailColumn[col]"
>
<template slot-scope="scope">
{{ scope.row[col] }}
</template>
</el-table-column>
<el-table-column
:render-header="renderHeader"
fixed="right"
@ -123,6 +134,14 @@
</el-col>
</el-row>
</el-checkbox-group>
<el-divider />
<el-checkbox-group v-model="checkedFixedTailCustomColumns">
<el-row>
<el-col v-for="(val, key) in fixedDefaultLabelFormTailColumn" :key="key" :span="4">
<el-checkbox :label="key">{{ val }}</el-checkbox>
</el-col>
</el-row>
</el-checkbox-group>
<span slot="footer" class="dialog-footer">
<el-button @click="customColumnDialogVisible = false"> </el-button>
<el-button type="primary" @click="saveStatisticsCheckedColumns"> </el-button>
@ -139,8 +158,12 @@ import ResultItem from './item'
import DataFilter from './filter'
import {getCheckedColumn, saveCheckedColumn} from '@/utils/db'
const fixedDefaultFormColumn = ['serialNumber', 'submitAddress', 'createTime']
const fixedDefaultLabelFormColumn = {serialNumber: '提交序号', submitAddress: '提交地址', createTime: '提交时间'}
//
const fixedDefaultFormColumn = ['serialNumber']
const fixedDefaultLabelFormColumn = {serialNumber: '提交序号'}
//
const fixedDefaultFormTailColumn = ['submitAddress', 'createTime']
const fixedDefaultLabelFormTailColumn = { submitAddress: '提交地址', createTime: '提交时间'}
export default {
name: 'ProjectStatisticsList',
@ -156,9 +179,12 @@ export default {
checkedFilterColumns: [],
//
fixedCustomColumns: fixedDefaultFormColumn,
fixedFormTailColumns: fixedDefaultFormTailColumn,
//
checkedFixedCustomColumns: fixedDefaultFormColumn,
fixedDefaultLabelFormColumn: fixedDefaultLabelFormColumn,
checkedFixedTailCustomColumns: fixedDefaultFormTailColumn,
fixedDefaultLabelFormTailColumn: fixedDefaultLabelFormTailColumn,
//
checkOtherCustomColumns: [],
otherCustomColumns: [],
@ -223,9 +249,11 @@ export default {
this.customColumnDialogVisible = false
this.fixedCustomColumns = this.checkedFixedCustomColumns
this.otherCustomColumns = this.checkOtherCustomColumns
this.fixedFormTailColumns = this.checkedFixedTailCustomColumns
saveCheckedColumn(this.projectKey, {
fixedCustomColumns: this.fixedCustomColumns,
otherCustomColumns: this.otherCustomColumns
otherCustomColumns: this.otherCustomColumns,
fixedCustomTailColumns: this.fixedFormTailColumns
})
},
getDbCheckedColumns() {
@ -233,7 +261,7 @@ export default {
if (!checkedColumn) {
return
}
let {fixedCustomColumns, otherCustomColumns} = checkedColumn
let {fixedCustomColumns, otherCustomColumns, fixedCustomTailColumns} = checkedColumn
if (fixedCustomColumns) {
this.fixedCustomColumns = fixedCustomColumns
this.checkedFixedCustomColumns = fixedCustomColumns
@ -242,6 +270,10 @@ export default {
this.otherCustomColumns = otherCustomColumns
this.checkOtherCustomColumns = otherCustomColumns
}
if (fixedCustomTailColumns) {
this.fixedCustomTailColumns = fixedCustomTailColumns
this.checkedFixedTailCustomColumns = fixedCustomTailColumns
}
},
downloadProjectResultFile() {
if (!this.total) {

17
src/views/form/write/index.vue

@ -84,13 +84,13 @@ export default {
}
]
},
created() {
async created() {
let key = this.$route.query.key || this.$route.params.key
this.projectConfig.projectKey = key
let wxCode = getQueryString('code')
if (wxCode) {
this.wxAuthorizationCode = wxCode
this.getWxAuthorizationUserInfo()
await this.getWxAuthorizationUserInfo()
}
this.getWxAuthorizationUrl()
this.queryProjectSettingStatus()
@ -115,7 +115,12 @@ export default {
},
queryProjectSettingStatus() {
//
this.$api.get('/user/project/setting-status', {params: {projectKey: this.projectConfig.projectKey}}).then(res => {
this.$api.get('/user/project/setting-status', {
params: {
projectKey: this.projectConfig.projectKey,
wxOpenId: this.wxUserInfo ? this.wxUserInfo.openid : ''
}
}).then(res => {
if (res.msg) {
this.writeNotStartPrompt = res.msg
this.writeStatus = 0
@ -125,14 +130,13 @@ export default {
getWxAuthorizationUserInfo() {
let wxAuthorizationCode = this.wxAuthorizationCode
// code
this.$api.get('/authorization/user/info', {
this.$api.get('/wx/jsapi/authorization/user/info', {
params: {
code: wxAuthorizationCode
}
}).then(res => {
if (res.data) {
this.wxUserInfo = res.data
alert(res.data)
}
})
@ -233,7 +237,6 @@ export default {
if (res.data && res.data.wxWrite) {
//
if (res.data.recordWxUser && !this.wxAuthorizationCode) {
console.log(this.wxAuthorizationUrl)
location.href = this.wxAuthorizationUrl
} else {
this.onlyWxOpenHandle()
@ -266,6 +269,8 @@ export default {
'submitOs': ua.os.name,
'submitBrowser': ua.browser.name,
'submitUa': ua,
'wxUserInfo': this.wxUserInfo,
'wxOpenId': this.wxUserInfo ? this.wxUserInfo.openid : '',
'originalData': data.formModel,
'processData': data.labelFormModel
}).then(() => {

4
src/views/project/my/index.vue

@ -105,7 +105,7 @@
</el-button>
</el-popconfirm>
<el-popconfirm
v-if="p.status==3"
v-if="p.status!=2"
title="确定删除该项目吗?"
@confirm="deleteProject(p.key)"
>
@ -200,7 +200,7 @@
</el-button>
</el-popconfirm>
<el-popconfirm
v-if="scope.row.status==3"
v-if="scope.row.status!=2"
title="确定删除该项目吗?"
@confirm="deleteProject(scope.row.key)"
>

Loading…
Cancel
Save