低开开发笔记(六): 工作台与模板样式开发

· 浏览次数 : 0

小编点评

**组件样式** ```css .document-interface { height: 100%; overflow: hidden; } .menu-aside { border-right: 2px solid black; /* 设置右侧边框为1像素宽的黑色实线 */ height: 100vh; background-color: #fff; color: #fff; } .tool-header { display: flex; align-items: center; justify-content: space-between; background-color: #f5f5f5; box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); } .tool-header-left { display: flex; align-items: center; justify-content: space-around; width: 300px; } .content-main { padding: 14px 12px 0px 12px; background-color: #d6d6d6; overflow: auto; } .document-content { width: 100%; height: calc(100vh - 75px); overflow: auto; border: 1px solid #ddd; background-color: #ffffff; padding: 20px; box-sizing: border-box; border-radius: 5px 5px 0px 0px; } ``` **功能补充** 内容的样式包含一些简单的排版,但缺少功能描述或示例。根据您的需求,可以继续添加以下元素: * 添加表单元素,例如文本输入、下拉菜单和单选框。 * 添加图标,例如按钮和图片。 * 添加颜色和字体设置。 * 添加动画或自定义样式。

正文

好家伙,仅仅只是实现了样式,完整功能暂未完成

 

完整代码已开源

https://github.com/Fattiger4399/ph-questionnaire.git

 

 

1.灵感来源

(抄袭对象)

刚开始想着随便写个低开项目练练手的,然后就写成这样了

1.1.简道云

 

1.2.问卷星

 

 

2.上代码

<template>
    <div class="document-interface">
        <el-container>
            
            <!-- 左侧菜单栏 -->
            <el-aside width="300px" class="menu-aside">
                <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
                    :default-openeds="openeds">
                    <el-submenu index="0">
                        <template slot="title">
                            <i class="el-icon-monitor" style="color: #409EFF ;font-size: 30px;padding-right: 13px;"></i>
                            <span>工作台</span>
                        </template>
                    </el-submenu>
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-question" style="color: #409EFF ;font-size: 30px;padding-right: 13px;"></i>
                            <span>问卷模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="1-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    饮食偏好调查问卷
                                </template>
                            </el-menu-item>
                            <el-menu-item index="1-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    学业完成情况调查问卷
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                            <i class="el-icon-location" style="color: brown ;font-size: 30px;padding-right: 13px;"></i>
                            <span>订单模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="2-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    汽车销售订单
                                </template>
                            </el-menu-item>
                            <el-menu-item index="2-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    文具销售订单
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="3">
                        <template slot="title">
                            <i class="el-icon-document"
                                style="color: #409EFF ;font-size: 30px;padding-right: 15px;"></i>
                            <span>报表模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="3-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    公司财务统计报表
                                </template>
                            </el-menu-item>
                            <el-menu-item index="3-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    耗材报销模板
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>

            </el-aside>

            <el-container>
                <!-- 右侧上方工具栏 -->
                <el-header class="tool-header">
                    <div class="tool-header-left">
                        <div>
                            <el-dropdown trigger="click">
                                <span class="el-dropdown-link">
                                    选项<i class="el-icon-arrow-down el-icon--right"></i>
                                </span>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item>菜单项1</el-dropdown-item>
                                    <el-dropdown-item>菜单项2</el-dropdown-item>
                                    <el-dropdown-item>菜单项3</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </div>
                        <div>
                            <span class="divider">|</span>
                        </div>
                        <div>
                            <el-button type="text" icon="el-icon-edit" class="white-button"
                                @click="toeditpage">编辑</el-button>
                        </div>
                        <div>
                            <el-button type="text" icon="el-icon-data-analysis" class="white-button">数据管理</el-button>
                        </div>
                    </div>
                    <div>
                        <el-button icon="el-icon-search">搜索</el-button>
                    </div>
                    <div>
                        <el-button type="success" icon="el-icon-check" circle></el-button>
                    </div>
                    <div>
                        <el-button type="warning" icon="el-icon-star-off" circle></el-button>
                    </div>
                    <div>
                        <el-button type="primary" icon="el-icon-edit" circle></el-button>
                    </div>
                    <div>
                        <el-button type="danger" icon="el-icon-check" circle></el-button>
                    </div>
                    <div>
                        <el-button type="primary" :loading="true">加载中</el-button>
                    </div>
                    <div>
                        <el-button type="primary" icon="el-icon-plus">添加</el-button>
                    </div>
                </el-header>

                <!-- 右侧下方空白 -->
                <el-main class="content-main">
                    <div class="document-content">
                        <lc-editor ref="editor" :dsl="dsl" class="lc-editor"></lc-editor>
                    </div>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
