From f9b50a4f410e62e6aa1a560ee3da9bd8685a53b6 Mon Sep 17 00:00:00 2001 From: Nix Date: Sat, 20 Jun 2020 22:49:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5/src/main.js | 2 +- h5/src/store/layout.js | 89 +++++--- h5/src/views/index.vue | 8 +- .../views/layout/dashboard/componentItems.vue | 20 +- h5/src/views/layout/dashboard/workmeta.vue | 212 +++++++++++++++++- 5 files changed, 278 insertions(+), 53 deletions(-) diff --git a/h5/src/main.js b/h5/src/main.js index 253d3bb..9255cee 100755 --- a/h5/src/main.js +++ b/h5/src/main.js @@ -4,7 +4,7 @@ import router from './router/index.js' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' -Vue.use(ElementUI) +Vue.use(ElementUI, { size: 'mini' }) import VueI18n from 'vue-i18n' Vue.use(VueI18n) diff --git a/h5/src/store/layout.js b/h5/src/store/layout.js index b870c93..fbda3f0 100755 --- a/h5/src/store/layout.js +++ b/h5/src/store/layout.js @@ -2,59 +2,59 @@ const layout = { state: { elements: [ { - name: "el-form", + name: 'el-form', props: { - "label-width": "180px", - "label-position": "rigth", + 'label-width': '180px', + 'label-position': 'rigth', }, children: [ { - name: "el-form-item", + name: 'el-form-item', props: { - label: "姓名", - value: "3131", + label: '姓名', + value: '3131', }, children: [ { - name: "el-input", + name: 'el-input', props: { - type: "textarea", - size: "large", - value: "3131", - "v-model": "sddsds", + type: 'textarea', + size: 'large', + value: '3131', + 'v-model': 'sddsds', }, - text: "username", + text: 'username', }, ], }, { - name: "el-form-item", + name: 'el-form-item', props: { - label: "请选择请选择请选择请选择", + label: '请选择请选择请选择请选择', }, children: [ { - name: "el-select", + name: 'el-select', props: { - size: "small", - placeholder: "请选择", - "v-model": "type", - value: "1", + size: 'small', + placeholder: '请选择', + 'v-model': 'type', + value: '1', clearable: true, }, children: [ { - name: "el-option", - text: "选项一", + name: 'el-option', + text: '选项一', props: { - value: "type", + value: 'type', }, }, { - name: "el-option", - text: "选项e", + name: 'el-option', + text: '选项e', props: { - value: "2", + value: '2', }, }, ], @@ -64,17 +64,48 @@ const layout = { ], }, ], + layouts: [ + { + type: 'layout-container', + x: 0, + y: 0, + w: 24, + h: 4, + static: false, + i: 0, + children: [ + { + type: 'form', + children: [ + { + type: 'button', + }, + { + type: 'input', + }, + { + type: 'select', + }, + ], + }, + { + type: 'table', + columns: [{}], + }, + ], + }, + ], }, mutations: { updateElements: (state, payload) => { - state.elements = payload; + state.elements = payload }, }, actions: { updateElements: ({ commit }, payload) => { - commit("updateElements", payload); + commit('updateElements', payload) }, }, getters: {}, -}; -export default layout; +} +export default layout diff --git a/h5/src/views/index.vue b/h5/src/views/index.vue index dd9892c..6b4243d 100755 --- a/h5/src/views/index.vue +++ b/h5/src/views/index.vue @@ -25,10 +25,10 @@ diff --git a/h5/src/views/layout/dashboard/workmeta.vue b/h5/src/views/layout/dashboard/workmeta.vue index fe46ae7..7328154 100755 --- a/h5/src/views/layout/dashboard/workmeta.vue +++ b/h5/src/views/layout/dashboard/workmeta.vue @@ -1,8 +1,48 @@