Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
啊嘞嘞EC
vue-vben-admin
提交
bce6cee5
V
vue-vben-admin
项目概览
啊嘞嘞EC
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
bce6cee5
编写于
2月 10, 2023
作者:
W
wwsheng009
提交者:
GitHub
2月 10, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复form设计器在黑暗模式下的显示问题 (#2543)
上级
32daad61
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
3593 addition
and
4450 deletion
+3593
-4450
pnpm-lock.yaml
pnpm-lock.yaml
+3567
-3892
src/router/routes/modules/form-design/main.ts
src/router/routes/modules/form-design/main.ts
+1
-1
src/views/form-design/components/VFormDesign/index.vue
src/views/form-design/components/VFormDesign/index.vue
+11
-15
src/views/form-design/components/VFormDesign/styles/drag.less
...views/form-design/components/VFormDesign/styles/drag.less
+14
-20
src/views/form-design/components/VFormDesign/styles/v-form-design.less
...m-design/components/VFormDesign/styles/v-form-design.less
+0
-522
未找到文件。
pnpm-lock.yaml
浏览文件 @
bce6cee5
此差异已折叠。
点击以展开。
src/router/routes/modules/form-design/main.ts
浏览文件 @
bce6cee5
...
...
@@ -8,7 +8,7 @@ const permission: AppRouteModule = {
component
:
LAYOUT
,
meta
:
{
orderNo
:
10000
,
icon
:
'
i
con:add-circl
e
'
,
icon
:
'
i
on:build-outlin
e
'
,
title
:
'
表单设计
'
,
},
children
:
[
...
...
src/views/form-design/components/VFormDesign/index.vue
浏览文件 @
bce6cee5
<
template
>
<!--
<div
class=
"v-form-design-container"
>
-->
<!--
<header
class=
"v-form-design-header"
>
{{
title
}}
</header>
-->
<Layout>
<LayoutSider
class=
"left"
theme=
"light"
class=
"left sider"
collapsible
collapsedWidth=
"0"
width=
"270"
:zeroWidthTriggerStyle=
"
{ 'margin-top': '-70px' }"
:zeroWidthTriggerStyle=
"
{
'margin-top': '-70px',
'background-color': 'gray',
}"
breakpoint="md"
>
<CollapseContainer
title=
"基础控件"
>
...
...
@@ -53,16 +52,14 @@
/>
</LayoutContent>
<LayoutSider
class=
"right"
class=
"right
sider
"
collapsible
:reverseArrow=
"true"
theme=
"light"
collapsedWidth=
"0"
width=
"270"
:zeroWidthTriggerStyle=
"
{ 'margin-top': '-70px' }"
:zeroWidthTriggerStyle=
"
{ 'margin-top': '-70px'
, 'background-color': 'gray'
}"
breakpoint="lg"
>
<!--
<div
class=
"right"
onselectstart=
"return false"
>
-->
<PropsPanel
ref=
"propsPanel"
:activeKey=
"formConfig.activeKey"
>
<template
v-for=
"item of formConfig.schemas"
#
[`$
{item.component}Props`]="data">
<slot
...
...
@@ -71,7 +68,6 @@
>
</slot>
</
template
>
</PropsPanel>
<!-- </div> -->
</LayoutSider>
</Layout>
...
...
@@ -80,7 +76,6 @@
<ImportJsonModal
ref=
"importJsonModal"
/>
<VFormPreview
ref=
"eFormPreview"
:formConfig=
"formConfig"
/>
<VFormPreview2
ref=
"eFormPreview2"
:formConfig=
"formConfig"
/>
<!-- </div> -->
</template>
<
script
lang=
"ts"
setup
>
...
...
@@ -100,13 +95,11 @@
import
{
ref
,
provide
,
Ref
}
from
'
vue
'
;
import
{
Layout
,
LayoutContent
,
LayoutSider
}
from
'
ant-design-vue
'
;
// import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
import
{
IVFormComponent
,
IFormConfig
,
PropsTabKey
}
from
'
../../typings/v-form-component
'
;
import
{
formItemsForEach
,
generateKey
}
from
'
../../utils
'
;
import
{
cloneDeep
}
from
'
lodash-es
'
;
import
{
baseComponents
,
customComponents
,
layoutComponents
}
from
'
../../core/formItemConfig
'
;
import
{
useRefHistory
,
UseRefHistoryReturn
}
from
'
@vueuse/core
'
;
// import { IAnyObject } from '../../typings/base-type';
import
{
globalConfigState
}
from
'
./config/formItemPropsConfig
'
;
import
{
IFormDesignMethods
,
IPropsPanel
,
IToolbarMethods
}
from
'
../../typings/form-type
'
;
...
...
@@ -361,5 +354,8 @@
</
script
>
<
style
lang=
"less"
scoped
>
// @import url(./styles/variable.less);
.sider {
//需要设置背景色,让主题生效
background-color: @component-background;
}
</
style
>
src/views/form-design/components/VFormDesign/styles/drag.less
浏览文件 @
bce6cee5
...
...
@@ -4,27 +4,22 @@
:deep(.list-main) {
overflow: hidden;
min-height: 100%;
padding: 5px;
position: relative;
background: #fafafa;
// border : 1px #ccc dashed;
.moving {
// 拖放移动中
// outline-width: 0;
// 拖放移动中;
min-height: 35px;
box-sizing: border-box;
overflow: hidden;
padding: 0 !important;
// margin : 3px 0;
position: relative;
&::before {
content: '';
height: 5px;
width: 100%;
background: @primary-color;
background
-color
: @primary-color;
position: absolute;
top: 0;
right: 0;
...
...
@@ -40,7 +35,7 @@
min-height: 60px;
&:hover {
background: @primary-hover-bg-color;
background
-color
: @primary-hover-bg-color;
}
// 选择时 start
...
...
@@ -48,7 +43,7 @@
content: '';
height: 5px;
width: 100%;
background: @primary-color;
background
-color
: @primary-color;
position: absolute;
top: 0;
right: -100%;
...
...
@@ -56,7 +51,7 @@
}
&.active {
background: @primary-hover-bg-color;
background
-color
: @primary-hover-bg-color;
outline-offset: 0;
&::before {
...
...
@@ -77,7 +72,6 @@
height: 100%;
top: 0;
left: 0;
// z-index: 888;
}
.ant-form-item {
...
...
@@ -122,12 +116,12 @@
.copy {
border-radius: 0 0 0 8px;
right: 30px;
background: @primary-color;
background
-color
: @primary-color;
}
.delete {
right: 0;
background: @primary-color;
background
-color
: @primary-color;
}
}
...
...
@@ -135,7 +129,7 @@
position: relative;
box-sizing: border-box;
padding: 5px;
background: @layout-background-color;
background
-color
: @layout-background-color;
width: 100%;
transition: all 0.3s;
overflow: hidden;
...
...
@@ -152,14 +146,14 @@
}
.grid-row {
background: @layout-background-color;
background
-color
: @layout-background-color;
.grid-col {
.draggable-box {
min-height: 80px;
min-width: 50px;
border: 1px #ccc dashed;
background: #fff;
//
background: #fff;
.list-main {
min-height: 83px;
...
...
@@ -183,11 +177,11 @@
}
&.active {
background: @layout-hover-bg-color;
background
-color
: @layout-hover-bg-color;
outline-offset: 0;
&::before {
background: @layout-color;
background
-color
: @layout-color;
right: 0;
}
}
...
...
@@ -218,12 +212,12 @@
> .copy {
border-radius: 0 0 0 8px;
right: 30px;
background: @layout-color;
background
-color
: @layout-color;
}
> .delete {
right: 0;
background: @layout-color;
background
-color
: @layout-color;
}
}
}
...
...
src/views/form-design/components/VFormDesign/styles/v-form-design.less
已删除
100644 → 0
浏览文件 @
32daad61
.v-form-design-container {
// height: 100%;
width: 100%;
// overflow: hidden;
display: flex;
flex-direction: column;
& > .v-form-design-header {
height: @header-height;
line-height: @header-height;
background: @primary-color;
text-align: center;
font-size: 20px;
color: #fff;
}
:deep(.icon) {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentcolor;
// overflow: hidden;
}
.content {
position: relative;
flex: 1;
// margin-top: 5px;
display: flex;
// flex-flow: row nowrap;
// height: 100%;
// overflow: hidden;
box-sizing: border-box;
.left,
.right {
width: @left-right-width;
box-shadow: 0 0 1px 1px #ccc;
// overflow: hidden;
// height: 100%;
// height: 600px;
//
border: 1px solid green;
// overflow-y: auto;
// :deep(.ant-tabs) {
// height: 100%;
// .ant-tabs-content-holder {
// // display: flex;
// // flex-flow: column;
// height: 100%;
// .ant-tabs-content {
// // flex:1;
// // height: 0;
// // overflow-y: auto;
// // overflow-x: hidden;
// display: flex;
// flex-flow: column;
// height: 100%;
// }
// }
// }
}
:deep(.right) {
// & > div {
// height: 100%;
// }
// overflow: hidden;
// & > div {
// height: 100%;
// .ant-tabs-content-holder{
// height: 100%;
// .ant-tabs-content{
// height: 100%;
// .ant-tabs-tabpane{
// height: 100%;
// }
// }
// }
// }
.ant-tabs {
width: 280px;
height: 100%;
// overflow: hidden;
.ant-tabs-content-holder {
// display: flex;
// flex-flow: column;
// height: 100%;
// overflow: hidden;
.ant-tabs-content {
// flex:1;
// height: 0;
// overflow-y: auto;
// overflow-x: hidden;
height: 100%;
// overflow: hidden;
.ant-tabs-tabpane {
.properties-content {
// height: 100%;
// overflow: auto;
// overflow: hidden;
// background: #fff;
.properties-body {
box-sizing: border-box;
// height: 100%;
// display: flex;
// flex-flow: column;
form {
position: absolute;
// height: 400px;
height: calc(100% - 50px);
// height: 100%;
// flex: 1;
// height: 0;
margin-right: 10px;
// overflow: auto;
overflow-y: auto;
overflow-x: hidden;
// overflow: auto;
}
// overflow: auto;
// height: 100%;
// padding: 8px 16px;
.hint-box {
margin-top: 200px;
}
.ant-form-item,
.ant-slider-with-marks {
margin-left: 10px;
margin-right: 20px;
margin-bottom: 0;
}
.ant-form-item {
// box-sizing: border-box;
width: 100%;
margin-bottom: 0;
// padding: 2px 0;
border-bottom: 1px solid @border-color;
.ant-form-item-label {
line-height: 2;
vertical-align: text-top;
}
}
}
}
}
}
}
}
}
:deep(.left) {
.ant-collapse {
border: 0;
.ant-collapse-header {
padding: 7px 0 7px 40px;
}
.ant-collapse-content-box {
padding: 0;
}
}
ul {
padding: 5px;
list-style: none;
display: flex;
margin-bottom: 0;
flex-wrap: wrap;
// background: #efefef;
li {
padding: 8px 12px;
transition: all 0.3s;
width: calc(50% - 6px);
margin: 2.7px;
height: 36px;
line-height: 20px;
cursor: move;
border: 1px solid @border-color;
border-radius: 3px;
&:hover {
color: @primary-color;
border: 1px solid @primary-color;
position: relative;
// z-index: 1;
box-shadow: 0 2px 6px @primary-color;
}
}
}
}
:deep(.node-panel) {
box-shadow: 0 0 1px 1px #ccc;
flex: 1;
margin: 0 8px;
overflow: hidden;
.draggable-box {
height: 100%;
overflow: auto;
.list-main {
overflow: hidden;
min-height: 100%;
padding: 5px;
position: relative;
background: #fafafa;
// border : 1px #ccc dashed;
.moving {
// 拖放移动中
// outline-width: 0;
min-height: 35px;
box-sizing: border-box;
overflow: hidden;
padding: 0 !important;
// margin : 3px 0;
position: relative;
&::before {
content: '';
height: 5px;
width: 100%;
background: @primary-color;
position: absolute;
top: 0;
right: 0;
}
}
.drag-move-box {
position: relative;
box-sizing: border-box;
padding: 8px;
overflow: hidden;
transition: all 0.3s;
min-height: 60px;
&:hover {
background: @primary-hover-bg-color;
}
// 选择时 start
&::before {
content: '';
height: 5px;
width: 100%;
background: @primary-color;
position: absolute;
top: 0;
right: -100%;
transition: all 0.3s;
}
&.active {
background: @primary-hover-bg-color;
outline-offset: 0;
&::before {
right: 0;
}
}
// 选择时 end
.form-item-box {
position: relative;
box-sizing: border-box;
word-wrap: break-word;
&::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
// z-index: 888;
}
.ant-form-item {
// 修改ant form-item的margin为padding
margin: 0;
padding-bottom: 6px;
}
}
.show-key-box {
// 显示key
position: absolute;
bottom: 2px;
right: 5px;
font-size: 14px;
// z-index: 999;
color: @primary-color;
}
.copy,
.delete {
position: absolute;
top: 0;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
color: #fff;
// z-index: 989;
transition: all 0.3s;
&.unactivated {
opacity: 0 !important;
pointer-events: none;
}
&.active {
opacity: 1 !important;
}
}
.copy {
border-radius: 0 0 0 8px;
right: 30px;
background: @primary-color;
}
.delete {
right: 0;
background: @primary-color;
}
}
.grid-box {
position: relative;
box-sizing: border-box;
padding: 5px;
background: @layout-background-color;
width: 100%;
transition: all 0.3s;
overflow: hidden;
.form-item-box {
position: relative;
box-sizing: border-box;
.ant-form-item {
// 修改ant form-item的margin为padding
margin: 0;
padding-bottom: 15px;
}
}
.grid-row {
background: @layout-background-color;
.grid-col {
.draggable-box {
min-height: 80px;
min-width: 50px;
border: 1px #ccc dashed;
background: #fff;
.list-main {
min-height: 83px;
position: relative;
border: 1px #ccc dashed;
}
}
}
}
// 选择时 start
&::before {
content: '';
height: 5px;
width: 100%;
background: transparent;
position: absolute;
top: 0;
right: -100%;
transition: all 0.3s;
}
&.active {
background: @layout-hover-bg-color;
outline-offset: 0;
&::before {
background: @layout-color;
right: 0;
}
}
// 选择时 end
> .copy-delete-box {
> .copy,
> .delete {
position: absolute;
top: 0;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
color: #fff;
// z-index: 989;
transition: all 0.3s;
&.unactivated {
opacity: 0 !important;
pointer-events: none;
}
&.active {
opacity: 1 !important;
}
}
> .copy {
border-radius: 0 0 0 8px;
right: 30px;
background: @layout-color;
}
> .delete {
right: 0;
background: @layout-color;
}
}
}
}
}
}
}
::-webkit-scrollbar {
/* 滚动条整体样式 */
width: 6px;
/* 高宽分别对应横竖滚动条的尺寸 */
height: 6px;
scrollbar-arrow-color: red;
}
::-webkit-scrollbar-thumb {
/* 滚动条里面小方块 */
border-radius: 5px;
box-shadow: inset 0 0 5px rgb(0 0 0 / 20%);
background: rgb(0 0 0 / 20%);
scrollbar-arrow-color: red;
}
::-webkit-scrollbar-track {
/* 滚动条里面轨道 */
box-shadow: inset 0 0 5px rgb(0 0 0 / 20%);
border-radius: 0;
background: rgb(0 0 0 / 10%);
}
}
// code盒子样式
.v-json-box {
height: 570px;
overflow: auto;
.vue-codemirror-wrap {
height: 100%;
.CodeMirror-wrap {
height: 100%;
background: #f6f6f6;
.CodeMirror-scroll {
height: 100%;
width: 100%;
}
pre.CodeMirror-line,
.CodeMirror-linenumber {
min-height: 21px;
line-height: 21px;
}
}
}
}
// code-modal盒子样式
.v-code-modal {
.ant-modal-body {
padding: 12px;
}
}
.v-form-container {
// 内联布局样式
.ant-form-inline {
.list-main {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
.layout-width {
width: 100%;
}
}
.ant-form-item-control-wrapper {
min-width: 175px !important;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录