Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
8603fab6
提交
8603fab6
authored
4月 18, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 去掉矩阵密度选项,适配新的矩阵密度
上级
64b655b9
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
79 行增加
和
32 行删除
+79
-32
Grid.vue
frontend/src/components/canvas/components/Editor/Grid.vue
+21
-3
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+6
-6
component-list.js
.../src/components/canvas/custom-component/component-list.js
+2
-2
utils.js
frontend/src/components/canvas/utils/utils.js
+21
-6
DeTabs.vue
frontend/src/components/widget/DeWidget/DeTabs.vue
+4
-0
index.vue
frontend/src/views/panel/AssistComponent/index.vue
+2
-2
PanelAidedDesign.vue
...iews/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue
+7
-7
index.vue
frontend/src/views/panel/ViewSelect/index.vue
+2
-1
index.vue
frontend/src/views/panel/edit/index.vue
+2
-2
index.vue
frontend/src/views/panel/filter/index.vue
+1
-1
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+1
-0
panel.js
frontend/src/views/panel/panel.js
+10
-2
没有找到文件。
frontend/src/components/canvas/components/Editor/Grid.vue
浏览文件 @
8603fab6
...
@@ -5,16 +5,25 @@
...
@@ -5,16 +5,25 @@
<path
<path
:d=
"smallGridPathD"
:d=
"smallGridPathD"
fill=
"none"
fill=
"none"
stroke=
"rgba(207, 207, 207, 0.
6
)"
stroke=
"rgba(207, 207, 207, 0.
5
)"
stroke-width=
"1"
stroke-width=
"1"
/>
/>
</pattern>
</pattern>
<pattern
id=
"middleGrid"
:width=
"middleGridW"
:height=
"middleGridH"
patternUnits=
"userSpaceOnUse"
>
<rect
:width=
"middleGridW"
:height=
"middleGridH"
fill=
"url(#smallGrid)"
/>
<path
:d=
"middleGridPathD"
fill=
"none"
stroke=
"rgba(207, 207, 207, 0.7)"
stroke-width=
"1.5"
/>
</pattern>
<pattern
id=
"grid"
:width=
"gridW"
:height=
"gridH"
patternUnits=
"userSpaceOnUse"
>
<pattern
id=
"grid"
:width=
"gridW"
:height=
"gridH"
patternUnits=
"userSpaceOnUse"
>
<rect
:width=
"gridW"
:height=
"gridH"
fill=
"url(#
small
Grid)"
/>
<rect
:width=
"gridW"
:height=
"gridH"
fill=
"url(#
middle
Grid)"
/>
<path
<path
:d=
"pathD"
:d=
"pathD"
fill=
"none"
fill=
"none"
stroke=
"rgba(64,158,255,0.
6
)"
stroke=
"rgba(64,158,255,0.
8
)"
stroke-width=
"1"
stroke-width=
"1"
/>
/>
</pattern>
</pattern>
...
@@ -44,6 +53,9 @@ export default {
...
@@ -44,6 +53,9 @@ export default {
pathD
:
function
()
{
pathD
:
function
()
{
return
'M '
+
this
.
gridW
+
' 0 L 0 0 0 '
+
this
.
gridH
return
'M '
+
this
.
gridW
+
' 0 L 0 0 0 '
+
this
.
gridH
},
},
middleGridPathD
:
function
()
{
return
'M '
+
this
.
middleGridW
+
' 0 L 0 0 0 '
+
this
.
middleGridH
},
smallGridPathD
:
function
()
{
smallGridPathD
:
function
()
{
return
'M '
+
this
.
smallGridW
+
' 0 L 0 0 0 '
+
this
.
smallGridH
return
'M '
+
this
.
smallGridW
+
' 0 L 0 0 0 '
+
this
.
smallGridH
},
},
...
@@ -53,6 +65,12 @@ export default {
...
@@ -53,6 +65,12 @@ export default {
gridH
:
function
()
{
gridH
:
function
()
{
return
this
.
matrixStyle
.
height
*
2
*
this
.
matrixBase
return
this
.
matrixStyle
.
height
*
2
*
this
.
matrixBase
},
},
middleGridW
:
function
()
{
return
this
.
matrixStyle
.
width
*
this
.
matrixBase
},
middleGridH
:
function
()
{
return
this
.
matrixStyle
.
height
*
this
.
matrixBase
},
smallGridW
:
function
()
{
smallGridW
:
function
()
{
return
this
.
matrixStyle
.
width
return
this
.
matrixStyle
.
width
},
},
...
...
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
8603fab6
...
@@ -1011,12 +1011,12 @@ export default {
...
@@ -1011,12 +1011,12 @@ export default {
}
}
},
},
watch
:
{
watch
:
{
'canvasStyleData.aidedDesign.matrixBase'
:
{
//
'canvasStyleData.aidedDesign.matrixBase': {
handler
(
newVal
,
oldVal
)
{
//
handler(newVal, oldVal) {
this
.
changeComponentSizePoint
(
newVal
/
oldVal
)
//
this.changeComponentSizePoint(newVal / oldVal)
},
//
},
deep
:
true
//
deep: true
},
//
},
customStyle
:
{
customStyle
:
{
handler
(
newVal
)
{
handler
(
newVal
)
{
// 获取当前宽高(宽高改变后重新渲染画布)
// 获取当前宽高(宽高改变后重新渲染画布)
...
...
frontend/src/components/canvas/custom-component/component-list.js
浏览文件 @
8603fab6
...
@@ -317,7 +317,7 @@ const list = [
...
@@ -317,7 +317,7 @@ const list = [
},
},
x
:
1
,
x
:
1
,
y
:
36
,
y
:
36
,
sizex
:
1
0
,
sizex
:
1
2
,
sizey
:
6
,
sizey
:
6
,
auxiliaryMatrix
:
true
,
auxiliaryMatrix
:
true
,
miniSizex
:
1
,
miniSizex
:
1
,
...
@@ -347,7 +347,7 @@ const list = [
...
@@ -347,7 +347,7 @@ const list = [
},
},
x
:
1
,
x
:
1
,
y
:
1
,
y
:
1
,
sizex
:
1
0
,
sizex
:
1
2
,
sizey
:
10
,
sizey
:
10
,
miniSizex
:
1
,
miniSizex
:
1
,
miniSizey
:
1
miniSizey
:
1
...
...
frontend/src/components/canvas/utils/utils.js
浏览文件 @
8603fab6
...
@@ -67,6 +67,15 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
...
@@ -67,6 +67,15 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
}
}
export
function
panelInit
(
componentData
,
componentStyle
)
{
export
function
panelInit
(
componentData
,
componentStyle
)
{
// style初始化
componentStyle
.
refreshTime
=
(
componentStyle
.
refreshTime
||
5
)
componentStyle
.
refreshViewLoading
=
(
componentStyle
.
refreshViewLoading
||
false
)
componentStyle
.
refreshUnit
=
(
componentStyle
.
refreshUnit
||
'minute'
)
componentStyle
.
aidedDesign
=
(
componentStyle
.
aidedDesign
||
deepCopy
(
AIDED_DESIGN
))
// // // 初始化密度为最高密度
// const matrixChange = 2 / componentStyle.aidedDesign.matrixBase
// componentStyle.aidedDesign.matrixBase = 2
componentData
.
forEach
((
item
,
index
)
=>
{
componentData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
component
&&
item
.
component
===
'de-date'
)
{
if
(
item
.
component
&&
item
.
component
===
'de-date'
)
{
if
(
item
.
options
.
attrs
&&
if
(
item
.
options
.
attrs
&&
...
@@ -96,12 +105,6 @@ export function panelInit(componentData, componentStyle) {
...
@@ -96,12 +105,6 @@ export function panelInit(componentData, componentStyle) {
}
}
item
.
commonBackground
=
item
.
commonBackground
||
deepCopy
(
COMMON_BACKGROUND_NONE
)
item
.
commonBackground
=
item
.
commonBackground
||
deepCopy
(
COMMON_BACKGROUND_NONE
)
})
})
// style初始化
componentStyle
.
refreshTime
=
(
componentStyle
.
refreshTime
||
5
)
componentStyle
.
refreshViewLoading
=
(
componentStyle
.
refreshViewLoading
||
false
)
componentStyle
.
refreshUnit
=
(
componentStyle
.
refreshUnit
||
'minute'
)
componentStyle
.
aidedDesign
=
(
componentStyle
.
aidedDesign
||
deepCopy
(
AIDED_DESIGN
))
// 将data 和 style 数据设置到全局store中
// 将data 和 style 数据设置到全局store中
store
.
commit
(
'setComponentData'
,
resetID
(
componentData
))
store
.
commit
(
'setComponentData'
,
resetID
(
componentData
))
store
.
commit
(
'setCanvasStyle'
,
componentStyle
)
store
.
commit
(
'setCanvasStyle'
,
componentStyle
)
...
@@ -115,3 +118,15 @@ export function resetID(data) {
...
@@ -115,3 +118,15 @@ export function resetID(data) {
}
}
return
data
return
data
}
}
export
function
matrixBaseChange
(
component
)
{
const
matrixBase
=
store
.
state
.
canvasStyleData
.
aidedDesign
.
matrixBase
if
(
component
)
{
component
.
x
=
(
component
.
x
-
1
)
*
matrixBase
component
.
y
=
(
component
.
y
-
1
)
*
matrixBase
component
.
sizex
=
component
.
sizex
*
matrixBase
component
.
sizey
=
component
.
sizey
*
matrixBase
}
return
component
}
frontend/src/components/widget/DeWidget/DeTabs.vue
浏览文件 @
8603fab6
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
{{
$t
(
'detabs.selectview'
)
}}
{{
$t
(
'detabs.selectview'
)
}}
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeHandleCommond('selectOthers', item)"
>
添加其他组件
</el-dropdown-item>
<el-dropdown-item
v-if=
" element.options.tabList.length > 1"
:command=
"beforeHandleCommond('deleteCur', item)"
>
<el-dropdown-item
v-if=
" element.options.tabList.length > 1"
:command=
"beforeHandleCommond('deleteCur', item)"
>
{{
$t
(
'table.delete'
)
}}
{{
$t
(
'table.delete'
)
}}
</el-dropdown-item>
</el-dropdown-item>
...
...
frontend/src/views/panel/AssistComponent/index.vue
浏览文件 @
8603fab6
...
@@ -83,7 +83,7 @@ import componentList, { assistList, pictureList, otherList } from '@/components/
...
@@ -83,7 +83,7 @@ import componentList, { assistList, pictureList, otherList } from '@/components/
import
toast
from
'@/components/canvas/utils/toast'
import
toast
from
'@/components/canvas/utils/toast'
import
{
commonStyle
,
commonAttr
}
from
'@/components/canvas/custom-component/component-list'
import
{
commonStyle
,
commonAttr
}
from
'@/components/canvas/custom-component/component-list'
import
generateID
from
'@/components/canvas/utils/generateID'
import
generateID
from
'@/components/canvas/utils/generateID'
import
{
deepCopy
}
from
'@/components/canvas/utils/utils'
import
{
deepCopy
,
matrixBaseChange
}
from
'@/components/canvas/utils/utils'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
...
@@ -163,7 +163,7 @@ export default {
...
@@ -163,7 +163,7 @@ export default {
let
component
let
component
componentList
.
forEach
(
componentTemp
=>
{
componentList
.
forEach
(
componentTemp
=>
{
if
(
id
===
componentTemp
.
id
)
{
if
(
id
===
componentTemp
.
id
)
{
component
=
deepCopy
(
componentTemp
)
component
=
matrixBaseChange
(
deepCopy
(
componentTemp
)
)
}
}
})
})
// 图片移入是 不支持矩阵 暂时无法监听窗口取消事件
// 图片移入是 不支持矩阵 暂时无法监听窗口取消事件
...
...
frontend/src/views/panel/SubjectSetting/PanelStyle/PanelAidedDesign.vue
浏览文件 @
8603fab6
...
@@ -11,13 +11,13 @@
...
@@ -11,13 +11,13 @@
<el-form-item
:label=
"'辅助网格'"
class=
"form-item form-item-slider"
>
<el-form-item
:label=
"'辅助网格'"
class=
"form-item form-item-slider"
>
<el-checkbox
v-model=
"aidedDesign.showGrid"
size=
"mini"
@
change=
"onChangePanelStyle"
/>
<el-checkbox
v-model=
"aidedDesign.showGrid"
size=
"mini"
@
change=
"onChangePanelStyle"
/>
</el-form-item>
</el-form-item>
<el-form-item
:label=
"'矩阵密度'"
class=
"form-item form-item-slider"
>
<!--
<el-form-item
:label=
"'矩阵密度'"
class=
"form-item form-item-slider"
>
--
>
<el-radio-group
v-model=
"aidedDesign.matrixBase"
size=
"mini"
>
<!--
<el-radio-group
v-model=
"aidedDesign.matrixBase"
size=
"mini"
@
change=
"onChangePanelStyle"
>
--
>
<el-radio-button
:label=
"1"
>
普通
</el-radio-button
>
<!--
<el-radio-button
:label=
"1"
>
普通
</el-radio-button>
--
>
<el-radio-button
:label=
"2"
>
适中
</el-radio-button
>
<!--
<el-radio-button
:label=
"2"
>
适中
</el-radio-button>
--
>
<el-radio-button
:label=
"4"
>
密集
</el-radio-button
>
<!--
<el-radio-button
:label=
"4"
>
密集
</el-radio-button>
--
>
</el-radio-group
>
<!--
</el-radio-group>
--
>
</el-form-item
>
<!--
</el-form-item>
--
>
</el-form>
</el-form>
</el-col>
</el-col>
<el-button
slot=
"reference"
size=
"mini"
class=
"shape-item"
>
辅助设计
<i
<el-button
slot=
"reference"
size=
"mini"
class=
"shape-item"
>
辅助设计
<i
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
8603fab6
...
@@ -75,6 +75,7 @@ import { mapState } from 'vuex'
...
@@ -75,6 +75,7 @@ import { mapState } from 'vuex'
import
{
queryPanelViewTree
}
from
'@/api/panel/panel'
import
{
queryPanelViewTree
}
from
'@/api/panel/panel'
import
{
deleteCircle
}
from
'@/api/chart/chart'
import
{
deleteCircle
}
from
'@/api/chart/chart'
import
{
pluginTypes
}
from
'@/api/chart/chart'
import
{
pluginTypes
}
from
'@/api/chart/chart'
import
{
matrixBaseChange
}
from
'@/components/canvas/utils/utils'
export
default
{
export
default
{
name
:
'ViewSelect'
,
name
:
'ViewSelect'
,
...
@@ -201,7 +202,7 @@ export default {
...
@@ -201,7 +202,7 @@ export default {
// 用户视图设置 复制一个模板
// 用户视图设置 复制一个模板
componentList
.
forEach
(
componentTemp
=>
{
componentList
.
forEach
(
componentTemp
=>
{
if
(
componentTemp
.
type
===
'view'
)
{
if
(
componentTemp
.
type
===
'view'
)
{
component
=
deepCopy
(
componentTemp
)
component
=
matrixBaseChange
(
deepCopy
(
componentTemp
)
)
}
}
})
})
component
.
auxiliaryMatrix
=
this
.
canvasStyleData
.
auxiliaryMatrix
component
.
auxiliaryMatrix
=
this
.
canvasStyleData
.
auxiliaryMatrix
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
8603fab6
...
@@ -338,7 +338,7 @@ import ViewSelect from '../ViewSelect'
...
@@ -338,7 +338,7 @@ import ViewSelect from '../ViewSelect'
import
SubjectSetting
from
'../SubjectSetting'
import
SubjectSetting
from
'../SubjectSetting'
import
bus
from
'@/utils/bus'
import
bus
from
'@/utils/bus'
import
Editor
from
'@/components/canvas/components/Editor/index'
import
Editor
from
'@/components/canvas/components/Editor/index'
import
{
deepCopy
,
panelInit
}
from
'@/components/canvas/utils/utils'
import
{
deepCopy
,
matrixBaseChange
,
panelInit
}
from
'@/components/canvas/utils/utils'
import
componentList
,
{
import
componentList
,
{
BASE_MOBILE_STYLE
,
BASE_MOBILE_STYLE
,
COMMON_BACKGROUND
,
COMMON_BACKGROUND
,
...
@@ -992,7 +992,7 @@ export default {
...
@@ -992,7 +992,7 @@ export default {
// 用户视图设置 复制一个模板
// 用户视图设置 复制一个模板
componentList
.
forEach
(
componentTemp
=>
{
componentList
.
forEach
(
componentTemp
=>
{
if
(
componentTemp
.
type
===
'view'
)
{
if
(
componentTemp
.
type
===
'view'
)
{
component
=
deepCopy
(
componentTemp
)
component
=
matrixBaseChange
(
deepCopy
(
componentTemp
)
)
const
propValue
=
{
const
propValue
=
{
id
:
newComponentId
,
id
:
newComponentId
,
viewId
:
newViewInfo
.
id
viewId
:
newViewInfo
.
id
...
...
frontend/src/views/panel/filter/index.vue
浏览文件 @
8603fab6
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<
script
>
<
script
>
import
{
ApplicationContext
}
from
'@/utils/ApplicationContext'
import
{
ApplicationContext
}
from
'@/utils/ApplicationContext'
import
{
deepCopy
}
from
'@/components/canvas/utils/utils'
import
{
deepCopy
,
matrixBaseChange
}
from
'@/components/canvas/utils/utils'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
export
default
{
export
default
{
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
8603fab6
...
@@ -419,6 +419,7 @@ export default {
...
@@ -419,6 +419,7 @@ export default {
this
.
editPanel
.
optType
=
param
.
optType
this
.
editPanel
.
optType
=
param
.
optType
this
.
editPanel
.
panelInfo
.
nodeType
=
param
.
type
this
.
editPanel
.
panelInfo
.
nodeType
=
param
.
type
this
.
editPanel
.
visible
=
true
this
.
editPanel
.
visible
=
true
const
temp
=
DEFAULT_COMMON_CANVAS_STYLE_STRING
switch
(
param
.
optType
)
{
switch
(
param
.
optType
)
{
case
'new'
:
case
'new'
:
this
.
editPanel
.
titlePre
=
this
.
$t
(
'commons.create'
)
this
.
editPanel
.
titlePre
=
this
.
$t
(
'commons.create'
)
...
...
frontend/src/views/panel/panel.js
浏览文件 @
8603fab6
...
@@ -21,10 +21,13 @@ export const CANVAS_STYLE = {
...
@@ -21,10 +21,13 @@ export const CANVAS_STYLE = {
auxiliaryMatrix
:
true
,
auxiliaryMatrix
:
true
,
openCommonStyle
:
true
,
openCommonStyle
:
true
,
panel
:
DEFAULT_PANEL_STYLE
,
panel
:
DEFAULT_PANEL_STYLE
,
aidedDesign
:
{
showGrid
:
false
,
matrixBase
:
4
// 当前matrix的基数 (是pcMatrixCount的几倍)
},
// 辅助设计
refreshViewLoading
:
true
,
// 仪表板视图loading提示
refreshViewLoading
:
true
,
// 仪表板视图loading提示
refreshUnit
:
'minute'
,
// 仪表板刷新时间带外 默认 分钟
refreshUnit
:
'minute'
,
// 仪表板刷新时间带外 默认 分钟
refreshTime
:
5
,
// 仪表板刷新时间 默认5分钟
refreshTime
:
5
// 仪表板刷新时间 默认5分钟
aidedDesign
:
AIDED_DESIGN
// 辅助设计
}
}
export
const
AIDED_DESIGN
=
{
export
const
AIDED_DESIGN
=
{
...
@@ -32,6 +35,11 @@ export const AIDED_DESIGN = {
...
@@ -32,6 +35,11 @@ export const AIDED_DESIGN = {
matrixBase
:
1
// 当前matrix的基数 (是pcMatrixCount的几倍)
matrixBase
:
1
// 当前matrix的基数 (是pcMatrixCount的几倍)
}
}
// export const AIDED_DESIGN_NEW = {
// showGrid: true,
// matrixBase: 4 // 当前matrix的基数 (是pcMatrixCount的几倍)
// }
export
const
DEFAULT_COMMON_CANVAS_STYLE_STRING
=
{
export
const
DEFAULT_COMMON_CANVAS_STYLE_STRING
=
{
...
CANVAS_STYLE
,
...
CANVAS_STYLE
,
chart
:
BASE_CHART_STRING
chart
:
BASE_CHART_STRING
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论