diff --git a/.eslintignore b/.eslintignore index 14ae794..f488173 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,8 +3,5 @@ node_modules/ babel.config.js vue.config.js .eslintrc.js -src/components/echarts/china.js -src/components/render/ -src/components/verifition/ -src/components/tinymce/ -src/views/form/editor/RightPanel.vue +src + diff --git a/package.json b/package.json index 0ee7564..aee15fd 100644 --- a/package.json +++ b/package.json @@ -71,5 +71,19 @@ "hooks": { "pre-commit": "lint-staged" } + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/essential" + ], + "rules": {}, + "parserOptions": { + "parser": "babel-eslint" + } } + } diff --git a/src/components/generator/config.js b/src/components/generator/config.js index 87d25ac..1d1898a 100644 --- a/src/components/generator/config.js +++ b/src/components/generator/config.js @@ -22,6 +22,8 @@ export const inputComponents = [ // 组件的自定义配置 typeId: 'INPUT', __config__: { + name: 'input', + moduleType: 'input', label: '单行文本', labelWidth: null, showLabel: true, @@ -55,6 +57,8 @@ export const inputComponents = [ { typeId: 'TEXTAREA', __config__: { + name: 'textarea', + moduleType: 'input', label: '多行文本', labelWidth: null, showLabel: true, @@ -83,6 +87,8 @@ export const inputComponents = [ { typeId: 'NUMBER_INPUT', __config__: { + name: 'number', + moduleType: 'input', label: '计数器', showLabel: true, changeTag: true, @@ -112,6 +118,8 @@ export const selectComponents = [ { typeId: 'SELECT', __config__: { + name: 'select', + moduleType: 'choose', label: '下拉选择', showLabel: true, labelWidth: null, @@ -143,6 +151,8 @@ export const selectComponents = [ { typeId: 'CASCADER', __config__: { + name: 'cascader', + moduleType: 'choose', label: '级联选择', url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList', method: 'get', @@ -189,6 +199,8 @@ export const selectComponents = [ { typeId: 'RADIO', __config__: { + name: 'radio', + moduleType: 'choose', label: '单选框组', labelWidth: null, showLabel: true, @@ -221,6 +233,8 @@ export const selectComponents = [ { typeId: 'CHECKBOX', __config__: { + name: 'checkbox', + moduleType: 'choose', label: '多选框组', tag: 'el-checkbox-group', tagIcon: 'checkbox', @@ -255,10 +269,13 @@ export const selectComponents = [ { typeId: 'SWITCH', __config__: { + name: 'switch', + moduleType: 'choose', label: '开关', tag: 'el-switch', tagIcon: 'switch', defaultValue: false, + showDefaultValue: false, span: 24, showRegList: false, showLabel: true, @@ -276,11 +293,15 @@ 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', __config__: { + name: 'slider', + moduleType: 'choose', label: '滑块', tag: 'el-slider', tagIcon: 'slider', @@ -305,6 +326,8 @@ export const selectComponents = [ { typeId: 'TIME', __config__: { + name: 'time', + moduleType: 'choose', label: '时间选择', tag: 'el-time-picker', tagIcon: 'time', @@ -332,6 +355,8 @@ export const selectComponents = [ { typeId: 'TIME_RANGE', __config__: { + name: 'timeRange', + moduleType: 'choose', label: '时间范围', tag: 'el-time-picker', tagIcon: 'time-range', @@ -358,6 +383,8 @@ export const selectComponents = [ { typeId: 'DATE', __config__: { + name: 'date', + moduleType: 'choose', label: '日期选择', tag: 'el-date-picker', tagIcon: 'date', @@ -383,6 +410,8 @@ export const selectComponents = [ { typeId: 'DATE_RANGE', __config__: { + name: 'dateRange', + moduleType: 'choose', label: '日期范围', tag: 'el-date-picker', tagIcon: 'date-range', @@ -411,6 +440,8 @@ export const selectComponents = [ { typeId: 'RATE', __config__: { + name: 'rate', + moduleType: 'choose', label: '评分', tag: 'el-rate', tagIcon: 'rate', @@ -428,6 +459,7 @@ export const selectComponents = [ style: {}, max: 5, 'allow-half': false, + 'show-allow-half': false, 'show-text': false, 'show-score': false, disabled: false @@ -435,6 +467,8 @@ export const selectComponents = [ { typeId: 'COLOR', __config__: { + name: 'color', + moduleType: 'choose', label: '颜色选择', tag: 'el-color-picker', tagIcon: 'color', @@ -457,6 +491,8 @@ export const selectComponents = [ { typeId: 'UPLOAD', __config__: { + name: 'upload', + moduleType: 'choose', label: '上传', tag: 'el-upload', tagIcon: 'upload', @@ -494,6 +530,8 @@ export const imageComponents = [ { typeId: 'IMAGE', __config__: { + name: 'image', + moduleType: 'image', label: '图片展示', showLabel: false, displayType: true, @@ -521,6 +559,8 @@ export const imageComponents = [ { typeId: 'IMAGE_CAROUSEL', __config__: { + name: 'imageCarousel', + moduleType: 'image', label: '图片轮播', showLabel: false, displayType: true, @@ -549,6 +589,8 @@ export const imageComponents = [ { typeId: 'IMAGE_SELECT', __config__: { + name: 'imageSelect', + moduleType: 'image', label: '图片选择', showLabel: true, labelWidth: null, @@ -579,6 +621,8 @@ export const assistComponents = [ { typeId: 'DESC_TEXT', __config__: { + name: 'descText', + moduleType: 'assist', label: '文字描述', defaultValue: '描述文字', displayType: true, @@ -601,6 +645,8 @@ export const assistComponents = [ { typeId: 'DIVIDER', __config__: { + name: 'divider', + moduleType: 'assist', label: '分割线', defaultValue: '', displayType: true, @@ -624,6 +670,8 @@ export const assistComponents = [ { typeId: 'SIGN_PAD', __config__: { + name: 'signPad', + moduleType: 'assist', label: '手写签名', defaultValue: '', showLabel: true, @@ -646,6 +694,8 @@ export const assistComponents = [ { typeId: 'PAGINATION', __config__: { + name: 'page', + moduleType: 'assist', label: '分页', defaultValue: '分页', displayType: true, @@ -676,6 +726,8 @@ export const personalInfoComponents = [ { typeId: 'INPUT', __config__: { + name: 'phone', + moduleType: 'concat', label: '手机号', labelWidth: null, showLabel: true, @@ -712,6 +764,8 @@ export const personalInfoComponents = [ { typeId: 'INPUT', __config__: { + name: 'email', + moduleType: 'concat', label: '邮箱', labelWidth: null, showLabel: true, @@ -748,6 +802,8 @@ export const personalInfoComponents = [ { typeId: 'INPUT', __config__: { + name: 'idCard', + moduleType: 'concat', label: '身份证', labelWidth: null, showLabel: true, @@ -784,6 +840,8 @@ export const personalInfoComponents = [ { typeId: 'PROVINCE_CITY', __config__: { + name: 'provinceCity', + moduleType: 'concat', label: '省市联动', labelWidth: null, showLabel: true, @@ -804,6 +862,8 @@ export const personalInfoComponents = [ { typeId: 'INPUT_MAP', __config__: { + name: 'location', + moduleType: 'concat', label: '地理位置', labelWidth: null, showLabel: true, diff --git a/src/utils/convert.js b/src/utils/convert.js index 4973d88..4c36c6c 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -17,6 +17,8 @@ import { */ export function formItemConvertData(item, projectKey) { let data = { + 'itemKey': item.__config__.name, + 'moduleType': item.__config__.moduleType, 'type': item.typeId, 'formItemId': item.__config__.formId, 'label': item.__config__.label, @@ -72,6 +74,8 @@ export function dbDataConvertForItemJson(data) { jsonItem.sort = data.sort jsonItem.typeId = data.type jsonItem.displayType = data.displayType + jsonItem.__config__.name = data.itemKey + jsonItem.__config__.moduleType = data.moduleType jsonItem.__config__.span = data.span jsonItem.__config__.formId = data.formItemId jsonItem.__config__.label = data.label diff --git a/src/views/form/editor/RightPanel.vue b/src/views/form/editor/RightPanel.vue index c86f86f..a936fb9 100644 --- a/src/views/form/editor/RightPanel.vue +++ b/src/views/form/editor/RightPanel.vue @@ -219,6 +219,7 @@ - - - @@ -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 () { diff --git a/src/views/form/index.vue b/src/views/form/index.vue index 340f0c9..952b050 100644 --- a/src/views/form/index.vue +++ b/src/views/form/index.vue @@ -38,7 +38,7 @@ />
- +
{ - 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') { diff --git a/src/views/form/preview/ProjectForm.vue b/src/views/form/preview/ProjectForm.vue index 52e74e5..738827f 100644 --- a/src/views/form/preview/ProjectForm.vue +++ b/src/views/form/preview/ProjectForm.vue @@ -5,29 +5,34 @@ >
-
- -

+

{{ formConf.title }}

-
@@ -35,8 +40,8 @@ diff --git a/src/views/form/publish/index.vue b/src/views/form/publish/index.vue index 5e2200d..a8dc3f0 100644 --- a/src/views/form/publish/index.vue +++ b/src/views/form/publish/index.vue @@ -1,196 +1,287 @@ diff --git a/src/views/form/setting/index.vue b/src/views/form/setting/index.vue index 9f809b6..49f4e25 100644 --- a/src/views/form/setting/index.vue +++ b/src/views/form/setting/index.vue @@ -1,60 +1,79 @@ @@ -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; diff --git a/src/views/project/my/index.vue b/src/views/project/my/index.vue index 7c54a02..a60d6b0 100644 --- a/src/views/project/my/index.vue +++ b/src/views/project/my/index.vue @@ -42,6 +42,12 @@ > 查询 + + 新建项目 +

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

- @@ -185,7 +192,8 @@ />