Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
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
bltdc
DataCenter_Core2.1_20190520
Commits
1c4a7fe6
Commit
1c4a7fe6
authored
Jun 01, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加功能:离线导出
parent
e2144134
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
207 additions
and
3 deletions
+207
-3
ResultDTO.cs
Bailun.DC.Models/Component/DTO/ResultDTO.cs
+1
-1
TableDTO.cs
Bailun.DC.Models/Component/DTO/TableDTO.cs
+5
-0
dc_component_offline_download.cs
....Models/Component/Entity/dc_component_offline_download.cs
+74
-0
dc_component_table.cs
Bailun.DC.Models/Component/Entity/dc_component_table.cs
+5
-0
OfflineDownloadEnum.cs
Bailun.DC.Models/Component/Enum/OfflineDownloadEnum.cs
+31
-0
OfflineDownloadService.cs
Bailun.DC.Services/Component/OfflineDownloadService.cs
+0
-0
TableService.cs
Bailun.DC.Services/Component/TableService.cs
+7
-2
OfflineDownloadController.cs
.../Areas/Component/Controllers/OfflineDownloadController.cs
+56
-0
Filter.cshtml
Bailun.DC.Web/Areas/Component/Views/Form/Filter.cshtml
+1
-0
Query.cshtml
Bailun.DC.Web/Areas/Component/Views/Table/Query.cshtml
+1
-0
el-form-filter.js
Bailun.DC.Web/wwwroot/js/component/el-form-filter.js
+4
-0
el-table-query.js
Bailun.DC.Web/wwwroot/js/component/el-table-query.js
+22
-0
No files found.
Bailun.DC.Models/Component/DTO/ResultDTO.cs
View file @
1c4a7fe6
...
@@ -29,7 +29,7 @@ namespace Bailun.DC.Models.Component.DTO
...
@@ -29,7 +29,7 @@ namespace Bailun.DC.Models.Component.DTO
public
object
Data
{
get
;
set
;
}
public
object
Data
{
get
;
set
;
}
}
}
public
class
ResultD
to
<
T
>
:
ResultDTO
public
class
ResultD
TO
<
T
>
:
ResultDTO
{
{
/// <summary>
/// <summary>
/// 结果集
/// 结果集
...
...
Bailun.DC.Models/Component/DTO/TableDTO.cs
View file @
1c4a7fe6
...
@@ -47,6 +47,11 @@ namespace Bailun.DC.Models.Component.DTO
...
@@ -47,6 +47,11 @@ namespace Bailun.DC.Models.Component.DTO
public
bool
?
IsShowExportButton
{
get
;
set
;
}
public
bool
?
IsShowExportButton
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否显示离线导出按钮:(默认否)
/// </summary>
public
bool
?
IsShowOfflineExportButton
{
get
;
set
;
}
/// <summary>
/// 是否显示导入按钮:(默认否)
/// 是否显示导入按钮:(默认否)
/// </summary>
/// </summary>
public
bool
?
IsShowImportButton
{
get
;
set
;
}
public
bool
?
IsShowImportButton
{
get
;
set
;
}
...
...
Bailun.DC.Models/Component/Entity/dc_component_offline_download.cs
0 → 100644
View file @
1c4a7fe6
using
Bailun.DC.Models.Component.Enum
;
using
Dapper
;
using
System
;
namespace
Bailun.DC.Models.Component.Entity
{
/// <summary>
/// 离线下载组件
/// </summary>
public
class
dc_component_offline_download
{
/// <summary>
/// ID
/// </summary>
public
int
id
{
get
;
set
;
}
/// <summary>
/// 编码
/// </summary>
public
string
code
{
get
;
set
;
}
/// <summary>
/// 名称
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 后缀
/// </summary>
public
string
suffix
{
get
;
set
;
}
/// <summary>
/// 状态:0:未执行, 1:执行中, 2:完成, 3:失败
/// </summary>
public
OfflineDownloadStatusEnum
?
status
{
get
;
set
;
}
/// <summary>
/// 消息
/// </summary>
public
string
message
{
get
;
set
;
}
/// <summary>
/// 下载地址
/// </summary>
public
string
url
{
get
;
set
;
}
/// <summary>
/// 是否删除: 1:是; 0:否
/// </summary>
[
IgnoreUpdate
]
public
bool
is_delete
{
get
;
set
;
}
/// <summary>
/// 创建人ID
/// </summary>
public
int
?
gmt_create_userid
{
get
;
set
;
}
/// <summary>
/// 创建人名称
/// </summary>
public
string
gmt_create_username
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
[
IgnoreUpdate
]
public
DateTime
gmt_create_time
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
gmt_modified_time
{
get
;
set
;
}
}
}
Bailun.DC.Models/Component/Entity/dc_component_table.cs
View file @
1c4a7fe6
...
@@ -65,6 +65,11 @@ namespace Bailun.DC.Models.Component.Entity
...
@@ -65,6 +65,11 @@ namespace Bailun.DC.Models.Component.Entity
public
bool
is_show_export_button
{
get
;
set
;
}
public
bool
is_show_export_button
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否显示离线导出按钮:(默认否)
/// </summary>
public
bool
is_show_offline_export_button
{
get
;
set
;
}
/// <summary>
/// 是否显示导入按钮:(默认否)
/// 是否显示导入按钮:(默认否)
/// </summary>
/// </summary>
public
bool
is_show_import_button
{
get
;
set
;
}
public
bool
is_show_import_button
{
get
;
set
;
}
...
...
Bailun.DC.Models/Component/Enum/OfflineDownloadEnum.cs
0 → 100644
View file @
1c4a7fe6
using
System.ComponentModel
;
namespace
Bailun.DC.Models.Component.Enum
{
/// <summary>
/// 状态:0:未执行, 1:执行中, 2:完成, 3:失败
/// </summary>
public
enum
OfflineDownloadStatusEnum
{
/// <summary>
/// 未执行
/// </summary>
[
Description
(
"未执行"
)]
UnExecuted
=
0
,
/// <summary>
/// 执行中
/// </summary>
[
Description
(
"执行中"
)]
Executing
=
1
,
/// <summary>
/// 完成
/// </summary>
[
Description
(
"完成"
)]
Complete
=
2
,
/// <summary>
/// 失败
/// </summary>
[
Description
(
"失败"
)]
Fail
=
3
,
}
}
Bailun.DC.Services/Component/OfflineDownloadService.cs
0 → 100644
View file @
1c4a7fe6
This diff is collapsed.
Click to expand it.
Bailun.DC.Services/Component/TableService.cs
View file @
1c4a7fe6
...
@@ -51,6 +51,7 @@ namespace Bailun.DC.Services.Component
...
@@ -51,6 +51,7 @@ namespace Bailun.DC.Services.Component
IsShowSearchButton
=
entity
.
is_show_search_button
,
IsShowSearchButton
=
entity
.
is_show_search_button
,
IsShowResetButton
=
entity
.
is_show_reset_button
,
IsShowResetButton
=
entity
.
is_show_reset_button
,
IsShowExportButton
=
entity
.
is_show_export_button
,
IsShowExportButton
=
entity
.
is_show_export_button
,
IsShowOfflineExportButton
=
entity
.
is_show_offline_export_button
,
IsShowImportButton
=
entity
.
is_show_import_button
,
IsShowImportButton
=
entity
.
is_show_import_button
,
IsShowSequenceColumn
=
entity
.
is_show_sequence_column
,
IsShowSequenceColumn
=
entity
.
is_show_sequence_column
,
OperateControlsPosition
=
entity
.
operate_controls_position
,
OperateControlsPosition
=
entity
.
operate_controls_position
,
...
@@ -472,14 +473,17 @@ namespace Bailun.DC.Services.Component
...
@@ -472,14 +473,17 @@ namespace Bailun.DC.Services.Component
return
pageList
;
return
pageList
;
}
}
public
(
string
,
byte
[])
Export
(
QueryFilterDTO
queryFilter
)
public
(
string
,
byte
[])
Export
(
QueryFilterDTO
queryFilter
,
TableDTO
entity
=
null
)
{
{
byte
[]
b
=
default
(
byte
[]);
byte
[]
b
=
default
(
byte
[]);
string
name
=
default
(
string
);
string
name
=
default
(
string
);
int
dataCount
=
default
(
int
);
int
dataCount
=
default
(
int
);
if
(
queryFilter
!=
null
)
if
(
queryFilter
!=
null
)
{
{
TableDTO
entity
=
this
.
Get
(
queryFilter
.
Code
);
if
(
entity
==
null
)
{
entity
=
this
.
Get
(
queryFilter
.
Code
);
}
if
(
entity
!=
null
)
if
(
entity
!=
null
)
{
{
name
=
string
.
Join
(
string
.
Empty
,
entity
.
ListCrumb
);
name
=
string
.
Join
(
string
.
Empty
,
entity
.
ListCrumb
);
...
@@ -550,6 +554,7 @@ namespace Bailun.DC.Services.Component
...
@@ -550,6 +554,7 @@ namespace Bailun.DC.Services.Component
is_show_search_button
=
dto
.
IsShowSearchButton
??
false
,
is_show_search_button
=
dto
.
IsShowSearchButton
??
false
,
is_show_reset_button
=
dto
.
IsShowResetButton
??
false
,
is_show_reset_button
=
dto
.
IsShowResetButton
??
false
,
is_show_export_button
=
dto
.
IsShowExportButton
??
false
,
is_show_export_button
=
dto
.
IsShowExportButton
??
false
,
is_show_offline_export_button
=
dto
.
IsShowOfflineExportButton
??
false
,
is_show_import_button
=
dto
.
IsShowImportButton
??
false
,
is_show_import_button
=
dto
.
IsShowImportButton
??
false
,
is_show_sequence_column
=
dto
.
IsShowSequenceColumn
??
false
,
is_show_sequence_column
=
dto
.
IsShowSequenceColumn
??
false
,
is_show_column_search
=
dto
.
IsShowColumnSearch
??
false
,
is_show_column_search
=
dto
.
IsShowColumnSearch
??
false
,
...
...
Bailun.DC.Web/Areas/Component/Controllers/OfflineDownloadController.cs
0 → 100644
View file @
1c4a7fe6
using
Bailun.DC.Models.Component.DTO
;
using
Bailun.DC.Services.Component
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
System
;
using
System.IO
;
using
System.Text
;
namespace
Bailun.DC.Web.Areas.Component.Controllers
{
[
Area
(
"Component"
)]
public
class
OfflineDownloadController
:
Base
.
BaseController
{
[
HttpPost
]
public
JsonResult
Export
(
QueryFilterDTO
queryFilter
)
{
ResultDTO
result
=
default
(
ResultDTO
);
try
{
if
(
Request
.
ContentType
.
Contains
(
"application/json"
))
{
using
(
Stream
stream
=
Request
.
Body
)
{
byte
[]
buffer
=
new
byte
[
Request
.
ContentLength
.
Value
];
stream
.
Read
(
buffer
,
0
,
buffer
.
Length
);
string
content
=
Encoding
.
UTF8
.
GetString
(
buffer
);
queryFilter
=
JsonConvert
.
DeserializeObject
<
QueryFilterDTO
>(
content
);
}
}
result
=
new
OfflineDownloadService
().
Export
(
queryFilter
,
Request
.
Cookies
[
"BailunToken"
]);
}
catch
(
Exception
ex
)
{
result
=
new
ResultDTO
()
{
Message
=
ex
.
Message
};
}
return
Json
(
result
);
}
[
HttpPost
]
public
JsonResult
Delete
(
int
[]
id
)
{
ResultDTO
result
=
default
(
ResultDTO
);
try
{
result
=
new
OfflineDownloadService
().
Save
(
id
,
true
);
}
catch
(
Exception
ex
)
{
result
=
new
ResultDTO
()
{
Message
=
ex
.
Message
};
}
return
Json
(
result
);
}
}
}
Bailun.DC.Web/Areas/Component/Views/Form/Filter.cshtml
View file @
1c4a7fe6
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<el-form-control v-if="filter.isShowSearchButton" v-bind:item="{type: 'button',name:'查询',buttonType:'primary',icon:'el-icon-search'}" v-on:click="onSearch"></el-form-control>
<el-form-control v-if="filter.isShowSearchButton" v-bind:item="{type: 'button',name:'查询',buttonType:'primary',icon:'el-icon-search'}" v-on:click="onSearch"></el-form-control>
<el-form-control v-if="filter.isShowResetButton" v-bind:item="{type: 'button',name:'重置',icon:'el-icon-refresh-right'}" v-on:click="onReset"></el-form-control>
<el-form-control v-if="filter.isShowResetButton" v-bind:item="{type: 'button',name:'重置',icon:'el-icon-refresh-right'}" v-on:click="onReset"></el-form-control>
<el-form-control v-if="filter.isShowExportButton" v-bind:item="{type: 'button',name:'导出',buttonType:'success',icon:'el-icon-download'}" v-on:click="onExport"></el-form-control>
<el-form-control v-if="filter.isShowExportButton" v-bind:item="{type: 'button',name:'导出',buttonType:'success',icon:'el-icon-download'}" v-on:click="onExport"></el-form-control>
<el-form-control v-if="filter.isShowOfflineExportButton" v-bind:item="{type: 'button',name:'离线导出',buttonType:'success',icon:'el-icon-download'}" v-on:click="onOfflineExport"></el-form-control>
<el-form-control v-if="filter.isShowImportButton" v-show="!filter.file || !filter.file.name" ref="file" v-bind:item="{type: 'file',name:'导入',action:filter.importApi,buttonType:'warning',icon:'el-icon-upload2',accept:'.xls,.xlsx'}" v-model="filter.file" v-on:import="onImport"></el-form-control>
<el-form-control v-if="filter.isShowImportButton" v-show="!filter.file || !filter.file.name" ref="file" v-bind:item="{type: 'file',name:'导入',action:filter.importApi,buttonType:'warning',icon:'el-icon-upload2',accept:'.xls,.xlsx'}" v-model="filter.file" v-on:import="onImport"></el-form-control>
<el-form-control v-if="filter.isShowImportButton && filter.file && filter.file.name" class="el-upload-input" v-bind:item="{type: 'input',readonly:true}" v-model="filter.file.name"></el-form-control>
<el-form-control v-if="filter.isShowImportButton && filter.file && filter.file.name" class="el-upload-input" v-bind:item="{type: 'input',readonly:true}" v-model="filter.file.name"></el-form-control>
<el-form-control v-if="filter.isShowImportButton && filter.file && filter.file.name" v-bind:item="{type: 'button',name:'上传',buttonType:'warning',icon:'el-icon-upload2'}" v-on:click="$refs.file.upLoad"></el-form-control>
<el-form-control v-if="filter.isShowImportButton && filter.file && filter.file.name" v-bind:item="{type: 'button',name:'上传',buttonType:'warning',icon:'el-icon-upload2'}" v-on:click="$refs.file.upLoad"></el-form-control>
...
...
Bailun.DC.Web/Areas/Component/Views/Table/Query.cshtml
View file @
1c4a7fe6
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
v-on:search="onSearch"
v-on:search="onSearch"
v-on:reset="onReset"
v-on:reset="onReset"
v-on:export="onExport"
v-on:export="onExport"
v-on:offline-export="onOfflineExport"
v-on:click="onClick"></el-form-filter>
v-on:click="onClick"></el-form-filter>
</el-header>
</el-header>
<el-main v-loading="$root.loading">
<el-main v-loading="$root.loading">
...
...
Bailun.DC.Web/wwwroot/js/component/el-form-filter.js
View file @
1c4a7fe6
...
@@ -117,6 +117,10 @@
...
@@ -117,6 +117,10 @@
onExport
:
function
()
{
onExport
:
function
()
{
this
.
$emit
(
"export"
,
this
.
getFilter
());
this
.
$emit
(
"export"
,
this
.
getFilter
());
},
},
//离线导出
onOfflineExport
:
function
()
{
this
.
$emit
(
"offline-export"
,
this
.
getFilter
());
},
//导入
//导入
onImport
:
function
(
result
,
file
,
message
)
{
onImport
:
function
(
result
,
file
,
message
)
{
if
(
result
)
{
if
(
result
)
{
...
...
Bailun.DC.Web/wwwroot/js/component/el-table-query.js
View file @
1c4a7fe6
...
@@ -181,6 +181,28 @@
...
@@ -181,6 +181,28 @@
}
}
}
}
},
},
//离线导出
onOfflineExport
:
function
(
filterParams
,
cb
)
{
var
that
=
this
;
//异步请求
if
(
that
.
$refs
.
formFilter
.
validate
())
{
that
.
$http
.
post
(
"/Component/OfflineDownload/Export"
,
((
filterParams
.
constructor
===
Object
?
filterParams
:
null
)
||
that
.
filterParams
),
{
emulateJSON
:
true
}).
then
(
function
(
response
)
{
var
result
=
response
.
data
;
if
(
response
.
status
===
200
&&
result
.
result
)
{
that
.
$message
({
message
:
'正在导出,请稍后在离线下载页面下载文件!'
,
type
:
'success'
});
}
else
{
this
.
$message
(
result
.
message
||
" 未知错误!"
);
}
},
function
(
error
)
{
this
.
$message
(
error
.
statusText
||
" 未知错误!"
);
});
}
else
{
var
message
=
that
.
$refs
.
formFilter
.
getValidateMessage
();
if
(
message
&&
message
.
length
)
{
that
.
$message
({
dangerouslyUseHTMLString
:
true
,
message
:
message
.
join
(
"<br/>"
)
});
}
}
},
//单击事件
//单击事件
onClick
:
function
(
fn
)
{
onClick
:
function
(
fn
)
{
var
that
=
this
;
var
that
=
this
;
...
...
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