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
58c907e7
Commit
58c907e7
authored
Apr 23, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
7c12db40
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
166 additions
and
46 deletions
+166
-46
HelloWorld.vue
src/components/HelloWorld.vue
+31
-36
apiUc.js
src/components/apiUc.js
+100
-0
dyncFormItemComponentChild.vue
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
+1
-1
index.vue
src/packages/hs-select-plus/index.vue
+16
-4
ItemComponentChild.vue
src/packages/hs-table/ItemComponentChild.vue
+1
-2
index.vue
src/packages/hs-table/index.vue
+0
-2
vue.config.js
vue.config.js
+17
-1
No files found.
src/components/HelloWorld.vue
View file @
58c907e7
...
...
@@ -2,7 +2,9 @@
<div
style=
"width:500px"
>
<hsSelectPlus
ref=
'select'
v-model=
"selectValue"
:allSourceData=
'allSourceData'
:requestMethod=
'requestMethod'
></hsSelectPlus>
<el-button
@
click=
"change1"
>
change1
</el-button>
<el-button
@
click=
"change2"
>
change2
</el-button>
...
...
@@ -10,12 +12,16 @@
</
template
>
<
script
>
import
uc
from
"./apiUc"
;
export
default
{
mixins
:
[
uc
],
data
()
{
return
{
selectValue
:
"1052069380861628416"
,
allSourceData
:
{
config
:
{
url
:
""
,
isInnerRequest
:
true
,
proxyTag
:
"commonUtilAPI"
,
ref
:
{
const_id
:
"0"
,
...
...
@@ -36,7 +42,7 @@ export default {
label
:
"name"
,
is_computed
:
false
},
sourceData
:
[]
sourceData
:
[]
,
},
show
:
false
,
config
:
{
...
...
@@ -63,24 +69,13 @@ export default {
}
};
},
mounted
()
{
this
.
init
();
},
methods
:
{
change1
(){
this
.
allSourceData
.
sourceData
=
[{
value
:
1
,
label
:
2
}]
},
change2
(){
this
.
allSourceData
.
sourceData
=
[{
value
:
2
,
label
:
3
}]
change1
()
{
this
.
allSourceData
.
sourceData
=
[{
value
:
1
,
label
:
2
}];
},
init
()
{
// this.getData()
;
change2
()
{
this
.
allSourceData
.
sourceData
=
[{
value
:
2
,
label
:
3
}]
;
},
async
getData
()
{
const
data
=
await
this
.
get_options
(
this
.
config
);
//this.allSourceData.config=this.config
this
.
allSourceData
.
sourceData
=
data
}
}
};
</
script
>
\ No newline at end of file
src/components/apiUc.js
0 → 100644
View file @
58c907e7
import
axios
from
'axios'
import
_
from
'lodash'
export
default
{
data
()
{
return
{
config
:
{
'url'
:
''
,
'ref'
:
{
const_id
:
'0'
,
table_name
:
''
,
columns
:
''
,
remote_condition
:
''
,
displayfield
:
''
,
writebackfield
:
[]
},
dyncQueryParms
:
{},
multiple
:
false
,
disabled
:
false
,
size
:
'mini'
,
clearable
:
true
,
title
:
''
,
placeholder
:
''
,
value
:
''
,
label
:
''
,
is_computed
:
false
}
}
},
methods
:
{
async
requestMethod
(
config
,
value
)
{
const
{
ref
,
proxyTag
,
dyncQueryParms
}
=
config
||
{}
const
{
const_id
,
table_name
,
columns
,
remote_condition
}
=
ref
||
{}
const
url_dynamic
=
`
${
proxyTag
}
/ref/table`
const
url_static
=
`
${
proxyTag
}
/ref/items`
let
real_url
=
''
const
url
=
''
let
remote_condition_
=
remote_condition
.
trim
()
let
parms
=
''
const
dyncQueryParms_
=
_
.
cloneDeep
(
dyncQueryParms
||
{})
if
(
value
)
{
dyncQueryParms_
[
remote_condition_
]
=
value
.
trim
()
}
for
(
const
key
in
dyncQueryParms_
)
{
if
(
key
===
remote_condition
)
{
parms
+=
`&
${
key
}
=
${
encodeURIComponent
(
'%'
+
dyncQueryParms_
[
key
]
+
'%'
)}
`
}
else
{
parms
+=
`&
${
key
}
=
${
encodeURIComponent
(
dyncQueryParms_
[
key
])}
`
}
}
if
(
const_id
!==
'0'
&&
Number
(
const_id
))
{
// 常量id
real_url
=
`
${
url_static
}
/
${
const_id
}
/`
}
else
if
(
table_name
)
{
// 表名字段名
// 字段查询
real_url
=
`
${
url_dynamic
}
/
${
table_name
}
/
${
columns
}
/`
}
else
if
(
url
)
{
real_url
=
url
}
if
(
real_url
.
includes
(
'?'
))
{
real_url
+=
parms
}
else
{
real_url
+=
'?'
+
parms
}
if
(
!
real_url
)
return
[]
const
type
=
typeof
value
if
(
type
===
'undefined'
&&
remote_condition
)
{
// 远程搜索的时候
return
[]
}
else
{
const
res
=
await
axios
.
get
(
real_url
)
const
options
=
Array
.
isArray
(
res
.
data
)
?
this
.
tansLate
(
res
.
data
,
config
)
:
this
.
translate_json
(
res
.
data
)
return
options
}
},
tansLate
(
data
,
config
)
{
const
arr
=
data
const
list
=
[]
const
{
value
,
label
}
=
config
arr
.
forEach
(
element
=>
{
const
parm
=
{}
for
(
const
pro
in
element
)
{
if
(
pro
===
value
&&
value
===
label
)
{
parm
.
value
=
element
[
pro
]
parm
.
label
=
element
[
pro
]
}
else
if
(
pro
===
value
)
{
parm
.
value
=
element
[
pro
]
}
else
if
(
pro
===
label
)
{
parm
.
label
=
element
[
label
]
}
parm
[
pro
]
=
element
[
pro
]
}
list
.
push
(
parm
)
})
return
list
},
},
}
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
View file @
58c907e7
...
...
@@ -92,7 +92,7 @@
:readonly=
'disabled'
:prop=
'item.prop'
:containerType=
'type'
:re
moteMethod=
'item.remote
Method'
:re
questMethod=
'item.request
Method'
>
</hsSelectPlus>
</
template
>
...
...
src/packages/hs-select-plus/index.vue
View file @
58c907e7
...
...
@@ -94,9 +94,8 @@ export default {
dialogIframe
},
props
:
{
remoteMethod
:
{
type
:
Function
,
default
()
{}
requestMethod
:{
type
:
Function
},
containerType
:
{},
elInfo
:
{
...
...
@@ -249,6 +248,7 @@ export default {
// }
this
.
initData
(
newVal
);
this
.
initValue
(
this
.
value
);
this
.
clientData
();
},
deep
:
true
}
...
...
@@ -262,9 +262,20 @@ export default {
this
.
title
=
this
.
elInfo
.
title
;
this
.
initData
(
this
.
allSourceData
);
this
.
initValue
(
this
.
value
);
this
.
clientData
();
});
},
methods
:
{
async
clientData
()
{
const
{
config
,
sourceData
}
=
this
.
allSourceData
;
if
(
config
&&
Object
.
keys
(
config
).
length
>
0
)
{
const
isInnerRequest
=
config
.
isInnerRequest
;
if
(
isInnerRequest
)
{
const
datas
=
await
this
.
requestMethod
(
config
);
this
.
options
=
datas
||
[];
}
}
},
closeDialog
()
{
this
.
dialogIframeVisible
=
false
;
},
...
...
@@ -354,6 +365,7 @@ export default {
if
(
this
.
configData
.
ref
)
{
this
.
configData
.
remote
=
!!
this
.
configData
.
ref
.
remote_condition
;
this
.
configData
.
filterable
=
!!
this
.
configData
.
ref
.
remote_condition
;
debugger
}
const
linkBtnUi
=
this
.
configData
.
linkBtnUi
;
this
.
linkBtnUiVis
=
!!
linkBtnUi
;
...
...
@@ -466,7 +478,7 @@ export default {
// 节流
remoteMethodsDebounce
:
_
.
debounce
(
async
function
(
query
)
{
if
(
this
.
is_mock
)
return
;
const
data
=
await
this
.
re
moteMethod
(
query
,
this
.
configData
);
const
data
=
await
this
.
re
questMethod
(
this
.
configData
,
query
);
this
.
options
=
this
.
tansLate
(
data
||
[]);
},
1000
),
async
remoteMethod_
(
query
)
{
...
...
src/packages/hs-table/ItemComponentChild.vue
View file @
58c907e7
...
...
@@ -94,7 +94,7 @@
:elInfo=
'item.elInfo'
:writeBackObject=
'formParms'
:readonly=
'disabled'
:re
moteMethod=
'remote
Method'
:re
questMethod=
'item.request
Method'
>
</hsSelectPlus>
</
template
>
...
...
@@ -105,7 +105,6 @@
export
default
{
name
:
'dyncFormItemComponentChild_'
,
props
:
{
remoteMethod
:
{},
item
:
{},
formParms
:
{},
jsoneditorOpenAfter
:
{
...
...
src/packages/hs-table/index.vue
View file @
58c907e7
...
...
@@ -93,7 +93,6 @@
<
template
v-else
>
<!--
<span
@
click=
"cellClickItem(scope.row[column.prop],column.action)"
>
{{
scope
.
row
[
column
.
prop
]
}}
</span>
-->
<childItem
:remoteMethod=
"remoteMethod"
v-if=
"jumpItem(column.prop)"
:item=
'jumpItem(column.prop)'
:prop=
"column.prop"
...
...
@@ -246,7 +245,6 @@ export default {
},
name
:
'hsTable'
,
props
:
{
remoteMethod
:
{},
importInfo
:
{
// 导入信息
type
:
Array
,
default
()
{
...
...
vue.config.js
View file @
58c907e7
const
path
=
require
(
'path'
)
let
api
=
'47.110.145.204:59168'
// 代理服务器地址
const
mainAPI
=
`http://
${
api
}
/Tool/api/`
const
mockAPI
=
'http://47.110.145.204:8082/mock/203'
const
authAPI
=
`http://
${
api
}
/HSRight/api/`
const
menuAPI
=
'http://localhost:3000'
const
GQLAPI
=
`http://
${
api
}
/GQL/api/`
const
toolAPI
=
`http://
${
api
}
/Tool/api/`
const
commonUtilAPI
=
`http://
${
api
}
/CommonUtil/api/`
const
ipCommonAPI
=
`http://
${
api
}
/`
const
fileresourceAPI
=
`http://
${
api
}
/fileresource/api/`
module
.
exports
=
{
// 部署应用包时的基本 URL,用法和 webpack 本身的 output.publicPath 一致
publicPath
:
'./'
,
...
...
@@ -58,6 +67,13 @@ module.exports = {
pathRewrite
:
{
'^/api'
:
''
}
},
'/commonUtilAPI'
:
{
target
:
commonUtilAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/commonUtilAPI'
:
''
}
}
},
before
:
(
app
)
=>
{}
...
...
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