Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
quantum-blocks
Commits
e595a044
Commit
e595a044
authored
Nov 19, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tenant): 接入量星球权限系统
parent
5ee9eceb
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
121 additions
and
81 deletions
+121
-81
operation.api.ts
app/web/api/operation.api.ts
+0
-4
user.api.ts
app/web/api/user.api.ts
+6
-0
index.vue
app/web/component/layout/editor/micro/index.vue
+70
-56
index.ts
app/web/component/layout/editor/single/index.ts
+1
-1
index.vue
app/web/component/layout/editor/single/index.vue
+3
-3
index.ts
app/web/page/editor/component/BasicPageFormModal/index.ts
+1
-1
index.vue
app/web/page/editor/component/BasicPageFormModal/index.vue
+1
-1
index.ts
app/web/page/editor/component/DynamicComponent/index.ts
+5
-5
index.ts
app/web/page/editor/component/DynamicPageForm/index.ts
+3
-3
index.vue
app/web/page/editor/view/dashboard/index.vue
+1
-1
index.ts
app/web/page/store/modules/tenant/index.ts
+24
-3
state.ts
app/web/page/store/modules/tenant/state.ts
+5
-2
http.service.ts
app/web/service/http.service.ts
+1
-1
No files found.
app/web/api/operation.api.ts
View file @
e595a044
...
...
@@ -20,10 +20,6 @@ export default {
getTemplateList
()
{
return
http
.
get
(
'
editor/get/template
'
);
},
// 获取权限
getTenantAuthInfo
()
{
return
http
.
get
(
'
tenant/get
'
);
},
// 商品列表-查询
skuInfo
(
params
)
{
return
http
.
post
(
`
${
config
.
opapiHost
}
/kdspOp/api/kdsp/activity/activity-goods/sku-info/list`
,
params
,
{
...
...
app/web/api/user.api.ts
View file @
e595a044
...
...
@@ -18,4 +18,10 @@ export function getUserInfo() {
return
http
.
get
(
`
${
opapiHost
}
/backStms/oauth/currentuserinfo`
,
{
accessToken
:
true
});
}
// 获取权限
export
function
getMenuData
()
{
return
http
.
get
(
`
${
config
.
opapiHost
}
/backStms/user/getresources/APP016`
,
{
accessToken
:
true
});
}
\ No newline at end of file
app/web/component/layout/editor/micro/index.vue
View file @
e595a044
...
...
@@ -3,7 +3,7 @@
<Row
type=
"flex"
class=
"layout-container"
v-if=
"!isDashboard"
>
<Sider
collapsible
:collapsed-width=
"71"
style=
"z-index: 100"
ref=
"sider"
v-model=
"isCollapsed"
>
<Menu
:active-name=
"activeName"
theme=
"dark"
width=
"auto"
:open-names=
"openNames"
accordion
@
on-select=
"select"
:class=
"menuitemClasses"
ref=
"menus"
>
<template
v-for=
"(menu, index) in page"
>
<template
v-for=
"(menu, index) in page
List
"
>
<MenuItem
style=
"background: #001529;"
v-if=
"!isCollapsed"
:name=
"index"
:key=
"menu.name"
>
<Icon
:type=
"menu.icon"
></Icon>
<span
class=
"layout-text"
>
{{
menu
.
name
}}
</span>
...
...
@@ -37,65 +37,79 @@
</div>
</template>
<
script
>
import
{
mapActions
}
from
'
vuex
'
export
default
{
data
()
{
return
{
showLoading
:
false
,
activeName
:
0
,
openNames
:
[
'
0
'
],
isCollapsed
:
false
,
page
:
[{
name
:
'
作品列表
'
,
icon
:
'
ios-list
'
,
path
:
'
list
'
,
children
:
[]
},
{
name
:
'
我的草稿
'
,
icon
:
'
ios-book
'
,
path
:
'
my
'
,
children
:
[]
},
{
name
:
'
创意模板
'
,
icon
:
'
ios-compose
'
,
path
:
'
template
'
,
children
:
[]
}]
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
export
default
{
data
()
{
return
{
showLoading
:
false
,
activeName
:
0
,
openNames
:
[
'
0
'
],
isCollapsed
:
false
,
page
:
[{
name
:
'
作品列表
'
,
icon
:
'
ios-list
'
,
path
:
'
list
'
,
children
:
[]
},
{
name
:
'
我的草稿
'
,
icon
:
'
ios-book
'
,
path
:
'
my
'
,
children
:
[]
},
{
name
:
'
创意模板
'
,
icon
:
'
ios-compose
'
,
path
:
'
template
'
,
children
:
[]
}]
}
},
methods
:
{
...
mapActions
([
'
fetchTenantAuthData
'
]),
select
(
name
)
{
console
.
log
(
'
select
'
,
name
);
const
current
=
this
.
page
[
name
];
this
.
$router
.
push
({
name
:
current
.
path
,
});
this
.
$nextTick
(()
=>
{
this
.
activeName
=
name
;
this
.
$refs
.
menus
.
updateOpened
();
this
.
$refs
.
menus
.
updateActiveName
();
});
},
},
created
()
{
this
.
fetchTenantAuthData
();
console
.
log
(
'
isDashboard
'
,
this
.
$route
);
},
computed
:
{
...
mapState
([
'
tmplList
'
,
'
draftList
'
,
'
workist
'
]),
pageList
()
{
const
pageList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
page
));
if
(
this
.
tmplList
)
{
pageList
.
splice
(
2
,
1
);
}
if
(
this
.
draftList
)
{
pageList
.
splice
(
1
,
1
);
}
if
(
this
.
workist
)
{
pageList
.
splice
(
0
,
1
);
}
return
pageList
;
},
methods
:
{
...
mapActions
([
'
fetchTenantAuthData
'
]),
select
(
name
)
{
console
.
log
(
'
select
'
,
name
);
const
current
=
this
.
page
[
name
];
this
.
$router
.
push
({
name
:
current
.
path
,
});
this
.
$nextTick
(()
=>
{
this
.
activeName
=
name
;
this
.
$refs
.
menus
.
updateOpened
();
this
.
$refs
.
menus
.
updateActiveName
();
});
},
menuitemClasses
:
function
()
{
return
[
'
ivu-menu-dark
'
,
'
menu-item
'
,
this
.
isCollapsed
?
'
collapsed-menu
'
:
''
];
},
created
()
{
this
.
fetchTenantAuthData
();
isDashboard
()
{
console
.
log
(
'
isDashboard
'
,
this
.
$route
);
},
computed
:
{
menuitemClasses
:
function
()
{
return
[
'
ivu-menu-dark
'
,
'
menu-item
'
,
this
.
isCollapsed
?
'
collapsed-menu
'
:
''
];
},
isDashboard
()
{
console
.
log
(
'
isDashboard
'
,
this
.
$route
);
return
this
.
$route
.
name
===
'
detail
'
;
}
},
}
return
this
.
$route
.
name
===
'
detail
'
;
}
},
}
</
script
>
<
style
lang=
"less"
scoped
>
.layout {
...
...
app/web/component/layout/editor/single/index.ts
View file @
e595a044
...
...
@@ -29,7 +29,7 @@ export default class Layout extends Vue {
activeName
:
string
=
'
list
'
;
username
:
string
=
localStorage
.
get
(
'
user
'
)?.
name
||
'
陌生人
'
;
@
Action
(
'
fetchTenantAuthData
'
)
fetchTenantAuthData
;
@
State
(
state
=>
state
)
state
;
@
State
(
state
=>
state
.
tenant
)
tenant
;
get
isDashboard
()
{
return
this
.
activeName
===
'
detail
'
;
...
...
app/web/component/layout/editor/single/index.vue
View file @
e595a044
...
...
@@ -4,9 +4,9 @@
<i-col
:span=
"3"
class=
"layout-menu-left"
>
<Menu
:active-name=
"activeName"
theme=
"dark"
width=
"auto"
:open-names=
"['1']"
accordion
@
on-select=
"select"
>
<div
class=
"layout-logo-left"
>
低代码平台
</div>
<Menu-item
name=
"list"
>
作品列表
</Menu-item>
<Menu-item
name=
"my"
>
我的草稿
</Menu-item>
<Menu-item
name=
"template"
>
创意模板
</Menu-item>
<Menu-item
v-if=
"tenant.workist"
name=
"list"
>
作品列表
</Menu-item>
<Menu-item
v-if=
"tenant.draftList"
name=
"my"
>
我的草稿
</Menu-item>
<Menu-item
v-if=
"tenant.tmplList"
name=
"template"
>
创意模板
</Menu-item>
</Menu>
</i-col>
<i-col
:span=
"21"
class=
"layout-menu-right"
>
...
...
app/web/page/editor/component/BasicPageFormModal/index.ts
View file @
e595a044
...
...
@@ -12,7 +12,7 @@ import { getStyle } from '@service/utils.service';
export
default
class
DynamicForm
extends
Vue
{
@
Getter
(
'
pageInfo
'
)
pageInfo
;
@
Getter
(
'
pageData
'
)
pageData
;
@
State
(
state
=>
state
.
tenant
.
hideShareBtn
)
hide
ShareBtn
;
@
State
(
state
=>
state
.
tenant
.
cartAndShareBtn
)
cartAnd
ShareBtn
;
@
Prop
(
Boolean
)
value
;
showPopup
:
boolean
=
false
;
...
...
app/web/page/editor/component/BasicPageFormModal/index.vue
View file @
e595a044
...
...
@@ -14,7 +14,7 @@
<Upload
v-model=
"formCustom.shareCoverImage"
:show-input=
"false"
/>
<p
class=
"basic-form__tip"
>
可选,默认使用页面缩略图,建议图片比例1:1,图片格式jpg、png
</p>
</FormItem>
<FormItem
label=
"分享打开方式"
prop=
"shareOpenMethod"
v-if=
"
!hide
ShareBtn"
>
<FormItem
label=
"分享打开方式"
prop=
"shareOpenMethod"
v-if=
"
cartAnd
ShareBtn"
>
<RadioGroup
v-model=
"formCustom.shareOpenMethod"
>
<Radio
:label=
"1"
:disabled=
"!enableShare"
>
小程序
</Radio>
<Radio
:label=
"2"
:disabled=
"!enableShare"
>
APP
</Radio>
...
...
app/web/page/editor/component/DynamicComponent/index.ts
View file @
e595a044
...
...
@@ -7,7 +7,7 @@ import { v4 as uuid } from 'uuid';
@
Component
({
name
:
'
DynamicComponent
'
})
export
default
class
DynamicComponent
extends
Vue
{
@
State
(
state
=>
state
.
editor
.
gridLayout
.
colNum
)
colNum
;
@
State
(
state
=>
state
.
tenant
.
hideFinanceTab
)
hideF
inanceTab
;
@
State
(
state
=>
state
.
tenant
.
financeTab
)
f
inanceTab
;
@
Prop
({
default
:
()
=>
([]),
type
:
Array
})
data
;
@
Prop
(
String
)
type
;
...
...
@@ -15,9 +15,9 @@ export default class DynamicComponent extends Vue {
eleConfigMap
:
object
=
{};
activeName
:
string
=
''
;
@
Watch
(
'
hideF
inanceTab
'
,
{
immediate
:
true
})
on
Hide
FinanceTabChange
(
val
)
{
if
(
val
&&
this
.
eleConfigMap
.
fs
)
{
@
Watch
(
'
f
inanceTab
'
,
{
immediate
:
true
})
onFinanceTabChange
(
val
)
{
if
(
!
val
&&
this
.
eleConfigMap
.
fs
)
{
this
.
$delete
(
this
.
eleConfigMap
,
'
fs
'
);
}
}
...
...
@@ -30,7 +30,7 @@ export default class DynamicComponent extends Vue {
pre
[
cur
.
name
]
=
{
...
cur
,
children
};
return
pre
;
},
{});
this
.
on
HideFinanceTabChange
(
this
.
hideF
inanceTab
);
this
.
on
FinanceTabChange
(
this
.
f
inanceTab
);
}
else
{
this
.
eleConfig
=
chunk
(
newVal
,
2
);
}
...
...
app/web/page/editor/component/DynamicPageForm/index.ts
View file @
e595a044
...
...
@@ -15,7 +15,7 @@ import { SHOP_CART_CONFIG } from '@service/staticData.service';
@
Component
({
components
:
{
Upload
,
ColorSelector
,
BaseSelect
,
Textarea
,
Number
,
FormList
,
BackTopPicker
,
SwitchBtn
},
name
:
'
DynamicPageForm
'
})
export
default
class
DynamicPageForm
extends
Mixins
(
ContextMenuMixin
)
{
@
Getter
(
'
pageData
'
)
pageData
;
@
State
(
state
=>
state
.
tenant
.
hideShareBtn
)
hide
ShareBtn
;
@
State
(
state
=>
state
.
tenant
.
cartAndShareBtn
)
cartAnd
ShareBtn
;
title
:
string
=
'
页面
'
;
commonStyleForm
:
object
=
{};
...
...
@@ -156,9 +156,9 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
return
[...
this
.
titleSchema
,
...
this
.
bottomSchema
,
...
this
.
floatSchema
];
}
@
Watch
(
'
hide
ShareBtn
'
,
{
immediate
:
true
})
@
Watch
(
'
cartAnd
ShareBtn
'
,
{
immediate
:
true
})
onAuthStateChange
(
val
)
{
const
options
=
val
?
[
'
自定义
'
]
:
[
'
购物车
'
,
'
分享
'
,
'
自定义
'
];
const
options
=
val
?
[
'
购物车
'
,
'
分享
'
,
'
自定义
'
]
:
[
'
自定义
'
];
this
.
$set
(
this
.
floatSchema
[
1
].
formControl
[
0
],
'
options
'
,
options
);
}
...
...
app/web/page/editor/view/dashboard/index.vue
View file @
e595a044
...
...
@@ -50,7 +50,7 @@
background: #fff;
box-shadow: 0 2px 3px 0 hsla(0,0%,39.2%,.06);
font-size: 16px;
z-index:
901
;
z-index:
10
;
.ivu-col {
text-align: center;
button {
...
...
app/web/page/store/modules/tenant/index.ts
View file @
e595a044
import
operationApi
from
'
@api/operation
.api
'
;
import
{
getMenuData
}
from
'
@api/user
.api
'
;
import
{
Module
,
GetterTree
,
ActionTree
,
MutationTree
}
from
'
vuex
'
;
import
{
FETCH_AUTH_INFO
...
...
@@ -18,8 +18,29 @@ export default class TenantModule implements Module<EditorAuthInfo, RootState> {
actions
:
ActionTree
<
EditorAuthInfo
,
RootState
>
=
{
async
fetchTenantAuthData
({
commit
})
{
const
res
:
Record
<
any
,
any
>
=
await
operationApi
.
getTenantAuthInfo
();
commit
(
FETCH_AUTH_INFO
,
JSON
.
parse
(
res
.
authConfig
as
string
));
const
res
:
Record
<
any
,
any
>
=
await
getMenuData
();
const
authMap
:
EditorAuthInfo
=
{};
res
.
forEach
(
item
=>
{
let
{
uri
,
code
}
=
item
.
node
;
uri
=
uri
?
uri
:
''
;
code
=
code
?
code
:
''
;
if
(
uri
.
indexOf
(
'
/template
'
)
>
-
1
)
{
authMap
.
tmplList
=
true
;
}
if
(
uri
===
'
/my
'
)
{
authMap
.
draftList
=
true
;
}
if
(
uri
===
'
/list
'
)
{
authMap
.
workist
=
true
;
}
if
(
code
===
'
cartAndShareBtn
'
)
{
authMap
.
cartAndShareBtn
=
true
;
}
if
(
code
===
'
financeTab
'
)
{
authMap
.
financeTab
=
true
;
}
});
commit
(
FETCH_AUTH_INFO
,
authMap
);
}
};
...
...
app/web/page/store/modules/tenant/state.ts
View file @
e595a044
export
default
interface
EditorAuthInfo
{
hideFinanceTab
?:
boolean
;
hideShareBtn
?:
boolean
;
financeTab
?:
boolean
;
cartAndShareBtn
?:
boolean
;
workist
?:
boolean
;
draftList
?:
boolean
;
tmplList
?:
boolean
;
}
\ No newline at end of file
app/web/service/http.service.ts
View file @
e595a044
...
...
@@ -96,7 +96,7 @@ instance.interceptors.request.use(
config
.
headers
[
'
X-Auth-Token
'
]
=
token
;
if
(
config
.
accessToken
)
{
config
.
headers
[
'
Access-Token
'
]
=
token
;
}
}
const
tenantId
=
localStorage
.
get
(
'
tenantId
'
)
||
''
;
const
tenantId
=
localStorage
.
get
(
'
tenantId
'
)
||
basicConfig
.
yxmTenantId
||
''
;
config
.
headers
[
'
qg-tenant-id
'
]
=
tenantId
||
''
;
return
config
;
},
...
...
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