Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
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
杨昕
media-resource
Commits
11a78305
Commit
11a78305
authored
Mar 22, 2023
by
周业恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
media_list
parent
91bdc728
Pipeline
#20522
passed with stages
in 1 minute 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
media_list.blade.php
resources/views/admin/media/media_list.blade.php
+19
-3
No files found.
resources/views/admin/media/media_list.blade.php
View file @
11a78305
...
...
@@ -168,11 +168,27 @@
<script
type=
"text/javascript"
>
var
media_export_name
=
"
<?php
$export_values
=
''
;
foreach
(
$medias
as
$key
=>
$media
)
{
$export_values
=
$export_values
.
'
\r\n'
.
$media
[
'_id'
]
.
" "
.
$media
[
'media_name'
]
;
}
echo
$export_values
;
?>
"
var
media_export_name
=
"
<?php
$export_values
=
''
;
foreach
(
$medias
as
$key
=>
$media
)
{
$export_values
=
$export_values
.
'
<tr><td>${'
.
$media
[
'_id'
]
.
`'\t'}</td>'`
.
'<td>${'
.
$media
[
'media_name'
]
.
`'\t'}</td>'`
.
'</tr>'
;
}
echo
$export_values
;
?>
"
function
export_media_id
(){
alert
(
media_export_name
)
}
//alert(media_export_name)
const
worksheet
=
'Sheet1'
const
uri
=
'data:application/vnd.ms-excel;base64,'
;
// 下载的表格模板数据
const
template
=
`<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>
<x:Name>
${
worksheet
}
</x:Name>
<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>
</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->
</head><body><table>
${
media_export_name
}
</table></body></html>`
;
// 下载模板
window
.
location
.
href
=
uri
+
base64
(
template
);
}
const
base64
=
s
=>
window
.
btoa
(
unescape
(
encodeURIComponent
(
s
)));
function
x_admin_show
(
url
){
window
.
location
.
href
=
url
;
...
...
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