Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source-trace-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
source-trace-manage
Commits
59a8f53c
Commit
59a8f53c
authored
Aug 04, 2022
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
71dbcc1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
7 deletions
+98
-7
index.vue
src/components/ImageDisplay/index.vue
+1
-1
CopyrightTable.vue
src/views/copyrightManagement/CopyrightTable.vue
+46
-2
index.vue
src/views/copyrightManagement/index.vue
+51
-4
No files found.
src/components/ImageDisplay/index.vue
View file @
59a8f53c
...
...
@@ -2,7 +2,7 @@
<Transition>
<div
v-if=
"visible"
class=
"fixed h-screen w-screen top-0 left-0 flex items-center justify-center flex-col"
class=
"fixed h-screen w-screen top-0 left-0 flex items-center justify-center flex-col
z-30
"
>
<div
class=
"opacity-70 bg-black absolute w-full h-full"
></div>
<div
...
...
src/views/copyrightManagement/CopyrightTable.vue
View file @
59a8f53c
...
...
@@ -74,6 +74,9 @@ import HoverShowReason from "./HoverShowReason.vue";
import
{
useTableScrollListener
}
from
"@/components/Table/hooks"
;
import
{
eOperate
}
from
"./types"
;
import
{
router
}
from
"@/router"
;
import
{
deleteCopyRights
}
from
"@/service/copyrightService"
;
import
{
iCopyRight
}
from
"@/types/copyright"
;
import
{
ElMessage
}
from
"element-plus"
;
defineProps
<
{
data
:
any
[];
...
...
@@ -91,10 +94,27 @@ const emit = defineEmits<{
}
):
void
;
(
e
:
"clickStatusFilter"
,
payload
:
eStatusOfCopyright
):
void
;
(
e
:
"viewCertificates"
,
payload
:
{
url
:
string
;
}
):
void
;
(
e
:
"downloadCert"
,
payload
:
{
url
:
string
;
}
):
void
;
(
e
:
"refresh"
):
void
;
}
>
();
const
tableRef
=
ref
<
InstanceType
<
typeof
Table
>>
();
defineExpose
({
tableRef
,
});
useTableScrollListener
(
tableRef
,
()
=>
{
emit
(
"scrollToEnd"
);
});
...
...
@@ -108,8 +128,7 @@ const getOperateList = (slotProps: any) => {
}));
};
const
handleClickItem
=
(
value
:
eOperate
,
slotProps
:
any
)
=>
{
console
.
log
(
value
,
slotProps
);
const
handleClickItem
=
async
(
value
:
eOperate
,
slotProps
:
iCopyRight
)
=>
{
switch
(
value
)
{
case
eOperate
.
seeDetails
:
router
.
push
({
...
...
@@ -119,6 +138,31 @@ const handleClickItem = (value: eOperate, slotProps: any) => {
},
});
break
;
case
eOperate
.
viewCertificates
:
emit
(
"viewCertificates"
,
{
url
:
slotProps
.
certificate
,
});
break
;
case
eOperate
.
downloadCertificates
:
emit
(
"downloadCert"
,
{
url
:
slotProps
.
certificate
,
});
break
;
case
eOperate
.
edit
:
router
.
push
({
name
:
"addCopyRight"
,
query
:
{
id
:
slotProps
.
id
,
},
});
break
;
case
eOperate
.
delete
:
const
res
=
await
deleteCopyRights
([
slotProps
.
id
]);
if
(
res
&&
res
.
code
===
200
)
{
ElMessage
.
success
(
"删除成功"
);
emit
(
"refresh"
);
}
break
;
}
};
...
...
src/views/copyrightManagement/index.vue
View file @
59a8f53c
...
...
@@ -63,6 +63,7 @@
</div>
<div
class=
"flex-grow overflow-hidden mt-4"
>
<CopyrightTable
ref=
"CopyrightTableRef"
v-show=
"activedMenu === eTableTab.going"
:data=
"tableData"
:loading=
"loading"
...
...
@@ -70,11 +71,31 @@
height=
"100%"
@
scrollToEnd=
"fetchNextPage"
@
clickStatusFilter=
"handleClickStatusFilter"
@
view-certificates=
"
(
{ url }) => {
imgUrl = url;
imageDisplayVisible = true;
}
"
@download-cert="
({ url }) => {
saveAs(url);
}
"
@refresh="handleRefetch"
>
</CopyrightTable>
</div>
</div>
<CopyRightNotify
v-model:visible=
"copyRightNotifyVisible"
></CopyRightNotify>
<ImageDisplay
:url=
"imgUrl"
v-model:visible=
"imageDisplayVisible"
>
<div
class=
"flex mt-7"
>
<div
class=
"imgBtn mr-2.5"
@
click=
"saveAs(imgUrl)"
>
保存证书
</div>
<div
class=
"imgBtn"
@
click=
"printJS('imageDisplay', 'html')"
>
打印证书
</div>
</div></ImageDisplay
>
</LayoutVue>
</
template
>
<
script
lang=
"ts"
setup
>
...
...
@@ -93,13 +114,19 @@ import { debounce } from "lodash";
import
CopyRightNotify
from
"@/components/Dialogs/CopyRightNotify/index.vue"
;
import
{
getCopyRights
}
from
"@/service/copyrightService"
;
import
{
iCopyRight
}
from
"@/types/copyright"
;
import
ImageDisplay
from
"@/components/ImageDisplay/index.vue"
;
import
{
saveAs
}
from
"file-saver"
;
import
printJS
from
"print-js"
;
const
copyRightNotifyVisible
=
ref
(
false
);
const
searchValue
=
ref
(
""
);
const
imgUrl
=
ref
(
""
);
const
imageDisplayVisible
=
ref
(
false
);
const
activedMenu
=
ref
(
eTableTab
.
going
);
const
currentStatusForGoing
=
ref
(
eStatusOfCopyright
.
ALL
);
// 进行中的表格的状态
const
CopyrightTableRef
=
ref
<
InstanceType
<
typeof
CopyrightTable
>>
();
const
fetchTableData
=
async
({
page
,
page_size
,
...
...
@@ -158,16 +185,36 @@ const {
});
const
refetchDebounce
=
debounce
(()
=>
{
r
efetch
();
handleR
efetch
();
},
500
);
function
handleRefetch
()
{
CopyrightTableRef
.
value
?.
tableRef
?.
scrollTo
(
0
,
0
);
refetch
();
}
const
handleClickStatusFilter
=
(
status
:
eStatusOfCopyright
)
=>
{
currentStatusForGoing
.
value
=
status
;
r
efetch
();
handleR
efetch
();
};
watch
(
searchValue
,
()
=>
{
refetchDebounce
();
});
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
>
.imgBtn
{
width
:
100px
;
height
:
40px
;
border-radius
:
4px
;
border
:
1px
solid
#ffffff
;
font-size
:
14px
;
font-weight
:
500
;
color
:
#ffffff
;
line-height
:
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
cursor
:
pointer
;
}
</
style
>
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