Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hs-sky-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何虹
hs-sky-ui
Commits
11f73108
Commit
11f73108
authored
Mar 09, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并单元格
parent
749d8765
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
173 additions
and
65 deletions
+173
-65
index.vue
src/packages/hs-action-set/src/index.vue
+0
-1
commonboxUc.js
src/packages/hs-component-shell/src/commonboxUc.js
+5
-2
child.vue
src/packages/hs-dync-form/src/child.vue
+24
-4
dyncFormItemComponentChild.vue
src/packages/hs-dync-form/src/dyncFormItemComponentChild.vue
+15
-5
child.vue
src/packages/hs-select-plus/src/child.vue
+0
-1
ItemComponentChild.vue
src/packages/hs-table/src/ItemComponentChild.vue
+1
-3
child.vue
src/packages/hs-table/src/child.vue
+98
-18
click-out-side copy.js
src/packages/ucClass/click-out-side copy.js
+0
-27
clickoutside.js
src/packages/ucClass/clickoutside.js
+28
-0
commonMixins.js
src/packages/ucClass/commonMixins.js
+2
-4
No files found.
src/packages/hs-action-set/src/index.vue
View file @
11f73108
...
...
@@ -69,7 +69,6 @@
<
script
>
import
elementUiMinins
from
'../../ucClass/elementUiMinins'
import
left
from
'./left'
import
hsUtil
from
'hs-util-js'
import
'codemirror/theme/ambiance.css'
import
'codemirror/lib/codemirror.css'
import
'codemirror/addon/hint/show-hint.css'
...
...
src/packages/hs-component-shell/src/commonboxUc.js
View file @
11f73108
...
...
@@ -52,8 +52,11 @@ export default {
systemSysDevDb
===
1
)
{
return
true
}
}
else
{
if
(
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
return
false
if
(
top
===
self
&&
location
.
hostname
===
'0.0.0.0'
)
return
true
// 这是在本地开发时使用没有user_info时
const
hostname
=
location
.
hostname
if
(
top
===
self
&&
(
hostname
===
'0.0.0.0'
||
hostname
===
'localhost'
))
return
true
if
(
top
!==
self
&&
(
hostname
!==
'0.0.0.0'
||
hostname
!==
'localhost'
))
return
false
}
},
boxEventMouse
(
event
)
{
...
...
src/packages/hs-dync-form/src/child.vue
View file @
11f73108
...
...
@@ -172,8 +172,18 @@ export default {
const
{
is_admin
}
=
user_info_json
if
(
is_admin
===
true
||
is_admin
===
'1'
||
is_admin
===
1
)
return
true
}
else
{
if
(
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
return
false
if
(
top
===
self
&&
location
.
hostname
===
'0.0.0.0'
)
return
true
// 这是在本地开发时使用没有user_info时
const
hostname
=
location
.
hostname
if
(
top
===
self
&&
(
hostname
===
'0.0.0.0'
||
hostname
===
'localhost'
)
)
return
true
if
(
top
!==
self
&&
(
hostname
!==
'0.0.0.0'
||
hostname
!==
'localhost'
)
)
return
false
}
},
getIsDev
()
{
...
...
@@ -188,8 +198,18 @@ export default {
)
return
true
}
else
{
if
(
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
return
false
if
(
top
===
self
&&
location
.
hostname
===
'0.0.0.0'
)
return
true
// 这是在本地开发时使用没有user_info时
const
hostname
=
location
.
hostname
if
(
top
===
self
&&
(
hostname
===
'0.0.0.0'
||
hostname
===
'localhost'
)
)
return
true
if
(
top
!==
self
&&
(
hostname
!==
'0.0.0.0'
||
hostname
!==
'localhost'
)
)
return
false
}
},
onContextmenu
(
event
)
{
...
...
src/packages/hs-dync-form/src/dyncFormItemComponentChild.vue
View file @
11f73108
...
...
@@ -24,6 +24,8 @@
</
template
>
<
template
v-else-if=
"item.type==='elDatePicker'"
>
<el-date-picker
v-click-outside=
"clickoutsideDom"
@
blur=
'blur'
ref=
'currentDom'
clearable
style=
"width:100%"
...
...
@@ -40,6 +42,8 @@
</
template
>
<
template
v-else-if=
"item.type==='elDatePickerDatetime'"
>
<el-date-picker
v-click-outside=
"clickoutsideDom"
@
blur=
'blur'
ref=
'currentDom'
clearable
style=
"width:100%"
...
...
@@ -53,6 +57,7 @@
</
template
>
<
template
v-else-if=
"item.type==='elDatePickerDate'"
>
<el-date-picker
v-click-outside=
"clickoutsideDom"
ref=
'currentDom'
clearable
style=
"width:100%"
...
...
@@ -66,6 +71,7 @@
</
template
>
<
template
v-else-if=
"item.type==='elDatePickerMonth'"
>
<el-date-picker
v-click-outside=
"clickoutsideDom"
ref=
'currentDom'
clearable
style=
"width:100%"
...
...
@@ -79,6 +85,7 @@
</
template
>
<
template
v-else-if=
"item.type==='elDatePickerMonthRange'"
>
<el-date-picker
v-click-outside=
"clickoutsideDom"
ref=
'currentDom'
clearable
style=
"width:100%"
...
...
@@ -400,14 +407,11 @@
</template>
<
script
>
// import elementUiMinins from '../../ucClass/elementUiMinins'
// import clickOutSide from '../../ucClass/click-out-side'
import
ClickOutside
from
'vue-click-outside'
import
Clickoutside
from
'../../ucClass/clickoutside'
export
default
{
// mixins: [elementUiMinins],
name
:
'dyncFormItemComponentChild'
,
directives
:
{
ClickOutside
ClickOutside
:
Clickoutside
},
props
:
{
popover_visible
:
{
...
...
@@ -426,6 +430,12 @@ export default {
}
},
methods
:
{
clickoutsideDom
()
{
this
.
hidePicker
()
},
blur
()
{
this
.
hidePicker
()
},
hidePicker
()
{
this
.
$refs
.
currentDom
.
hidePicker
()
},
...
...
src/packages/hs-select-plus/src/child.vue
View file @
11f73108
...
...
@@ -59,7 +59,6 @@
</
template
>
<
script
>
import
mockData
from
'../../common/initDbConfigDataJson'
import
commonMixins
from
'../../ucClass/commonMixins'
import
_
from
'lodash'
export
default
{
...
...
src/packages/hs-table/src/ItemComponentChild.vue
View file @
11f73108
...
...
@@ -249,9 +249,7 @@
</template>
<
script
>
// import clickOutSide from '../../ucClass/click-out-side'
// import Clickoutside from 'element-ui/src/utils/clickoutside'
import
Clickoutside
from
'vue-click-outside'
import
Clickoutside
from
'../../ucClass/clickoutside'
export
default
{
directives
:
{
ClickOutside
:
Clickoutside
...
...
src/packages/hs-table/src/child.vue
View file @
11f73108
...
...
@@ -53,6 +53,7 @@
:row-style=
'setRowStyle'
:cell-style=
"setCellStyle"
@
header-click=
"headerClick"
:span-method=
"spanMethod"
>
<template
v-for=
'(columnItem,index) in tableColumns'
>
...
...
@@ -322,9 +323,10 @@
v-show=
"!!paging"
>
<el-pagination
v-if=
'pagingConfig.total'
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync
=
"pagingConfig.page"
:current-page=
"pagingConfig.page"
:page-sizes=
"pageSizes"
:page-size=
"pagingConfig.per_page"
layout=
"total, sizes, prev, pager, next, jumper"
...
...
@@ -532,16 +534,11 @@ export default {
},
pagingConfig
()
{
if
(
!
this
.
paging
)
return
{}
const
{
page
,
per_page
,
total
,
total_page
}
=
this
.
paging
// this.paging.page = Number(page)
// this.paging.per_page = Number(per_page)
// this.paging.total = Number(total)
// this.paging.total_page = Number(total_page)
const
{
page
,
per_page
,
total
}
=
this
.
paging
const
obj
=
{
page
:
Number
(
page
),
per_page
:
Number
(
per_page
),
total
:
Number
(
total
),
total_page
:
Number
(
total_page
)
total
:
Number
(
total
)
}
return
obj
},
...
...
@@ -599,17 +596,78 @@ export default {
const
tkeys
=
Object
.
keys
(
this
.
total
||
{})
// 返回的数据中会有这样的一个total
const
sumKey
=
this
.
tableColumns
.
find
(
item
=>
item
.
summarizing
)
return
!!
tkeys
.
length
||
!!
sumKey
},
spanList
:
function
()
{
return
this
.
dealWithSpanList
()
}
},
mounted
()
{
// this.initContextmenu()
this
.
targetDom
=
this
.
$refs
.
boxtable
// setTimeout(() => {
// this.targetDom = this.$refs.boxtable// document.querySelector('._hs_table')
// console.log(this.$refs.boxtable)
// }, 500)
},
methods
:
{
getSpanArr
(
data
,
key1
,
key2
)
{
const
spanList
=
[]
let
pos
=
0
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
i
===
0
)
{
spanList
.
push
(
1
)
pos
=
0
}
else
{
if
(
key2
)
{
if
(
data
[
i
][
key2
]
===
data
[
i
-
1
][
key2
]
&&
data
[
i
][
key1
]
===
data
[
i
-
1
][
key1
]
)
{
spanList
[
pos
]
+=
1
spanList
.
push
(
0
)
}
else
{
spanList
.
push
(
1
)
pos
=
i
}
}
else
{
// 判断当前元素与上一个元素是否相同
if
(
data
[
i
][
key1
]
===
data
[
i
-
1
][
key1
])
{
spanList
[
pos
]
+=
1
spanList
.
push
(
0
)
}
else
{
spanList
.
push
(
1
)
pos
=
i
}
}
}
}
return
spanList
},
dealWithSpanList
()
{
const
spanList
=
{}
const
tableData
=
_
.
cloneDeep
(
this
.
tableDat
||
[])
const
config
=
_
.
cloneDeep
(
this
.
tableConfig
||
{})
if
(
config
.
spanCol
)
{
spanCol
=
config
.
spanCol
spanCol
.
forEach
(
key
=>
{
if
(
key
.
indexOf
(
'^'
)
>
-
1
)
{
const
key1
=
key
.
split
(
'^'
)[
0
]
const
key2
=
key
.
split
(
'^'
)[
1
]
spanList
[
key1
]
=
this
.
getSpanArr
(
tableData
,
key1
,
key2
)
}
else
{
spanList
[
key
]
=
this
.
getSpanArr
(
tableData
,
key
)
}
})
}
return
spanList
},
spanMethod
({
row
,
column
,
rowIndex
,
columnIndex
})
{
const
prop
=
column
.
property
const
target
=
this
.
spanList
[
prop
]
if
(
target
&&
target
.
length
)
{
const
_row
=
target
[
rowIndex
]
const
_col
=
_row
>
0
?
1
:
0
return
{
rowspan
:
_row
,
colspan
:
_col
}
}
},
getIsAdmin
()
{
const
user_info
=
sessionStorage
[
'user_info'
]
if
(
user_info
)
{
...
...
@@ -617,8 +675,18 @@ export default {
const
{
is_admin
}
=
user_info_json
if
(
is_admin
===
true
||
is_admin
===
'1'
||
is_admin
===
1
)
return
true
}
else
{
if
(
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
return
false
if
(
top
===
self
&&
location
.
hostname
===
'0.0.0.0'
)
return
true
// 这是在本地开发时使用没有user_info时
const
hostname
=
location
.
hostname
if
(
top
===
self
&&
(
hostname
===
'0.0.0.0'
||
hostname
===
'localhost'
)
)
return
true
if
(
top
!==
self
&&
(
hostname
!==
'0.0.0.0'
||
hostname
!==
'localhost'
)
)
return
false
}
},
getIsDev
()
{
...
...
@@ -636,8 +704,18 @@ export default {
return
false
}
}
else
{
if
(
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
return
false
if
(
top
===
self
&&
location
.
hostname
===
'0.0.0.0'
)
return
true
// 这是在本地开发时使用没有user_info时
const
hostname
=
location
.
hostname
if
(
top
===
self
&&
(
hostname
===
'0.0.0.0'
||
hostname
===
'localhost'
)
)
return
true
if
(
top
!==
self
&&
(
hostname
!==
'0.0.0.0'
||
hostname
!==
'localhost'
)
)
return
false
}
},
onContextmenu
(
event
)
{
...
...
@@ -674,7 +752,9 @@ export default {
if
(
!
is_admin
||
is_admin
===
0
)
return
return
is_admin
===
true
}
else
{
if
(
!
user_info
&&
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
{
return
false
}
if
(
!
user_info
&&
top
!==
self
&&
location
.
hostname
!==
'0.0.0.0'
)
{
return
false
}
return
true
}
},
...
...
src/packages/ucClass/click-out-side copy.js
deleted
100644 → 0
View file @
749d8765
export
default
{
bind
(
el
,
binding
,
vnode
)
{
el
.
handler
=
function
(
e
)
{
if
(
el
.
contains
(
e
.
target
))
{
return
false
}
// vnode.context[binding.expression] = false
binding
.
value
()
}
el
.
stopProp
=
function
(
event
)
{
event
.
stopPropagation
()
}
el
.
addEventListener
(
'click'
,
el
.
stopProp
)
document
.
body
.
addEventListener
(
'click'
,
el
.
handler
)
},
unbind
(
el
,
binding
)
{
el
.
removeEventListener
(
'click'
,
el
.
stopProp
)
document
.
body
.
removeEventListener
(
'click'
,
el
.
handler
)
},
install
(
Vue
)
{
Vue
.
directive
(
'clickoutside'
,
{
bind
:
this
.
bind
,
unbind
:
this
.
unbind
})
}
}
src/packages/ucClass/clickoutside.js
0 → 100644
View file @
11f73108
export
default
{
bind
(
el
,
binding
,
vnode
)
{
function
documentHandler
(
e
)
{
// el 包含其触发的元素 那当然不能触发啦
if
(
el
.
contains
(
e
.
target
))
{
return
false
}
// 满足上面条件, 并且expression 的值不为空 触发(希望value是个函数)
if
(
binding
.
expression
)
{
// 调用自定义指令传来的函数,e是事件原对象 作为参数(为什么传e 因为有些情况需要把这个对象抛出方便用户的操作)
binding
.
value
(
e
)
}
}
// 嗯??? 这么写有什么作用吗? 当然有了,如果你想取消事件的监听,那么是不是需要这个函数。
el
.
__vueClickOutside__
=
documentHandler
// 在document上监听事件
document
.
addEventListener
(
'click'
,
documentHandler
)
},
update
()
{
},
unbind
(
el
,
binding
)
{
// 取消事件监听(el.__vueClickOutside 派上用场了吧)
document
.
removeEventListener
(
'click'
,
el
.
__vueClickOutside__
)
// 既然都取消了 那么这个属性就没必要存在了
delete
el
.
__vueClickOutside__
}
}
src/packages/ucClass/commonMixins.js
View file @
11f73108
// import elementUiMinins from './elementUiMinins'
// import clickOutSide from './click-out-side'
// import Clickoutside from 'element-ui/src/utils/clickoutside'
import
Clickoutside
from
'vue-click-outside'
import
Clickoutside
from
'./clickoutside'
export
default
{
// mixins:[elementUiMinins],
directives
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment