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 @@
<div>
<hsTable
maxHeight=
'500px'
:elInfo=
"elInfo"
:allSourceData=
'allSourceData'
></hsTable>
</div>
</
template
>
<
script
>
import
apiUc
from
"./apiUc"
;
import
request
from
"../packages/funTools/requestConfigComponent"
;
export
default
{
mixins
:
[
apiUc
],
data
()
{
return
{
elInfo
:
{
position
:
"tt"
,
el
:
"hsTable"
,
page
:
"A"
,
sAppCode
:
"tyCode"
},
allSourceData
:
{
config
:
{
highlightCurrentRow
:
false
,
hover
:
{
hoverBackground
:
''
,
leaveBackground
:
''
},
highlightCurrentRow
:
false
,
hover
:
{
hoverBackground
:
""
,
leaveBackground
:
""
},
showIndex
:
false
,
// 是否显示 序号
hsConfig
:
{
default_type
:
1
// mes风格
...
...
@@ -110,18 +118,42 @@ export default {
}
]
},
sourceData
:
[]
//表格数据
sourceData
:
[]
//表格数据
}
};
},
mounted
()
{
this
.
init
();
this
.
getTableConfig
();
},
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
()
{
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'
import
'./packages/index'
import
ElementUI
from
'element-ui'
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
.
use
(
ElementUI
)
new
Vue
({
...
...
src/packages/funTools/commonUtility.js
View file @
c05f2bd7
...
...
@@ -51,7 +51,7 @@ function parseUrlQueryBIDyncAppcodePageName() {
}
// 解析动态菜单参数和全局参数MenuParams GlobalParams
function
parseMenuGlobalParams
(
str
,
params
)
{
const
{
menuParam
,
globalParam
,
other
Param
}
=
params
const
{
menuParam
,
globalParam
,
currentRowParam
,
mainParam
,
searchParam
,
indexParam
,
current
Param
}
=
params
const
empyt
=
[
undefined
]
if
(
typeof
str
!==
'string'
||
!
str
.
includes
(
'{'
)
||
!
str
.
includes
(
'}'
))
return
str
const
reg
=
/
\{(
.*
?)\}
/g
// /(?<=\{).*?(?=\})/g
...
...
@@ -74,11 +74,35 @@ function parseMenuGlobalParams(str, params) {
}
else
{
pt
=
globalParam
[
propStr
]
}
}
else
{
if
(
empyt
.
includes
(
otherParam
[
propStr
]))
{
}
else
if
(
sourceStr
===
'mainParam'
)
{
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
}
else
{
pt
=
other
Param
[
propStr
]
pt
=
currentRow
Param
[
propStr
]
}
}
pt
=
decodeURIComponent
(
pt
)
...
...
@@ -95,8 +119,9 @@ function recursiveDyncParam(obj, otherOBj = {}) {
const
parseUrlQueryParams
=
parseUrlQueryString
()
||
{}
const
parseGlobalParams_
=
parseGlobalParams
()
||
{}
const
parms
=
{
menuParam
:
parseUrlQueryParams
,
globalParam
:
parseGlobalParams_
,
otherParam
:
otherOBj
menuParam
:
parseUrlQueryParams
,
globalParam
:
parseGlobalParams_
}
Object
.
assign
(
parms
,
otherOBj
)
const
objType
=
typeof
obj
if
(
Array
.
isArray
(
obj
))
{
obj
.
forEach
((
item
,
index
)
=>
{
...
...
@@ -270,12 +295,20 @@ function recursiveReplaceAction(obj, activeManager) {
}
}
function
replaceItemAction
(
item
,
activeManager
)
{
const
actionProps
=
[
'isHide'
,
'click'
,
'disabled'
,
'changed'
,
'cleared'
]
const
actionProps
=
[
'isHide'
,
'click'
,
'
clicked'
,
'
disabled'
,
'changed'
,
'cleared'
]
actionProps
.
forEach
(
k
=>
{
const
type
=
typeof
item
[
k
]
if
(
type
===
'string'
&&
!
item
[
k
].
startsWith
(
'$'
))
{
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 = {
const
control_type
=
(
elInfo
&&
elInfo
.
el
)
||
''
const
{
appCode
,
page
,
isMock
,
dbName
:
db_Name
,
db_code
}
=
getPageParms
()
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
sAppCode
=
sAppCode_
||
appCode
const
sAppCode
=
sAppCode_
||
(
elInfo
&&
elInfo
.
sAppCode
)
||
appCode
var
sIsMock
if
(
parseInt
(
is_mock
)
===
0
||
parseInt
(
is_mock
)
===
1
)
{
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 @@
:elInfo=
'item.elInfo'
:readonly=
'disabled'
:prop=
'item.prop'
:uploadFileFun=
'item.uploadFileFun'
:containerType=
'type'
>
</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 = {
https
:
false
,
hotOnly
:
false
,
// http 代理配置
proxy
:
{
'/
api
'
:
{
target
:
'http://127.0.0.1:3000/api'
,
proxy
:
{
'/
fileresourceAPI
'
:
{
target
:
fileresourceAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api
'
:
''
pathRewrite
:
{
'^/fileresourceAPI
'
:
''
}
},
'/fileresourceAPI'
:
{
target
:
fileresourceAPI
,
'/GQLAPI'
:
{
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
,
pathRewrite
:
{
'^/fileresourceAPI'
:
''
pathRewrite
:
{
'^/authAPI'
:
''
}
},
'/toolAPI'
:
{
target
:
toolAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/toolAPI'
:
''
}
},
'/commonUtilAPI'
:
{
target
:
commonUtilAPI
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/commonUtilAPI'
:
''
pathRewrite
:
{
'^/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