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
ad93985a
Commit
ad93985a
authored
Jan 19, 2021
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hs-input-select优化
parent
20d0918c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2284 additions
and
148 deletions
+2284
-148
child.vue
src/packages/hs-input-select/src/child.vue
+1
-1
child.vue
src/packages/hs-lookup/src/child.vue
+18
-23
child copy 3.vue
src/packages/hs-table/src/child copy 3.vue
+942
-0
child copy 4.vue
src/packages/hs-table/src/child copy 4.vue
+1070
-0
child.vue
src/packages/hs-table/src/child.vue
+253
-124
No files found.
src/packages/hs-input-select/src/child.vue
View file @
ad93985a
...
...
@@ -130,7 +130,7 @@ export default {
await
this
.
remoteMethodsDebounce
(
query
,
this
.
configData
)
},
dealWithDefaultData
()
{
const
{
sourceData
}
=
_
.
cloneDeep
(
this
.
allSourceData
)
const
sourceData
=
_
.
cloneDeep
(
this
.
data
||
[]
)
const
sourceData_
=
_
.
cloneDeep
(
sourceData
)
return
Array
.
isArray
(
sourceData_
)
?
this
.
tansLate
(
sourceData_
)
...
...
src/packages/hs-lookup/src/child.vue
View file @
ad93985a
...
...
@@ -62,7 +62,7 @@
</hs-table>
<div
v-if=
'this.
lookupConfig
.multiple'
v-if=
'this.
configData
.multiple'
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -88,7 +88,7 @@ export default {
name
:
'lookup-component'
,
computed
:
{
getDisabled
:
function
()
{
const
{
disabled
,
disabledLevel
}
=
this
.
lookupConfig
const
{
disabled
,
disabledLevel
}
=
this
.
configData
const
type
=
typeof
disabled
if
(
disabledLevel
===
1
)
{
// 以自己的的配置为优先级最高
...
...
@@ -105,13 +105,10 @@ export default {
}
}
},
lookupConfig
:
function
()
{
return
this
.
allSourceData
.
config
||
{}
},
hsTableData
()
{
console
.
log
(
'测试hsTableData'
)
const
data
=
this
.
tableData
const
{
value
}
=
this
.
lookupConfig
const
{
value
}
=
this
.
configData
const
list
=
this
.
value
?
this
.
value
.
split
(
','
)
:
[]
list
.
forEach
(
x
=>
{
// 设置默认勾选
const
target
=
data
.
find
(
item
=>
item
[
value
]
===
x
)
...
...
@@ -150,7 +147,7 @@ export default {
this
.
hsTableEl
.
position
,
'hsTableSimple'
)
const
{
multiple
}
=
this
.
lookupConfig
const
{
multiple
}
=
this
.
configData
config
.
selection
=
!!
multiple
return
config
},
...
...
@@ -161,7 +158,7 @@ export default {
}
},
configData
:
function
()
{
return
this
.
allSourceData
.
config
||
{}
return
this
.
config
||
{}
}
},
watch
:
{
...
...
@@ -225,7 +222,7 @@ export default {
},
async
showDialog
()
{
// 弹出之前做逻辑判断
const
{
value
,
multiple
}
=
this
.
lookupConfig
const
{
value
,
multiple
}
=
this
.
configData
if
(
this
.
value
&&
multiple
)
{
// 多选
const
ids
=
this
.
value
.
split
(
','
)
...
...
@@ -260,7 +257,7 @@ export default {
init_value
()
{
if
(
!
this
.
hsTableConfig
)
return
const
sourceData
=
this
.
hsTableData
const
{
multiple
,
value
,
displayfield
}
=
this
.
lookupConfig
const
{
multiple
,
value
,
displayfield
}
=
this
.
configData
const
displayfield_value
=
this
.
formData
[
displayfield
]
if
(
displayfield_value
)
{
const
list
=
displayfield_value
.
split
(
','
)
...
...
@@ -296,13 +293,12 @@ export default {
}
},
async
queryByIds
()
{
this
.
allSourceData
.
sourceData
=
[]
const
{
value
}
=
this
.
lookupConfig
const
{
value
}
=
this
.
configData
// 调用外面的查询方法
const
obj
=
{}
obj
[
value
]
=
this
.
value
const
data
=
await
this
.
$listeners
.
queryLookup
(
this
.
allSourceData
.
config
,
this
.
configData
,
obj
,
this
.
formData
)
...
...
@@ -317,10 +313,9 @@ export default {
* 查询table数据
*/
async
queryTable
()
{
this
.
allSourceData
.
sourceData
=
[]
this
.
setDefaultQueryParms
()
// 如果有分页信息则要分页
const
{
per_page
}
=
this
.
lookupConfig
const
{
per_page
}
=
this
.
configData
if
(
per_page
&&
this
.
firstQuery
)
{
this
.
firstQuery
=
false
this
.
searchForm
.
per_page
=
per_page
...
...
@@ -328,7 +323,7 @@ export default {
}
// 调用外面的查询方法
const
data
=
await
this
.
$listeners
.
queryLookup
(
this
.
allSourceData
.
config
,
this
.
configData
,
this
.
searchForm
,
this
.
formData
)
...
...
@@ -337,7 +332,7 @@ export default {
this
.
paging
=
paging
}
// 做一个合并数据
const
{
multiple
}
=
this
.
lookupConfig
const
{
multiple
}
=
this
.
configData
let
returnData
=
[]
if
(
Array
.
isArray
(
data
))
{
returnData
=
data
...
...
@@ -354,7 +349,7 @@ export default {
}
},
unShiftData
(
queryData
)
{
const
{
value
}
=
this
.
lookupConfig
const
{
value
}
=
this
.
configData
const
selectIds
=
this
.
selectedData
.
map
(
item
=>
item
[
value
])
const
data_
=
_
.
remove
(
queryData
,
function
(
item
)
{
const
item_value
=
item
[
value
]
...
...
@@ -379,7 +374,7 @@ export default {
*/
submit
()
{
const
selectData
=
this
.
hsTableData
.
filter
(
x
=>
x
.
isSelected
)
const
prop
=
this
.
allSourceData
.
config
.
value
const
prop
=
this
.
configData
.
value
const
list_ids
=
selectData
.
map
(
x
=>
{
return
x
[
prop
]
})
...
...
@@ -398,7 +393,7 @@ export default {
* 双击行时设置当前行为选中项
*/
tableRowDblclick
(
row
)
{
const
prop
=
this
.
allSourceData
.
config
.
value
const
prop
=
this
.
configData
.
value
this
.
$emit
(
'input'
,
row
[
prop
])
this
.
changeAction
(
row
[
prop
])
this
.
setWritebackfield
([
row
])
...
...
@@ -407,7 +402,7 @@ export default {
},
setLabelValue
(
data
)
{
const
selectData
=
data
const
label
=
this
.
allSourceData
.
config
.
displayfield
const
label
=
this
.
configData
.
displayfield
const
label_list
=
selectData
.
map
(
x
=>
x
[
label
])
this
.
label_value
=
label_list
.
join
(
','
)
this
.
label_value_old
=
this
.
label_value
...
...
@@ -418,7 +413,7 @@ export default {
setWritebackfield
(
data
)
{
this
.
isChange
=
true
const
selectData
=
data
const
writebackfield
=
this
.
allSourceData
.
config
.
writebackfield
const
writebackfield
=
this
.
configData
.
writebackfield
if
(
writebackfield
)
{
// 解析回写字段
writebackfield
.
forEach
(
item
=>
{
...
...
@@ -436,7 +431,7 @@ export default {
* 清除回写字段
*/
clearWritebackfield
()
{
const
writebackfield
=
this
.
allSourceData
.
config
.
writebackfield
const
writebackfield
=
this
.
configData
.
writebackfield
writebackfield
.
forEach
(
item
=>
{
const
[
v1
,
v2
]
=
item
.
split
(
'='
)
if
(
v2
)
{
...
...
src/packages/hs-table/src/child copy 3.vue
0 → 100644
View file @
ad93985a
This diff is collapsed.
Click to expand it.
src/packages/hs-table/src/child copy 4.vue
0 → 100644
View file @
ad93985a
This diff is collapsed.
Click to expand it.
src/packages/hs-table/src/child.vue
View file @
ad93985a
This diff is collapsed.
Click to expand it.
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