import lcEditor from './editor.vue'

import dsl from './dsl.json'
export default {
    name: 'DocumentInterface',
    components: {
        lcEditor
    },
    data() {
        return {
            // 可以在这里定义数据
            dsl: {},
            openeds: ['1', '2', '3']
        };
    },
    created() {
        this.dsl = dsl
    },
    methods: {
        toeditpage() {
            this.$router.push('./editpage')
        }
    }
};
</script>

<style scoped>
.document-interface {
    height: 100%;
    overflow: hidden;
}

.menu-aside {
    border-right: 2px solid black;
    /* 设置右侧边框为1像素宽的黑色实线 */
    height: 100vh;
    background-color: #fff;
    color: #fff;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f5f5f5;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.tool-header-left {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 300px
}

.content-main {
    padding: 14px 12px 0px 12px;
    background-color: #d6d6d6;
    overflow: auto;
}

.document-content {
    width: 100%;
    height: calc(100vh - 75px);
    overflow: auto;
    border: 1px solid #ddd;
    background-color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 5px 5px 0px 0px;
}
</style>

都是比较简单的样式,没什么好解释的

 

JSON

{
    "component": "div",
    "wid": 0,
    "props": {},
    "style": {
        "background": "#FFF8DC"
    },
    "children": [{
            "wid": 1,
            "component": "ph-h1",
            "props": {
                "text": "饮食偏好调查问卷"
            },
            "style": {},
            "attrs": {},
            "events": {}
        },
        {
            "wid": 1,
            "component": "ph-radio",
            "props": {
                "No": 1,
                "title": "你是否喜欢吃肉",
                "options_1": "",
                "options_2": ""
            },
            "style": {
                "top": "300px",
                "left": "300px",
                "zIndex": "1"
            },
            "attrs": {},
            "events": {}
        }, {
            "wid": 2,
            "component": "ph-checkbox",
            "props": {
                "No": 2,
                "title": "选择你常吃的菜系",
                "options": [
                    "鲁菜(爆炒腰花、糖醋鲤鱼、葱烧海参、油爆双脆)",
                    "苏菜(鸡汁煮干丝、软兜长鱼、盐水鸭、蟹粉狮子头)",
                    "徽菜(臭鳜鱼、毛豆腐、一品锅",
                    "浙菜(西湖醋鱼、龙井虾仁、东坡肉、荷叶粉蒸肉、宋嫂鱼羹)",
                    "闽菜(佛跳墙、醉排骨、荔枝肉、福建酿豆腐、八宝红鲟饭)",
                    "川菜(麻婆豆腐、回锅肉、夫妻肺片、水煮牛肉、毛血旺、酸菜鱼)",
                    "粤菜(白切鸡、烤乳猪、红烧乳鸽、糖醋咕噜肉、客家酿豆腐)",
                    "湘菜(剁椒鱼头、毛氏紅烧肉、腊味合蒸、东安子鸡、麻辣子鸡)"
                ]
            },
            "style": {
                "top": "300px",
                "left": "300px",
                "zIndex": "1"
            },
            "attrs": {},
            "events": {}
        },
        {
            "wid": 3,
            "component": "ph-checkbox",
            "props": {
                "No": 3,
                "title": "选择你喜欢的口味类型",
                "options": [
                    "清淡(姜葱鸡)", "麻辣(水煮牛肉)", "酸甜(糖醋鱼,糖醋排骨)", "咸鮮", ""
                ]
            },
            "style": {
                "top": "300px",
                "left": "300px",
                "zIndex": "1"
            },
            "attrs": {},
            "events": {}
        },
        {
            "wid": 4,
            "component": "ph-input",
            "props": {
                "No": 4,
                "title": "补充你喜欢的菜"
            },
            "style": {},
            "attrs": {},
            "events": {}
        },
        {
            "wid": 5,
            "component": "ph-input",
            "props": {
                "No": 5,
                "title": "其他"
            },
            "style": {},
            "attrs": {},
            "events": {}
        },
        {
            "wid": 6,
            "component": "ph-button",
            "props": {
                "No": 6,
                "text": "提交",
                "title": ""
            },
            "style": {},
            "attrs": {},
            "events": {}
        }
    ]
}

 

