Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
5ec60144
提交
5ec60144
authored
4月 19, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 过滤条件
上级
fb536861
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
395 行增加
和
431 行删除
+395
-431
DeButton.vue
frontend/src/components/widget/DeWidget/DeButton.vue
+10
-13
DeDate.vue
frontend/src/components/widget/DeWidget/DeDate.vue
+15
-1
DeDrawingWidget.vue
frontend/src/components/widget/DeWidget/DeDrawingWidget.vue
+0
-39
DeInputSearch.vue
frontend/src/components/widget/DeWidget/DeInputSearch.vue
+11
-7
DeQuarter.vue
frontend/src/components/widget/DeWidget/DeQuarter.vue
+15
-1
MySelectImpl.js
...end/src/components/widget/drawServiceImpl/MySelectImpl.js
+0
-83
index.js
frontend/src/components/widget/index.js
+2
-2
DrawWidgetService.js
frontend/src/components/widget/service/DrawWidgetService.js
+0
-53
WidgetService.js
frontend/src/components/widget/service/WidgetService.js
+32
-10
ButtonSureServiceImpl.js
...rc/components/widget/serviceImpl/ButtonSureServiceImpl.js
+23
-23
TextInputServiceImpl.js
...src/components/widget/serviceImpl/TextInputServiceImpl.js
+38
-38
TextSelectServiceImpl.js
...rc/components/widget/serviceImpl/TextSelectServiceImpl.js
+46
-27
TimeDateRangeServiceImpl.js
...components/widget/serviceImpl/TimeDateRangeServiceImpl.js
+36
-23
TimeDateServiceImpl.js
.../src/components/widget/serviceImpl/TimeDateServiceImpl.js
+35
-23
TimeMonthServiceImpl.js
...src/components/widget/serviceImpl/TimeMonthServiceImpl.js
+36
-23
TimeQuarterServiceImpl.js
...c/components/widget/serviceImpl/TimeQuarterServiceImpl.js
+35
-23
TimeYearServiceImpl.js
.../src/components/widget/serviceImpl/TimeYearServiceImpl.js
+36
-23
filterDialog.vue
frontend/src/views/panel/filter/filterDialog.vue
+7
-1
index.vue
frontend/src/views/panel/filter/index.vue
+18
-18
没有找到文件。
frontend/src/components/widget/DeWidget/DeButton.vue
浏览文件 @
5ec60144
...
@@ -13,27 +13,24 @@
...
@@ -13,27 +13,24 @@
export
default
{
export
default
{
props
:
{
props
:
{
options
:
{
element
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
},
inDraw
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
data
()
{
data
()
{
return
{
return
{
options
:
null
,
operator
:
'eq'
,
values
:
null
}
}
},
},
mounted
()
{
created
()
{
this
.
$nextTick
(()
=>
{
this
.
options
=
this
.
element
.
options
// this.defaultOptions = Object.assign({}, this.options)
// const dom = this.$refs[this.options.refId]
// for (const key in this.options.attrs) {
// if (Object.hasOwnProperty.call(this.defaultOptions.attrs, key)) {
// const element = this.defaultOptions.attrs[key]
// dom.$props[key] = element
// }
// }
})
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/components/widget/DeWidget/DeDate.vue
浏览文件 @
5ec60144
...
@@ -14,10 +14,24 @@
...
@@ -14,10 +14,24 @@
export
default
{
export
default
{
props
:
{
props
:
{
options
:
{
element
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
},
inDraw
:
{
type
:
Boolean
,
default
:
true
}
}
},
data
()
{
return
{
options
:
null
,
operator
:
'eq'
,
values
:
null
}
},
created
()
{
this
.
options
=
this
.
element
.
options
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/components/widget/DeWidget/DeDrawingWidget.vue
deleted
100644 → 0
浏览文件 @
fb536861
<
script
>
import
{
ApplicationContext
}
from
'@/utils/ApplicationContext'
import
store
from
'@/store'
export
default
{
name
:
'DeDrawingWidget'
,
functional
:
true
,
props
:
{
serviceName
:
{
type
:
String
,
default
:
null
}
},
render
(
createElement
,
context
)
{
const
widgetInfo
=
ApplicationContext
.
getService
(
context
.
props
.
serviceName
)
// const widgetInfo = context.props.widgetInfo
const
dialogInfo
=
widgetInfo
.
getDialogPanel
&&
widgetInfo
.
getDialogPanel
()
||
null
const
drawInfo
=
widgetInfo
.
getDrawPanel
&&
widgetInfo
.
getDrawPanel
()
||
null
const
curComponent
=
store
.
state
.
curComponent
if
(
!
dialogInfo
)
{
throw
new
Error
(
'系统错误'
)
}
return
createElement
(
dialogInfo
.
component
,
{
props
:
{
element
:
curComponent
||
drawInfo
||
dialogInfo
},
style
:
context
.
data
.
style
,
on
:
{
'value-change'
:
value
=>
{
context
.
listeners
[
'filter-value-change'
]
&&
context
.
listeners
[
'filter-value-change'
](
value
)
}
}
},
context
.
data
,
context
.
children
)
}
}
</
script
>
frontend/src/components/widget/DeWidget/DeInputSearch.vue
浏览文件 @
5ec60144
<
template
>
<
template
>
<el-input
v-if=
"options!== null && options.attrs!==null"
v-model=
"options.value"
style=
"width:
260px;
"
:placeholder=
"options.attrs.placeholder"
>
<el-input
v-if=
"options!== null && options.attrs!==null"
v-model=
"options.value"
style=
"width:
260px
"
:placeholder=
"options.attrs.placeholder"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
/>
<el-button
slot=
"append"
icon=
"el-icon-search"
/>
</el-input>
</el-input>
...
@@ -11,20 +11,24 @@
...
@@ -11,20 +11,24 @@
export
default
{
export
default
{
props
:
{
props
:
{
options
:
{
element
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
},
inDraw
:
{
type
:
Boolean
,
default
:
true
}
}
},
},
data
()
{
data
()
{
return
{
return
{
options
:
null
,
operator
:
'eq'
,
values
:
null
}
}
},
},
mounted
()
{
created
()
{
this
.
$nextTick
(()
=>
{
this
.
options
=
this
.
element
.
options
})
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/components/widget/DeWidget/DeQuarter.vue
浏览文件 @
5ec60144
...
@@ -11,10 +11,24 @@
...
@@ -11,10 +11,24 @@
export
default
{
export
default
{
props
:
{
props
:
{
options
:
{
element
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
},
inDraw
:
{
type
:
Boolean
,
default
:
true
}
}
},
data
()
{
return
{
options
:
null
,
operator
:
'eq'
,
values
:
null
}
},
created
()
{
this
.
options
=
this
.
element
.
options
}
}
}
}
</
script
>
</
script
>
...
...
frontend/src/components/widget/drawServiceImpl/MySelectImpl.js
deleted
100644 → 0
浏览文件 @
fb536861
import
{
DrawWidgetService
}
from
'../service/DrawWidgetService'
const
leftPanel
=
{
// name: 'text-select',
icon
:
'iconfont icon-xialakuang'
,
label
:
'文本下拉'
,
defaultClass
:
'text-filter'
}
const
dialogPanel
=
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
multiple
:
false
,
placeholder
:
'请选择'
,
datas
:
[],
key
:
'id'
,
label
:
'text'
,
value
:
'id'
},
value
:
''
},
defaultClass
:
'text-filter'
,
component
:
'de-select'
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-select'
}
class
MySelectImpl
extends
DrawWidgetService
{
constructor
(
options
=
{})
{
Object
.
assign
(
options
,
{
name
:
'mySelectWidget'
})
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
true
}
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
}
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
field
[
'deType'
]
===
0
})
}
optionDatas
(
datas
)
{
if
(
!
datas
)
return
null
return
datas
.
map
(
item
=>
{
return
{
id
:
item
,
text
:
item
}
})
}
}
const
mySelectImpl
=
new
MySelectImpl
()
export
default
mySelectImpl
frontend/src/components/widget/index.js
浏览文件 @
5ec60144
...
@@ -31,8 +31,8 @@ requireComponent.keys().forEach(fileName => {
...
@@ -31,8 +31,8 @@ requireComponent.keys().forEach(fileName => {
)
)
})
})
//
const req = require.context('./serviceImpl', false, /\.js$/)
const
req
=
require
.
context
(
'./serviceImpl'
,
false
,
/
\.
js$/
)
const
req
=
require
.
context
(
'./drawServiceImpl'
,
false
,
/
\.
js$/
)
//
const req = require.context('./drawServiceImpl', false, /\.js$/)
const
requireAll
=
requireContext
=>
requireContext
.
keys
()
const
requireAll
=
requireContext
=>
requireContext
.
keys
()
const
widgets
=
{}
const
widgets
=
{}
...
...
frontend/src/components/widget/service/DrawWidgetService.js
deleted
100644 → 0
浏览文件 @
fb536861
import
store
from
'@/store'
export
const
commonStyle
=
{
rotate
:
0
,
opacity
:
1
}
export
const
commonAttr
=
{
animations
:
[],
events
:
{},
groupStyle
:
{},
// 当一个组件成为 Group 的子组件时使用
isLock
:
false
// 是否锁定组件
}
export
class
DrawWidgetService
{
constructor
(
options
)
{
this
.
options
=
options
this
.
name
=
options
.
name
// this.leftPanelPath = 'application/addLeftWidget'
// this.dialogPanelPath = 'application/addDialogWidget'
// this.drawPanelPath = 'application/addDrawWidget'
this
.
storeWidget
()
}
/**
* 存储数据到本地
* @param {本地存储路径} path
* @param {要存储的数据} data
*/
store
(
path
,
data
)
{
store
.
dispatch
(
path
,
data
)
}
getLeftPanel
()
{
return
this
.
initLeftPanel
()
}
getDialogPanel
()
{
return
this
.
initFilterDialog
()
}
getDrawPanel
()
{
let
drawPanel
=
this
.
initDrawPanel
()
drawPanel
.
serviceName
=
this
.
options
.
name
drawPanel
.
style
=
Object
.
assign
(
drawPanel
.
style
,
commonStyle
)
drawPanel
=
Object
.
assign
(
drawPanel
,
commonAttr
)
if
(
this
.
filterDialog
)
{
const
dialogOptions
=
this
.
getDialogPanel
()
drawPanel
=
Object
.
assign
(
drawPanel
,
dialogOptions
)
}
return
drawPanel
}
storeWidget
()
{
this
.
store
(
'application/loadBean'
,
{
key
:
this
.
name
,
value
:
this
})
}
}
frontend/src/components/widget/service/WidgetService.js
浏览文件 @
5ec60144
...
@@ -12,20 +12,42 @@ export const commonAttr = {
...
@@ -12,20 +12,42 @@ export const commonAttr = {
}
}
export
class
WidgetService
{
export
class
WidgetService
{
constructor
(
options
)
{
constructor
(
options
)
{
this
.
options
=
options
this
.
name
=
options
.
name
this
.
name
=
options
.
name
options
=
{
...
commonAttr
,
...
options
}
// this.leftPanelPath = 'application/addLeftWidget'
Object
.
assign
(
this
,
options
)
// this.dialogPanelPath = 'application/addDialogWidget'
this
.
style
=
{
...
commonStyle
,
...
options
.
style
}
// this.drawPanelPath = 'application/addDrawWidget'
this
.
type
=
'custom'
this
.
storeWidget
()
this
.
storeWidget
()
}
}
storeWidget
()
{
/**
store
.
dispatch
(
'application/loadBean'
,
{
key
:
this
.
name
,
value
:
this
})
* 存储数据到本地
* @param {本地存储路径} path
* @param {要存储的数据} data
*/
store
(
path
,
data
)
{
store
.
dispatch
(
path
,
data
)
}
getLeftPanel
()
{
return
this
.
initLeftPanel
()
}
getDialogPanel
()
{
return
this
.
initFilterDialog
()
}
getDrawPanel
()
{
let
drawPanel
=
this
.
initDrawPanel
()
drawPanel
.
serviceName
=
this
.
options
.
name
drawPanel
.
style
=
Object
.
assign
(
drawPanel
.
style
,
commonStyle
)
drawPanel
=
Object
.
assign
(
drawPanel
,
commonAttr
)
if
(
this
.
filterDialog
)
{
const
dialogOptions
=
this
.
getDialogPanel
()
drawPanel
=
Object
.
assign
(
drawPanel
,
dialogOptions
)
}
}
initWidget
()
{
return
drawPanel
console
.
log
(
'this is initWidget'
)
}
}
toDraw
Widget
()
{
store
Widget
()
{
console
.
log
(
'this is toDrawWidget'
)
this
.
store
(
'application/loadBean'
,
{
key
:
this
.
name
,
value
:
this
}
)
}
}
}
}
frontend/src/components/widget/serviceImpl/ButtonSureServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'buttonSureWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-chaxunsousuo'
,
icon
:
'iconfont icon-chaxunsousuo'
,
label
:
'确定'
,
label
:
'确定'
,
defaultClass
:
'time-filter'
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
style
:
{
width
:
100
,
width
:
300
,
height
:
34
,
height
:
35
,
borderWidth
:
''
,
borderColor
:
''
,
borderRadius
:
''
,
fontSize
:
14
,
fontSize
:
14
,
fontWeight
:
500
,
fontWeight
:
500
,
lineHeight
:
''
,
lineHeight
:
''
,
letterSpacing
:
0
,
letterSpacing
:
0
,
textAlign
:
''
,
textAlign
:
''
,
color
:
''
,
color
:
''
backgroundColor
:
''
},
},
defaultClass
:
'time-filter'
,
component
:
'de-button'
,
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
type
:
'primary'
,
type
:
'primary'
,
round
:
true
round
:
true
},
},
value
:
'测试按钮'
value
:
'测试按钮'
}
},
component
:
'de-button'
}
}
class
ButtonSureServiceImpl
extends
WidgetService
{
class
ButtonSureServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'buttonSureWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
false
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
// console.log('this is first initWidget')
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
}
return
value
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
}
}
const
buttonSureServiceImpl
=
new
ButtonSureServiceImpl
(
{
name
:
'buttonSureWidget'
}
)
const
buttonSureServiceImpl
=
new
ButtonSureServiceImpl
()
export
default
buttonSureServiceImpl
export
default
buttonSureServiceImpl
frontend/src/components/widget/serviceImpl/TextInputServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'textInputWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-shuru'
,
icon
:
'iconfont icon-shuru'
,
label
:
'文本搜索'
,
label
:
'文本搜索'
,
defaultClass
:
'text-filter'
}
const
dialogPanel
=
{
options
:
{
attrs
:
{
placeholder
:
'请选择'
},
value
:
''
},
defaultClass
:
'text-filter'
,
component
:
'de-input-search'
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
style
:
{
width
:
100
,
width
:
300
,
height
:
34
,
height
:
35
,
borderWidth
:
''
,
borderColor
:
''
,
borderRadius
:
''
,
fontSize
:
14
,
fontSize
:
14
,
fontWeight
:
500
,
fontWeight
:
500
,
lineHeight
:
''
,
lineHeight
:
''
,
letterSpacing
:
0
,
letterSpacing
:
0
,
textAlign
:
''
,
textAlign
:
''
,
color
:
''
,
color
:
''
backgroundColor
:
''
},
},
defaultClass
:
'text-filter'
,
component
:
'de-input-search'
component
:
'de-input-search'
,
options
:
{
refId
:
'1234567890'
,
attrs
:
{
placeholder
:
'请输入关键字'
},
value
:
''
},
filterDialog
:
true
}
}
class
TextInputServiceImpl
extends
WidgetService
{
class
TextInputServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'textInputWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
// console.log('this is first initWidget')
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
}
return
value
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
dynamicStype
()
{
return
{
initDrawPanel
()
{
'background-color'
:
'rgba(35,190,239,.1)'
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
}
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
fields
.
filter
(
field
=>
{
return
field
[
'deType'
]
===
0
return
field
[
'deType'
]
===
0
})
})
}
}
// dynamicIconStype() {
// return {
// color: '#23beef'
// }
// }
}
}
const
textInputServiceImpl
=
new
TextInputServiceImpl
(
{
name
:
'textInputWidget'
}
)
const
textInputServiceImpl
=
new
TextInputServiceImpl
()
export
default
textInputServiceImpl
export
default
textInputServiceImpl
frontend/src/components/widget/serviceImpl/TextSelectServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'textSelectWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-xialakuang'
,
icon
:
'iconfont icon-xialakuang'
,
label
:
'文本下拉'
,
label
:
'文本下拉'
,
style
:
{
defaultClass
:
'text-filter'
width
:
200
,
}
height
:
22
,
fontSize
:
14
,
const
dialogPanel
=
{
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
multiple
:
false
,
multiple
:
false
,
placeholder
:
'请选择'
,
placeholder
:
'请选择'
,
...
@@ -26,29 +20,44 @@ const defaultOptions = {
...
@@ -26,29 +20,44 @@ const defaultOptions = {
value
:
''
value
:
''
},
},
defaultClass
:
'text-filter'
,
defaultClass
:
'text-filter'
,
component
:
'de-select'
,
component
:
'de-select'
filterDialog
:
true
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-select'
}
}
class
TextSelectServiceImpl
extends
WidgetService
{
class
TextSelectServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'textSelectWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
true
}
}
initWidget
()
{
initLeftPanel
()
{
// console.log('this is first initWidget')
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
}
return
value
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
setOptionDatas
(
data
)
{
initDrawPanel
()
{
this
.
options
.
attrs
.
datas
=
data
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
...
@@ -56,6 +65,16 @@ class TextSelectServiceImpl extends WidgetService {
...
@@ -56,6 +65,16 @@ class TextSelectServiceImpl extends WidgetService {
return
field
[
'deType'
]
===
0
return
field
[
'deType'
]
===
0
})
})
}
}
optionDatas
(
datas
)
{
if
(
!
datas
)
return
null
return
datas
.
map
(
item
=>
{
return
{
id
:
item
,
text
:
item
}
})
}
}
}
const
textSelectServiceImpl
=
new
TextSelectServiceImpl
(
{
name
:
'textSelectWidget'
}
)
const
textSelectServiceImpl
=
new
TextSelectServiceImpl
()
export
default
textSelectServiceImpl
export
default
textSelectServiceImpl
frontend/src/components/widget/serviceImpl/TimeDateRangeServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'timeDateRangeWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-riqi'
,
icon
:
'iconfont icon-riqi'
,
label
:
'日期范围'
,
label
:
'日期范围'
,
style
:
{
defaultClass
:
'time-filter'
width
:
200
,
}
height
:
22
,
fontSize
:
14
,
const
dialogPanel
=
{
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
type
:
'daterange'
,
type
:
'daterange'
,
rangeSeparator
:
'至'
,
rangeSeparator
:
'至'
,
...
@@ -24,25 +17,45 @@ const defaultOptions = {
...
@@ -24,25 +17,45 @@ const defaultOptions = {
value
:
''
value
:
''
},
},
defaultClass
:
'time-filter'
,
defaultClass
:
'time-filter'
,
component
:
'de-date'
,
component
:
'de-date'
filterDialog
:
true
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-date'
}
}
class
TimeDateRangeServiceImpl
extends
WidgetService
{
class
TimeDateRangeServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'timeDateRangeWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
// console.log('this is first initWidget')
}
}
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
fields
.
filter
(
field
=>
{
...
@@ -50,5 +63,5 @@ class TimeDateRangeServiceImpl extends WidgetService {
...
@@ -50,5 +63,5 @@ class TimeDateRangeServiceImpl extends WidgetService {
})
})
}
}
}
}
const
timeDateRangeServiceImpl
=
new
TimeDateRangeServiceImpl
(
{
name
:
'timeDateRangeWidget'
}
)
const
timeDateRangeServiceImpl
=
new
TimeDateRangeServiceImpl
()
export
default
timeDateRangeServiceImpl
export
default
timeDateRangeServiceImpl
frontend/src/components/widget/serviceImpl/TimeDateServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'timeDateWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-ri'
,
icon
:
'iconfont icon-ri'
,
label
:
'日期'
,
label
:
'日期'
,
style
:
{
defaultClass
:
'time-filter'
width
:
200
,
}
height
:
22
,
fontSize
:
14
,
const
dialogPanel
=
{
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
type
:
'date'
,
type
:
'date'
,
placeholder
:
'请选择日期'
placeholder
:
'请选择日期'
},
},
value
:
''
value
:
''
},
},
defaultClass
:
'time-filter'
,
defaultClass
:
'time-filter'
,
component
:
'de-date'
,
component
:
'de-date'
filterDialog
:
true
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-date'
}
}
class
TimeDateServiceImpl
extends
WidgetService
{
class
TimeDateServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'timeDateWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
// console.log('this is first initWidget')
}
}
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
fields
.
filter
(
field
=>
{
...
...
frontend/src/components/widget/serviceImpl/TimeMonthServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'timeMonthWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-yue'
,
icon
:
'iconfont icon-yue'
,
label
:
'年月'
,
label
:
'年月'
,
style
:
{
defaultClass
:
'time-filter'
width
:
200
,
}
height
:
22
,
fontSize
:
14
,
const
dialogPanel
=
{
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
type
:
'month'
,
type
:
'month'
,
placeholder
:
'请选择年月'
placeholder
:
'请选择年月'
...
@@ -22,25 +15,45 @@ const defaultOptions = {
...
@@ -22,25 +15,45 @@ const defaultOptions = {
value
:
''
value
:
''
},
},
defaultClass
:
'time-filter'
,
defaultClass
:
'time-filter'
,
component
:
'de-date'
,
component
:
'de-date'
filterDialog
:
true
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-date'
}
}
class
TimeMonthServiceImpl
extends
WidgetService
{
class
TimeMonthServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'timeMonthWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
// console.log('this is first initWidget')
}
}
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
fields
.
filter
(
field
=>
{
...
@@ -48,5 +61,5 @@ class TimeMonthServiceImpl extends WidgetService {
...
@@ -48,5 +61,5 @@ class TimeMonthServiceImpl extends WidgetService {
})
})
}
}
}
}
const
timeMonthServiceImpl
=
new
TimeMonthServiceImpl
(
{
name
:
'timeMonthWidget'
}
)
const
timeMonthServiceImpl
=
new
TimeMonthServiceImpl
()
export
default
timeMonthServiceImpl
export
default
timeMonthServiceImpl
frontend/src/components/widget/serviceImpl/TimeQuarterServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'timeQuarterWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-jidu'
,
icon
:
'iconfont icon-jidu'
,
label
:
'季度'
,
label
:
'季度'
,
defaultClass
:
'time-filter'
}
const
dialogPanel
=
{
options
:
{
attrs
:
{
placeholder
:
'请选择年份'
},
value
:
''
},
defaultClass
:
'time-filter'
,
component
:
'de-quarter'
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
style
:
{
width
:
2
00
,
width
:
3
00
,
height
:
22
,
height
:
35
,
fontSize
:
14
,
fontSize
:
14
,
fontWeight
:
500
,
fontWeight
:
500
,
lineHeight
:
''
,
lineHeight
:
''
,
...
@@ -13,34 +28,31 @@ const defaultOptions = {
...
@@ -13,34 +28,31 @@ const defaultOptions = {
textAlign
:
''
,
textAlign
:
''
,
color
:
''
color
:
''
},
},
options
:
{
component
:
'de-quarter'
refId
:
'1234567890'
,
attrs
:
{
placeholder
:
'请选择季度'
},
value
:
''
},
defaultClass
:
'time-filter'
,
component
:
'de-quarter'
,
filterDialog
:
true
}
}
class
TimeQuarterServiceImpl
extends
WidgetService
{
class
TimeQuarterServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'timeQuarterWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
// console.log('this is first initWidget')
}
}
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
return
fields
.
filter
(
field
=>
{
return
fields
.
filter
(
field
=>
{
...
@@ -48,5 +60,5 @@ class TimeQuarterServiceImpl extends WidgetService {
...
@@ -48,5 +60,5 @@ class TimeQuarterServiceImpl extends WidgetService {
})
})
}
}
}
}
const
timeQuarterServiceImpl
=
new
TimeQuarterServiceImpl
(
{
name
:
'timeQuarterWidget'
}
)
const
timeQuarterServiceImpl
=
new
TimeQuarterServiceImpl
()
export
default
timeQuarterServiceImpl
export
default
timeQuarterServiceImpl
frontend/src/components/widget/serviceImpl/TimeYearServiceImpl.js
浏览文件 @
5ec60144
import
{
WidgetService
}
from
'../service/WidgetService'
import
{
WidgetService
}
from
'../service/WidgetService'
const
defaultOptions
=
{
name
:
'timeYearWidget'
,
const
leftPanel
=
{
icon
:
'iconfont icon-nian'
,
icon
:
'iconfont icon-nian'
,
label
:
'年份'
,
label
:
'年份'
,
style
:
{
defaultClass
:
'time-filter'
width
:
200
,
}
height
:
22
,
fontSize
:
14
,
const
dialogPanel
=
{
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
options
:
{
options
:
{
refId
:
'1234567890'
,
attrs
:
{
attrs
:
{
type
:
'year'
,
type
:
'year'
,
placeholder
:
'请选择年份'
placeholder
:
'请选择年份'
...
@@ -22,25 +15,45 @@ const defaultOptions = {
...
@@ -22,25 +15,45 @@ const defaultOptions = {
value
:
''
value
:
''
},
},
defaultClass
:
'time-filter'
,
defaultClass
:
'time-filter'
,
component
:
'de-date'
,
component
:
'de-date'
filterDialog
:
true
}
const
drawPanel
=
{
type
:
'custom'
,
style
:
{
width
:
300
,
height
:
35
,
fontSize
:
14
,
fontWeight
:
500
,
lineHeight
:
''
,
letterSpacing
:
0
,
textAlign
:
''
,
color
:
''
},
component
:
'de-date'
}
}
class
TimeYearServiceImpl
extends
WidgetService
{
class
TimeYearServiceImpl
extends
WidgetService
{
constructor
(
options
)
{
constructor
(
options
=
{}
)
{
Object
.
assign
(
options
,
defaultOptions
)
Object
.
assign
(
options
,
{
name
:
'timeYearWidget'
}
)
super
(
options
)
super
(
options
)
this
.
filterDialog
=
true
this
.
showSwitch
=
false
}
}
initWidget
()
{
initLeftPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
leftPanel
))
return
value
// console.log('this is first initWidget')
// console.log('this is first initWidget')
}
}
toDrawWidget
()
{
// console.log('this is first toDrawWidget')
initFilterDialog
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
dialogPanel
))
return
value
}
}
// 移动到画布之前回掉
beforeToDraw
()
{
initDrawPanel
()
{
const
value
=
JSON
.
parse
(
JSON
.
stringify
(
drawPanel
))
return
value
}
}
filterFieldMethod
(
fields
)
{
filterFieldMethod
(
fields
)
{
...
@@ -49,5 +62,5 @@ class TimeYearServiceImpl extends WidgetService {
...
@@ -49,5 +62,5 @@ class TimeYearServiceImpl extends WidgetService {
})
})
}
}
}
}
const
timeYearServiceImpl
=
new
TimeYearServiceImpl
(
{
name
:
'timeYearWidget'
}
)
const
timeYearServiceImpl
=
new
TimeYearServiceImpl
()
export
default
timeYearServiceImpl
export
default
timeYearServiceImpl
frontend/src/views/panel/filter/filterDialog.vue
浏览文件 @
5ec60144
...
@@ -237,12 +237,18 @@ export default {
...
@@ -237,12 +237,18 @@ export default {
if
(
values
&&
values
.
length
>
0
)
{
if
(
values
&&
values
.
length
>
0
)
{
const
value
=
values
[
0
]
const
value
=
values
[
0
]
const
fieldId
=
value
.
id
const
fieldId
=
value
.
id
this
.
widget
&&
fieldValues
(
fieldId
).
then
(
res
=>
{
if
(
this
.
widget
&&
this
.
widget
.
optionDatas
)
{
fieldValues
(
fieldId
).
then
(
res
=>
{
this
.
componentInfo
.
options
.
attrs
.
datas
=
this
.
widget
.
optionDatas
(
res
.
data
)
this
.
componentInfo
.
options
.
attrs
.
datas
=
this
.
widget
.
optionDatas
(
res
.
data
)
this
.
componentInfo
.
options
.
attrs
.
fieldId
=
fieldId
this
.
componentInfo
.
options
.
attrs
.
fieldId
=
fieldId
this
.
componentInfo
.
options
.
attrs
.
dragItems
=
values
this
.
componentInfo
.
options
.
attrs
.
dragItems
=
values
this
.
$emit
(
're-fresh-component'
,
this
.
componentInfo
)
this
.
$emit
(
're-fresh-component'
,
this
.
componentInfo
)
})
})
}
else
{
this
.
componentInfo
.
options
.
attrs
.
fieldId
=
fieldId
this
.
componentInfo
.
options
.
attrs
.
dragItems
=
values
this
.
$emit
(
're-fresh-component'
,
this
.
componentInfo
)
}
}
}
}
}
},
},
...
...
frontend/src/views/panel/filter/index.vue
浏览文件 @
5ec60144
...
@@ -36,28 +36,28 @@ export default {
...
@@ -36,28 +36,28 @@ export default {
return
{
return
{
componentList
,
componentList
,
panelInfo
:
this
.
$store
.
state
.
panel
.
panelInfo
,
panelInfo
:
this
.
$store
.
state
.
panel
.
panelInfo
,
widgetSubjects
:
{
'文本过滤组件'
:
[
'mySelectWidget'
]
}
// widgetSubjects: {
// widgetSubjects: {
// '时间过滤组件': [
// 'timeYearWidget',
// 'timeMonthWidget',
// 'timeQuarterWidget',
// 'timeDateWidget',
// 'timeDateRangeWidget'
// ],
// '文本过滤组件': [
// '文本过滤组件': [
// 'textSelectWidget',
// 'mySelectWidget'
// 'textInputWidget'
// ],
// '按钮': [
// 'buttonSureWidget'
// ]
// ]
// }
// }
widgetSubjects
:
{
'时间过滤组件'
:
[
'timeYearWidget'
,
'timeMonthWidget'
,
'timeQuarterWidget'
,
'timeDateWidget'
,
'timeDateRangeWidget'
],
'文本过滤组件'
:
[
'textSelectWidget'
,
'textInputWidget'
],
'按钮'
:
[
'buttonSureWidget'
]
}
}
}
},
},
created
()
{
created
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论