Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
H
huamu
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
郭铭瑶
huamu
Commits
e3589326
Commit
e3589326
authored
Sep 16, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入权限代码(目前接口还没数据)& 完善
parent
de7e2f04
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
99 additions
and
27 deletions
+99
-27
App.vue
src/App.vue
+4
-1
useAliOss.ts
src/hooks/useAliOss.ts
+2
-2
useFetch.ts
src/hooks/useFetch.ts
+24
-1
actions.ts
src/store/actions.ts
+28
-2
state.ts
src/store/state.ts
+3
-5
activity-drawer.vue
src/view/components/activity-drawer.vue
+1
-0
activity-list-modal.vue
src/view/components/activity-list-modal.vue
+6
-1
building-drawer.vue
src/view/components/building-drawer.vue
+1
-1
nav-bar.vue
src/view/components/nav-bar.vue
+3
-1
new-activity-drawer.vue
src/view/components/new-activity-drawer.vue
+10
-10
struct-modal.vue
src/view/components/struct-modal.vue
+15
-3
main.vue
src/view/main.vue
+2
-0
No files found.
src/App.vue
View file @
e3589326
...
@@ -114,7 +114,10 @@ const themeOverrides: GlobalThemeOverrides = {
...
@@ -114,7 +114,10 @@ const themeOverrides: GlobalThemeOverrides = {
itemColorActive
:
'#fcf4f5'
,
itemColorActive
:
'#fcf4f5'
,
},
},
DataTable
:
{
DataTable
:
{
fontSizeSmall
:
'.01rem'
,
fontSizeSmall
:
'.08rem'
,
},
Pagination
:
{
itemTextColorHover
:
'#dd505E'
,
},
},
}
}
</
script
>
</
script
>
...
...
src/hooks/useAliOss.ts
View file @
e3589326
import
OSS
from
'ali-oss'
import
OSS
from
'ali-oss'
import
{
useFetch
Auth
}
from
'@/hooks/useFetch'
import
{
useFetch
OSSToken
}
from
'@/hooks/useFetch'
import
md5
from
'md5'
import
md5
from
'md5'
import
{
api
}
from
'@/ajax'
import
{
api
}
from
'@/ajax'
export
default
async
function
useAliOss
(
file
:
any
)
{
export
default
async
function
useAliOss
(
file
:
any
)
{
const
auth
=
(
await
useFetch
Auth
())?.
token
const
auth
=
(
await
useFetch
OSSToken
())?.
token
const
client
=
new
OSS
({
const
client
=
new
OSS
({
region
:
'oss-'
+
auth
.
region
,
region
:
'oss-'
+
auth
.
region
,
accessKeyId
:
auth
.
access_key_id
,
accessKeyId
:
auth
.
access_key_id
,
...
...
src/hooks/useFetch.ts
View file @
e3589326
...
@@ -105,9 +105,32 @@ export async function useFetchTag(params: QueryProps) {
...
@@ -105,9 +105,32 @@ export async function useFetchTag(params: QueryProps) {
})
})
return
res
&&
res
.
data
&&
res
.
data
.
result
return
res
&&
res
.
data
&&
res
.
data
.
result
}
}
export
async
function
useFetch
Auth
()
{
export
async
function
useFetch
OSSToken
()
{
const
res
=
await
ajax
.
get
({
const
res
=
await
ajax
.
get
({
url
:
api
.
GET_AUTH
,
url
:
api
.
GET_AUTH
,
})
})
return
res
&&
res
.
data
&&
res
.
data
.
result
return
res
&&
res
.
data
&&
res
.
data
.
result
}
}
export
async
function
useFetchAuth
()
{
const
res
=
await
ajax
.
get
({
url
:
api
.
GET_USER_ID
,
})
return
res
&&
res
.
data
&&
res
.
data
.
result
}
export
async
function
useFetchUser
(
params
:
QueryProps
)
{
const
res
=
await
ajax
.
get
({
url
:
api
.
USER
,
params
,
})
return
res
&&
res
.
data
&&
res
.
data
.
result
}
export
async
function
useFetchOrgAuth
(
params
:
QueryProps
)
{
const
res
=
await
ajax
.
get
({
url
:
api
.
ORG
,
params
,
})
return
res
&&
res
.
data
&&
res
.
data
.
result
}
src/store/actions.ts
View file @
e3589326
import
{
Commit
,
Dispatch
}
from
'./index'
import
{
Commit
,
Dispatch
}
from
'./index'
import
{
useFetchOrg
,
useFetchMember
,
useFetchAuth
}
from
'@/hooks/useFetch'
import
{
useFetchOrg
,
useFetchMember
,
useFetchAuth
,
useFetchUser
,
useFetchOrgAuth
,
}
from
'@/hooks/useFetch'
import
dayjs
from
'@/util/dayjs'
import
dayjs
from
'@/util/dayjs'
import
state
from
'./state'
import
state
from
'./state'
...
@@ -10,7 +16,27 @@ interface Method {
...
@@ -10,7 +16,27 @@ interface Method {
export
default
{
export
default
{
async
getAuth
({
commit
}:
Method
)
{
async
getAuth
({
commit
}:
Method
)
{
commit
(
'SET_AUTH'
,
(
await
useFetchAuth
())?.
token
)
const
userid
:
number
|
null
=
(
await
useFetchAuth
())?.
customer
?.
id
||
null
if
(
!
userid
)
return
const
orgIds
:
string
[]
=
(
await
useFetchUser
({
keys
:
'组织id'
,
q
:
`paths @ "userid" && string == "
${
userid
}
"`
,
})
)?.[
'组织id'
]
||
[]
const
authList
:
string
[]
=
await
Promise
.
all
(
orgIds
.
map
(
async
(
id
)
=>
(
await
useFetchOrgAuth
({
keys
:
'权限编码'
,
q
:
`paths @ "组织id" && string == "
${
id
}
"`
,
})
)?.[
'权限编码'
]
||
''
,
),
)
commit
(
'SET_AUTH'
,
{
userid
,
orgIds
,
authList
})
},
},
async
getBasicInfo
({
commit
}:
Method
,
query
?:
string
)
{
async
getBasicInfo
({
commit
}:
Method
,
query
?:
string
)
{
commit
(
'SET_BASIC_INFO'
,
{
commit
(
'SET_BASIC_INFO'
,
{
...
...
src/store/state.ts
View file @
e3589326
export
default
{
export
default
{
showLoading
:
false
,
showLoading
:
false
,
auth
:
{
auth
:
{
region
:
''
,
userid
:
null
,
access_key_id
:
''
,
orgIds
:
[],
access_key_secret
:
''
,
authList
:
[],
bucket
:
''
,
security_token
:
''
,
},
},
showTag
:
true
,
showTag
:
true
,
showBasicInfo
:
true
,
showBasicInfo
:
true
,
...
...
src/view/components/activity-drawer.vue
View file @
e3589326
...
@@ -98,6 +98,7 @@ const closeDrawer = () => {
...
@@ -98,6 +98,7 @@ const closeDrawer = () => {
store
.
commit
(
'SET_ACTIVITY_DRAWER'
,
false
)
store
.
commit
(
'SET_ACTIVITY_DRAWER'
,
false
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
store
.
commit
(
'SET_SHOW_TAG'
,
true
)
store
.
commit
(
'SET_SHOW_TAG'
,
true
)
dateRange
.
value
=
[]
}
}
const
dateRange
=
ref
<
number
[]
>
([])
const
dateRange
=
ref
<
number
[]
>
([])
...
...
src/view/components/activity-list-modal.vue
View file @
e3589326
...
@@ -129,7 +129,8 @@ const fetchList = useDebounce(async (query?: string) => {
...
@@ -129,7 +129,8 @@ const fetchList = useDebounce(async (query?: string) => {
...
item
.
extra
,
...
item
.
extra
,
}))
||
[]
}))
||
[]
})
})
const
reFetchList
=
()
=>
{
function
clearData
()
{
model
.
value
=
{
model
.
value
=
{
dateStart
:
null
,
dateStart
:
null
,
dateEnd
:
null
,
dateEnd
:
null
,
...
@@ -137,6 +138,9 @@ const reFetchList = () => {
...
@@ -137,6 +138,9 @@ const reFetchList = () => {
rateEnd
:
null
,
rateEnd
:
null
,
type
:
null
,
type
:
null
,
}
}
}
const
reFetchList
=
()
=>
{
clearData
()
fetchList
()
fetchList
()
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
...
@@ -146,6 +150,7 @@ const show = computed(() => store.state.showActivityListModal)
...
@@ -146,6 +150,7 @@ const show = computed(() => store.state.showActivityListModal)
const
close
=
(
val
:
boolean
)
=>
{
const
close
=
(
val
:
boolean
)
=>
{
store
.
commit
(
'SET_ACTIVITY_LIST_MODAL'
,
val
)
store
.
commit
(
'SET_ACTIVITY_LIST_MODAL'
,
val
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
clearData
()
}
}
const
model
=
ref
<
any
>
({})
const
model
=
ref
<
any
>
({})
const
typeOptions
=
computed
(()
=>
{
const
typeOptions
=
computed
(()
=>
{
...
...
src/view/components/building-drawer.vue
View file @
e3589326
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<span>
党员数:{{ item.member }}
</span>
<span>
党员数:{{ item.member }}
</span>
</div>
</div>
</div>
</div>
<n-carousel
show-arrow
>
<n-carousel
:show-arrow=
"item.length > 4"
>
<div
<div
v-for=
"(_, segmentIndex) in new Array(
v-for=
"(_, segmentIndex) in new Array(
Math.ceil(item.rooms.length / 4),
Math.ceil(item.rooms.length / 4),
...
...
src/view/components/nav-bar.vue
View file @
e3589326
...
@@ -306,10 +306,11 @@ const toPage = (id?: string) => {
...
@@ -306,10 +306,11 @@ const toPage = (id?: string) => {
width 12rem
width 12rem
height 2.5rem
height 2.5rem
.menu
.menu
height 100%
border-radius .06rem
border-radius .06rem
background $white-bg
display flex
display flex
color $font
color $font
background $white-bg
.parent
.parent
margin .15rem 0
margin .15rem 0
width 1rem
width 1rem
...
@@ -320,6 +321,7 @@ const toPage = (id?: string) => {
...
@@ -320,6 +321,7 @@ const toPage = (id?: string) => {
box-sizing border-box
box-sizing border-box
padding .08rem .12rem
padding .08rem .12rem
cursor pointer
cursor pointer
margin-bottom .05rem
&:hover
&:hover
&.on
&.on
background $light-red
background $light-red
...
...
src/view/components/new-activity-drawer.vue
View file @
e3589326
...
@@ -171,7 +171,7 @@
...
@@ -171,7 +171,7 @@
:default-file-list=
"memberData.attachment || []"
:default-file-list=
"memberData.attachment || []"
style=
"width: 100%"
style=
"width: 100%"
accept=
".docx,.doc,.xlsx,.xls,.csv,.txt"
accept=
".docx,.doc,.xlsx,.xls,.csv,.txt"
:on-change=
"(e) => onChange(e, 'memberData.attachment')"
:on-change=
"(e) => on
File
Change(e, 'memberData.attachment')"
:show-remove-button=
"mode !== 'view'"
:show-remove-button=
"mode !== 'view'"
>
>
<n-button
v-if=
"mode !== 'view'"
>
上传附件
</n-button>
<n-button
v-if=
"mode !== 'view'"
>
上传附件
</n-button>
...
@@ -190,7 +190,9 @@
...
@@ -190,7 +190,9 @@
accept=
"image/jpg,image/jpeg,image/png,image/img"
accept=
"image/jpg,image/jpeg,image/png,image/img"
list-type=
"image-card"
list-type=
"image-card"
:show-remove-button=
"mode !== 'view'"
:show-remove-button=
"mode !== 'view'"
:on-change=
"(e) => onChange(e, 'memberData.attachmentPhoto')"
:on-change=
"
(e) => onFileChange(e, 'memberData.attachmentPhoto')
"
@
preview=
"handlePreview"
@
preview=
"handlePreview"
>
>
点击上传
点击上传
...
@@ -251,7 +253,9 @@
...
@@ -251,7 +253,9 @@
accept=
"image/jpg,image/jpeg,image/png,image/img"
accept=
"image/jpg,image/jpeg,image/png,image/img"
list-type=
"image-card"
list-type=
"image-card"
:show-remove-button=
"mode !== 'view'"
:show-remove-button=
"mode !== 'view'"
:on-change=
"(e) => onChange(e, 'detailData.attachmentPhoto')"
:on-change=
"
(e) => onFileChange(e, 'detailData.attachmentPhoto')
"
@
preview=
"handlePreview"
@
preview=
"handlePreview"
>
>
点击上传
点击上传
...
@@ -272,7 +276,7 @@
...
@@ -272,7 +276,7 @@
accept=
"image/jpg,image/jpeg,image/png,image/img"
accept=
"image/jpg,image/jpeg,image/png,image/img"
list-type=
"image-card"
list-type=
"image-card"
:show-remove-button=
"mode !== 'view'"
:show-remove-button=
"mode !== 'view'"
:on-change=
"(e) => onChange(e, 'detailData.photoList')"
:on-change=
"(e) => on
File
Change(e, 'detailData.photoList')"
@
preview=
"handlePreview"
@
preview=
"handlePreview"
>
>
点击上传
点击上传
...
@@ -638,11 +642,6 @@ const submit = () => {
...
@@ -638,11 +642,6 @@ const submit = () => {
})
})
}
}
// const previewFileList = ref([
// {
// url: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg',
// },
// ])
const
previewImageUrl
=
ref
(
''
)
const
previewImageUrl
=
ref
(
''
)
const
showPhoto
=
ref
(
false
)
const
showPhoto
=
ref
(
false
)
function
handlePreview
({
url
}:
any
)
{
function
handlePreview
({
url
}:
any
)
{
...
@@ -655,10 +654,11 @@ function getPercent(val: number) {
...
@@ -655,10 +654,11 @@ function getPercent(val: number) {
return
val
return
val
}
}
async
function
onChange
(
options
:
any
,
type
:
string
)
{
async
function
on
File
Change
(
options
:
any
,
type
:
string
)
{
console
.
log
(
'change'
,
options
,
type
)
console
.
log
(
'change'
,
options
,
type
)
if
(
!
options
)
return
if
(
!
options
)
return
if
(
!
options
.
event
)
{
if
(
!
options
.
event
)
{
// 删除
const
{
url
}
=
options
.
file
const
{
url
}
=
options
.
file
switch
(
type
)
{
switch
(
type
)
{
case
'memberData.attachment'
:
case
'memberData.attachment'
:
...
...
src/view/components/struct-modal.vue
View file @
e3589326
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
<n-layout-header
class=
"head"
>
<n-layout-header
class=
"head"
>
<n-space>
<n-space>
<p>
{{
curMenu
.
label
}}
</p>
<p>
{{
curMenu
.
label
}}
</p>
<template
v-if=
"curMenu['标签']"
>
<template
v-if=
"curMenu
?.
['标签']"
>
<n-tag
<n-tag
v-for=
"tag in curMenu['标签'].split(',')"
v-for=
"tag in curMenu['标签'].split(',')"
:key=
"tag"
:key=
"tag"
...
@@ -334,6 +334,15 @@ const close = () => {
...
@@ -334,6 +334,15 @@ const close = () => {
store
.
commit
(
'SET_STRUCT_MODAL'
,
false
)
store
.
commit
(
'SET_STRUCT_MODAL'
,
false
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
store
.
commit
(
'SET_SHOW_BASIC_INFO'
,
true
)
store
.
commit
(
'SET_SHOW_TAG'
,
true
)
store
.
commit
(
'SET_SHOW_TAG'
,
true
)
clear
()
}
function
clear
()
{
subKey
.
value
=
null
curSubMenu
.
value
=
{}
expandedKeys
.
value
=
[]
subExpandedKeys
.
value
=
[]
curMenu
.
value
=
{
label
:
'中共浦东新区花木街道工作委员会'
,
key
:
'default'
}
curKey
.
value
=
'default'
}
}
function
renderIcon
()
{
function
renderIcon
()
{
...
@@ -510,7 +519,7 @@ const handleExpand = (val: string[]) => {
...
@@ -510,7 +519,7 @@ const handleExpand = (val: string[]) => {
}
}
}
}
const
curKey
=
ref
(
'default'
)
const
curKey
=
ref
<
string
|
null
>
(
'default'
)
const
subKey
=
ref
<
string
|
null
>
(
null
)
const
subKey
=
ref
<
string
|
null
>
(
null
)
const
curMenu
=
ref
<
any
>
({
const
curMenu
=
ref
<
any
>
({
label
:
'中共浦东新区花木街道工作委员会'
,
label
:
'中共浦东新区花木街道工作委员会'
,
...
@@ -526,6 +535,7 @@ const setCurKey = (val: string, item: any) => {
...
@@ -526,6 +535,7 @@ const setCurKey = (val: string, item: any) => {
watch
(
watch
(
()
=>
curMenu
.
value
,
()
=>
curMenu
.
value
,
async
(
data
)
=>
{
async
(
data
)
=>
{
if
(
!
data
)
return
if
(
data
&&
data
.
_hasSub
)
{
if
(
data
&&
data
.
_hasSub
)
{
if
(
data
.
subList
&&
data
.
subList
.
length
>
0
)
{
if
(
data
.
subList
&&
data
.
subList
.
length
>
0
)
{
await
Promise
.
all
(
await
Promise
.
all
(
...
@@ -562,7 +572,9 @@ watch(
...
@@ -562,7 +572,9 @@ watch(
},
},
)
)
const
showSubordinates
=
computed
(()
=>
curMenu
.
value
.
_hasSub
||
!!
subKey
.
value
)
const
showSubordinates
=
computed
(
()
=>
curMenu
.
value
?.
_hasSub
||
!!
subKey
.
value
,
)
const
subExpandedKeys
=
ref
<
string
[]
>
([])
const
subExpandedKeys
=
ref
<
string
[]
>
([])
function
setSub
(
data
:
any
)
{
function
setSub
(
data
:
any
)
{
if
(
!
data
)
{
if
(
!
data
)
{
...
...
src/view/main.vue
View file @
e3589326
...
@@ -30,6 +30,8 @@ import ActivityDetail from './components/activity-detail.vue'
...
@@ -30,6 +30,8 @@ import ActivityDetail from './components/activity-detail.vue'
import
reset
from
'@images/reset.svg'
import
reset
from
'@images/reset.svg'
import
store
from
'@/store'
import
store
from
'@/store'
store
.
dispatch
(
'getAuth'
)
const
showReset
=
computed
(()
=>
store
.
state
.
showBasicInfo
)
const
showReset
=
computed
(()
=>
store
.
state
.
showBasicInfo
)
const
map
=
ref
<
any
>
()
const
map
=
ref
<
any
>
()
const
resetMap
=
()
=>
map
.
value
&&
map
.
value
.
resetMap
()
const
resetMap
=
()
=>
map
.
value
&&
map
.
value
.
resetMap
()
...
...
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