jiangyy 4 years ago
parent
commit
664e1fb8b0
  1. 10
      src/assets/styles/form/home.scss
  2. 30
      src/views/form/editor/IconsDialog.vue
  3. 58
      src/views/form/index.vue
  4. 55
      src/views/form/preview/index.vue
  5. 1
      src/views/form/publish/index.vue
  6. 10
      src/views/form/setting/index.vue
  7. 2
      src/views/form/statistics/public.vue
  8. 21
      src/views/form/theme/index.vue
  9. 13
      src/views/form/write/index.vue

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

@ -1,10 +1,10 @@
@import '../resources/variables'; @import "../resources/variables";
$selectedColor: rgba(24, 144, 255, 0.05); $selectedColor: rgba(24, 144, 255, 0.05);
$lighterBlue: #1890ff; $lighterBlue: #1890ff;
.form-edit-container { .form-edit-container {
position: relative; position: relative;
width: 100%; width: 100%;
height: calc(100vh - 60px); height: 100vh;
overflow-y: hidden; overflow-y: hidden;
} }
.components-list { .components-list {
@ -55,7 +55,7 @@ $lighterBlue: #1890ff;
left: 10px; left: 10px;
top: 0; top: 0;
margin-top: 5px; margin-top: 5px;
height: calc(100vh - 80px); height: calc(100vh - 20px);
background-color: rgba(255, 255, 255, 100); background-color: rgba(255, 255, 255, 100);
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 100); border: 1px solid rgba(255, 255, 255, 100);
@ -64,13 +64,13 @@ $lighterBlue: #1890ff;
border-bottom: none; border-bottom: none;
} }
.left-scrollbar { .left-scrollbar {
height: calc(100vh - 80px); height: calc(100vh - 20px);
overflow: hidden; overflow: hidden;
margin: 5px; margin: 5px;
border-radius: 7px; border-radius: 7px;
} }
.center-scrollbar { .center-scrollbar {
height: calc(100vh - 60px); height: 100vh;
overflow: hidden; overflow: hidden;
width: 90%; width: 90%;
margin: 20px auto 0; margin: 20px auto 0;

30
src/views/form/editor/IconsDialog.vue

@ -1,32 +1,26 @@
<template> <template>
<div class="icon-dialog"> <div class="icon-dialog">
<el-dialog <el-dialog v-bind="$attrs"
v-bind="$attrs"
width="980px" width="980px"
:modal-append-to-body="false" :modal-append-to-body="false"
v-on="$listeners" v-on="$listeners"
@open="onOpen" @open="onOpen"
@close="onClose" @close="onClose">
>
<div slot="title"> <div slot="title">
选择图标 选择图标
<el-input <el-input v-model="key"
v-model="key"
size="mini" size="mini"
:style="{width: '260px'}" :style="{width: '260px'}"
placeholder="请输入图标名称" placeholder="请输入图标名称"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
clearable clearable />
/>
</div> </div>
<ul class="icon-ul"> <ul class="icon-ul">
<li <li v-for="icon in iconList"
v-for="icon in iconList"
:key="icon" :key="icon"
:class="active===icon?'active-item':''" :class="active===icon?'active-item':''"
@click="onSelect(icon)" @click="onSelect(icon)">
>
<i :class="icon" /> <i :class="icon" />
<div>{{ icon }}</div> <div>{{ icon }}</div>
</li> </li>
@ -43,7 +37,7 @@ const originList = iconList.map(name => `el-icon-${name}`)
export default { export default {
inheritAttrs: false, inheritAttrs: false,
props: ['current'], props: ['current'],
data() { data () {
return { return {
iconList: originList, iconList: originList,
active: null, active: null,
@ -51,7 +45,7 @@ export default {
} }
}, },
watch: { watch: {
key(val) { key (val) {
if (val) { if (val) {
this.iconList = originList.filter(name => name.indexOf(val) > -1) this.iconList = originList.filter(name => name.indexOf(val) > -1)
} else { } else {
@ -60,13 +54,13 @@ export default {
} }
}, },
methods: { methods: {
onOpen() { onOpen () {
this.active = this.current this.active = this.current
this.key = '' this.key = ''
}, },
onClose() { onClose () {
}, },
onSelect(icon) { onSelect (icon) {
this.active = icon this.active = icon
this.$emit('select', icon) this.$emit('select', icon)
this.$emit('update:visible', false) this.$emit('update:visible', false)
@ -120,7 +114,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
.el-dialog__header { .el-dialog__header {
padding-top: 14px; // padding-top: 14px;
} }
.el-dialog__body { .el-dialog__body {

58
src/views/form/index.vue

@ -13,13 +13,14 @@
</el-button> </el-button>
</el-row> </el-row>
</el-card> --> </el-card> -->
<div class="main-container"> <div v-if="!previewDialogVisible"
class="main-container">
<div class="left-menu-container"> <div class="left-menu-container">
<el-menu :collapse="isCollapse" <el-menu :collapse="isCollapse"
:default-active="defaultActiveMenu" :default-active="defaultActiveMenu"
class="el-menu-vertical"> class="el-menu-vertical">
<el-menu-item class="el-menu-item-per" <el-menu-item class="el-menu-item-per"
v-for="menuItem in (publishStatus?menuItemList2:menuItemList)" v-for="menuItem in (publishStatus===1?menuItemList1:publishStatus===2?menuItemList2:menuItemList3)"
:key="menuItem.key" :key="menuItem.key"
:index="menuItem.route" :index="menuItem.route"
@click="menuSelectHandle(menuItem.route,menuItem.key)"> @click="menuSelectHandle(menuItem.route,menuItem.key)">
@ -43,12 +44,19 @@
<router-view /> <router-view />
</div> </div>
</div> </div>
<el-dialog :visible.sync="previewDialogVisible" <div v-if="previewDialogVisible">
<pre-view :key="previewKey"
:showCloseBtn="true"
:preview-qrcode="true"
@diaCancal="diaCancal" />
</div>
<!-- <el-dialog :visible.sync="previewDialogVisible"
class="dialog"
destroy-on-close destroy-on-close
fullscreen> fullscreen>
<pre-view :key="previewKey" <pre-view :key="previewKey"
:preview-qrcode="true" /> :preview-qrcode="true" />
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
@ -61,13 +69,13 @@ export default {
components: { PreView }, components: { PreView },
data () { data () {
return { return {
publishStatus: true, publishStatus: 1,
previewKey: +new Date(), previewKey: +new Date(),
previewDialogVisible: false, previewDialogVisible: false,
defaultActiveMenu: '', defaultActiveMenu: '',
projectKey: null, projectKey: null,
isCollapse: false, isCollapse: false,
menuItemList: [ menuItemList1: [
{ {
key: 'edit', key: 'edit',
title: '编辑', title: '编辑',
@ -141,6 +149,23 @@ export default {
title: '返回', title: '返回',
icon: 'el-icon-back' icon: 'el-icon-back'
} }
], menuItemList3: [
{
key: 'static',
title: '统计',
icon: 'el-icon-data-line',
route: '/project/form/statistics'
},
{
key: 'preview',
title: '预览',
icon: 'el-icon-view'
},
{
key: 'back',
title: '返回',
icon: 'el-icon-back'
}
] ]
} }
}, },
@ -154,16 +179,20 @@ export default {
}, },
methods: { methods: {
diaCancal () {
this.previewDialogVisible = false
},
getProjectStatus () { getProjectStatus () {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => { this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/${this.projectKey}`).then(res => {
if (res.data.status == 1) { console.log('状态', res.data.status)
this.publishStatus = false this.publishStatus = res.data.status
} else {
this.publishStatus = true
if (this.publishStatus === 3) {
this.menuSelectHandle('/project/form/statistics', 'static')
} }
}) })
}, },
@ -239,13 +268,13 @@ export default {
.main-container { .main-container {
width: 100vw; width: 100vw;
height: calc(100vh - 60px); height: 100vh;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.right-content-container { .right-content-container {
width: calc(100vw - 100px); width: 100vw;
height: calc(100vh - 60px); height: 100vh;
overflow-x: hidden; overflow-x: hidden;
} }
} }
@ -284,6 +313,9 @@ export default {
} }
} }
} }
::v-deep.el-dialog__header {
padding-top: 0px;
}
::v-deep.preview-container { ::v-deep.preview-container {
background-color: #ffffff; background-color: #ffffff;

55
src/views/form/preview/index.vue

@ -1,6 +1,12 @@
<template> <template>
<div class="preview-container"> <div class="preview-container">
<el-tabs v-if="projectConfig.projectKey" type="card"> <el-button v-if="showCloseBtn"
@click="diaCancal"
class="btn_close"
icon="el-icon-close"
circle></el-button>
<el-tabs v-if="projectConfig.projectKey"
type="card">
<el-tab-pane> <el-tab-pane>
<span slot="label"><i class="el-icon-mobile" /> <span slot="label"><i class="el-icon-mobile" />
手机 手机
@ -10,10 +16,10 @@
<div class="preview-phone"> <div class="preview-phone">
<iframe id="preview-html" <iframe id="preview-html"
:src="mobilePreviewUrl" :src="mobilePreviewUrl"
class="preview-html" frameborder="0" class="preview-html"
frameborder="0"
name="preview-html" name="preview-html"
scrolling="auto" scrolling="auto" />
/>
</div> </div>
</div> </div>
<!-- <div v-if="mobilePreviewUrl&&previewQrcode" class="qrcode-view"> <!-- <div v-if="mobilePreviewUrl&&previewQrcode" class="qrcode-view">
@ -28,10 +34,8 @@
电脑 电脑
</span> </span>
<el-scrollbar style="height: 77vh;overflow-x: hidden!important;"> <el-scrollbar style="height: 77vh;overflow-x: hidden!important;">
<project-form <project-form v-if="projectConfig.projectKey"
v-if="projectConfig.projectKey" :project-config="projectConfig" />
:project-config="projectConfig"
/>
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -49,9 +53,13 @@ export default {
// VueQr // VueQr
}, },
props: { props: {
previewQrcode: null previewQrcode: null,
showCloseBtn: {
type: Boolean,
default: false
}
}, },
data() { data () {
return { return {
projectKey: null, projectKey: null,
mobilePreviewUrl: '', mobilePreviewUrl: '',
@ -61,24 +69,34 @@ export default {
} }
} }
}, },
mounted() { mounted () {
this.projectKey = this.$route.query.key this.projectKey = this.$route.query.key
let url = window.location.protocol + '//' + window.location.host let url = window.location.protocol + '//' + window.location.host
this.mobilePreviewUrl = `${url}/${process.env.VUE_APP_PUBLIC_PATH}/project/view?key=${this.projectKey}` this.mobilePreviewUrl = `${url}/${process.env.VUE_APP_PUBLIC_PATH}/project/view?key=${this.projectKey}`
this.$set(this.projectConfig, 'projectKey', this.projectKey) this.$set(this.projectConfig, 'projectKey', this.projectKey)
},
methods: {
diaCancal () {
this.$emit("diaCancal")
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.preview-container { .preview-container {
margin: 0; margin: 0;
padding-top: 30px; padding-top: 15px;
background-color: #f7f7f7; background-color: #f7f7f7;
position: relative;
}
.btn_close {
position: absolute;
right: 200px;
top: 20px;
} }
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__nav{ ::v-deep .el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 1px solid #E4E7ED!important; border: 1px solid #e4e7ed !important;
} }
::v-deep .el-tabs__header { ::v-deep .el-tabs__header {
width: 300px; width: 300px;
@ -110,16 +128,16 @@ div.preview-layer .preview-bg {
div.preview-layer .preview-phone { div.preview-layer .preview-phone {
width: 372px; width: 372px;
height: 744px; height: 744px;
background: url('~@/assets/images/appearset_bgc_big.png'); background: url("~@/assets/images/appearset_bgc_big.png");
background-size: 372px 744px; background-size: 372px 744px;
z-index: 1000; z-index: 1000;
} }
.qrcode-view{ .qrcode-view {
position: absolute; position: absolute;
top: 0; top: 0;
right: 20px; right: 20px;
p{ p {
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
color: #303133; color: #303133;
@ -142,5 +160,4 @@ div.preview-layer .preview-phone {
border-bottom-width: 0; border-bottom-width: 0;
border-left-width: 0; border-left-width: 0;
} }
</style> </style>

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

@ -236,6 +236,7 @@ export default {
this.msgSuccess('停止成功') this.msgSuccess('停止成功')
this.$parent.getProjectStatus() this.$parent.getProjectStatus()
this.getProjectStatus() this.getProjectStatus()
// this.$router.push({ path: '/home' })
} }
}) })
}, },

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

@ -6,8 +6,7 @@
class="project-setting-container" class="project-setting-container"
justify="center" justify="center"
type="flex"> type="flex">
<el-col :offset="3" <el-col :span="6"
:span="5"
class="project-setting-view"> class="project-setting-view">
<p class="project-setting-title"> <p class="project-setting-title">
提交设置 提交设置
@ -104,7 +103,8 @@
</el-col> </el-col>
</el-row> --> </el-row> -->
</el-col> </el-col>
<el-col :span="6" <el-col :offset="3"
:span="6"
class="project-setting-view text-center"> class="project-setting-view text-center">
<p class="project-setting-title"> <p class="project-setting-title">
回收设置 回收设置
@ -776,7 +776,7 @@ export default {
<style scoped> <style scoped>
.project-setting-container { .project-setting-container {
width: 100%; width: 100%;
height: 100%; height: 100vh;
min-height: 85vh; min-height: 85vh;
padding-top: 30px; padding-top: 30px;
margin: 0; margin: 0;
@ -784,7 +784,7 @@ export default {
} }
.project-setting-view { .project-setting-view {
height: 100%; height: 98%;
line-height: 20px; line-height: 20px;
border-radius: 7px; border-radius: 7px;
color: rgba(16, 16, 16, 100); color: rgba(16, 16, 16, 100);

2
src/views/form/statistics/public.vue

@ -150,7 +150,7 @@ export default {
} }
.el-main { .el-main {
background-color: rgba(247, 247, 247, 90); background-color: rgba(247, 247, 247, 90);
height: calc(100vh - 60px); height: 100vh;
} }
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
.public-result-table { .public-result-table {

21
src/views/form/theme/index.vue

@ -1,25 +1,26 @@
<template> <template>
<div class="theme-container"> <div class="theme-container">
<div class="left-container"> <div v-if="false"
class="left-container">
<el-scrollbar class="left-scrollbar-container"> <el-scrollbar class="left-scrollbar-container">
<p class="theme-title">外观主题</p> <p class="theme-title">外观主题</p>
<el-row> <el-row>
<el-col :span="3"> <el-col :span="6">
<span class="theme-prompt-text">风格</span> <span class="theme-prompt-text">风格</span>
</el-col> </el-col>
<el-col v-for="item in styleList" <el-col v-for="item in styleList"
:key="item.key" :key="item.key"
:span="3"> :span="6">
<span :class="{'style-btn-active':activeStyle==item.key}" <span :class="{'style-btn-active':activeStyle==item.key}"
class="style-btn" class="style-btn"
@click="activeStyleHandle(item)">{{ item.label }}</span> @click="activeStyleHandle(item)">{{ item.label }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row style="margin-top:20px">
<el-col :span="3"> <el-col :span="6">
<span class="theme-prompt-text">颜色</span> <span class="theme-prompt-text">颜色</span>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="6">
<span :class="{'style-btn-active':activeColor==''}" <span :class="{'style-btn-active':activeColor==''}"
class="style-btn" class="style-btn"
@click="activeColorHandle('')">全部</span> @click="activeColorHandle('')">全部</span>
@ -27,7 +28,7 @@
<el-col v-for="c in colorList" <el-col v-for="c in colorList"
:key="c" :key="c"
:class="{'style-btn-active':activeColor==c}" :class="{'style-btn-active':activeColor==c}"
:span="3" :span="6"
:style="{backgroundColor: c}" :style="{backgroundColor: c}"
class="color-btn" class="color-btn"
@click.native="activeColorHandle(c)" /> @click.native="activeColorHandle(c)" />
@ -391,7 +392,7 @@ export default {
<style scoped> <style scoped>
.theme-container { .theme-container {
width: 100%; width: 100vw;
height: 100%; height: 100%;
background-color: #f7f7f7; background-color: #f7f7f7;
overflow: hidden; overflow: hidden;
@ -407,7 +408,7 @@ export default {
border: 1px solid rgba(255, 255, 255, 100); border: 1px solid rgba(255, 255, 255, 100);
background-color: white; background-color: white;
width: 20%; width: 20%;
height: calc(100vh - 60px); height: 100vh;
} }
.left-scrollbar-container { .left-scrollbar-container {
height: 100%; height: 100%;
@ -481,7 +482,7 @@ export default {
} }
.right-container { .right-container {
width: 310px; width: 310px;
height: calc(100vh - 60px); height: 100vh;
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
padding: 22px; padding: 22px;

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

@ -307,13 +307,24 @@ export default {
'orgType': this.orgType,//(:agency;:dept;:grid) 'orgType': this.orgType,//(:agency;:dept;:grid)
'realName': this.realName,// 'realName': this.realName,//
//'accessKey':this.accessKey //'accessKey':this.accessKey
}).then(() => { }).then((res) => {
if (res.code !== 0) {
this.$message(
{
message: res.msg,
type: 'warning'
}
)
} else {
this.writeStatus = 2 this.writeStatus = 2
if (this.userProjectSetting.submitJumpUrl) { if (this.userProjectSetting.submitJumpUrl) {
setTimeout(() => { setTimeout(() => {
window.location.replace(this.userProjectSetting.submitJumpUrl) window.location.replace(this.userProjectSetting.submitJumpUrl)
}, 1000) }, 1000)
} }
}
}) })
} }

Loading…
Cancel
Save