(后面会继续跟进功能)

与低开开发笔记(六): 工作台与模板样式开发相似的内容:

低开开发笔记(六): 工作台与模板样式开发

好家伙,仅仅只是实现了样式,完整功能暂未完成 完整代码已开源 https://github.com/Fattiger4399/ph-questionnaire.git 1.灵感来源 (抄袭对象) 刚开始想着随便写个低开项目练练手的,然后就写成这样了 1.1.简道云 1.2.问卷星 2.上代码

低开开发笔记(五):修bug-深拷贝与浅拷贝

好家伙 今天遇到一个bug 0.问题描述 描述如下: 代码如下: copynodefunc() { this.copynode = this.model.selected }, affixnode() { const id = this.model.selected.wid - 1; const g

低开开发笔记(二):低代码编辑器基本原理

好家伙, 完整代码已开源 https://github.com/Fattiger4399/ph-questionnaire.git 本片我们来讲述 如何将dsl的数据渲染为视图 1.数据格式 dsl: { component: 'div', wid: 0, props: { }, style: {

Gitee千Star优质项目解析: ng-form-element低开引擎解析

好家伙, 在写项目的时候,我发现自己的平台的组件写的实在是太难看了,于是想去gitee上偷点东西,于是我们本期的受害者出现了 gitee项目地址 https://gitee.com/jjxliu306/ng-form-elementplus-sample.git 组件库以及引擎完全开源,非常牛逼的项

Karmada v1.5发布:多调度组助力成本优化

摘要:在最新发布的1.5版本中,Karmada 提供了多调度组的能力,利用该能力,用户可以实现将业务优先调度到成本更低的集群,或者在主集群故障时,优先迁移业务到指定的备份集群。 本文分享自华为云社区《Karmada v1.5发布!多调度组助力成本优化》,作者:华为云云原生团队。 Karmada 是开

Ui2Code+ChatGPT助力低代码搭建

低代码开发平台(LCDP),是低代码或无代码通过快速搭建配置的方式完成一个应用程序的开发与上线,可视化低代码就是可视化的DSL,它的优点更多的是来源可视化,相对的,它的局限性也还是来源于可视化,复杂的业务逻辑用低代码可能会更加复杂。低代码应该是特定领域问题的简化和抽象,如果只是单纯将原有的编码工作转换为 GUI 的模式,并没有多大意义。

LuBase 低代码开发框架介绍 - 可私有化部署

框架定位 面向开发人员,针对管理软件领域,对页面交互和通用功能进行高阶封装,逐步打造成平台型、生态型开发工具。 涓涓细流 ,汇聚成海,基于 PBC(组件式开发)开发理念,让功能模块的复用更简单。 让管理软件开发回归到对需求的深入思考和求解。 框架简介 LuBase 是以数据模型驱动,可视化表单和页面

ChatGPT赋能低代码开发:打造智能应用的双重引擎

摘要:本文摘自葡萄城低代码产品活字格的资深用户(格友超哥)所撰写的文章:《惊叹表现!活字格+ChatGPT:低代码开发智能应用的巨大潜力》。 ChatGPT的functions函数使用方 自从OPENAI发布了最新的GPT引擎gpt-3.5-turbo-0613之后,我就对它的functions参数

为什么现代的低代码开发平台都不支持导出源代码?

> 摘要:本文由葡萄城技术团队于博客园原创并首发。葡萄城为开发者提供专业的开发工具、解决方案和服务,赋能开发者。 初次接触低代码的程序员大多会纠结一个问题,为什么功能越强大的低代码开发平台越不会提供导出源代码的功能? 要想回答这个问题,我们得回顾一下低代码开发的发展史。事实上,支持导出[源代码](h

华为云Astro的前世今生:用7年时间革新低代码开发观念

摘要:深扒华为云Astro低代码平台的前世今生,其成功之路显然是一条“个性”之路。 本文分享自华为云社区《华为云Astro的前世今生:用7年时间革新低代码开发观念》,作者:华为云PaaS服务小智。 2022年华为全联接大会(HUAWEI CONNECT)期间,华为云CEO张平安发布华为云Astro低