Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect-api
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyi.chen
data-collect-api
Commits
49dff0f9
Commit
49dff0f9
authored
Apr 02, 2024
by
wenyi.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线上更新
parent
97ec0eba
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
app/api/controller/ExcelFile.php
+0
-0
app/api/controller/Test.php
+1
-4
app/api/route/api.php
+6
-4
config/config.php
+2
-1
public/import.xlsx
+0
-0
No files found.
app/api/controller/ExcelFile.php
View file @
49dff0f9
This diff is collapsed.
Click to expand it.
app/api/controller/Test.php
View file @
49dff0f9
...
@@ -25,14 +25,12 @@ class Test extends BaseController
...
@@ -25,14 +25,12 @@ class Test extends BaseController
$spreadsheet
=
new
Spreadsheet
();
$spreadsheet
=
new
Spreadsheet
();
$sheet
=
$spreadsheet
->
getActiveSheet
();
$sheet
=
$spreadsheet
->
getActiveSheet
();
// 设置一些数据到单元格中
$sheet
->
setCellValue
(
'A1'
,
'带有图片的 ExcelFile 表格'
);
// 创建一个 Drawing 对象,并设置图片的路径
// 创建一个 Drawing 对象,并设置图片的路径
$drawing
=
new
Drawing
();
$drawing
=
new
Drawing
();
$drawing
->
setName
(
'Sample Image'
);
$drawing
->
setName
(
'Sample Image'
);
$drawing
->
setDescription
(
'Sample Image'
);
$drawing
->
setDescription
(
'Sample Image'
);
$drawing
->
setPath
(
'./image_0.
pn
g'
);
// 图片路径
$drawing
->
setPath
(
'./image_0.
jp
g'
);
// 图片路径
$drawing
->
setCoordinates
(
'B1'
);
// 图片放置的单元格位置
$drawing
->
setCoordinates
(
'B1'
);
// 图片放置的单元格位置
$drawing
->
setWorksheet
(
$sheet
);
// 关联到工作表
$drawing
->
setWorksheet
(
$sheet
);
// 关联到工作表
...
@@ -84,7 +82,6 @@ class Test extends BaseController
...
@@ -84,7 +82,6 @@ class Test extends BaseController
// 保存Excel文件
// 保存Excel文件
$writer
->
save
(
$outputFileName
);
$writer
->
save
(
$outputFileName
);
// 下载Excel文件(或者你可以返回文件路径让用户自己下载)
// 下载Excel文件(或者你可以返回文件路径让用户自己下载)
// return response()->download($outputFileName, 'file.xlsx')->deleteFileAfterSend(true);
// return response()->download($outputFileName, 'file.xlsx')->deleteFileAfterSend(true);
}
catch
(
\Exception
$e
){
}
catch
(
\Exception
$e
){
...
...
app/api/route/api.php
View file @
49dff0f9
...
@@ -93,9 +93,10 @@ Route::rule("normOrders/list","NormOrders/list"); //结算指标列表
...
@@ -93,9 +93,10 @@ Route::rule("normOrders/list","NormOrders/list"); //结算指标列表
Route
::
rule
(
"normOrders/detail"
,
"NormOrders/detail"
);
//结算指标列表
Route
::
rule
(
"normOrders/detail"
,
"NormOrders/detail"
);
//结算指标列表
Route
::
rule
(
"importFile"
,
"ExcelFile/importFile"
);
//结算指标列表
//
Route::rule("importFile","ExcelFile/importFile"); //结算指标列表
Route
::
rule
(
"exportFile"
,
"ExcelFile/exportFile"
);
//结算指标列表
//
Route::rule("exportFile","ExcelFile/exportFile"); //结算指标列表
Route
::
rule
(
"taskExportFile"
,
"ExcelFile/taskExportFile"
);
//
结算指标列表
Route
::
rule
(
"taskExportFile"
,
"ExcelFile/taskExportFile"
);
//
按任务导出数据
Route
::
rule
(
"normExportFile"
,
"ExcelFile/normExportFile"
);
//按指标导出数据
Route
::
rule
(
"test"
,
"test/index"
);
//结算指标列表
//
Route
::
rule
(
"import"
,
"ImportFile/import"
);
//
Route
::
rule
(
"import"
,
"ImportFile/import"
);
\ No newline at end of file
config/config.php
View file @
49dff0f9
...
@@ -69,5 +69,6 @@ return [
...
@@ -69,5 +69,6 @@ return [
"table_delete"
=>
99
,
// 删除
"table_delete"
=>
99
,
// 删除
],
],
// "resource_address"=>'https://data-collect.raisound.com/data-collect-api/',
// "resource_address"=>'https://data-collect.raisound.com/data-collect-api/',
"resource_address"
=>
'http://192.168.10.168/data-collect-api/'
// "resource_address"=>'http://192.168.10.168/data-collect-api/'
"resource_address"
=>
'http://gcspider.raisound.com:81/data-collect-api/'
];
];
public/import.xlsx
View file @
49dff0f9
No preview for this file type
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