From 664e1fb8b08526ccb1a8c043a2ad3fdffbcfd01f Mon Sep 17 00:00:00 2001 From: jiangyy Date: Mon, 27 Sep 2021 16:47:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/form/home.scss | 428 +++++++++++++------------- src/views/form/editor/IconsDialog.vue | 118 ++++--- src/views/form/index.vue | 58 +++- src/views/form/preview/index.vue | 143 +++++---- src/views/form/publish/index.vue | 1 + src/views/form/setting/index.vue | 10 +- src/views/form/statistics/public.vue | 2 +- src/views/form/theme/index.vue | 21 +- src/views/form/write/index.vue | 23 +- 9 files changed, 430 insertions(+), 374 deletions(-) diff --git a/src/assets/styles/form/home.scss b/src/assets/styles/form/home.scss index 2b7f01f..d7d8f75 100644 --- a/src/assets/styles/form/home.scss +++ b/src/assets/styles/form/home.scss @@ -1,271 +1,271 @@ -@import '../resources/variables'; +@import "../resources/variables"; $selectedColor: rgba(24, 144, 255, 0.05); $lighterBlue: #1890ff; .form-edit-container { - position: relative; - width: 100%; - height: calc(100vh - 60px); - overflow-y: hidden; + position: relative; + width: 100%; + height: 100vh; + overflow-y: hidden; } .components-list { - padding: 8px; - box-sizing: border-box; - height: 100%; - .components-item { - display: inline-block; - width: 48%; - margin: 1%; - transition: transform 0ms !important; - } + padding: 8px; + box-sizing: border-box; + height: 100%; + .components-item { + display: inline-block; + width: 48%; + margin: 1%; + transition: transform 0ms !important; + } } .components-draggable { - padding-bottom: 20px; + padding-bottom: 20px; } .components-title { - font-size: 14px; - color: #222; - margin: 6px 2px; - .svg-icon { - color: #666; - font-size: 18px; - } + font-size: 14px; + color: #222; + margin: 6px 2px; + .svg-icon { + color: #666; + font-size: 18px; + } } .components-body { - padding: 8px 10px; - background: $selectedColor; - font-size: 12px; - cursor: move; - border: 1px dashed $selectedColor; - border-radius: 3px; + padding: 8px 10px; + background: $selectedColor; + font-size: 12px; + cursor: move; + border: 1px dashed $selectedColor; + border-radius: 3px; + .svg-icon { + color: #777; + font-size: 15px; + } + &:hover { + border: 1px dashed $--color-primary; + color: $--color-primary; .svg-icon { - color: #777; - font-size: 15px; - } - &:hover { - border: 1px dashed $--color-primary; - color: $--color-primary; - .svg-icon { - color: $--color-primary; - } + color: $--color-primary; } + } } .left-board { - width: 260px; - position: absolute; - left: 10px; - top: 0; - margin-top: 5px; - height: calc(100vh - 80px); - background-color: rgba(255, 255, 255, 100); - box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); - border: 1px solid rgba(255, 255, 255, 100); + width: 260px; + position: absolute; + left: 10px; + top: 0; + margin-top: 5px; + height: calc(100vh - 20px); + background-color: rgba(255, 255, 255, 100); + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + border: 1px solid rgba(255, 255, 255, 100); } .el-menu.el-menu--horizontal { - border-bottom: none; + border-bottom: none; } .left-scrollbar { - height: calc(100vh - 80px); - overflow: hidden; - margin: 5px; - border-radius: 7px; + height: calc(100vh - 20px); + overflow: hidden; + margin: 5px; + border-radius: 7px; } .center-scrollbar { - height: calc(100vh - 60px); - overflow: hidden; - width: 90%; - margin: 20px auto 0; - box-sizing: border-box; - background-color: rgb(255, 255, 255); - border: 2px solid rgba(255, 255, 255, 100); - overflow-y: hidden; + height: 100vh; + overflow: hidden; + width: 90%; + margin: 20px auto 0; + box-sizing: border-box; + background-color: rgb(255, 255, 255); + border: 2px solid rgba(255, 255, 255, 100); + overflow-y: hidden; } .center-board { - height: calc(100vh - 220px); - width: auto; - margin: 0 350px 80px 260px; - box-sizing: border-box; + height: calc(100vh - 220px); + width: auto; + margin: 0 350px 80px 260px; + box-sizing: border-box; } .empty-info { - position: absolute; - top: 36%; - left: 0; - right: 0; - text-align: center; - font-size: 18px; - color: $--color-primary; - letter-spacing: 4px; + position: absolute; + top: 36%; + left: 0; + right: 0; + text-align: center; + font-size: 18px; + color: $--color-primary; + letter-spacing: 4px; } .action-bar { - position: relative; - height: 42px; - text-align: right; - padding: 0 15px; - box-sizing: border-box; - border: 1px solid #f1e8e8; - border-top: none; - border-left: none; - .delete-btn { - color: #f56c6c; - } + position: relative; + height: 42px; + text-align: right; + padding: 0 15px; + box-sizing: border-box; + border: 1px solid #f1e8e8; + border-top: none; + border-left: none; + .delete-btn { + color: #f56c6c; + } } .center-board-row { - padding: 12px 12px 15px 12px; - box-sizing: border-box; - overflow-y: hidden; - & > .el-form { - // 69 = 12+15+42 - height: calc(100vh - 69px); - } + padding: 12px 12px 15px 12px; + box-sizing: border-box; + overflow-y: hidden; + & > .el-form { + // 69 = 12+15+42 + height: calc(100vh - 69px); + } } .drawing-board { - height: 100%; + height: 100%; + position: relative; + .components-body { + padding: 0; + margin: 0; + font-size: 0; + } + .sortable-ghost { position: relative; - .components-body { - padding: 0; - margin: 0; - font-size: 0; - } - .sortable-ghost { - position: relative; - display: block; - overflow: hidden; - &::before { - content: " "; - position: absolute; - left: 0; - right: 0; - top: 0; - height: 3px; - background: $--color-primary; - z-index: 2; - } + display: block; + overflow: hidden; + &::before { + content: " "; + position: absolute; + left: 0; + right: 0; + top: 0; + height: 3px; + background: $--color-primary; + z-index: 2; } - .components-item.sortable-ghost { - width: 100%; - height: 60px; - background-color: $selectedColor; + } + .components-item.sortable-ghost { + width: 100%; + height: 60px; + background-color: $selectedColor; + } + .active-from-item { + & > .el-form-item { + background: $selectedColor; + border-radius: 6px; } - .active-from-item { - & > .el-form-item { - background: $selectedColor; - border-radius: 6px; - } - & > .drawing-item-copy, - & > .drawing-item-delete { - display: initial; - } - & > .component-name { - color: $lighterBlue; - } + & > .drawing-item-copy, + & > .drawing-item-delete { + display: initial; } - .el-form-item { - margin-bottom: 15px; + & > .component-name { + color: $lighterBlue; } + } + .el-form-item { + margin-bottom: 15px; + } } .drawing-item { - position: relative; - cursor: move; - &.unfocus-bordered:not(.active-from-item) > div:first-child { - border: 1px dashed #ccc; - } - .el-form-item { - padding: 12px 10px; - } + position: relative; + cursor: move; + &.unfocus-bordered:not(.active-from-item) > div:first-child { + border: 1px dashed #ccc; + } + .el-form-item { + padding: 12px 10px; + } } .drawing-row-item { - position: relative; - cursor: move; - box-sizing: border-box; - border: 1px dashed #ccc; - border-radius: 3px; - padding: 0 2px; - margin-bottom: 15px; - .drawing-row-item { - margin-bottom: 2px; - } - .el-col { - margin-top: 22px; - } - .el-form-item { - margin-bottom: 0; - } - .drag-wrapper { - min-height: 80px; - } - &.active-from-item { - border: 1px dashed $lighterBlue; - } - .component-name { - position: absolute; - top: 0; - left: 0; - font-size: 12px; - color: #bbb; - display: inline-block; - padding: 0 6px; - } + position: relative; + cursor: move; + box-sizing: border-box; + border: 1px dashed #ccc; + border-radius: 3px; + padding: 0 2px; + margin-bottom: 15px; + .drawing-row-item { + margin-bottom: 2px; + } + .el-col { + margin-top: 22px; + } + .el-form-item { + margin-bottom: 0; + } + .drag-wrapper { + min-height: 80px; + } + &.active-from-item { + border: 1px dashed $lighterBlue; + } + .component-name { + position: absolute; + top: 0; + left: 0; + font-size: 12px; + color: #bbb; + display: inline-block; + padding: 0 6px; + } } .drawing-item, .drawing-row-item { - &:hover { - & > .el-form-item { - background: $selectedColor; - border-radius: 6px; - } - & > .drawing-item-copy, - & > .drawing-item-delete { - display: initial; - } + &:hover { + & > .el-form-item { + background: $selectedColor; + border-radius: 6px; } & > .drawing-item-copy, & > .drawing-item-delete { - display: none; - position: absolute; - top: -10px; - width: 22px; - height: 22px; - line-height: 22px; - text-align: center; - border-radius: 50%; - font-size: 12px; - border: 1px solid; - cursor: pointer; - z-index: 1; + display: initial; } - & > .drawing-item-copy { - right: 56px; - border-color: $lighterBlue; - color: $lighterBlue; - background: #fff; - &:hover { - background: $lighterBlue; - color: #fff; - } + } + & > .drawing-item-copy, + & > .drawing-item-delete { + display: none; + position: absolute; + top: -10px; + width: 22px; + height: 22px; + line-height: 22px; + text-align: center; + border-radius: 50%; + font-size: 12px; + border: 1px solid; + cursor: pointer; + z-index: 1; + } + & > .drawing-item-copy { + right: 56px; + border-color: $lighterBlue; + color: $lighterBlue; + background: #fff; + &:hover { + background: $lighterBlue; + color: #fff; } - & > .drawing-item-delete { - right: 24px; - border-color: #f56c6c; - color: #f56c6c; - background: #fff; - &:hover { - background: #f56c6c; - color: #fff; - } + } + & > .drawing-item-delete { + right: 24px; + border-color: #f56c6c; + color: #f56c6c; + background: #fff; + &:hover { + background: #f56c6c; + color: #fff; } + } } .form-name-text { - padding: 6px 10px; - border: 1px dashed transparent; - line-height: 30px; - margin: 0; + padding: 6px 10px; + border: 1px dashed transparent; + line-height: 30px; + margin: 0; } .form-name-text input { - border: none; - background-color: transparent; + border: none; + background-color: transparent; } [contenteditable]:focus { - outline: none; - background-color: #f4f4f4; - border: 1px solid #f4f4f4; + outline: none; + background-color: #f4f4f4; + border: 1px solid #f4f4f4; } diff --git a/src/views/form/editor/IconsDialog.vue b/src/views/form/editor/IconsDialog.vue index acf1994..c8504cd 100644 --- a/src/views/form/editor/IconsDialog.vue +++ b/src/views/form/editor/IconsDialog.vue @@ -1,38 +1,32 @@ diff --git a/src/views/form/publish/index.vue b/src/views/form/publish/index.vue index 65f7430..9e6308f 100644 --- a/src/views/form/publish/index.vue +++ b/src/views/form/publish/index.vue @@ -236,6 +236,7 @@ export default { this.msgSuccess('停止成功') this.$parent.getProjectStatus() this.getProjectStatus() + // this.$router.push({ path: '/home' }) } }) }, diff --git a/src/views/form/setting/index.vue b/src/views/form/setting/index.vue index fcbb6ef..f52b9d4 100644 --- a/src/views/form/setting/index.vue +++ b/src/views/form/setting/index.vue @@ -6,8 +6,7 @@ class="project-setting-container" justify="center" type="flex"> -

