jiangyy 4 years ago
parent
commit
e2f835d867
  1. 14
      package.json
  2. 6
      src/components/generator/config.js
  3. 9
      src/views/form/editor/RightPanel.vue
  4. 27
      src/views/form/index.vue
  5. 46
      src/views/form/preview/ProjectForm.vue
  6. 185
      src/views/form/publish/index.vue
  7. 408
      src/views/form/setting/index.vue
  8. 22
      src/views/project/my/index.vue

14
package.json

@ -74,5 +74,19 @@
"hooks": {
"pre-commit": "lint-staged"
}
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
}
}

6
src/components/generator/config.js

@ -259,6 +259,7 @@ export const selectComponents = [
tag: 'el-switch',
tagIcon: 'switch',
defaultValue: false,
showDefaultValue: false,
span: 24,
showRegList: false,
showLabel: true,
@ -276,7 +277,9 @@ export const selectComponents = [
'active-color': null,
'inactive-color': null,
'active-value': true,
'inactive-value': false
'show-active-value': false,
'inactive-value': false,
'show-inactive-value': false
},
{
typeId: 'SLIDER',
@ -428,6 +431,7 @@ export const selectComponents = [
style: {},
max: 5,
'allow-half': false,
'show-allow-half': false,
'show-text': false,
'show-score': false,
disabled: false

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

@ -219,6 +219,7 @@
<el-form-item v-if="isShowMax"
label="最大值">
<el-input-number v-model="activeData.max"
:max="activeData.maxLimit?activeData.maxLimit:undefined"
placeholder="最大值" />
</el-form-item>
<el-form-item v-if="activeData.height !== undefined"
@ -262,13 +263,13 @@
<el-input v-model="activeData['inactive-text']"
placeholder="请输入关闭提示" />
</el-form-item>
<el-form-item v-if="activeData['active-value'] !== undefined"
<el-form-item v-if="activeData['show-active-value']"
label="开启值">
<el-input :value="setDefaultValue(activeData['active-value'])"
placeholder="请输入开启值"
@input="onSwitchValueInput($event, 'active-value')" />
</el-form-item>
<el-form-item v-if="activeData['inactive-value'] !== undefined"
<el-form-item v-if="activeData['show-inactive-value']"
label="关闭值">
<el-input :value="setDefaultValue(activeData['inactive-value'])"
placeholder="请输入关闭值"
@ -663,7 +664,7 @@
<el-switch v-model="activeData.branding"
@input="changeRenderKey" />
</el-form-item>
<el-form-item v-if="activeData['allow-half'] !== undefined"
<el-form-item v-if="activeData['show-allow-half'] "
label="允许半选">
<el-switch v-model="activeData['allow-half']" />
</el-form-item>
@ -1098,7 +1099,7 @@ export default {
},
isShowMax () {
return (
["el-input-number", "el-slider", "el-rate"].indexOf(this.activeTag) > -1
["el-input-number", "el-slider"].indexOf(this.activeTag) > -1
);
},
isShowStep () {

27
src/views/form/index.vue

@ -38,7 +38,7 @@
/>
</div>
<div class="right-content-container">
<router-view v-if="initLoaded" />
<router-view />
</div>
</div>
<el-dialog :visible.sync="previewDialogVisible"
@ -61,7 +61,7 @@ export default {
components: { PreView },
data() {
return {
initLoaded: false,
previewKey: +new Date(),
previewDialogVisible: false,
defaultActiveMenu: '',
@ -121,36 +121,13 @@ export default {
}
},
async created() {
this.initLoaded = false
const source = this.$route.query.source
console.log(source)
if (source === 'edit') { //
this.initLoaded = true
this.projectKey = this.$route.query.key
this.defaultActiveMenu = this.$route.path
this.isCollapse = this.$store.state.form.isCollapse
} else { //
await this.initAdd()
}
},
methods: {
initAdd() {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/create`, {
'describe': formConf.description,
'name': formConf.title
}).then(res => {
console.log(res)
this.projectKey = res.data
console.log('新增')
console.log(this.projectKey)
this.initLoaded = true
this.defaultActiveMenu = this.$route.path
this.isCollapse = this.$store.state.form.isCollapse
})
},
menuSelectHandle(route, key) {
if (key === 'preview') {

46
src/views/form/preview/ProjectForm.vue

@ -5,29 +5,34 @@
>
<div class="">
<div :style="{textAlign:projectTheme.logoPosition}">
<img
:src="projectTheme.logoImg" class="logo-img"
<img :src="projectTheme.logoImg"
class="logo-img"
>
</div>
<el-image
v-if="projectTheme.headImgUrl"
<el-image v-if="projectTheme.headImgUrl"
:src="projectTheme.headImgUrl"
style="width: 100%;"
fit="scale-down"
/>
<h4 v-if="projectTheme.showTitle" class="form-name-text" style="text-align: center;">
<h4 v-if="projectTheme.showTitle"
class="form-name-text"
style="text-align: center;"
>
{{ formConf.title }}
</h4>
<div
v-show="projectTheme.showDescribe"
class="form-name-text describe-html" v-html="formConf.description"
<div v-show="projectTheme.showDescribe"
class="form-name-text describe-html"
v-html="formConf.description"
/>
<el-divider />
<parser v-if="startParser"
:key="parserKey"
:form-model="formModel"
:label-form-model="labelFormModel"
:form-conf="formConf" @next="nextPage" @prev="prevPage" @submit="submitForm"
:form-conf="formConf"
@next="nextPage"
@prev="prevPage"
@submit="submitForm"
/>
</div>
</div>
@ -35,8 +40,8 @@
<script>
import Parser from '@/components/parser/Parser'
import {dbDataConvertForItemJson} from '@/utils/convert'
import {getExpression} from '@/utils/expression'
import { dbDataConvertForItemJson } from '@/utils/convert'
import { getExpression } from '@/utils/expression'
import _ from 'lodash'
window.onload = function() {
@ -55,12 +60,15 @@ export default {
},
props: {
projectConfig: {
type: String,
type: Object,
return: {
projectKey: '',
showBtns: true,
// 1 2
projectKind: 1
}
}
},
metaInfo: {
meta: [
@ -173,7 +181,7 @@ export default {
//
if (res.data.userProjectTheme) {
this.projectTheme = res.data.userProjectTheme
let {submitBtnText, showNumber, btnsColor} = res.data.userProjectTheme
let { submitBtnText, showNumber, btnsColor } = res.data.userProjectTheme
if (submitBtnText) this.formConf.submitBtnText = submitBtnText
if (showNumber) this.formConf.showNumber = showNumber
if (btnsColor) this.formConf.submitBtnColor = btnsColor
@ -254,7 +262,7 @@ export default {
// axios
queryLogicItemList() {
return new Promise((resolve, reject) => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/logic/list`, {params: {projectKey: this.formConf.projectKey}})
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/logic/list`, { params: { projectKey: this.formConf.projectKey } })
.then(res => {
resolve(res)
}).catch(err => {
@ -269,7 +277,7 @@ export default {
this.switchPage(params.page + 1, params)
},
switchPage(page, params) {
let {labelFormModel, formModel} = params
let { labelFormModel, formModel } = params
this.formModel = formModel
this.labelFormModel = labelFormModel
this.formConf.formBtns = _.keys(this.perPageFields).length == page
@ -284,7 +292,7 @@ export default {
</script>
<style lang="scss">
@import '@/assets/styles/elementui-mobile.scss';
@import "@/assets/styles/elementui-mobile.scss";
.project-form {
margin: 15px auto;
width: 800px;
@ -292,7 +300,7 @@ export default {
background-repeat: repeat;
background-color: rgba(229, 239, 247, 0.87);
}
.project-form .describe-html img{
.project-form .describe-html img {
max-width: 780px;
margin: 0px;
}
@ -334,8 +342,8 @@ export default {
.submit-btn-form-item button {
width: 80%;
}
.project-form .describe-html img{
width: 95vw!important;
.project-form .describe-html img {
width: 95vw !important;
}
}
</style>

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

@ -1,23 +1,50 @@
<template>
<div class="publish-container">
<div>
<div v-if="!publishStatus" class="publish-btn-view">
<el-button
class="publish-btn"
<div v-if="!publishStatus"
class="publish-btn-view">
<div>
<el-form label-width="90px">
<el-form-item label="小程序端">
<el-radio-group v-model="clientType">
<el-radio-button label="resi">居民端</el-radio-button>
<el-radio-button label="work">工作端</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="发布范围">
<el-tree ref="tree"
style="background-color:#f7f7f7"
:props="props"
:data="data"
show-checkbox
:default-expand-all="true"
@node-click="nodeClick"
@check="check"
@check-change="handleCheckChange" />
</el-form-item>
</el-form>
</div>
<div style="text-align:center">
<el-button class="publish-btn"
size="medium"
type="primary"
@click="publishProject"
>
@click="publishProject">
<i class="el-icon-document-checked el-icon--right">开始发布</i>
</el-button>
</div>
<div v-if="publishStatus" class="publish-finish-view">
<el-row :gutter="10" align="middle" type="flex">
<el-col>
</div>
<div v-if="publishStatus"
class="publish-finish-view">
<el-row :gutter="10"
align="middle"
type="flex">
<!-- <el-col>
<div>
<vue-qr v-if="writeLink" :callback="qrCodeGenSuccess" :size="194"
:text="writeLink"
/>
<vue-qr v-if="writeLink"
:callback="qrCodeGenSuccess"
:size="194"
:text="writeLink" />
</div>
<div style="text-align: center;">
<el-link type="primary" @click="()=>{
@ -27,7 +54,7 @@
下载分享二维码
</el-link>
</div>
</el-col>
</el-col> -->
<el-col style="margin-left: 75px;">
<div style="display: flex; justify-content: center;">
<div class="icon-view">
@ -37,31 +64,28 @@
<div>
<p class="success-title">恭喜您发布成功</p>
</div>
<div>
<!-- <div>
<p class="link-text"> {{ writeLink }}</p>
</div>
</div> -->
<el-row>
<el-col :offset="3" :span="6">
<!-- <el-col :offset="2"
:span="6">
<el-button v-clipboard:copy="writeLink"
v-clipboard:error="()=>{this.msgError('复制失败')}"
v-clipboard:success="()=>{this.msgSuccess('复制成功')}" type="primary"
>
复制链接
</el-button>
</el-col>
<el-col :span="6">
<el-button
type="danger"
@click="stopPublishProject"
>
</el-col> -->
<el-col :span="12">
<el-button type="danger"
@click="stopPublishProject">
停止发布
</el-button>
</el-col>
<el-col :span="6">
<el-button
type="warning"
@click="toFeedbackPageHandle"
>
<el-col :span="12">
<el-button type="warning"
@click="toFeedbackPageHandle">
查看反馈
</el-button>
</el-col>
@ -74,28 +98,91 @@
</template>
<script>
import VueQr from 'vue-qr'
// import VueQr from 'vue-qr'
export default {
name: 'ProjectPublish',
components: {
VueQr
// VueQr
},
data() {
data () {
return {
publishStatus: false,
projectKey: null,
writeLink: '',
qrCodeUrl: ''
qrCodeUrl: '',
clientType: 'resi',
props: {
// label: 'name',
// children: 'zones'
},
count: 1,
data: [{
id: 1,
label: '一级 1',
children: [{
id: 4,
label: '二级 1-1',
children: [{
id: 9,
label: '三级 1-1-1'
}, {
id: 10,
label: '三级 1-1-2'
}]
}]
}, {
id: 2,
label: '一级 2',
children: [{
id: 5,
label: '二级 2-1'
}, {
id: 6,
label: '二级 2-2'
}]
}, {
id: 3,
label: '一级 3',
children: [{
id: 7,
label: '二级 3-1'
}, {
id: 8,
label: '二级 3-2'
}]
}]
}
},
mounted() {
mounted () {
this.projectKey = this.$route.query.key
let url = window.location.protocol + '//' + window.location.host
this.writeLink = `${url}/s/${this.projectKey}`
this.getProjectStatus()
}, methods: {
getProjectStatus() {
},
methods: {
currentChange (data, node) {
console.log(data, node)
},
check () {
},
handleCheckChange (data, checked, indeterminate) {
data.select = true
console.log(data, checked, indeterminate)
// console.log('');
// console.log(this.data)
},
nodeClick (a, b, c) {
console.log(a, b, c)
},
handleNodeClick (data) {
// console.log(data);
},
getProjectStatus () {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => {
if (res.data.status == 2) {
this.publishStatus = true
@ -104,24 +191,26 @@ export default {
}
})
},
publishProject() {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, {key: this.projectKey}).then(() => {
this.publishStatus = true
this.msgSuccess('发布成功')
})
publishProject () {
const aaa = this.$refs.tree.getCheckedNodes(false, false)
console.log(aaa)
// this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/publish`, { key: this.projectKey }).then(() => {
// this.publishStatus = true
// this.msgSuccess('')
// })
},
stopPublishProject() {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/stop`, {'key': this.projectKey}).then(res => {
stopPublishProject () {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/stop`, { 'key': this.projectKey }).then(res => {
if (res.data) {
this.msgSuccess('停止成功')
this.getProjectStatus()
}
})
},
qrCodeGenSuccess(dataUrl) {
qrCodeGenSuccess (dataUrl) {
this.qrCodeUrl = dataUrl
},
downloadFile(fileName, content) {
downloadFile (fileName, content) {
let aLink = document.createElement('a')
let blob = this.base64ToBlob(content) // new Blob([content]);
let evt = document.createEvent('HTMLEvents')
@ -132,7 +221,7 @@ export default {
aLink.click()
},
// base64blob
base64ToBlob(code) {
base64ToBlob (code) {
let parts = code.split(';base64,')
let contentType = parts[0].split(':')[1]
let raw = window.atob(parts[1])
@ -141,10 +230,10 @@ export default {
for (let i = 0; i < rawLength; ++i) {
uInt8Array[i] = raw.charCodeAt(i)
}
return new Blob([uInt8Array], {type: contentType})
return new Blob([uInt8Array], { type: contentType })
},
toFeedbackPageHandle() {
this.$router.replace({path: '/project/form/statistics', query: {key: this.projectKey}})
toFeedbackPageHandle () {
this.$router.replace({ path: '/project/form/statistics', query: { key: this.projectKey } })
}
}
@ -163,6 +252,9 @@ export default {
align-items: center;
justify-content: center;
}
.publish-btn-view {
width: 800px;
}
.publish-finish-view {
width: 500px;
height: 200px;
@ -192,5 +284,4 @@ export default {
font-size: 14px;
}
}
</style>

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

@ -1,51 +1,68 @@
<template>
<el-form ref="setting" :model="userProjectSettingData" :rules="settingRules">
<el-row align="top" class="project-setting-container" justify="center" type="flex">
<el-col :offset="3" :span="5" class="project-setting-view">
<el-form ref="setting"
:model="userProjectSettingData"
:rules="settingRules"
>
<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 align="middle" type="flex">
<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="projectSetting.showPromptImg"
<el-switch v-model="projectSetting.showPromptImg"
@change="()=>{this.userProjectSettingData.submitPromptImg=''}"
/>
</el-col>
</el-row>
<div v-if="projectSetting.showPromptImg">
<div class="block">
<el-image
:src="userProjectSettingData.submitPromptImg"
<el-image :src="userProjectSettingData.submitPromptImg"
class="submit-prompt-img"
fit="cover "
>
<div slot="error" class="image-slot">
<div slot="error"
class="image-slot"
>
<i class="el-icon-picture-outline" />
</div>
</el-image>
</div>
<el-upload
ref="logoUpload"
<el-upload ref="logoUpload"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadSubmitPromptHandle"
: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-button slot="trigger"
size="small"
type="text"
>
请上传提示图片 *
</el-button>
</el-upload>
</div>
<el-row align="middle" type="flex">
<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="projectSetting.showPromptText"
<el-switch v-model="projectSetting.showPromptText"
@change="()=>{
this.userProjectSettingData.submitPromptText=''
this.saveUserProjectSetting()
@ -54,7 +71,9 @@
</el-col>
</el-row>
<el-row v-if="projectSetting.showPromptText">
<el-col :span="20" class="setting-input">
<el-col :span="20"
class="setting-input"
>
<el-input v-model="userProjectSettingData.submitPromptText"
:maxlength="50"
:show-word-limit="true"
@ -62,67 +81,66 @@
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<!-- <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="projectSetting.showSubmitJumpUrl"
<el-switch v-model="projectSetting.showSubmitJumpUrl"
@change="()=>{
this.userProjectSettingData.submitJumpUrl=''
this.saveUserProjectSetting()
}"
/>
}" />
</el-col>
</el-row>
<el-row v-if="projectSetting.showSubmitJumpUrl">
<el-col :span="20" class="setting-input">
<el-input
v-model="userProjectSettingData.submitJumpUrl"
</el-row> -->
<!-- <el-row v-if="projectSetting.showSubmitJumpUrl">
<el-col :span="20"
class="setting-input">
<el-input v-model="userProjectSettingData.submitJumpUrl"
:maxlength="50"
:show-word-limit="true"
placeholder="https://demo.tduckapp.com"
@change="saveUserProjectSetting"
/>
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<el-row align="middle" type="flex">
</el-row> -->
<!-- <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.publicResult"
<el-switch v-model="userProjectSettingData.publicResult"
@change="()=>{
this.saveUserProjectSetting()
}"
/>
}" />
</el-col>
</el-row>
</el-row> -->
</el-col>
<el-col :span="6" class="project-setting-view text-center">
<el-col :span="6"
class="project-setting-view text-center"
>
<p class="project-setting-title">
回收设置
</p>
<el-row align="middle" type="flex">
<!-- <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.wxWrite"
@change="saveUserProjectSetting"
/>
<el-switch v-model="userProjectSettingData.wxWrite"
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<el-row align="middle" type="flex">
</el-row> -->
<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="projectSetting.timingCollectForm"
<el-switch v-model="projectSetting.timingCollectForm"
@change="()=>{
this.projectSetting.timingQuantitativeForm=false
this.clearFieldHandle(['timedCollectionBeginTime','timedCollectionEndTime'
@ -133,13 +151,14 @@
</el-col>
</el-row>
<div v-if="projectSetting.timingCollectForm">
<el-row align="middle" type="flex">
<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"
<el-date-picker v-model="userProjectSettingData.timedCollectionBeginTime"
align="center"
class="collection-date-picker"
placeholder="选择开始时间"
@ -151,8 +170,7 @@
</el-col>
<el-col :span="1"><span> </span></el-col>
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionEndTime"
<el-date-picker v-model="userProjectSettingData.timedCollectionEndTime"
align="center"
class="collection-date-picker"
placeholder="结束日期"
@ -163,12 +181,15 @@
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<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" :maxlength="50"
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@ -176,12 +197,15 @@
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<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" :maxlength="50"
<el-input v-model="userProjectSettingData.timedDeactivatePromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@ -190,13 +214,14 @@
</el-col>
</el-row>
</div>
<el-row align="middle" type="flex">
<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="projectSetting.timingQuantitativeForm"
<el-switch v-model="projectSetting.timingQuantitativeForm"
@change="()=>{
this.projectSetting.timingCollectForm=false
this.clearFieldHandle(['timedCollectionBeginTime','timedCollectionEndTime'
@ -207,13 +232,14 @@
</el-col>
</el-row>
<div v-if="projectSetting.timingQuantitativeForm">
<el-row align="middle" type="flex">
<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"
<el-date-picker v-model="userProjectSettingData.timedCollectionBeginTime"
align="center"
class="collection-date-picker"
placeholder="选择开始时间"
@ -225,8 +251,7 @@
</el-col>
<el-col :span="1"><span> </span></el-col>
<el-col :span="8">
<el-date-picker
v-model="userProjectSettingData.timedCollectionEndTime"
<el-date-picker v-model="userProjectSettingData.timedCollectionEndTime"
align="center"
class="collection-date-picker"
placeholder="结束日期"
@ -237,12 +262,15 @@
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<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" :maxlength="50"
<el-input v-model="userProjectSettingData.timedNotEnabledPromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@ -250,12 +278,15 @@
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<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" :maxlength="50"
<el-input v-model="userProjectSettingData.timedDeactivatePromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@ -263,12 +294,16 @@
/>
</el-col>
</el-row>
<el-row v-if="projectSetting.timingQuantitativeForm" align="middle" type="flex">
<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"
<el-input v-model="userProjectSettingData.timedQuantitativeQuantity"
class="setting-input"
oninput="value=value.replace(/[^\d]/g,'')"
style="width: 80%;"
@change="saveUserProjectSetting"
@ -277,12 +312,15 @@
</el-row>
</div>
<div v-if="projectSetting.timingQuantitativeForm">
<el-row align="middle" type="flex">
<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" :maxlength="50"
<el-input v-model="userProjectSettingData.timedEndPromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@ -291,197 +329,212 @@
</el-col>
</el-row>
</div>
<el-row align="middle" type="flex">
<!-- <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"
<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-row> -->
<el-row align="middle"
type="flex"
>
<el-col :span="12">
<p class="project-setting-label ">
每人限制填写1次用户id
<el-tooltip class="item" content="根据用户ID限制填写" effect="dark" placement="top-start">
<el-tooltip class="item"
content="根据用户ID限制填写"
effect="dark"
placement="top-start"
>
<i class="el-icon-warning" />
</el-tooltip>
</p>
</el-col>
<el-col :span="12">
<el-switch
v-model="userProjectSettingData.everyoneWriteOnceByUId"
<el-switch v-model="userProjectSettingData.everyoneWriteOnceByUId"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<!-- <el-row align="middle"
type="flex">
<el-col :span="12">
<p class="project-setting-label ">
每人限制填写1次IP地址
<el-tooltip class="item" content="根据IP地址限制填写" effect="dark" placement="top-start">
<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
v-model="userProjectSettingData.everyoneWriteOnceByIp"
@change="saveUserProjectSetting"
/>
<el-switch v-model="userProjectSettingData.everyoneWriteOnceByIp"
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<el-row align="middle" type="flex">
</el-row> -->
<el-row align="middle"
type="flex"
>
<el-col :span="12">
<p class="project-setting-label">每人每天限制填写1次</p>
</el-col>
<el-col :span="12">
<el-switch
v-model="userProjectSettingData.everyoneDayWriteOnce"
<el-switch v-model="userProjectSettingData.everyoneDayWriteOnce"
@change="saveUserProjectSetting"
/>
</el-col>
</el-row>
<el-row v-if="userProjectSettingData.everyoneWriteOnceByUId||userProjectSettingData.everyoneWriteOnceByIp||userProjectSettingData.everyoneWriteOnce"
<!-- <el-row v-if="userProjectSettingData.everyoneWriteOnceByUId||userProjectSettingData.everyoneWriteOnceByIp||userProjectSettingData.everyoneWriteOnce"
align="middle"
type="flex"
>
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" :maxlength="50"
<el-input v-model="userProjectSettingData.writeOncePromptText"
:maxlength="50"
:show-word-limit="true"
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<el-row align="middle" type="flex">
</el-row> -->
<!-- <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="projectSetting.newFeedbackRemind" />
</el-col>
</el-row>
<div v-if="projectSetting.newFeedbackRemind">
<el-row align="middle" type="flex">
</el-row> -->
<!-- <div v-if="projectSetting.newFeedbackRemind">
<el-row align="middle"
type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">发邮件提醒我</p>
</el-col>
<el-col :span="3">
<el-checkbox
v-model="projectSetting.newFeedbackRemindEmail"
<el-checkbox v-model="projectSetting.newFeedbackRemindEmail"
@change="()=>{
this.clearFieldHandle(['newWriteNotifyEmail'])
this.saveUserProjectSetting()
}"
/>
}" />
</el-col>
</el-row>
<el-row v-if="projectSetting.newFeedbackRemindEmail" align="middle" type="flex">
<el-col :offset="3" :span="5">
<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"
<el-input v-model="userProjectSettingData.newWriteNotifyEmail"
class="setting-input"
placeholder="多个邮箱用 ; 隔开"
style="width: 80%;"
@change="saveUserProjectSetting"
/>
@change="saveUserProjectSetting" />
</el-form-item>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<el-row align="middle"
type="flex">
<el-col :span="5">
<p class="project-setting-sub-label">发微信提醒我</p>
</el-col>
<el-col :span="3">
<el-checkbox
v-model="projectSetting.newFeedbackRemindWx"
<el-checkbox v-model="projectSetting.newFeedbackRemindWx"
@change="()=>{
this.clearFieldHandle(['newWriteNotifyWx'])
this.saveUserProjectSetting()
}"
/>
}" />
</el-col>
<el-col :span="10">
<p class="project-setting-sub-label">
需要关注公众号
<el-link type="primary" @click="openSubNotifyWxDialogHandle">TDUCK</el-link>
<el-link type="primary"
@click="openSubNotifyWxDialogHandle">TDUCK</el-link>
</p>
</el-col>
</el-row>
<el-row v-if="userProjectSettingData.newWriteNotifyWx" align="middle" type="flex">
<el-col :offset="3" :span="5">
<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">
<span v-for="(user,i) in subNotifyWxUserList" :key="i" class="sub-user-view">
<i class="el-icon-close sub-user-delete" @click="deleteSubNotifyUserHandle(i)" />
<span v-for="(user,i) in subNotifyWxUserList"
:key="i"
class="sub-user-view">
<i class="el-icon-close sub-user-delete"
@click="deleteSubNotifyUserHandle(i)" />
<el-avatar :src="user.headImgUrl" />
</span>
</el-col>
</el-row>
</div>
</div> -->
<el-dialog :visible.sync="dialogSubNotifyVisible"
title="微信扫描二维码订阅"
width="400px"
>
<el-image
:src="subNotifyWxQrCode"
<el-image :src="subNotifyWxQrCode"
fit="fill"
style="width: 150px; height: 150px;"
/>
</el-dialog>
<el-row align="middle" type="flex">
<!-- <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.recordWxUser"
<el-switch v-model="userProjectSettingData.recordWxUser"
@change="()=>{
this.userProjectSettingData.wxWrite=true
this.saveUserProjectSetting()
}"
/>
}" />
</el-col>
</el-row>
<el-row>
</el-row> -->
<!-- <el-row>
<p class="project-setting-sub-label">
* 开启后将会授权登录提供微信昵称性别城市信息
</p>
</el-row>
</el-row> -->
</el-col>
<el-col :span="6" class="project-setting-view">
<!-- <el-col :span="6"
class="project-setting-view">
<p class="project-setting-title">
分享设置
</p>
<el-row align="middle" type="flex">
<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="projectSetting.customizeShareIcon"
@change="clearFieldHandle(['userProjectSettingData.shareImg'])"
/>
<el-switch v-model="projectSetting.customizeShareIcon"
@change="clearFieldHandle(['userProjectSettingData.shareImg'])" />
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareIcon" align="middle" type="flex">
<el-row v-if="projectSetting.customizeShareIcon"
align="middle"
type="flex">
<el-col :span="10">
<p class="project-setting-label">
请上传分享图片 *
@ -489,21 +542,18 @@
</p>
</el-col>
<el-col :span="12">
<el-upload
ref="logoUpload"
<el-upload ref="logoUpload"
:action="getUploadUrl"
:headers="getUploadHeader"
:on-success="uploadShareImgHandle"
:show-file-list="false"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
>
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP">
<div class="block">
<el-image
:src="userProjectSettingData.shareImg"
<el-image :src="userProjectSettingData.shareImg"
class="share-img"
fit="cover "
>
<div slot="error" class="image-slot">
fit="cover ">
<div slot="error"
class="image-slot">
<i class="el-icon-picture-outline" />
</div>
</el-image>
@ -511,33 +561,33 @@
</el-upload>
</el-col>
</el-row>
<el-row align="middle" type="flex">
<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="projectSetting.customizeShareTitle"
@change="clearFieldHandle(['userProjectSettingData.shareTitle'])"
/>
<el-switch v-model="projectSetting.customizeShareTitle"
@change="clearFieldHandle(['userProjectSettingData.shareTitle'])" />
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareTitle" align="middle"
type="flex"
>
<el-row v-if="projectSetting.customizeShareTitle"
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.shareTitle"
<el-input v-model="userProjectSettingData.shareTitle"
:maxlength="50"
:show-word-limit="true"
class="setting-input" style="width: 80%;" @change="saveUserProjectSetting"
/>
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<el-row align="middle" type="flex">
<el-row align="middle"
type="flex">
<el-col :span="12">
<p class="project-setting-label">自定义分享描述</p>
</el-col>
@ -545,24 +595,22 @@
<el-switch v-model="projectSetting.customizeShareDesc" />
</el-col>
</el-row>
<el-row v-if="projectSetting.customizeShareDesc" align="middle"
type="flex"
>
<el-row v-if="projectSetting.customizeShareDesc"
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.shareDesc"
<el-input v-model="userProjectSettingData.shareDesc"
:maxlength="50"
:show-word-limit="true"
class="setting-input" style="width: 80%;" @change="saveUserProjectSetting"
/>
class="setting-input"
style="width: 80%;"
@change="saveUserProjectSetting" />
</el-col>
</el-row>
<div
v-if="userProjectSettingData.shareDesc||userProjectSettingData.shareTitle||userProjectSettingData.shareImg"
>
<div v-if="userProjectSettingData.shareDesc||userProjectSettingData.shareTitle||userProjectSettingData.shareImg">
<p>通知卡片预览</p>
<div class="share-preview">
<div style="flex: 1" />
@ -576,18 +624,21 @@
{{ userProjectSettingData.shareDesc }}
</p>
<div class="share-preview-img-box">
<img v-if="userProjectSettingData.shareImg" :src="userProjectSettingData.shareImg" class="share-preview-img">
<img v-if="userProjectSettingData.shareImg"
:src="userProjectSettingData.shareImg"
class="share-preview-img">
</div>
</div>
</div>
<div class="share-preview-msg-angle" />
</div>
<div class="share-preview-avatar">
<img :src="getUserInfo.avatar" class="share-user-avatar">
<img :src="getUserInfo.avatar"
class="share-user-avatar">
</div>
</div>
</div>
</el-col>
</el-col> -->
</el-row>
</el-form>
</template>
@ -741,7 +792,7 @@ export default {
})
},
getSubNotifyWxQrCode() {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}user/project/wx/notify-qrcode`, {params: {key: this.projectKey}}).then(res => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/wx/notify-qrcode`, { params: { key: this.projectKey } }).then(res => {
this.subNotifyWxQrCode = res.data
})
},
@ -892,8 +943,9 @@ export default {
overflow: hidden;
}
.share-preview-msg::after,.share-preview-msg-angle {
content: '';
.share-preview-msg::after,
.share-preview-msg-angle {
content: "";
border: 8px solid transparent;
border-style: solid;
border-left-color: rgba(157, 158, 162, 0.397);
@ -919,7 +971,7 @@ export default {
font-size: 14px;
text-align: left;
overflow : hidden;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
@ -941,7 +993,7 @@ export default {
line-height: 20px;
text-align: left;
overflow : hidden;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;

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

@ -42,6 +42,12 @@
>
查询
</el-button>
<el-button class="ml-20"
type="primary"
@click="createBlankTemplate"
>
新建项目
</el-button>
</el-form-item>
<el-form-item label="项目状态">
<el-radio-group v-model="queryParams.status"
@ -96,7 +102,8 @@
>
<p class="project-grid-view-time">创建时间{{ p.createdTime | formatDate }}</p>
<div class="gird-operating-btns">
<el-button type="text"
<el-button v-if="p.status==1"
type="text"
@click="toProjectHandle(p.key,'editor')"
>
<i class="el-icon-edit" />
@ -185,7 +192,8 @@
/>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text"
<el-button v-if="scope.row.status==1"
type="text"
@click="toProjectHandle(scope.row.key,'editor')"
>
编辑
@ -239,6 +247,7 @@
</template>
<script>
import dayjs from 'dayjs'
import { formConf } from '@/components/generator/config'
let projectStatusList = [
{ code: 1, name: '未发布', color: '#006EFF' },
@ -285,6 +294,15 @@ export default {
this.queryProjectPage()
},
methods: {
createBlankTemplate() {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/create`, {
'describe': formConf.description,
'name': formConf.title
}).then(res => {
console.log(res)
this.$router.push({ path: '/project/form', query: { key: res.data } })
})
},
switchDataShowTypeHandle(type) {
this.dataShowType = type
},

Loading…
Cancel
Save