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
c05f2bd7
Commit
c05f2bd7
authored
Apr 29, 2020
by
何虹
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化组件
parent
6a7a2f9e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1559 additions
and
1076 deletions
+1559
-1076
HelloWorld.vue
src/components/HelloWorld.vue
+37
-5
main.js
src/main.js
+3
-0
commonUtility.js
src/packages/funTools/commonUtility.js
+40
-7
request.js
src/packages/funTools/request.js
+2
-2
requestConfigComponent.js
src/packages/funTools/requestConfigComponent.js
+372
-0
dyncFormItemComponentChild.vue
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
+1
-0
index.vue
src/packages/hs-file/index.vue
+108
-108
index.vue
src/packages/hs-select-plus/index.vue
+263
-263
index.vue
src/packages/hs-table/index.vue
+680
-680
vue.config.js
vue.config.js
+53
-11
No files found.
src/components/HelloWorld.vue
View file @
c05f2bd7
...
@@ -2,20 +2,28 @@
...
@@ -2,20 +2,28 @@
<div>
<div>
<hsTable
<hsTable
maxHeight=
'500px'
maxHeight=
'500px'
:elInfo=
"elInfo"
:allSourceData=
'allSourceData'
:allSourceData=
'allSourceData'
></hsTable>
></hsTable>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
apiUc
from
"./apiUc"
;
import
apiUc
from
"./apiUc"
;
import
request
from
"../packages/funTools/requestConfigComponent"
;
export
default
{
export
default
{
mixins
:
[
apiUc
],
mixins
:
[
apiUc
],
data
()
{
data
()
{
return
{
return
{
elInfo
:
{
position
:
"tt"
,
el
:
"hsTable"
,
page
:
"A"
,
sAppCode
:
"tyCode"
},
allSourceData
:
{
allSourceData
:
{
config
:
{
config
:
{
highlightCurrentRow
:
false
,
highlightCurrentRow
:
false
,
hover
:
{
hoverBackground
:
''
,
leaveBackground
:
''
},
hover
:
{
hoverBackground
:
""
,
leaveBackground
:
""
},
showIndex
:
false
,
// 是否显示 序号
showIndex
:
false
,
// 是否显示 序号
hsConfig
:
{
hsConfig
:
{
default_type
:
1
// mes风格
default_type
:
1
// mes风格
...
@@ -110,18 +118,42 @@ export default {
...
@@ -110,18 +118,42 @@ export default {
}
}
]
]
},
},
sourceData
:
[]
//表格数据
sourceData
:
[]
//表格数据
}
}
};
};
},
},
mounted
()
{
mounted
()
{
this
.
init
();
this
.
init
();
this
.
getTableConfig
();
},
},
methods
:
{
methods
:
{
async
getTableConfig
()
{
// 初始化main上面的工具栏
const
data
=
{
control_name
:
this
.
elInfo
.
position
,
sAppCode
:
this
.
elInfo
.
sAppCode
,
sPage
:
this
.
elInfo
.
page
,
return_type
:
1
};
const
res
=
await
request
.
getPageInfo
(
data
);
if
(
res
.
length
)
{
this
.
allSourceData
.
config
=
JSON
.
parse
(
res
[
0
].
json_config
);
}
},
init
()
{
init
()
{
this
.
allSourceData
.
sourceData
=
[
this
.
allSourceData
.
sourceData
=
[
{
customer_name
:
1
,
style_code
:
2
,
order_size
:
"0"
,
_styleRowSetting_
:{
"color"
:
"blue"
,
"background"
:
"red"
}
},
{
{
customer_name
:
1
,
style_code
:
2
,
order_size
:
"0"
,
_styleRowSetting_
:{
"color"
:
"blue"
,
"background"
:
"blue"
}
}
customer_name
:
1
,
style_code
:
2
,
order_size
:
"0"
,
_styleRowSetting_
:
{
color
:
"blue"
,
background
:
"red"
}
},
{
customer_name
:
1
,
style_code
:
2
,
order_size
:
"0"
,
_styleRowSetting_
:
{
color
:
"blue"
,
background
:
"blue"
}
}
];
];
}
}
}
}
...
...
src/main.js
View file @
c05f2bd7
...
@@ -3,6 +3,9 @@ import App from './App.vue'
...
@@ -3,6 +3,9 @@ import App from './App.vue'
import
'./packages/index'
import
'./packages/index'
import
ElementUI
from
'element-ui'
import
ElementUI
from
'element-ui'
import
'element-ui/lib/theme-chalk/index.css'
import
'element-ui/lib/theme-chalk/index.css'
import
'jsoneditor/dist/jsoneditor.min.css'
import
jsoneditor
from
'jsoneditor'
Vue
.
prototype
.
$jsoneditor
=
jsoneditor
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
)
Vue
.
use
(
ElementUI
)
new
Vue
({
new
Vue
({
...
...
src/packages/funTools/commonUtility.js
View file @
c05f2bd7
...
@@ -51,7 +51,7 @@ function parseUrlQueryBIDyncAppcodePageName() {
...
@@ -51,7 +51,7 @@ function parseUrlQueryBIDyncAppcodePageName() {
}
}
// 解析动态菜单参数和全局参数MenuParams GlobalParams
// 解析动态菜单参数和全局参数MenuParams GlobalParams
function
parseMenuGlobalParams
(
str
,
params
)
{
function
parseMenuGlobalParams
(
str
,
params
)
{
const
{
menuParam
,
globalParam
,
other
Param
}
=
params
const
{
menuParam
,
globalParam
,
currentRowParam
,
mainParam
,
searchParam
,
indexParam
,
current
Param
}
=
params
const
empyt
=
[
undefined
]
const
empyt
=
[
undefined
]
if
(
typeof
str
!==
'string'
||
!
str
.
includes
(
'{'
)
||
!
str
.
includes
(
'}'
))
return
str
if
(
typeof
str
!==
'string'
||
!
str
.
includes
(
'{'
)
||
!
str
.
includes
(
'}'
))
return
str
const
reg
=
/
\{(
.*
?)\}
/g
// /(?<=\{).*?(?=\})/g
const
reg
=
/
\{(
.*
?)\}
/g
// /(?<=\{).*?(?=\})/g
...
@@ -74,11 +74,35 @@ function parseMenuGlobalParams(str, params) {
...
@@ -74,11 +74,35 @@ function parseMenuGlobalParams(str, params) {
}
else
{
}
else
{
pt
=
globalParam
[
propStr
]
pt
=
globalParam
[
propStr
]
}
}
}
else
{
}
else
if
(
sourceStr
===
'mainParam'
)
{
if
(
empyt
.
includes
(
otherParam
[
propStr
]))
{
if
(
empyt
.
includes
(
mainParam
[
propStr
]))
{
pt
=
p
}
else
{
pt
=
mainParam
[
propStr
]
}
}
else
if
(
sourceStr
===
'searchParam'
)
{
if
(
empyt
.
includes
(
searchParam
[
propStr
]))
{
pt
=
p
}
else
{
pt
=
searchParam
[
propStr
]
}
}
else
if
(
sourceStr
===
'indexParam'
)
{
if
(
empyt
.
includes
(
indexParam
[
propStr
]))
{
pt
=
p
}
else
{
pt
=
indexParam
[
propStr
]
}
}
else
if
(
sourceStr
===
'currentParam'
)
{
if
(
empyt
.
includes
(
currentParam
[
propStr
]))
{
pt
=
p
}
else
{
pt
=
currentParam
[
propStr
]
}
}
else
if
(
sourceStr
===
'currentRowParam'
)
{
if
(
empyt
.
includes
(
currentParam
[
propStr
]))
{
pt
=
p
pt
=
p
}
else
{
}
else
{
pt
=
other
Param
[
propStr
]
pt
=
currentRow
Param
[
propStr
]
}
}
}
}
pt
=
decodeURIComponent
(
pt
)
pt
=
decodeURIComponent
(
pt
)
...
@@ -95,8 +119,9 @@ function recursiveDyncParam(obj, otherOBj = {}) {
...
@@ -95,8 +119,9 @@ function recursiveDyncParam(obj, otherOBj = {}) {
const
parseUrlQueryParams
=
parseUrlQueryString
()
||
{}
const
parseUrlQueryParams
=
parseUrlQueryString
()
||
{}
const
parseGlobalParams_
=
parseGlobalParams
()
||
{}
const
parseGlobalParams_
=
parseGlobalParams
()
||
{}
const
parms
=
{
const
parms
=
{
menuParam
:
parseUrlQueryParams
,
globalParam
:
parseGlobalParams_
,
otherParam
:
otherOBj
menuParam
:
parseUrlQueryParams
,
globalParam
:
parseGlobalParams_
}
}
Object
.
assign
(
parms
,
otherOBj
)
const
objType
=
typeof
obj
const
objType
=
typeof
obj
if
(
Array
.
isArray
(
obj
))
{
if
(
Array
.
isArray
(
obj
))
{
obj
.
forEach
((
item
,
index
)
=>
{
obj
.
forEach
((
item
,
index
)
=>
{
...
@@ -270,12 +295,20 @@ function recursiveReplaceAction(obj, activeManager) {
...
@@ -270,12 +295,20 @@ function recursiveReplaceAction(obj, activeManager) {
}
}
}
}
function
replaceItemAction
(
item
,
activeManager
)
{
function
replaceItemAction
(
item
,
activeManager
)
{
const
actionProps
=
[
'isHide'
,
'click'
,
'disabled'
,
'changed'
,
'cleared'
]
const
actionProps
=
[
'isHide'
,
'click'
,
'
clicked'
,
'
disabled'
,
'changed'
,
'cleared'
]
actionProps
.
forEach
(
k
=>
{
actionProps
.
forEach
(
k
=>
{
const
type
=
typeof
item
[
k
]
const
type
=
typeof
item
[
k
]
if
(
type
===
'string'
&&
!
item
[
k
].
startsWith
(
'$'
))
{
if
(
type
===
'string'
&&
!
item
[
k
].
startsWith
(
'$'
))
{
const
funName
=
'$'
+
item
[
k
]
const
funName
=
'$'
+
item
[
k
]
item
[
k
]
=
activeManager
[
funName
]
if
(
!
activeManager
[
funName
])
{
alert
(
`action---
${
funName
}
,不存在 `
)
console
.
error
(
`action---
${
funName
}
,不存在 `
)
item
[
k
]
=
()
=>
{
console
.
log
(
`action---
${
funName
}
,不存在 `
)
}
}
else
{
item
[
k
]
=
activeManager
[
funName
]
}
}
}
})
})
}
}
...
...
src/packages/funTools/request.js
View file @
c05f2bd7
...
@@ -326,9 +326,9 @@ const API = {
...
@@ -326,9 +326,9 @@ const API = {
const
control_type
=
(
elInfo
&&
elInfo
.
el
)
||
''
const
control_type
=
(
elInfo
&&
elInfo
.
el
)
||
''
const
{
appCode
,
page
,
isMock
,
dbName
:
db_Name
,
db_code
}
=
getPageParms
()
const
{
appCode
,
page
,
isMock
,
dbName
:
db_Name
,
db_code
}
=
getPageParms
()
var
p
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
p
=
new
Promise
(
function
(
resolve
,
reject
)
{
const
db_name
=
dbName
||
db_Name
||
''
const
db_name
=
dbName
||
(
elInfo
&&
elInfo
.
db_name
)
||
db_Name
||
''
const
sPage
=
sPage_
||
(
elInfo
&&
elInfo
.
page
)
||
page
||
''
const
sPage
=
sPage_
||
(
elInfo
&&
elInfo
.
page
)
||
page
||
''
const
sAppCode
=
sAppCode_
||
appCode
const
sAppCode
=
sAppCode_
||
(
elInfo
&&
elInfo
.
sAppCode
)
||
appCode
var
sIsMock
var
sIsMock
if
(
parseInt
(
is_mock
)
===
0
||
parseInt
(
is_mock
)
===
1
)
{
if
(
parseInt
(
is_mock
)
===
0
||
parseInt
(
is_mock
)
===
1
)
{
sIsMock
=
is_mock
sIsMock
=
is_mock
...
...
src/packages/funTools/requestConfigComponent.js
0 → 100644
View file @
c05f2bd7
This diff is collapsed.
Click to expand it.
src/packages/hs-dyncForm/dyncFormItemComponentChild.vue
View file @
c05f2bd7
...
@@ -104,6 +104,7 @@
...
@@ -104,6 +104,7 @@
:elInfo=
'item.elInfo'
:elInfo=
'item.elInfo'
:readonly=
'disabled'
:readonly=
'disabled'
:prop=
'item.prop'
:prop=
'item.prop'
:uploadFileFun=
'item.uploadFileFun'
:containerType=
'type'
:containerType=
'type'
>
>
</hsFile>
</hsFile>
...
...
src/packages/hs-file/index.vue
View file @
c05f2bd7
This diff is collapsed.
Click to expand it.
src/packages/hs-select-plus/index.vue
View file @
c05f2bd7
This diff is collapsed.
Click to expand it.
src/packages/hs-table/index.vue
View file @
c05f2bd7
This diff is collapsed.
Click to expand it.
vue.config.js
View file @
c05f2bd7
...
@@ -60,26 +60,68 @@ module.exports = {
...
@@ -60,26 +60,68 @@ module.exports = {
https
:
false
,
https
:
false
,
hotOnly
:
false
,
hotOnly
:
false
,
// http 代理配置
// http 代理配置
proxy
:
{
proxy
:
{
'/
api
'
:
{
'/
fileresourceAPI
'
:
{
target
:
'http://127.0.0.1:3000/api'
,
target
:
fileresourceAPI
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
'^/api
'
:
''
'^/fileresourceAPI
'
:
''
}
}
},
},
'/fileresourceAPI'
:
{
'/GQLAPI'
:
{
target
:
fileresourceAPI
,
target
:
GQLAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/GQLAPI'
:
''
}
},
'/mainAPI'
:
{
target
:
mainAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/mainAPI'
:
''
}
},
'/menuAPI'
:
{
target
:
menuAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/menuAPI'
:
''
}
},
'/mockAPI'
:
{
target
:
mockAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/mockAPI'
:
''
}
},
'/authAPI'
:
{
target
:
authAPI
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
'^/fileresourceAPI'
:
''
'^/authAPI'
:
''
}
},
'/toolAPI'
:
{
target
:
toolAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/toolAPI'
:
''
}
}
},
},
'/commonUtilAPI'
:
{
'/commonUtilAPI'
:
{
target
:
commonUtilAPI
,
target
:
commonUtilAPI
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
'^/commonUtilAPI'
:
''
'^/commonUtilAPI'
:
''
}
},
'/ipCommonAPI'
:
{
target
:
ipCommonAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/ipCommonAPI'
:
''
}
}
}
}
},
},
...
...
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