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
38b9b115
Commit
38b9b115
authored
Apr 27, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化下拉组件
parent
115af5c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
71 deletions
+133
-71
HelloWorld.vue
src/components/HelloWorld.vue
+53
-17
dyncFormItemComponentChild.vue
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
+1
-0
index.vue
src/packages/hs-select-plus/index.vue
+2
-1
index.vue
src/packages/hs-tags/index.vue
+77
-53
No files found.
src/components/HelloWorld.vue
View file @
38b9b115
<
template
>
<div
style=
"width:500px"
>
<hsSwitch
v-model=
"checkList"
:allSourceData=
'configData'
></hsSwitch>
<hsSelectPlus
v-model=
"formData.test_p"
:allSourceData=
'allSourceData'
:requestMethod=
'requestMethod'
:writeBackObject=
'formData'
></hsSelectPlus>
</div>
</
template
>
<
script
>
import
u
c
from
"./apiUc"
;
import
apiU
c
from
"./apiUc"
;
export
default
{
mixins
:
[
u
c
],
mixins
:
[
apiU
c
],
data
()
{
return
{
value1
:
""
,
checkList
:
""
,
configData
:
{
sourceData
:
[],
formData
:
{
test_p
:
""
},
allSourceData
:
{
config
:
{
activeText
:
"A"
,
inactiveText
:
"B"
,
changeed
:
()
=>
{
console
.
log
(
21312
);
}
url
:
""
,
isInnerRequest
:
true
,
// 静态查询时 是否在内部请求数据
proxyTag
:
"commonUtilAPI"
,
//代理前缀
ref
:
{
const_id
:
"0"
,
// 常量id
table_name
:
"mmMaterialCategory"
,
// 表名
columns
:
"id,material_category"
,
// 查询列
remote_condition
:
"material_category"
,
// 远程搜索字段
displayfield
:
""
,
// 显示默认值
writebackfield
:
[]
// 回写对象
},
multiple
:
false
,
is_computed
:
false
,
disabled
:
false
,
size
:
"mini"
,
clearable
:
true
,
title
:
""
,
placeholder
:
""
,
value
:
"id"
,
label
:
"material_category"
,
linkBtnUi
:
{
url
:
"http://47.110.145.204:59168/queryBi/web//#/DyncUI/Single/PBArchive/pb_unit"
,
writeProp
:
{
test_p
:
"unit_name"
// 后面这个值是弹出页面返回过来的字段,回写给writeBackObject中的某个属性
},
parms
:
{}
}
},
sourceData
:
[]
// [{value:'',lable:''}] 的形式
}
};
},
methods
:
{}
mounted
()
{},
methods
:
{
printResult
()
{
console
.
log
(
this
.
formData
);
}
}
};
</
script
>
<
style
scoped
>
.codeTxt
{
text-align
:
left
;
}
</
style
>
\ No newline at end of file
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
View file @
38b9b115
...
...
@@ -16,6 +16,7 @@
</
template
>
<
template
v-if=
"item.type==='textarea'"
>
<el-input
autosize
style=
"width:100%"
type=
'textarea'
clearable
...
...
src/packages/hs-select-plus/index.vue
View file @
38b9b115
...
...
@@ -480,7 +480,7 @@ export default {
// 节流
remoteMethodsDebounce
:
_
.
debounce
(
async
function
(
query
)
{
if
(
this
.
is_mock
)
return
;
const
data
=
await
this
.
requestMethod
(
this
.
configData
,
query
);
const
data
=
await
this
.
requestMethod
(
this
.
configData
,
query
||
""
);
this
.
options
=
this
.
tansLate
(
data
||
[]);
},
1000
),
async
remoteMethod_
(
query
)
{
...
...
@@ -510,6 +510,7 @@ export default {
},
select_focus
(
event
)
{
const
{
remote_condition
}
=
this
.
configData
.
ref
;
debugger
;
if
(
remote_condition
&&
!
this
.
is_mock
)
{
this
.
remoteMethod_
();
}
...
...
src/packages/hs-tags/index.vue
View file @
38b9b115
<
template
>
<div
class=
"hsTags"
:id=
'elId'
style=
"
{width:100%;height:100%}">
<el-tag
:style=
"style"
:size=
'configData.size'
@
click=
"clickTagItem(item)"
class=
"hsTagsItem"
v-for=
"(item,index) in tagsList"
:key=
"index"
:type=
"item.type"
>
<div
class=
"hsTags"
:id=
'elId'
style=
"
{width:100%;height:100%}"
>
<el-tag
:style=
"style"
:size=
'configData.size'
@
click=
"clickTagItem(item)"
class=
"hsTagsItem"
v-for=
"(item,index) in tagsList"
:key=
"index"
:type=
"item.type"
>
{{
item
.
title
}}
</el-tag>
<jsoneditor
...
...
@@ -14,28 +26,28 @@
</div>
</
template
>
<
script
>
import
jsoneditor
from
'../common/jsoneditor'
import
ucComponent
from
'../ucClass/uc_component'
import
uuidv1
from
'uuid/v1'
import
_
from
'lodash'
import
jsoneditor
from
"../common/jsoneditor"
;
import
ucComponent
from
"../ucClass/uc_component"
;
import
uuidv1
from
"uuid/v1"
;
import
_
from
"lodash"
;
export
default
{
mixins
:
[
ucComponent
],
components
:
{
jsoneditor
},
name
:
'hsTags'
,
name
:
"hsTags"
,
props
:
{
value
:
''
,
value
:
""
,
elInfo
:
{
type
:
Object
,
default
()
{
return
{}
return
{}
;
}
},
allSourceData
:
{
type
:
Object
,
default
()
{
return
{}
return
{}
;
}
},
...
...
@@ -54,84 +66,96 @@ export default {
watch
:
{
allSourceData
:
{
handler
:
function
(
newVal
,
oldVal
)
{
this
.
initConfigData
(
newVal
)
this
.
initConfigData
(
newVal
)
;
},
deep
:
true
},
value
(
val
)
{
this
.
value_inner
=
val
this
.
setDefaultVal
(
val
)
this
.
value_inner
=
val
;
this
.
setDefaultVal
(
val
)
;
},
value_inner
(
val
)
{
this
.
$emit
(
'input'
,
val
)
console
.
log
(
val
,
'val'
)
this
.
$emit
(
"input"
,
val
);
}
},
data
()
{
return
{
tagsList
:
[],
elId
:
''
,
elId
:
""
,
jsoneditorVisible
:
false
,
buttonText
:
'操作'
,
buttonText
:
"操作"
,
clickTimer
:
null
,
configData
:
{
type
:
'primary'
,
size
:
'medium'
type
:
"primary"
,
size
:
"medium"
},
style
:
{},
value_inner
:
''
}
value_inner
:
""
}
;
},
created
()
{
this
.
elId
=
uuidv1
()
// 获取随机id
this
.
elId
=
uuidv1
()
;
// 获取随机id
},
mounted
()
{
this
.
initConfigData
(
this
.
allSourceData
)
this
.
initConfigData
(
this
.
allSourceData
)
;
},
methods
:
{
setDefaultVal
(
val
)
{
this
.
tagsList
.
forEach
(
item
=>
{
if
(
item
.
title
===
val
)
{
item
.
type
=
'success'
item
.
type
=
"success"
;
}
else
{
item
.
type
=
'primary'
item
.
type
=
"primary"
;
}
})
})
;
},
initConfigData
(
data
=
{})
{
const
config
=
data
.
config
||
{}
const
style
=
config
.
style
||
{}
this
.
style
=
style
const
sourceData
=
data
.
sourceData
||
[]
this
.
tagsList
=
sourceData
.
length
?
sourceData
:
[{
title
:
'测试'
}]
this
.
configData
=
Object
.
assign
(
_
.
cloneDeep
(
this
.
configData
),
_
.
cloneDeep
(
config
))
const
config
=
data
.
config
||
{};
const
style
=
config
.
style
||
{};
this
.
style
=
style
;
const
sourceData
=
data
.
sourceData
||
[];
this
.
tagsList
=
sourceData
.
length
?
sourceData
:
[{
title
:
"测试"
}];
this
.
configData
=
Object
.
assign
(
_
.
cloneDeep
(
this
.
configData
),
_
.
cloneDeep
(
config
)
);
},
clickTagItem
(
item
)
{
this
.
tagsList
.
forEach
(
x
=>
{
x
.
type
=
'primary'
x
.
type
=
"primary"
;
if
(
x
.
title
===
item
.
title
)
{
item
.
type
=
'success'
item
.
type
=
"success"
;
}
else
{
x
.
type
=
'primary'
x
.
type
=
"primary"
;
}
})
const
parm
=
{}
parm
[
this
.
elInfo
.
prop
]
=
item
.
title
||
item
.
id
this
.
$emit
(
'clickTagItem'
,
parm
)
});
this
.
value_inner
=
item
.
title
||
item
.
id
;
const
{
clicked
}
=
this
.
configData
;
this
.
execAction
(
clicked
,
item
);
this
.
$emit
(
"click"
,
item
);
},
execAction
(
actionName
,
value
)
{
const
type
=
typeof
actionName
;
if
(
type
===
"function"
)
{
actionName
(
value
);
}
}
}
}
};
</
script
>
<
style
scoped
>
.hsTags
{
.hsTags
{
padding
:
2px
1px
1px
1px
;
width
:
90%
;
height
:
100%
;
width
:
90%
;
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.hsTagsItem
{
margin-left
:
10px
;
.hsTagsItem
{
margin-left
:
10px
;
}
/* .hsTags>>>.el-tag--medium{
width: 100%;
...
...
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