提交设置 @@ -104,7 +103,8 @@ --> -

回收设置 @@ -776,7 +776,7 @@ export default { diff --git a/src/views/form/write/index.vue b/src/views/form/write/index.vue index cdbb865..3b65377 100644 --- a/src/views/form/write/index.vue +++ b/src/views/form/write/index.vue @@ -47,6 +47,7 @@ import loadWXJs from '@/utils/loadWxSdk' import defaultValue from '@/utils/defaultValue' import { getQueryString } from '@/utils' import constants from '@/utils/constants' +import ELEMENT from 'element-ui' const uaParser = require('ua-parser-js') const ua = uaParser(navigator.userAgent) @@ -288,10 +289,18 @@ export default { let projectKey = this.projectConfig.projectKey this.$router.replace({ path: '/project/public/result', query: { projectKey } }) }, - submitForm (data) { + async submitForm (data) { + const loading = ELEMENT.Loading.service({ + fullscreen: true, + lock: true, + text: '提交中', + spinner: 'el-icon-loading', + background: 'rgba(255, 255, 255, 0.5)' + }) + // 完成时间 let inActiveTime = document.getElementById('inActiveTime').innerText - this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/create?access_key=${this.accessKey}`, { + await this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/result/create?access_key=${this.accessKey}`, { 'completeTime': inActiveTime, 'projectKey': this.projectConfig.projectKey, 'submitOs': ua.os.name, @@ -309,24 +318,19 @@ export default { //'accessKey':this.accessKey }).then((res) => { - if (res.code !== 0) { - this.$message( - { - message: res.msg, - type: 'warning' - } - ) - } else { - this.writeStatus = 2 - if (this.userProjectSetting.submitJumpUrl) { - setTimeout(() => { - window.location.replace(this.userProjectSetting.submitJumpUrl) - }, 1000) - } + this.writeStatus = 2 + if (this.userProjectSetting.submitJumpUrl) { + setTimeout(() => { + window.location.replace(this.userProjectSetting.submitJumpUrl) + }, 1000) } - - }) + }, + (msg) => { + // debugger + }) + // debugger + loading.close() } } } From 609a764be7e00748a63dc3f5164bed6d82ff5fb8 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 29 Sep 2021 15:49:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=AD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/parser/Parser.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/parser/Parser.vue b/src/components/parser/Parser.vue index c0163b7..bdda21a 100644 --- a/src/components/parser/Parser.vue +++ b/src/components/parser/Parser.vue @@ -473,6 +473,7 @@ export default { } // 处理其他输入必填校验 const validateOtherInput = (rule, value, callback) => { + debugger // 0 等于选中其他 if (value == 0 || (Array.isArray(value) && value.includes(0))) { if (!this[this.formConf.labelFormModel][`${rule.field}other`]) { From 89d58c637d2d63b667bf774143cf1c3b96369b35 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 29 Sep 2021 16:02:49 +0800 Subject: [PATCH 4/6] 11 --- src/components/parser/Parser.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/parser/Parser.vue b/src/components/parser/Parser.vue index bdda21a..f69a914 100644 --- a/src/components/parser/Parser.vue +++ b/src/components/parser/Parser.vue @@ -473,7 +473,7 @@ export default { } // 处理其他输入必填校验 const validateOtherInput = (rule, value, callback) => { - debugger + // 0 等于选中其他 if (value == 0 || (Array.isArray(value) && value.includes(0))) { if (!this[this.formConf.labelFormModel][`${rule.field}other`]) { @@ -486,6 +486,7 @@ export default { } } if (Array.isArray(config.regList)) { + debugger // 必填其他输入框校验 if (['RADIO', 'CHECKBOX'].includes(cur.typeId)) { const required = { validator: validateOtherInput, message: cur.placeholder } From e4138e298b46a3260b811f45fa385524a673aab8 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 30 Sep 2021 09:59:46 +0800 Subject: [PATCH 5/6] el-menu --- src/components/parser/Parser.vue | 2 +- src/views/form/index.vue | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/parser/Parser.vue b/src/components/parser/Parser.vue index f69a914..5626949 100644 --- a/src/components/parser/Parser.vue +++ b/src/components/parser/Parser.vue @@ -486,7 +486,7 @@ export default { } } if (Array.isArray(config.regList)) { - debugger + // 必填其他输入框校验 if (['RADIO', 'CHECKBOX'].includes(cur.typeId)) { const required = { validator: validateOtherInput, message: cur.placeholder } diff --git a/src/views/form/index.vue b/src/views/form/index.vue index ebcd1c7..3b913ad 100644 --- a/src/views/form/index.vue +++ b/src/views/form/index.vue @@ -20,15 +20,14 @@ :default-active="defaultActiveMenu" class="el-menu-vertical"> - {{ menuItem.title }} + {{ menuItem.title }} @@ -75,6 +74,7 @@ export default { defaultActiveMenu: '', projectKey: null, isCollapse: false, + menuShow: [], menuItemList1: [ { key: 'edit', @@ -177,8 +177,13 @@ export default { this.getProjectStatus() + }, methods: { + menuInit () { + this.menuShow = this.publishStatus === 1 ? this.menuItemList1 : this.publishStatus === 2 ? this.menuItemList2 : this.menuItemList3 + + }, diaCancal () { this.previewDialogVisible = false }, @@ -192,6 +197,7 @@ export default { if (this.publishStatus === 3) { this.menuSelectHandle('/project/form/statistics', 'static') } + this.menuInit() }) }, @@ -280,7 +286,9 @@ export default { } .left-menu-container { - max-width: 100px; + width: 130px; + min-width: 130px; + max-width: 200px; text-align: center; position: relative; display: flex; @@ -296,8 +304,8 @@ export default { min-height: 400px; } .el-menu-item-per { - display: flex; - line-height: 20px; + // display: flex; + // line-height: 20px; } .el-icon-d-arrow-left, @@ -306,7 +314,7 @@ export default { cursor: pointer; font-weight: 550; color: #000; - margin-bottom: 100px; + margin-bottom: 20px; &:hover { color: rgb(32, 160, 255); From cc6f1a7bfc68c6a6785327cacbe8f12a820e063e Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Sep 2021 12:40:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/my/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/project/my/index.vue b/src/views/project/my/index.vue index a60d6b0..a40c162 100644 --- a/src/views/project/my/index.vue +++ b/src/views/project/my/index.vue @@ -100,7 +100,7 @@ -

创建时间:{{ p.createdTime | formatDate }}

+

更新时间:{{ p.updatedTime | formatDate }}