diff --git a/.env.development b/.env.development index cf41b70..d764f67 100644 --- a/.env.development +++ b/.env.development @@ -9,3 +9,5 @@ VUE_APP_CDN = OFF VUE_APP_DEBUG_TOOL = # 高德地图key VUE_APP_MAP_KEY = f2200337d0d08538e78729572749882d +# 微信功能开关 开启设置 ON,关闭设置 OFF +VUE_APP_WX = ON diff --git a/.env.production b/.env.production index 3741072..c414eda 100644 --- a/.env.production +++ b/.env.production @@ -9,3 +9,5 @@ VUE_APP_CDN = OFF VUE_APP_DEBUG_TOOL = # 高德地图key VUE_APP_MAP_KEY = f2200337d0d08538e78729572749882d +# 微信功能开关 开启设置 ON,关闭设置 OFF +VUE_APP_WX = ON diff --git a/.eslintignore b/.eslintignore index e09f782..14ae794 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,4 @@ src/components/echarts/china.js src/components/render/ src/components/verifition/ src/components/tinymce/ -src/views/form/RightPanel.vue +src/views/form/editor/RightPanel.vue diff --git a/plop-templates/component/prompt.js b/plop-templates/component/prompt.js index 13739d1..ba1ca5b 100644 --- a/plop-templates/component/prompt.js +++ b/plop-templates/component/prompt.js @@ -47,7 +47,7 @@ module.exports = { actions: data => { let path = '' if (data.isGlobal) { - path = 'src/components/{{properCase name}}/index.vue' + path = 'src/components/{{properCase name}}/oldIndex.vue' } else { path = `${data.path}/components/{{properCase name}}/index.vue` } diff --git a/src/api/index.js b/src/api/index.js index cb35d32..b3390d7 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,6 @@ import axios from 'axios' // import qs from 'qs' -import {MessageBox, Message} from 'element-ui' +import {Message, MessageBox} from 'element-ui' import Verification from '@/components/verifition/verification.js' import router from '@/router/index' import store from '@/store/index' @@ -39,7 +39,11 @@ api.interceptors.request.use( } ) -function signRequest(request) { +/** + * 签名请求 + * @param request + */ +const signRequest = request => { // 签名验证 if (request.params == undefined) { request.params = {} @@ -51,7 +55,8 @@ function signRequest(request) { } api.interceptors.response.use( - response => { + async response => { + console.log(response) /** * 全局拦截请求发送后返回的数据,如果数据有报错则在这做全局的错误提示 * 假设返回数据格式为:{"code":500,"msg":"邮箱地址不正确","data":null} @@ -60,16 +65,11 @@ api.interceptors.response.use( * 请求出错时 msg 会返回错误信息 * 则代码如下 */ - console.log(response) let errCodes = [500, 405, 403] const res = response.data - // eslint-disable-next-line no-debugger - debugger if (res.code === 200) { return Promise.resolve(res) } else if (errCodes.includes(res.code)) { - // eslint-disable-next-line no-debugger - debugger // 这里做错误提示,如果使用了 element ui 则可以使用 Message 进行提示 Message({ message: res.msg || 'Error', @@ -99,18 +99,17 @@ api.interceptors.response.use( } return Promise.reject(res) } else if (res.code === 416) { - console.log('validate') - Verification().then(value => { - console.log(value) - setTimeout(function() { - response.config.params.slideCode = value - delete response.config.params.sign + // 需要滑动验证 + let result = {} + await Verification().then(async value => { + response.config.params.slideCode = value + delete response.config.params.sign + if (response.config.data) { response.config.data = JSON.parse(response.config.data) - signRequest(response.config) - return axios(response.config) - }, 1000) + } + result = await api.request(response.config) }) - return Promise.reject(res) + return Promise.resolve(result) } return Promise.resolve(res) }, diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index b662055..d4f82f6 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -72,7 +72,7 @@ div:focus { margin-right: 10px; } .ml-20 { - margin-left: 20px; + margin-left: 20px !important; } .ml-10 { margin-left: 10px; @@ -99,6 +99,11 @@ div:focus { flex-direction: column; box-sizing: border-box; } +.flex-center { + display: flex; + justify-content: center; + align-content: center; +} .desc-text { color: rgba(155, 155, 155, 100); font-size: 14px; @@ -107,6 +112,9 @@ div:focus { .width-full { width: 100% !important; } +.width50 { + width: 50% !important; +} .width80 { width: 80% !important; margin: 0 auto; diff --git a/src/assets/styles/resources/element-variables.scss b/src/assets/styles/resources/element-variables.scss index e114288..a123c0d 100644 --- a/src/assets/styles/resources/element-variables.scss +++ b/src/assets/styles/resources/element-variables.scss @@ -19,6 +19,8 @@ $--border-color-lighter: #e6ebf5; $--table-border: 1px solid #dfe6ec; +$--box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + /* icon font path, required */ $--font-path: "~element-ui/lib/theme-chalk/fonts"; @import "../../../../node_modules/element-ui/packages/theme-chalk/src/index"; diff --git a/src/assets/styles/resources/variables.scss b/src/assets/styles/resources/variables.scss index eff6f98..decb04a 100644 --- a/src/assets/styles/resources/variables.scss +++ b/src/assets/styles/resources/variables.scss @@ -1,23 +1,23 @@ // base color -$blue:#324157; -$light-blue:#3a71a8; -$red:#c03639; +$blue: #324157; +$light-blue: #3a71a8; +$red: #c03639; $pink: #e65d6e; $green: #30b08f; $tiffany: #4ab7bd; -$yellow:#fec171; +$yellow: #fec171; $panGreen: #30b08f; - +$backgroundColor: rgba(247, 247, 247, 90); // sidebar -$menuText:#bfcbd9; -$menuActiveText:#409eff; -$subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951 +$menuText: #bfcbd9; +$menuActiveText: #409eff; +$subMenuActiveText: #f4f4f5; // https://github.com/ElemeFE/element/issues/12951 -$menuBg:#304156; -$menuHover:#263445; +$menuBg: #304156; +$menuHover: #263445; -$subMenuBg:#1f2d3d; -$subMenuHover:#001528; +$subMenuBg: #1f2d3d; +$subMenuHover: #001528; $sideBarWidth: 210px; diff --git a/src/components/form/SignPad/index.vue b/src/components/form/SignPad/index.vue index 1c39ce2..b4ccf97 100644 --- a/src/components/form/SignPad/index.vue +++ b/src/components/form/SignPad/index.vue @@ -2,7 +2,7 @@
- +

