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
3ac1c8d7
Commit
3ac1c8d7
authored
Aug 04, 2022
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草稿箱
parent
ec79069d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
30 deletions
+60
-30
copyrightService.ts
src/service/copyrightService.ts
+1
-1
index.vue
src/views/AddCopyRight/index.vue
+1
-1
draftBoxTable.vue
src/views/draftBox/draftBoxTable.vue
+29
-8
index.vue
src/views/draftBox/index.vue
+24
-17
table.ts
src/views/draftBox/table.ts
+5
-3
No files found.
src/service/copyrightService.ts
View file @
3ac1c8d7
...
@@ -128,7 +128,7 @@ export function getCopyRights(payload: {
...
@@ -128,7 +128,7 @@ export function getCopyRights(payload: {
export
function
deleteCopyRights
(
ids
:
number
[])
{
export
function
deleteCopyRights
(
ids
:
number
[])
{
return
$ajax
({
return
$ajax
({
type
:
"delete"
,
type
:
"delete"
,
url
:
"/api/copyright"
,
url
:
"/api/copyright
s
"
,
params
:
{
params
:
{
ids
,
ids
,
},
},
...
...
src/views/AddCopyRight/index.vue
View file @
3ac1c8d7
...
@@ -422,7 +422,7 @@ const handleClickSave = async () => {
...
@@ -422,7 +422,7 @@ const handleClickSave = async () => {
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
ElMessage
.
success
(
"保存成功"
);
ElMessage
.
success
(
"保存成功"
);
router
.
push
({
router
.
push
({
name
:
"
copyrightManagement
"
,
name
:
"
draftBox
"
,
});
});
}
}
}
}
...
...
src/views/draftBox/draftBoxTable.vue
View file @
3ac1c8d7
...
@@ -7,12 +7,18 @@
...
@@ -7,12 +7,18 @@
height=
"100%"
height=
"100%"
element-loading-text=
"加载中..."
element-loading-text=
"加载中..."
>
>
<template
#
record_work_type=
"slotProps"
>
{{
(
workTypeMapping
as
any
)[
slotProps
.
record_work_type
]
}}
</
template
>
<
template
#
create_time=
"slotProps"
>
{{
formatTime
(
slotProps
.
create_time
)
}}
</
template
>
<
template
#
operate=
"slotProps"
>
<
template
#
operate=
"slotProps"
>
<syMoreOperate
<syMoreOperate
:teleport=
"true"
:teleport=
"true"
:list=
"operateList"
:list=
"operateList"
@
click-item=
"(value) => handleClickItem(value, slotProps)"
@
click-item=
"(value) => handleClickItem(value, slotProps)"
:margin-left=
"
30
0"
:margin-left=
"
-5
0"
>
>
<Icon
<Icon
icon-name=
"iconbianzu7"
icon-name=
"iconbianzu7"
...
@@ -29,10 +35,14 @@ import Table from "@/components/Table/index.vue";
...
@@ -29,10 +35,14 @@ import Table from "@/components/Table/index.vue";
import
{
tableColumns
}
from
"./table"
;
import
{
tableColumns
}
from
"./table"
;
import
Icon
from
"@/components/Icon/index.vue"
;
import
Icon
from
"@/components/Icon/index.vue"
;
import
{
ref
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
import
{
syMoreOperate
}
from
"cqk-sy-ui"
;
import
{
syMoreOperate
,
formatTime
}
from
"cqk-sy-ui"
;
import
{
useTableScrollListener
}
from
"@/components/Table/hooks"
;
import
{
useTableScrollListener
}
from
"@/components/Table/hooks"
;
import
{
workTypeMapping
}
from
"../copyrightManagement/statusMapping"
;
import
{
router
}
from
"@/router"
;
import
{
deleteCopyRights
}
from
"@/service/copyrightService"
;
import
{
ElMessage
}
from
"element-plus"
;
const
emit
=
defineEmits
([
"scrollToEnd"
]);
const
emit
=
defineEmits
([
"scrollToEnd"
,
"refresh"
]);
const
tableRef
=
ref
<
InstanceType
<
typeof
Table
>>
();
const
tableRef
=
ref
<
InstanceType
<
typeof
Table
>>
();
...
@@ -50,20 +60,31 @@ const operateList = [
...
@@ -50,20 +60,31 @@ const operateList = [
name
:
"编辑"
,
name
:
"编辑"
,
value
:
"编辑"
,
value
:
"编辑"
,
click
:
(
slotProps
:
any
)
=>
{
click
:
(
slotProps
:
any
)
=>
{
//
router
.
push
({
console
.
log
(
slotProps
.
status
,
"show slotProps Status"
);
name
:
"addCopyRight"
,
query
:
{
id
:
slotProps
.
id
,
},
});
},
},
},
},
{
{
name
:
"删除"
,
name
:
"删除"
,
value
:
"删除"
,
value
:
"删除"
,
click
:
(
slotProps
:
any
)
=>
{
click
:
async
(
slotProps
:
any
)
=>
{
//
const
res
=
await
deleteCopyRights
([
slotProps
.
id
]);
console
.
log
(
slotProps
.
status
,
"show slotProps status"
);
if
(
res
&&
res
.
code
===
200
)
{
ElMessage
.
success
(
"删除成功"
);
emit
(
"refresh"
);
}
},
},
},
},
];
];
defineExpose
({
tableRef
,
});
const
handleClickItem
=
(
value
:
any
,
slotProps
:
any
)
=>
{
const
handleClickItem
=
(
value
:
any
,
slotProps
:
any
)
=>
{
operateList
.
find
((
i
)
=>
i
.
value
===
value
)?.
click
(
slotProps
);
operateList
.
find
((
i
)
=>
i
.
value
===
value
)?.
click
(
slotProps
);
};
};
...
...
src/views/draftBox/index.vue
View file @
3ac1c8d7
...
@@ -45,9 +45,11 @@
...
@@ -45,9 +45,11 @@
</div>
</div>
<div
class=
"flex-grow overflow-hidden"
>
<div
class=
"flex-grow overflow-hidden"
>
<DraftBoxTable
<DraftBoxTable
ref=
"DraftBoxTableRef"
:loading=
"loading"
:loading=
"loading"
:data=
"tableData"
:data=
"tableData"
@
scrollToEnd=
"fetchNextPage"
@
scrollToEnd=
"fetchNextPage"
@
refresh=
"handleRefresh"
></DraftBoxTable>
></DraftBoxTable>
</div>
</div>
</div>
</div>
...
@@ -61,43 +63,48 @@ import Avatar from "@/components/Avatar/index.vue";
...
@@ -61,43 +63,48 @@ import Avatar from "@/components/Avatar/index.vue";
import
Title
from
"@/components/Title.vue"
;
import
Title
from
"@/components/Title.vue"
;
import
Search
from
"@/components/Search/index.vue"
;
import
Search
from
"@/components/Search/index.vue"
;
import
Icon
from
"@/components/Icon/index.vue"
;
import
Icon
from
"@/components/Icon/index.vue"
;
import
{
syButton
}
from
"cqk-sy-ui"
;
import
{
ref
,
watch
}
from
"vue"
;
import
{
ref
,
watch
}
from
"vue"
;
import
DraftBoxTable
from
"./draftBoxTable.vue"
;
import
DraftBoxTable
from
"./draftBoxTable.vue"
;
import
{
useTableData
}
from
"@/components/Table/hooks"
;
import
{
useTableData
}
from
"@/components/Table/hooks"
;
import
{
debounce
}
from
"lodash"
;
import
{
debounce
}
from
"lodash"
;
import
CopyRightNotify
from
"@/components/Dialogs/CopyRightNotify/index.vue"
;
import
CopyRightNotify
from
"@/components/Dialogs/CopyRightNotify/index.vue"
;
import
{
getCopyRights
}
from
"@/service/copyrightService"
;
import
{
eStatusOfCopyright
}
from
"@/components/ApproveStatus/status"
;
const
DraftBoxTableRef
=
ref
<
InstanceType
<
typeof
DraftBoxTable
>>
();
const
copyRightNotifyVisible
=
ref
(
false
);
const
copyRightNotifyVisible
=
ref
(
false
);
const
searchValue
=
ref
(
""
);
const
searchValue
=
ref
(
""
);
const
fetchTableData
=
({
const
fetchTableData
=
async
({
page
,
page
,
page_size
,
page_size
,
}:
{
}:
{
page
:
number
;
page
:
number
;
page_size
:
number
;
page_size
:
number
;
}):
Promise
<
any
>
=>
{
})
=>
{
return
new
Promise
<
any
>
((
r
)
=>
{
const
res
=
await
getCopyRights
({
setTimeout
(()
=>
{
record_no
:
""
,
r
({
record_work_name
:
searchValue
.
value
,
total
:
100
,
record_work_status
:
[
eStatusOfCopyright
.
WAITING_SUBMIT
],
data
:
"1"
page
,
.
repeat
(
page_size
)
page_size
,
.
split
(
""
)
.
map
((
i
,
index
)
=>
({
name
:
index
+
(
page
-
1
)
*
page_size
,
id
:
searchValue
.
value
,
})),
});
},
1000
);
});
});
return
{
total
:
res
?.
data
.
total
||
0
,
data
:
res
?.
data
.
results
||
[],
};
};
};
const
{
fetchNextPage
,
tableData
,
loading
,
refetch
}
=
useTableData
({
const
{
fetchNextPage
,
tableData
,
loading
,
refetch
}
=
useTableData
({
fetchData
:
fetchTableData
,
fetchData
:
fetchTableData
,
});
});
const
refetchDebounce
=
debounce
(
refetch
,
500
);
function
handleRefresh
()
{
DraftBoxTableRef
.
value
?.
tableRef
?.
scrollTo
(
0
,
0
);
refetch
();
}
const
refetchDebounce
=
debounce
(
handleRefresh
,
500
);
watch
(
searchValue
,
()
=>
{
watch
(
searchValue
,
()
=>
{
refetchDebounce
();
refetchDebounce
();
});
});
...
...
src/views/draftBox/table.ts
View file @
3ac1c8d7
...
@@ -3,16 +3,18 @@ import { iTableColumn } from "@/components/Table/types";
...
@@ -3,16 +3,18 @@ import { iTableColumn } from "@/components/Table/types";
export
const
tableColumns
=
[
export
const
tableColumns
=
[
{
{
label
:
"版权名称"
,
label
:
"版权名称"
,
prop
:
"name"
,
prop
:
"
record_work_
name"
,
minWidth
:
200
,
minWidth
:
200
,
},
},
{
{
label
:
"作品类型"
,
label
:
"作品类型"
,
prop
:
"id"
,
prop
:
"record_work_type"
,
slotName
:
"record_work_type"
,
},
},
{
{
label
:
"提交日期"
,
label
:
"提交日期"
,
prop
:
"date"
,
prop
:
"create_time"
,
slotName
:
"create_time"
,
},
},
{
{
label
:
"操作"
,
label
:
"操作"
,
...
...
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