├── public ├── favicon.ico └── index.html ├── src ├── assets │ └── logo.png ├── views │ ├── About.vue │ └── Home.vue ├── store │ └── index.js ├── main.js ├── router │ └── index.js ├── components │ └── HelloWorld.vue └── App.vue ├── static └── formDesignTCD1.gif ├── object ├── formBuildTCD │ ├── index.js │ ├── build.vue │ └── buildFormNode.vue ├── formDesignTCD │ ├── contentFormTemplate │ │ ├── importJson.vue │ │ ├── index.vue │ │ └── topButton.vue │ ├── components │ │ ├── codemirrorVue.vue │ │ ├── uploadFileOrImg.vue │ │ ├── tMkeditor │ │ │ └── index.vue │ │ ├── tOptionAdd.vue │ │ ├── uploadImg │ │ │ └── index.vue │ │ ├── uploadFile │ │ │ └── index.vue │ │ ├── timeOrDateConfig.vue │ │ ├── tFormBuild │ │ │ └── index.vue │ │ ├── fromNode.vue │ │ └── tFormTemplate.vue │ ├── rightAside │ │ └── index.vue │ ├── controlList │ │ └── index.vue │ ├── baseConfig │ │ └── index.js │ ├── index.vue │ └── tFormControlConfig │ │ └── index.vue ├── eleComponents │ └── index.js └── index.js ├── vue.config.js ├── babel.config.js ├── .gitignore ├── .npmignore ├── .eslintrc.js ├── styles ├── T-Form-build.less ├── tMkeditor-chinesization.less └── tcd-form-design.less ├── LICENSE ├── package.json └── README.md /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimudehub/FormDesignTCD/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimudehub/FormDesignTCD/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /static/formDesignTCD1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zimudehub/FormDesignTCD/HEAD/static/formDesignTCD1.gif -------------------------------------------------------------------------------- /src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export default new Vuex.Store({ 7 | state: { 8 | }, 9 | mutations: { 10 | }, 11 | actions: { 12 | }, 13 | modules: { 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /object/formBuildTCD/index.js: -------------------------------------------------------------------------------- 1 | import FormBuildTCD from "./build" 2 | FormBuildTCD.install = function (Vue) { 3 | if (install.installed)return; 4 | install.installed = true; 5 | Vue.component(FormBuildTCD.name, FormBuildTCD) 6 | 7 | }; 8 | export default FormBuildTCD 9 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | productionSourceMap: false, 3 | css: { 4 | // extract: false, 5 | loaderOptions: { 6 | less: { 7 | javascriptEnabled: true 8 | } 9 | } 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset', 4 | ], 5 | "plugins": [ 6 | [ 7 | "component", 8 | { 9 | "libraryName": "element-ui", 10 | "styleLibraryName": "theme-chalk" 11 | } 12 | ] 13 | ] 14 | }; 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /lib 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # 忽略目录 2 | object/ 3 | public/ 4 | src/ 5 | static/ 6 | styles/ 7 | node_modules/ 8 | 9 | # 忽略指定文件 10 | vue.config.js 11 | babel.config.js 12 | .eslintrc.js 13 | 14 | # Log files 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? 27 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | // '@vue/standard' 9 | ], 10 | parserOptions: { 11 | parser: 'babel-eslint' 12 | }, 13 | rules: { 14 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import FormDesign from '../object' 6 | import FormBuildTCD from '../object/formBuildTCD' 7 | 8 | FormDesign.setDesignConfig({ 9 | uploadImg:{ 10 | headers:{"auuu":"auuu"}, 11 | data:{wo:123} 12 | } 13 | }); 14 | Vue.use(FormDesign); 15 | 16 | Vue.config.productionTip = false; 17 | 18 | new Vue({ 19 | router, 20 | store, 21 | render: h => h(App) 22 | }).$mount('#app') 23 | -------------------------------------------------------------------------------- /object/formDesignTCD/contentFormTemplate/importJson.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 25 | 26 | 29 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'Home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'About', 16 | // route level code-splitting 17 | // this generates a separate chunk (about.[hash].js) for this route 18 | // which is lazy-loaded when the route is visited. 19 | component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') 20 | } 21 | ] 22 | 23 | const router = new VueRouter({ 24 | mode: 'history', 25 | base: process.env.BASE_URL, 26 | routes 27 | }) 28 | 29 | export default router 30 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/codemirrorVue.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /styles/T-Form-build.less: -------------------------------------------------------------------------------- 1 | 2 | .finalForm{ 3 | .el-form-item__label{ 4 | white-space: nowrap; 5 | } 6 | .form-build-grid{ 7 | //格栅布局 8 | 9 | } 10 | 11 | .form-build-table{ 12 | width: 100%; 13 | border: 1px solid #d6d8df; 14 | tbody{ 15 | 16 | tr{ 17 | 18 | td{ 19 | .el-form-item{ 20 | min-width: 120px; 21 | } 22 | min-height: 40px; 23 | &>div{ 24 | padding: 5px; 25 | } 26 | .el-form-item{ 27 | margin: 0; 28 | } 29 | } 30 | } 31 | } 32 | } 33 | .form-build-childTable{ 34 | margin: 10px 0; 35 | .table-button{ 36 | display: inline-block; 37 | padding: 5px; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 TanChengDuo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/uploadFileOrImg.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 38 | -------------------------------------------------------------------------------- /object/eleComponents/index.js: -------------------------------------------------------------------------------- 1 | //按需配置formDesignTCD的element配置,减小输出体积 2 | import Vue from 'vue'; 3 | import { 4 | Dialog, 5 | Input, 6 | InputNumber, 7 | Radio, 8 | RadioGroup, 9 | RadioButton, 10 | Checkbox, 11 | CheckboxButton, 12 | CheckboxGroup, 13 | Switch, 14 | Select, 15 | Option, 16 | OptionGroup, 17 | Button, 18 | ButtonGroup, 19 | Table, 20 | TableColumn, 21 | DatePicker, 22 | TimeSelect, 23 | TimePicker, 24 | Popover, 25 | Tooltip, 26 | Form, 27 | FormItem, 28 | Slider, 29 | Icon, 30 | Row, 31 | Col, 32 | Upload, 33 | Card, 34 | Link, 35 | Divider, 36 | Cascader, 37 | Message, 38 | } from 'element-ui'; 39 | 40 | Vue.use(Dialog); 41 | Vue.use(Cascader); 42 | Vue.use(Input); 43 | Vue.use(InputNumber); 44 | Vue.use(Radio); 45 | Vue.use(RadioGroup); 46 | Vue.use(RadioButton); 47 | Vue.use(Checkbox); 48 | Vue.use(CheckboxButton); 49 | Vue.use(CheckboxGroup); 50 | Vue.use(Switch); 51 | Vue.use(Select); 52 | Vue.use(Option); 53 | Vue.use(OptionGroup); 54 | Vue.use(Button); 55 | Vue.use(ButtonGroup); 56 | Vue.use(Table); 57 | Vue.use(TableColumn); 58 | Vue.use(DatePicker); 59 | Vue.use(TimeSelect); 60 | Vue.use(TimePicker); 61 | Vue.use(Popover); 62 | Vue.use(Tooltip); 63 | Vue.use(Form); 64 | Vue.use(FormItem); 65 | Vue.use(Slider); 66 | Vue.use(Icon); 67 | Vue.use(Row); 68 | Vue.use(Col); 69 | Vue.use(Upload); 70 | Vue.use(Card); 71 | Vue.use(Link); 72 | Vue.use(Divider); 73 | 74 | 75 | 76 | Vue.prototype.$message = Message; 77 | -------------------------------------------------------------------------------- /object/formDesignTCD/rightAside/index.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 49 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/tMkeditor/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 43 | 57 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/tOptionAdd.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 53 | 61 | 62 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "form-design-tcd", 3 | "version": "0.0.6", 4 | "private": false, 5 | "description": "基于element-ui的vue表单设计器", 6 | "main": "lib/form-design-tcd.umd.min.js", 7 | "author": "子沐", 8 | "keyword": [ 9 | "element-ui", 10 | "OA系统", 11 | "FormDesignTCD", 12 | "表单设计器", 13 | "拖拽", 14 | "工作流" 15 | ], 16 | "scripts": { 17 | "serve": "vue-cli-service serve", 18 | "build": "vue-cli-service build", 19 | "lint": "vue-cli-service lint", 20 | "lib": "vue-cli-service build --target lib --name form-design-tcd --dest lib object/index.js" 21 | }, 22 | "dependencies": { 23 | "babel-polyfill": "^6.26.0", 24 | "core-js": "^3.6.5", 25 | "element-ui": "^2.13.0", 26 | "vue": "^2.6.11", 27 | "vue-codemirror-lite": "^1.0.4", 28 | "vue-quill-editor": "^3.0.6", 29 | "vue-router": "^3.2.0", 30 | "vuedraggable": "^2.23.2", 31 | "vuex": "^3.4.0" 32 | }, 33 | "devDependencies": { 34 | "@vue/cli-plugin-babel": "~4.4.0", 35 | "@vue/cli-plugin-eslint": "~4.4.0", 36 | "@vue/cli-plugin-router": "~4.4.0", 37 | "@vue/cli-plugin-vuex": "~4.4.0", 38 | "@vue/cli-service": "~4.4.0", 39 | "babel-eslint": "^10.1.0", 40 | "babel-plugin-component": "^1.1.1", 41 | "eslint": "^6.7.2", 42 | "eslint-plugin-vue": "^6.2.2", 43 | "less": "^3.0.4", 44 | "less-loader": "^5.0.0", 45 | "vue-template-compiler": "^2.6.11" 46 | }, 47 | "eslintConfig": { 48 | "root": true, 49 | "env": { 50 | "node": true 51 | }, 52 | "extends": [ 53 | "plugin:vue/essential", 54 | "eslint:recommended" 55 | ], 56 | "parserOptions": { 57 | "parser": "babel-eslint" 58 | }, 59 | "rules": {} 60 | }, 61 | "browserslist": [ 62 | "> 1%", 63 | "last 2 versions", 64 | "not dead" 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 指南 2 | 基于vue和element-ui实现的表单设计器,主要功能是使使用者在图形界面配置所需的表单,生成可保存的JSON数据,并能将JSON还原成表单,使表单开发更简单更快速 3 | 4 | [预览地址](http://47.98.53.80:8005/) 5 | [[GitHub]源码开源地址](https://github.com/zimudehub/FormDesignTCD) 6 | [[码云]源码开源地址](https://gitee.com/tanchengduo/form-design-tcd) 7 | 8 | ![An image](./img/formDesignTCD1.gif) 9 | 特性 10 | - 可视化配置页面 11 | - 自由控制表单控件布局 12 | - 表单自定义样式(以行内样式插入) 13 | - 提供预览、保存、生成json、生成可执行代码等操作 14 | - 支持表单验证 15 | - 快速获取表单数据 16 | - 提供高级控件 17 |

18 | 19 | vue 20 | 21 | 22 | element-ui 23 | 24 | 25 | license 26 | 27 |

28 | ### 感谢 29 | 创作感谢k-form-design给予的灵感 30 | ### 版本 31 |

32 | 33 | vue 34 | 35 |

36 | 37 | ### 设计原则 38 | form-design-tcd本着所有表单控件特性尽可能可视化配置。 39 | ## 快速上手 40 | ### 1.安装vue-cli 41 | ``` 42 | npm install -g @vue/cli 43 | # OR 44 | yarn global add @vue/cli 45 | ``` 46 | ### 2.创建一个项目 47 | 使用初始化项目命令 48 | ``` 49 | vue create myapp 50 | ``` 51 | ### 3.安装form-design-tcd 52 | ``` 53 | npm i form-design-tcd --save 54 | # OR 55 | yarn add form-design-tcd 56 | ``` 57 | 58 | ### 4.使用form-design-tcd 59 | 在项目main.js中 60 | ``` 61 | import FormDesignTCD from 'form-design-tcd' 62 | import "form-design-tcd/lib/form-design-tcd.css" 63 | Vue.use(FormDesignTCD) 64 | ``` 65 | 以上步骤便完成便可在项目中直接使用form-design-tcd。 66 | form-design-tcd内置了两个组件分别为FormDesignTCD和FormBuildTCD。 67 | ## 建议 68 | form-design-tcd基础组件样式引用的element-ui的组件库,在使用过程中一些表单控件特性可查阅element-ui官方文档 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /object/formDesignTCD/controlList/index.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 83 | 84 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 43 | 44 | 45 | 61 | -------------------------------------------------------------------------------- /styles/tMkeditor-chinesization.less: -------------------------------------------------------------------------------- 1 | //汉化编辑器 2 | 3 | .chinesization{ 4 | .ql-snow .ql-tooltip[data-mode="link"]::before { 5 | content: "请输入链接地址:"; 6 | } 7 | .ql-snow .ql-tooltip.ql-editing a.ql-action::after { 8 | border-right: 0px; 9 | content: "保存"; 10 | padding-right: 0px; 11 | } 12 | 13 | .ql-snow .ql-tooltip[data-mode="video"]::before { 14 | content: "请输入视频地址:"; 15 | } 16 | 17 | .ql-snow .ql-picker.ql-size .ql-picker-label::before, 18 | .ql-snow .ql-picker.ql-size .ql-picker-item::before { 19 | content: "14px"; 20 | } 21 | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before, 22 | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before { 23 | content: "10px"; 24 | } 25 | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before, 26 | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before { 27 | content: "18px"; 28 | } 29 | .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before, 30 | .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before { 31 | content: "32px"; 32 | } 33 | 34 | .ql-snow .ql-picker.ql-header .ql-picker-label::before, 35 | .ql-snow .ql-picker.ql-header .ql-picker-item::before { 36 | content: "文本"; 37 | } 38 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, 39 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { 40 | content: "标题1"; 41 | } 42 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, 43 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { 44 | content: "标题2"; 45 | } 46 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, 47 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { 48 | content: "标题3"; 49 | } 50 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, 51 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { 52 | content: "标题4"; 53 | } 54 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, 55 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { 56 | content: "标题5"; 57 | } 58 | .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, 59 | .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { 60 | content: "标题6"; 61 | } 62 | 63 | .ql-snow .ql-picker.ql-font .ql-picker-label::before, 64 | .ql-snow .ql-picker.ql-font .ql-picker-item::before { 65 | content: "标准字体"; 66 | } 67 | .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before, 68 | .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before { 69 | content: "衬线字体"; 70 | } 71 | .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before, 72 | .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before { 73 | content: "等宽字体"; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 25 | 84 | 91 | -------------------------------------------------------------------------------- /object/formDesignTCD/contentFormTemplate/index.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 109 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/uploadImg/index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 102 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/uploadFile/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 103 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/timeOrDateConfig.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 101 | -------------------------------------------------------------------------------- /object/formDesignTCD/contentFormTemplate/topButton.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 101 | 102 | 105 | -------------------------------------------------------------------------------- /object/index.js: -------------------------------------------------------------------------------- 1 | 2 | //处理兼容 3 | import "@babel/polyfill"; 4 | //导入element 5 | import "./eleComponents/index.js"; 6 | //导入FormDesignTCD样式 7 | import 'codemirror/mode/javascript/javascript'; 8 | import 'codemirror/mode/vue/vue'; 9 | import "../styles/tcd-form-design.less"; 10 | import "../styles/T-Form-build.less"; 11 | import FormDesignTCD from "./formDesignTCD" 12 | import FormBuildTCD from "./formBuildTCD" 13 | 14 | import { 15 | baseList, 16 | layoutList 17 | } from "./formDesignTCD/baseConfig" 18 | 19 | let components = [FormDesignTCD, FormBuildTCD]; 20 | 21 | let install = function (Vue) { 22 | //检查是否已经注册过FormDesignTCD 23 | if (install.installed)return; 24 | install.installed = true; 25 | 26 | components.map(component=>{ 27 | Vue.component(component.name, component) 28 | }) 29 | 30 | }; 31 | //当插件引入时,会自动注册组件,避免一些用户疏忽导致组件未注册 32 | if (typeof window !== "undefined" && window.Vue) { 33 | install(window.Vue); 34 | } 35 | 36 | function setDesignConfig(config) { 37 | //全局前置函数配置formDesignTCD设计器 38 | if (Object.prototype.toString.call(config)!=="[object Object]"){ 39 | throw "[formDesignTCD warn] Function setDesignConfig argument is not object" 40 | } 41 | baseList.forEach((item)=>{ 42 | if(config[item.type]){ 43 | item.options = { 44 | ...item.options, 45 | ...config[item.type] 46 | } 47 | } 48 | }); 49 | } 50 | 51 | function serBuildConfig(buildArray, config, model = undefined) { 52 | //配置formBuildTCD解析器,配置不同表单 53 | if (Object.prototype.toString.call(config)!=="[object Object]"&&Object.prototype.toString.call(buildArray)!=="[object Array]"){ 54 | throw "[formDesignTCD warn] Function setBuildConfig arguments type error" 55 | } 56 | if (model){ 57 | //如果传入model则只修改对应model字段的控件,否则所有类型的控件都会被修改 58 | buildArray.forEach((item)=>{ 59 | if(item.type === "card"){ 60 | serBuildConfig(item.list, config, model) 61 | }else if(item.type === "grid"){ 62 | item.columns.forEach((column)=>{ 63 | serBuildConfig(column.list, config, model) 64 | }) 65 | }else if (item.type === "table"){ 66 | item.trs.forEach((tr)=>{ 67 | tr.tds.forEach((td)=>{ 68 | serBuildConfig(td.list, config, model) 69 | }) 70 | }) 71 | }else if (item.type === "childTable"){ 72 | serBuildConfig(item.list, config, model) 73 | }else { 74 | if(config[item.type]&&item.model === model){ 75 | item.options = { 76 | ...item.options, 77 | ...config[item.type] 78 | } 79 | } 80 | } 81 | }) 82 | }else { 83 | buildArray.forEach((item)=>{ 84 | if(item.type === "card"){ 85 | serBuildConfig(item.list, config, model) 86 | }else if(item.type === "grid"){ 87 | item.columns.forEach((column)=>{ 88 | serBuildConfig(column.list, config, model) 89 | }) 90 | }else if (item.type === "table"){ 91 | item.trs.forEach((tr)=>{ 92 | tr.tds.forEach((td)=>{ 93 | serBuildConfig(td.list, config, model) 94 | }) 95 | }) 96 | }else if (item.type === "childTable"){ 97 | serBuildConfig(item.list, config, model) 98 | }else { 99 | if(config[item.type]){ 100 | item.options = { 101 | ...item.options, 102 | ...config[item.type] 103 | } 104 | } 105 | } 106 | }); 107 | } 108 | } 109 | 110 | //可以导入FormDesignTCD提供的单个组件,如果在项目中只需要使用FormDesignTCD的单个组件 111 | export { 112 | FormDesignTCD, 113 | FormBuildTCD, 114 | setDesignConfig, 115 | serBuildConfig 116 | } 117 | 118 | export default { 119 | install, 120 | setDesignConfig, 121 | serBuildConfig 122 | } 123 | 124 | 125 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/tFormBuild/index.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 215 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/fromNode.vue: -------------------------------------------------------------------------------- 1 | 210 | 211 | 260 | -------------------------------------------------------------------------------- /object/formBuildTCD/build.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 235 | -------------------------------------------------------------------------------- /styles/tcd-form-design.less: -------------------------------------------------------------------------------- 1 | .CodeMirror{ 2 | height: 450px !important; 3 | } 4 | .el-upload__tip{ 5 | white-space: normal; 6 | } 7 | .el-radio-group{ 8 | white-space: normal; 9 | } 10 | li{ 11 | list-style: none; 12 | } 13 | ::-webkit-scrollbar { 14 | /*滚动条整体样式*/ 15 | width: 6px; 16 | /*高宽分别对应横竖滚动条的尺寸*/ 17 | height : 6px; 18 | scrollbar-arrow-color: red; 19 | 20 | } 21 | 22 | ::-webkit-scrollbar-thumb { 23 | /*滚动条里面小方块*/ 24 | border-radius : 5px; 25 | box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2); 26 | background : rgba(0, 0, 0, 0.2); 27 | scrollbar-arrow-color: red; 28 | } 29 | 30 | ::-webkit-scrollbar-track { 31 | /*滚动条里面轨道*/ 32 | box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2); 33 | border-radius: 0; 34 | background : rgba(0, 0, 0, 0.1); 35 | } 36 | 37 | #T-form-wrap{ 38 | position: relative; 39 | max-width: 100%; 40 | height: 100%; 41 | min-width: 860px; 42 | display: flex; 43 | flex-direction: row; 44 | min-height: 62vh; 45 | background: white; 46 | 47 | 48 | .button-wrap{ 49 | //左侧待拖入展示控件 50 | width: 300px; 51 | min-width: 300px; 52 | height: 100%; 53 | .test{ 54 | width: 100%; 55 | 56 | .control-button-title{ 57 | width: 100%; 58 | height: 30px; 59 | border-bottom: 3px solid #edeff1; 60 | text-align: center; 61 | font-size: 14px; 62 | line-height: 30px; 63 | color: black; 64 | font-weight: 600; 65 | } 66 | 67 | .button-wrap-drg{ 68 | //控件栏拖拽区 69 | padding: 0; 70 | display: flex; 71 | flex-direction: row; 72 | flex-wrap: wrap; 73 | justify-content: space-around; 74 | 75 | li{ 76 | list-style: none; 77 | text-align: left; 78 | width: 40%; 79 | display: inline-block; 80 | line-height: 1; 81 | white-space: nowrap; 82 | cursor: pointer; 83 | background: #fff; 84 | border: 1px solid #dcdfe6; 85 | color: #606266; 86 | -webkit-appearance: none; 87 | box-sizing: border-box; 88 | outline: none; 89 | margin: 0 0 6px 0; 90 | transition: .1s; 91 | font-weight: 500; 92 | -moz-user-select: none; 93 | -webkit-user-select: none; 94 | -ms-user-select: none; 95 | padding: 12px 20px 12px 6px; 96 | font-size: 14px; 97 | border-radius: 4px; 98 | } 99 | 100 | } 101 | } 102 | 103 | 104 | 105 | } 106 | 107 | .T-form-main{ 108 | //中间展示层 109 | position: relative; 110 | flex: 1 0 auto; 111 | border-right: 5px solid #edeff1; 112 | border-left: 5px solid #edeff1; 113 | height: 100%; 114 | min-height: 72vh; 115 | 116 | .form-enter-active { 117 | transition: all .5s; 118 | } 119 | 120 | .form-leave-active { 121 | transition: all .3s; 122 | } 123 | 124 | .form-enter, 125 | .form-leave-to /* .list-leave-active for below version 2.1.8 */ { 126 | opacity : 0; 127 | transform: translateX(100%); 128 | } 129 | 130 | .right-template-form{ 131 | //右侧控件属性 132 | position: absolute; 133 | width: 300px; 134 | min-width: 300px; 135 | top:33px; 136 | height: calc(100% - 40px); 137 | right: -305px; 138 | background: white; 139 | overflow-y: auto; 140 | z-index: 999; 141 | 142 | .el-divider--horizontal{ 143 | margin: 12px 0; 144 | } 145 | .shrink-button{ 146 | position: absolute; 147 | padding: 8px; 148 | right: 0; 149 | top: 0; 150 | z-index: 99999999999999; 151 | } 152 | .control-config-form{ 153 | width: 92%; 154 | margin: 15px auto 0; 155 | 156 | 157 | } 158 | } 159 | 160 | .content-top-button{ 161 | padding: 6px; 162 | border-bottom: 5px solid #edeff1; 163 | button{ 164 | margin: 0 5px; 165 | } 166 | } 167 | 168 | .control-center-wrap{ 169 | height: calc(100% - 65px); 170 | 171 | form{ 172 | height: 100%; 173 | .wrapper{ 174 | width: 100%; 175 | height: 100%; 176 | overflow: auto ; 177 | .moving{ 178 | position: relative; 179 | //控件选择栏移动样式 180 | &.moving::before{ 181 | content: ''; 182 | position: absolute; 183 | top: 0; 184 | width: 100%; 185 | height: 5px; 186 | background: #409eff; 187 | display: block; 188 | } 189 | } 190 | .list-main{ 191 | height: 100%; 192 | min-height: 62vh; 193 | overflow-y: auto; 194 | .list-enter-active { 195 | transition: all .5s; 196 | } 197 | 198 | .list-leave-active { 199 | transition: all .3s; 200 | } 201 | 202 | .list-enter, 203 | .list-leave-to /* .list-leave-active for below version 2.1.8 */ { 204 | opacity : 0; 205 | transform: translateX(-100px); 206 | } 207 | .list-enter { 208 | height: 30px; 209 | } 210 | .item-wrap:hover{ 211 | background: rgba(183,221,255,0.5); 212 | } 213 | .item-wrap{ 214 | position: relative; 215 | padding: 16px 0; 216 | &:hover{ 217 | background: rgba(183,221,255,0.5); 218 | 219 | } 220 | &::before{ 221 | content: ''; 222 | display: block; 223 | position: absolute; 224 | top: 1px; 225 | height: 5px; 226 | right: 0; 227 | width: 1%; 228 | transition: width 0.5s; 229 | } 230 | 231 | &.active{ 232 | background: rgba(183,221,255,0.5); 233 | &::before{ 234 | width: 100%; 235 | background: #409eff; 236 | } 237 | } 238 | .delete{ 239 | display: none; 240 | } 241 | .delete-active{ 242 | position: absolute; 243 | top:4px; 244 | right: 0; 245 | padding: 7px 9px; 246 | } 247 | #control-key{ 248 | position: absolute; 249 | padding: 0; 250 | margin: 0; 251 | height: 14px; 252 | font-size: 12px; 253 | color: black; 254 | line-height: 14px; 255 | right: 3px; 256 | } 257 | .grid-box{ 258 | padding: 5px; 259 | background: #fadce6; 260 | .grid-box-dra{ 261 | min-height: 60px; 262 | } 263 | .grid-item{ 264 | min-height: 60px; 265 | border: 1px #ccc dashed; 266 | } 267 | } 268 | .table-rightClick-wrap{ 269 | padding: 0; 270 | margin: 0; 271 | position: fixed; 272 | top: 0; 273 | left: 0; 274 | background: #ffffff; 275 | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3); 276 | z-index: 99999999999; 277 | &>li{ 278 | padding: 8px; 279 | } 280 | &>li:hover{ 281 | background: #d6d8df; 282 | } 283 | } 284 | .table-layout{ 285 | //表格布局 286 | background: #fadce6; 287 | width: calc(100% - 10px); 288 | td{ 289 | vertical-align: top; 290 | } 291 | .table-dra{ 292 | min-height: 80px; 293 | .table-item{ 294 | min-height: 80px; 295 | min-width: 40px; 296 | } 297 | } 298 | } 299 | .childTable-layout{ 300 | //子表布局 301 | background:#fadce6; 302 | .el-card__body{ 303 | padding: 6px; 304 | .childTable-card-dra { 305 | min-height: 60px; 306 | width : 100%; 307 | border : 1px #ccc dashed; 308 | background: #fff; 309 | 310 | .childTable-main { 311 | min-height : 60px; 312 | position : relative; 313 | border : 1px #ccc dashed; 314 | overflow-x : auto; 315 | overflow-y : auto; 316 | white-space: nowrap; 317 | 318 | .gridMoving { 319 | // 拖放移动中 320 | width : 175px; 321 | min-height: 94px; 322 | display : inline-block; 323 | &.gridMoving::before{ 324 | content: ''; 325 | position: absolute; 326 | top: 0; 327 | min-width: 185px; 328 | height: 5px; 329 | background: #409eff; 330 | display: block; 331 | } 332 | } 333 | >div { 334 | min-width : 185px; 335 | display : inline-block; 336 | vertical-align: top; 337 | } 338 | } 339 | } 340 | } 341 | } 342 | .card-layout{ 343 | background:#fadce6; 344 | 345 | .grid-card-dra{ 346 | min-height: 60px; 347 | } 348 | .card-item{ 349 | min-height: 60px; 350 | } 351 | } 352 | .el-form-item{ 353 | width: 86%; 354 | margin: auto; 355 | white-space: nowrap; 356 | 357 | label{ 358 | white-space: nowrap; 359 | } 360 | } 361 | } 362 | } 363 | } 364 | } 365 | 366 | } 367 | } 368 | 369 | .right-form-layout{ 370 | //右侧布局表单 371 | width: 300px; 372 | min-width: 300px; 373 | overflow-y: auto; 374 | 375 | .control-props{ 376 | width: 100%; 377 | height: 30px; 378 | border-bottom: 3px solid #edeff1; 379 | text-align: center; 380 | font-size: 14px; 381 | line-height: 30px; 382 | color: black; 383 | font-weight: 600; 384 | 385 | } 386 | form{ 387 | .el-form-item{ 388 | margin-top: 15px; 389 | white-space: nowrap; 390 | } 391 | } 392 | 393 | } 394 | } 395 | 396 | 397 | -------------------------------------------------------------------------------- /object/formDesignTCD/baseConfig/index.js: -------------------------------------------------------------------------------- 1 | export const baseList=[ 2 | { 3 | type: "input",//控件类型 4 | icon: "el-icon-edit",//图标 5 | label: "输入框",//控件名字 6 | options: { 7 | label: "输入框", 8 | minWidth:10, 9 | width: 100, // 宽度 10 | defaultValue: "", // 默认值 11 | placeholder: "请输入", // 没有输入时,提示文字 12 | clearable: false, 13 | hidden: false, // 是否隐藏,false显示,true隐藏 14 | disabled: false // 是否禁用,false不禁用,true禁用 15 | }, 16 | model: "", // 数据字段 17 | key: "", 18 | rules: [ 19 | //验证规则 20 | { 21 | required: false, // 必须填写 22 | message: "必填项", 23 | trigger: 'blur' 24 | } 25 | ] 26 | }, 27 | { 28 | type: "text",//控件类型 29 | icon: "el-icon-edit-outline",//图标 30 | label: "文本域",//控件名字 31 | options: { 32 | minWidth:10, 33 | width: 100, // 宽度 34 | height:3,//高度 35 | defaultValue: "", // 默认值 36 | placeholder: "请输入", // 没有输入时,提示文字 37 | clearable: false, 38 | hidden: false, // 是否隐藏,false显示,true隐藏 39 | disabled: false // 是否禁用,false不禁用,true禁用 40 | }, 41 | model: "", // 数据字段 42 | key: "", 43 | rules: [ 44 | //验证规则 45 | { 46 | required: false, // 必须填写 47 | message: "必填项", 48 | trigger: 'blur' 49 | } 50 | ] 51 | }, 52 | { 53 | type: "number",//控件类型 54 | icon: "el-icon-c-scale-to-original",//图标 55 | label: "计数器",//控件名字 56 | options: { 57 | minWidth:40, 58 | width: 40, // 宽度 59 | numberDefaultValue: 0, // 默认值 60 | min: -999999999, // 可输入最小值 61 | max: 99999999999, 62 | step:1, 63 | precision:null, 64 | disabled: false // 是否禁用,false不禁用,true禁用 65 | }, 66 | model: "", // 数据字段 67 | key: "", 68 | rules: [ 69 | { 70 | required: false, 71 | message: "必填项", 72 | trigger: 'blur' 73 | } 74 | ] 75 | }, 76 | { 77 | type: "select",//控件类型 78 | icon: "el-icon-caret-bottom",//图标 79 | label: "下拉选择框",//控件名字 80 | options: { 81 | width: 100, // 宽度 82 | minWidth:20, 83 | multiple:false, 84 | defaultValue: "1", // 下拉选框请使用null为默认值 85 | multipleDefaultValue:[], 86 | disabled: false, // 是否禁用 87 | clearable: false, // 是否显示清除按钮 88 | placeholder: "请选择", // 默认提示文字 89 | dynamicKey: "", 90 | dynamic: false, 91 | options: [ 92 | // 下拉选择项配置 93 | { 94 | value: "1", 95 | label: "选项1", 96 | }, 97 | { 98 | value: "2", 99 | label: "选项2", 100 | }, 101 | ], 102 | showSearch: false // 是否显示搜索框,搜索选择的项的值,而不是文字 103 | }, 104 | model: "", 105 | key: "", 106 | rules: [ 107 | { 108 | required: false, 109 | message: "必填项", 110 | trigger: 'blur' 111 | } 112 | ] 113 | }, 114 | { 115 | type: "cascader", // 表单类型 116 | label: "级联选择器", // 标题文字 117 | icon: "el-icon-office-building", 118 | options: { 119 | width: 100, 120 | multipleDefaultValue:[], 121 | multiple:false, 122 | disabled: false, //是否禁用 123 | defaultValue: "1", // 默认值 124 | showSearch: false, // 是否显示搜索框,搜索选择的项的值,而不是文字 125 | placeholder: "请选择", 126 | clearable: false, // 是否显示清除按钮 127 | dynamicKey: "", 128 | dynamic: true, 129 | options: [ 130 | { 131 | value: "1", 132 | label: "选项1", 133 | children: [ 134 | { 135 | value: "11", 136 | label: "选项11" 137 | } 138 | ] 139 | }, 140 | { 141 | value: "2", 142 | label: "选项2", 143 | children: [ 144 | { 145 | value: "22", 146 | label: "选项22" 147 | } 148 | ] 149 | } 150 | ] 151 | }, 152 | model: "", 153 | key: "", 154 | rules: [ 155 | { 156 | required: false, 157 | message: "必填项" 158 | } 159 | ] 160 | }, 161 | { 162 | type: "checkbox",//控件类型 163 | icon: "el-icon-tickets",//图标 164 | label: "多选框",//控件名字 165 | options: { 166 | disabled: false, //是否禁用 167 | checkboxDefaultValue: [], 168 | chooseMin:0, 169 | chooseMax:3, 170 | dynamicKey: "", 171 | dynamic: false, 172 | options: [ 173 | { 174 | value: "1", 175 | label: "选项1", 176 | }, 177 | { 178 | value: "2", 179 | label: "选项2", 180 | }, 181 | { 182 | value: "3", 183 | label: "选项3", 184 | } 185 | ] 186 | }, 187 | model: "", 188 | key: "", 189 | rules: [ 190 | { 191 | required: false, 192 | message: "必填项", 193 | trigger: 'blur' 194 | } 195 | ] 196 | }, 197 | { 198 | type: "radio",//控件类型 199 | icon: "el-icon-remove-outline",//图标 200 | label: "单选框", 201 | options: { 202 | disabled: false, //是否禁用 203 | defaultValue: null, // 默认值 204 | dynamicKey: "", 205 | dynamic: false, 206 | options: [ 207 | { 208 | value: "1", 209 | label: "选项1", 210 | }, 211 | { 212 | value: "2", 213 | label: "选项2", 214 | }, 215 | ] 216 | }, 217 | model: "", 218 | key: "", 219 | rules: [ 220 | { 221 | required: false, 222 | message: "必填项", 223 | trigger: 'blur' 224 | } 225 | ] 226 | }, 227 | { 228 | type: "date",//控件类型 229 | icon: "el-icon-stopwatch",//图标 230 | label: "日期选择器", 231 | options: { 232 | width: 100, // 宽度 233 | defaultValue: "", // 默认值,字符串 12:00:00 234 | rangeDefaultValue: [ "", "" ], // 默认值,字符串 12:00:00 235 | disabled: false, // 是否禁用 236 | placeholder: "请选择日期点", 237 | format:"yyyy 年 MM 月 dd 日",//展示格式 238 | isChooseTimes: "1",//是否是选择一个时间段1是时间点 239 | valueFormat:"timestamp",//解析格式 240 | rangeSeparator:"至",//时间段选择中间文字 241 | startPlaceholder:"开始日期",//时间段选择前文字 242 | endPlaceholder:"结束日期",//时间段选择后文字 243 | }, 244 | model: "", 245 | key: "", 246 | rules: [ 247 | { 248 | required: false, 249 | message: "必填项", 250 | trigger: 'blur' 251 | } 252 | ] 253 | }, 254 | { 255 | type: "time",//控件类型 256 | icon: "el-icon-date",//图标 257 | label: "时间选择器", 258 | options: { 259 | isChooseTimes: "1",//是否是选择一个时间段 260 | width: 100, // 宽度 261 | defaultValue: "", // 默认值,字符串 12:00:00 262 | clearable: false, // 是否显示清除按钮 263 | placeholder: "请选择时间点", 264 | format: "HH:mm:ss", // 展示格式 265 | rangeSeparator:"至",//时间段选择中间文字 266 | startPlaceholder:"开始时间",//时间段选择前文字 267 | endPlaceholder:"结束时间",//时间段选择后文字 268 | }, 269 | model: "", 270 | key: "", 271 | rules: [ 272 | { 273 | required: false, 274 | message: "必填项", 275 | trigger: 'blur' 276 | } 277 | ] 278 | }, 279 | { 280 | type: "uploadFile",//控件类型 281 | icon: "el-icon-upload2",//图标 282 | label: "上传文件", 283 | options: { 284 | fileList:[], 285 | multiple: true, 286 | disabled: false, 287 | width: 100, 288 | limit: 3, 289 | buttonText:"点击上传", 290 | warnText:"只能上传jpg/png文件,且不超过500kb", 291 | action: "http://cdn.kcz66.com/uploadFile.txt", 292 | }, 293 | model: "", 294 | key: "", 295 | rules: [ 296 | { 297 | required: false, 298 | message: "必填项", 299 | trigger: 'blur' 300 | } 301 | ] 302 | }, 303 | { 304 | type: "uploadImg",//控件类型 305 | icon: "el-icon-picture-outline",//图标 306 | label: "上传图片", 307 | options: { 308 | fileList:[], 309 | multiple: true, 310 | disabled: false, 311 | width: 100, 312 | limit: 3, 313 | action: "http://cdn.kcz66.com/uploadFile.txt", 314 | listType: "picture-card", 315 | }, 316 | model: "", 317 | key: "", 318 | rules: [ 319 | { 320 | required: false, 321 | message: "必填项", 322 | trigger: 'blur' 323 | } 324 | ] 325 | }, 326 | { 327 | type: "button",//控件类型 328 | icon: "el-icon-thumb",//图标 329 | label: "按钮", 330 | options: { 331 | width:0, 332 | maxWidth:80, 333 | buttonType: "primary", 334 | handle: "submit", 335 | dynamicFun: "", 336 | disabled:false 337 | }, 338 | key: "" 339 | }, 340 | { 341 | type: "switch",//控件类型 342 | icon: "el-icon-open",//图标 343 | label: "开关", 344 | options: { 345 | switchValue: "1", // 默认值 Boolean 类型 346 | disabled: false, // 是否禁用 347 | activeText:"开", 348 | inactiveText:"关" 349 | }, 350 | model: "", 351 | key: "", 352 | rules: [ 353 | { 354 | required: false, 355 | message: "必填项", 356 | trigger: 'blur' 357 | } 358 | ] 359 | }, 360 | { 361 | type: "slider",//控件类型 362 | icon: "el-icon-set-up",//图标 363 | label: "滑动输入条", 364 | options: { 365 | width: 100, // 宽度 366 | numberDefaultValue: 0, // 默认值, 如果range为true的时候,则需要改成数组,如:[12,15] 367 | disabled: false, // 是否禁用 368 | min: 0, // 最小值 369 | max: 100, // 最大值 370 | step: 1, // 步长,取值必须大于 0,并且可被 (max - min) 整除 371 | showInput: true // 是否显示输入框,range为true时,请勿开启 372 | }, 373 | model: "", 374 | key: "", 375 | rules: [ 376 | { 377 | required: false, 378 | message: "必填项", 379 | trigger: 'blur' 380 | } 381 | ] 382 | }, 383 | // { 384 | // type: "tipsWindow",//控件类型 385 | // icon: "el-icon-copy-document",//图标 386 | // label: "弹出选择框", 387 | // options: { 388 | // width: 100, // 宽度 389 | // defaultValue: "", // 默认值 390 | // placeholder: "请输入", // 没有输入时,提示文字 391 | // clearable: false, 392 | // hidden: false, // 是否隐藏,false显示,true隐藏 393 | // disabled: false // 是否禁用,false不禁用,true禁用 394 | // }, 395 | // }, 396 | { 397 | type: "childTable", 398 | label: "子表", 399 | icon: "el-icon-menu", 400 | list: [], 401 | options: { 402 | 403 | }, 404 | model: "", 405 | key: "" 406 | }, 407 | { 408 | type: "p",//控件类型 409 | icon: "el-icon-notebook-2",//图标 410 | label: "文字", 411 | options: { 412 | width: 100, // 宽度 413 | }, 414 | }, 415 | { 416 | type: "super",//控件类型 417 | icon: "el-icon-link",//图标 418 | label: "超链接", 419 | options: { 420 | defaultValue: "点击这跳转", // 默认值 421 | url:"",//跳转连接 422 | }, 423 | }, 424 | // { 425 | // type: "tMKeditor",//控件类型 426 | // icon: "el-icon-s-grid",//图标 427 | // label: "富文本", 428 | // list: [], 429 | // options: { 430 | // height: 3, 431 | // placeholder: "请dada", 432 | // chinesization: true, 433 | // hidden: false, // 是否隐藏,false显示,true隐藏 434 | // disabled: false, 435 | // showLabel: false, 436 | // width: 100 437 | // }, 438 | // model: "", 439 | // key: "", 440 | // rules: [ 441 | // { 442 | // required: false, 443 | // message: "必填项" 444 | // } 445 | // ] 446 | // }, 447 | ]; 448 | //布局控件 449 | export const layoutList = [ 450 | { 451 | type: "divider", 452 | label: "分割线", 453 | icon: "el-icon-minus", 454 | options: { 455 | orientation: "left" 456 | }, 457 | key: "", 458 | model: "" 459 | }, 460 | { 461 | type: "card", 462 | label: "卡片布局", 463 | icon: "el-icon-postcard", 464 | list: [], 465 | key: "", 466 | model: "", 467 | options: { 468 | }, 469 | }, 470 | { 471 | type: "grid", 472 | label: "栅格布局", 473 | icon: "el-icon-s-grid", 474 | columns: [ 475 | { 476 | span: 12, 477 | list: [] 478 | }, 479 | { 480 | span: 12, 481 | list: [] 482 | }, 483 | ], 484 | options: { 485 | gutter: 0 486 | }, 487 | key: "", 488 | model: "" 489 | }, 490 | { 491 | type: "table", 492 | label: "表格布局", 493 | icon: "el-icon-menu", 494 | trs: [ 495 | { 496 | tds: [ 497 | { 498 | colspan: 1, 499 | rowspan: 1, 500 | list: [] 501 | }, 502 | { 503 | colspan: 1, 504 | rowspan: 1, 505 | list: [] 506 | } 507 | ] 508 | }, 509 | { 510 | tds: [ 511 | { 512 | colspan: 1, 513 | rowspan: 1, 514 | list: [] 515 | }, 516 | { 517 | colspan: 1, 518 | rowspan: 1, 519 | list: [] 520 | } 521 | ] 522 | } 523 | ], 524 | options: { 525 | bordered: true, 526 | bright: false, 527 | small: true, 528 | customStyle: "" 529 | }, 530 | key: "", 531 | model: "" 532 | } 533 | ]; 534 | -------------------------------------------------------------------------------- /object/formDesignTCD/components/tFormTemplate.vue: -------------------------------------------------------------------------------- 1 | 217 | 218 | 378 | 379 | -------------------------------------------------------------------------------- /object/formDesignTCD/index.vue: -------------------------------------------------------------------------------- 1 | 52 | 53 | 360 | -------------------------------------------------------------------------------- /object/formDesignTCD/tFormControlConfig/index.vue: -------------------------------------------------------------------------------- 1 | 257 | 258 | 319 | -------------------------------------------------------------------------------- /object/formBuildTCD/buildFormNode.vue: -------------------------------------------------------------------------------- 1 | 539 | 540 | 618 | --------------------------------------------------------------------------------