请在上面区域完成签名 然后点击确"确认"按钮

diff --git a/src/components/generator/config.js b/src/components/generator/config.js index 6c49857..9a20785 100644 --- a/src/components/generator/config.js +++ b/src/components/generator/config.js @@ -496,6 +496,7 @@ export const imageComponents = [ __config__: { label: '图片展示', showLabel: false, + displayType: true, labelWidth: null, showDefaultValue: false, showRequired: false, @@ -505,7 +506,7 @@ export const imageComponents = [ tagIcon: 'image', layout: 'colFormItem', span: 24, - required: true, + required: false, regList: [], changeTag: true }, @@ -522,6 +523,7 @@ export const imageComponents = [ __config__: { label: '图片轮播', showLabel: false, + displayType: true, labelWidth: null, defaultValue: null, showDefaultValue: false, @@ -579,6 +581,7 @@ export const assistComponents = [ __config__: { label: '文字描述', defaultValue: '描述文字', + displayType: true, showDefaultValue: true, showRequired: false, showClearable: false, @@ -600,6 +603,7 @@ export const assistComponents = [ __config__: { label: '分割线', defaultValue: '分割线', + displayType: true, showLabel: false, showDefaultValue: false, showRequired: false, @@ -621,7 +625,7 @@ export const assistComponents = [ typeId: 'SIGN_PAD', __config__: { label: '手写签名', - defaultValue: '手写签名', + defaultValue: '', showLabel: true, showDefaultValue: true, showRequired: true, @@ -644,6 +648,7 @@ export const assistComponents = [ __config__: { label: '分页', defaultValue: '分页', + displayType: true, showLabel: false, showDefaultValue: false, showRequired: false, @@ -667,7 +672,7 @@ export const assistComponents = [ ] // 个人信息组件 -export const personalInfoComponents = [ +export const personalInfoComponents = [ { typeId: 'INPUT', __config__: { diff --git a/src/components/parser/Parser.vue b/src/components/parser/Parser.vue index 32f2bf4..fd8af7c 100644 --- a/src/components/parser/Parser.vue +++ b/src/components/parser/Parser.vue @@ -150,9 +150,9 @@ function setUpload(config, scheme, response, file, fileList) { newValue = [] } newValue.push({fileName: file.name, url: response.data}) - this.$set(config, 'defaultValue', JSON.stringify(newValue)) - this.$set(this[this.formConf.formModel], scheme.__vModel__, JSON.stringify(newValue)) - setValueLabel.call(this, {type: 'file', files: JSON.stringify(newValue)}, config, scheme) + this.$set(config, 'defaultValue', newValue) + this.$set(this[this.formConf.formModel], scheme.__vModel__, newValue) + setValueLabel.call(this, {type: 'file', files: newValue}, config, scheme) } function deleteUpload(config, scheme, file, fileList) { @@ -160,9 +160,9 @@ function deleteUpload(config, scheme, file, fileList) { fileList.forEach(element => { newValue.push({fileName: element.name, url: element.url}) }) - this.$set(config, 'defaultValue', JSON.stringify(newValue)) - this.$set(this[this.formConf.formModel], scheme.__vModel__, JSON.stringify(newValue)) - setValueLabel.call(this, {type: 'file', files: JSON.stringify(newValue)}, config, scheme) + this.$set(config, 'defaultValue', newValue) + this.$set(this[this.formConf.formModel], scheme.__vModel__, newValue) + setValueLabel.call(this, {type: 'file', files: newValue}, config, scheme) } function setValue(event, config, scheme) { diff --git a/src/components/render/slots/el-carousel.js b/src/components/render/slots/el-carousel.js index 54ba8ae..ca65f03 100644 --- a/src/components/render/slots/el-carousel.js +++ b/src/components/render/slots/el-carousel.js @@ -4,7 +4,7 @@ export default { let style = 'height: 100%;' conf.__slot__.options.forEach(item => { list.push( - {item.label} +

{item.label}

) }) diff --git a/src/router/modules/form.js b/src/router/modules/form.js index c1550a3..c2e0511 100644 --- a/src/router/modules/form.js +++ b/src/router/modules/form.js @@ -2,7 +2,7 @@ export default [ { path: '/project/form', meta: {requireLogin: false}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/newIndex.vue'), + component: () => import(/* webpackChunkName: 'root' */ '@/views/form'), children: [ { path: '', @@ -22,7 +22,7 @@ export default [ { path: 'preview', meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/PreView') + component: () => import(/* webpackChunkName: 'root' */ '@/views/form/preview') }, { path: 'setting', diff --git a/src/router/modules/project.js b/src/router/modules/project.js new file mode 100644 index 0000000..1879a47 --- /dev/null +++ b/src/router/modules/project.js @@ -0,0 +1,50 @@ +export default [ + { + path: '/project', + meta: {requireLogin: true}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/home'), + children: [ + { + path: 'my', + meta: {requireLogin: true}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/project/my/index') + }, + { + path: 'recycle', + meta: {requireLogin: true}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/project/recycle/index') + }, + { + path: 'template', + meta: {requireLogin: true}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/project/template/index') + }, + + { + path: 'template/preview', + meta: {requireLogin: true}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/project/template/preview.vue') + } + ] + }, + { + path: '/project/view', + meta: {requireLogin: false}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/form/preview/ProjectForm.vue') + }, + { + path: '/project/public/result', + meta: {requireLogin: false}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/form/statistics/public') + }, + { + path: '/s/:key', + meta: {requireLogin: false}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/form/write') + }, + { + path: '/project/write', + meta: {requireLogin: false}, + component: () => import(/* webpackChunkName: 'root' */ '@/views/form/write') + } +] diff --git a/src/router/modules/root.js b/src/router/modules/root.js index 44c4e7c..d24eb25 100644 --- a/src/router/modules/root.js +++ b/src/router/modules/root.js @@ -54,27 +54,12 @@ export default [ { path: '/home', meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/home/NewIndex'), + component: () => import(/* webpackChunkName: 'root' */ '@/views/home'), children: [ { path: '/', meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/MyProject') - }, - { - path: 'my', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/MyProject') - }, - { - path: 'recycle', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/RecycleBin') - }, - { - path: 'template', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/template.vue') + component: () => import(/* webpackChunkName: 'root' */ '@/views/project/my/index') }, { path: 'member', @@ -82,51 +67,6 @@ export default [ component: () => import(/* webpackChunkName: 'root' */ '@/views/account/member') } ] - }, { - path: '/project', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/home/index.vue'), - children: [ - { - path: 'create', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/template.vue') - }, - { - path: 'my', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/MyProject.vue') - }, - - { - path: 'template/preview', - meta: {requireLogin: true}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/project/TemplatePreview.vue') - } - // { - // path: 'form', - // meta: {requireLogin: true}, - // component: () => import(/* webpackChunkName: 'root' */ '@/views/form/index1.vue') - // } - ] - }, - { - path: '/project/preview', - meta: {requireLogin: false}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/PreView.vue') - }, { - path: '/project/view', - meta: {requireLogin: false}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/ProjectForm.vue') - }, - { - path: '/s/:key', - meta: {requireLogin: false}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/write.vue') - }, - { - path: '/project/write', - meta: {requireLogin: false}, - component: () => import(/* webpackChunkName: 'root' */ '@/views/form/write.vue') } + ] diff --git a/src/utils/constants.js b/src/utils/constants.js index 19ca04f..8dc5cad 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -4,5 +4,7 @@ export default { // 密码正则 passwordReg: /^.{6,}$/, passwordRegDesc: '密码最少为6位字符', - userUploadUrl: `${process.env.VUE_APP_API_ROOT}/user/file/upload` + userUploadUrl: `${process.env.VUE_APP_API_ROOT}/user/file/upload`, + // 启用微信功能 + enableWx: process.env.VUE_APP_WX == 'ON' } diff --git a/src/utils/convert.js b/src/utils/convert.js index c28d0e4..43a5a39 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -20,6 +20,7 @@ export function formItemConvertData(item, projectKey) { 'regList': item.__config__.regList, 'showLabel': item.__config__.showLabel, 'span': item.__config__.span, + 'displayType': item.displayType, 'projectKey': projectKey } let expand = {} @@ -64,6 +65,7 @@ export function dbDataConvertForItemJson(data) { jsonItem.dId = data.id jsonItem.sort = data.sort jsonItem.typeId = data.type + jsonItem.displayType = data.displayType jsonItem.__config__.span = data.span jsonItem.__config__.formId = data.formItemId jsonItem.__config__.label = data.label @@ -97,7 +99,9 @@ const dataParams = { // 单行文本 'INPUT': { 'prepend': '__slot__.prepend', + 'prefixIcon': 'prefix-icon', 'maxlength': 'maxlength', + 'showWordLimit': 'show-word-limit', 'append': '__slot__.append' }, // 多行文本 diff --git a/src/utils/sign.js b/src/utils/sign.js index 4a1496a..fb9beb0 100644 --- a/src/utils/sign.js +++ b/src/utils/sign.js @@ -48,6 +48,7 @@ export default class sign { let jsonObj = _.merge(urlParams, requestParams) jsonObj = _.merge(jsonObj, dataParams) let requestBody = this.sortAsc(jsonObj) + console.log(jsonObj) return CryptoJS.MD5(constants.signSecret + JSON.stringify(requestBody)).toString().toLowerCase() } diff --git a/src/views/account/ForgetPwd.vue b/src/views/account/ForgetPwd.vue index a3a23b6..b4f1a7f 100644 --- a/src/views/account/ForgetPwd.vue +++ b/src/views/account/ForgetPwd.vue @@ -14,7 +14,7 @@ /> - + @@ -22,7 +22,7 @@ - + 找回密码 @@ -37,7 +37,7 @@ - + 找回密码 @@ -78,26 +78,14 @@ 没有收到邮件?请检查您的垃圾邮件或者重新发送

-
- diff --git a/src/views/form/logic.vue b/src/views/form/logic/index.vue similarity index 99% rename from src/views/form/logic.vue rename to src/views/form/logic/index.vue index 96f96e3..6fdbe55 100644 --- a/src/views/form/logic.vue +++ b/src/views/form/logic/index.vue @@ -129,7 +129,7 @@ - - diff --git a/src/views/form/oldIndex.vue b/src/views/form/oldIndex.vue new file mode 100644 index 0000000..9c40257 --- /dev/null +++ b/src/views/form/oldIndex.vue @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/form/ProjectForm.vue b/src/views/form/preview/ProjectForm.vue similarity index 100% rename from src/views/form/ProjectForm.vue rename to src/views/form/preview/ProjectForm.vue diff --git a/src/views/form/PreView.vue b/src/views/form/preview/index.vue similarity index 100% rename from src/views/form/PreView.vue rename to src/views/form/preview/index.vue diff --git a/src/views/form/publish.vue b/src/views/form/publish/index.vue similarity index 100% rename from src/views/form/publish.vue rename to src/views/form/publish/index.vue diff --git a/src/views/form/setting.vue b/src/views/form/setting/index.vue similarity index 98% rename from src/views/form/setting.vue rename to src/views/form/setting/index.vue index 7557006..12b7585 100644 --- a/src/views/form/setting.vue +++ b/src/views/form/setting/index.vue @@ -5,7 +5,6 @@

提交设置

-

提交后

显示提示图片

@@ -87,8 +86,21 @@ />
+ + +

公开反馈结果

+
+ + + +
- +

回收设置

@@ -572,6 +584,7 @@ export default { submitPromptText: '提交成功 !', submitJumpUrl: '', wxWrite: false, + publicResult: false, timedNotEnabledPromptText: '填写尚未启用', timedDeactivatePromptText: '填写尚已经停用', timedQuantitativeQuantity: null, diff --git a/src/views/form/statistics.vue b/src/views/form/statistics/index.vue similarity index 90% rename from src/views/form/statistics.vue rename to src/views/form/statistics/index.vue index 7c1df23..6730d28 100644 --- a/src/views/form/statistics.vue +++ b/src/views/form/statistics/index.vue @@ -65,6 +65,7 @@ @@ -76,25 +77,10 @@

{{ item.label }}

- -
- - {{ file.fileName }} - -
- - {{ - activeResultRow ? - activeResultRow['processData'][`field${item.formItemId}`] : '' - }} - + +
@@ -146,7 +132,7 @@ + diff --git a/src/views/form/statistics/public.vue b/src/views/form/statistics/public.vue new file mode 100644 index 0000000..71d43ec --- /dev/null +++ b/src/views/form/statistics/public.vue @@ -0,0 +1,185 @@ + + + + diff --git a/src/views/form/theme.vue b/src/views/form/theme/index.vue similarity index 99% rename from src/views/form/theme.vue rename to src/views/form/theme/index.vue index 99ec15a..0237fbe 100644 --- a/src/views/form/theme.vue +++ b/src/views/form/theme/index.vue @@ -237,7 +237,7 @@ - - diff --git a/src/views/home/index.vue b/src/views/home/index.vue index b407bf6..f5c9ac0 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,102 +1,106 @@ + - diff --git a/src/views/home/oldIndex.vue b/src/views/home/oldIndex.vue new file mode 100644 index 0000000..44febee --- /dev/null +++ b/src/views/home/oldIndex.vue @@ -0,0 +1,205 @@ + + + diff --git a/src/views/project/MyProject.vue b/src/views/project/my/index.vue similarity index 99% rename from src/views/project/MyProject.vue rename to src/views/project/my/index.vue index 3234b09..d7ffddb 100644 --- a/src/views/project/MyProject.vue +++ b/src/views/project/my/index.vue @@ -120,7 +120,7 @@ -
+
diff --git a/src/views/project/RecycleBin.vue b/src/views/project/recycle/index.vue similarity index 100% rename from src/views/project/RecycleBin.vue rename to src/views/project/recycle/index.vue diff --git a/src/views/project/template.vue b/src/views/project/template/index.vue similarity index 74% rename from src/views/project/template.vue rename to src/views/project/template/index.vue index 96bcfa5..fe595be 100644 --- a/src/views/project/template.vue +++ b/src/views/project/template/index.vue @@ -1,48 +1,41 @@