Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
luqiao-admin-mobile
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
杨子
luqiao-admin-mobile
Commits
baee629e
Commit
baee629e
authored
Apr 26, 2019
by
杨子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加固定资产列表
parent
d801bd8c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
342 additions
and
27 deletions
+342
-27
default.interceptor.ts
src/app/core/net/default.interceptor.ts
+15
-14
delon.module.ts
src/app/delon.module.ts
+8
-4
fixed-assets.component.html
...sets/assets-info/fixed-assets/fixed-assets.component.html
+88
-3
fixed-assets.component.ts
...assets/assets-info/fixed-assets/fixed-assets.component.ts
+25
-4
fixed-detail.component.html
...nfo/fixed-assets/fixed-detail/fixed-detail.component.html
+11
-0
fixed-detail.component.less
...nfo/fixed-assets/fixed-detail/fixed-detail.component.less
+0
-0
fixed-detail.component.spec.ts
.../fixed-assets/fixed-detail/fixed-detail.component.spec.ts
+25
-0
fixed-detail.component.ts
...-info/fixed-assets/fixed-detail/fixed-detail.component.ts
+166
-0
fixed-assets-routing.module.ts
src/app/routes/fixed-assets/fixed-assets-routing.module.ts
+0
-0
fixed-assets.module.ts
src/app/routes/fixed-assets/fixed-assets.module.ts
+3
-1
proxy.config.json
src/proxy.config.json
+1
-1
No files found.
src/app/core/net/default.interceptor.ts
View file @
baee629e
...
@@ -7,6 +7,7 @@ import {
...
@@ -7,6 +7,7 @@ import {
HttpErrorResponse
,
HttpErrorResponse
,
HttpEvent
,
HttpEvent
,
HttpResponseBase
,
HttpResponseBase
,
HttpResponse
,
}
from
'@angular/common/http'
;
}
from
'@angular/common/http'
;
import
{
Observable
,
of
,
throwError
}
from
'rxjs'
;
import
{
Observable
,
of
,
throwError
}
from
'rxjs'
;
import
{
mergeMap
,
catchError
}
from
'rxjs/operators'
;
import
{
mergeMap
,
catchError
}
from
'rxjs/operators'
;
...
@@ -71,20 +72,20 @@ export class DefaultInterceptor implements HttpInterceptor {
...
@@ -71,20 +72,20 @@ export class DefaultInterceptor implements HttpInterceptor {
// 错误内容:{ status: 1, msg: '非法参数' }
// 错误内容:{ status: 1, msg: '非法参数' }
// 正确内容:{ status: 0, response: { } }
// 正确内容:{ status: 0, response: { } }
// 则以下代码片断可直接适用
// 则以下代码片断可直接适用
//
if (event instanceof HttpResponse) {
if
(
event
instanceof
HttpResponse
)
{
//
const body: any = event.body;
const
body
:
any
=
event
.
body
;
//
if (body && body.status !== 0) {
if
(
body
&&
body
.
status
!==
0
)
{
//
this.msg.error(body.msg);
//
this.msg.error(body.msg);
//
// 继续抛出错误中断后续所有 Pipe、subscribe 操作,因此:
// 继续抛出错误中断后续所有 Pipe、subscribe 操作,因此:
//
// this.http.get('/').subscribe() 并不会触发
// this.http.get('/').subscribe() 并不会触发
//
return throwError({});
return
throwError
({});
//
} else {
}
else
{
//
// 重新修改 `body` 内容为 `response` 内容,对于绝大多数场景已经无须再关心业务状态码
// 重新修改 `body` 内容为 `response` 内容,对于绝大多数场景已经无须再关心业务状态码
//
return of(new HttpResponse(Object.assign(event, { body: body.response })));
return
of
(
new
HttpResponse
(
Object
.
assign
(
event
,
{
body
:
body
.
response
})));
//
// 或者依然保持完整的格式
// 或者依然保持完整的格式
//
return of(event);
//
return of(event);
//
}
}
//
}
}
break
;
break
;
case
401
:
case
401
:
this
.
notification
.
error
(
`未登录或登录已过期,请重新登录。`
,
``
);
this
.
notification
.
error
(
`未登录或登录已过期,请重新登录。`
,
``
);
...
...
src/app/delon.module.ts
View file @
baee629e
...
@@ -51,7 +51,13 @@ import { DelonAuthConfig } from '@delon/auth';
...
@@ -51,7 +51,13 @@ import { DelonAuthConfig } from '@delon/auth';
export
function
fnDelonAuthConfig
():
DelonAuthConfig
{
export
function
fnDelonAuthConfig
():
DelonAuthConfig
{
return
{
return
{
...
new
DelonAuthConfig
(),
...
new
DelonAuthConfig
(),
...({
login_url
:
'/passport/login'
}
as
DelonAuthConfig
),
...({
login_url
:
'/passport/login'
,
token_send_key
:
'JSESSIONID'
,
token_send_place
:
'url'
,
token_send_template
:
'${token}'
,
ignores
:
[
/
\/
login/
,
/^assets
\/
/
,
/passport
\/
/
],
}
as
DelonAuthConfig
),
};
};
}
}
...
@@ -75,9 +81,7 @@ const GLOBAL_CONFIG_PROVIDES = [
...
@@ -75,9 +81,7 @@ const GLOBAL_CONFIG_PROVIDES = [
// #endregion
// #endregion
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
AlainThemeModule
.
forRoot
()],
AlainThemeModule
.
forRoot
()
],
})
})
export
class
DelonModule
{
export
class
DelonModule
{
constructor
(@
Optional
()
@
SkipSelf
()
parentModule
:
DelonModule
)
{
constructor
(@
Optional
()
@
SkipSelf
()
parentModule
:
DelonModule
)
{
...
...
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-assets.component.html
View file @
baee629e
<p>
<page-header
[
title
]="'资产列表'"
[
extra
]="
extra
"
>
固定资产台账
<form
nz-form
[
nzLayout
]="'
inline
'"
(
ngSubmit
)="
getData
()"
class=
"search__form"
>
</p>
<div
nz-row
[
nzGutter
]="{
xs:
8
,
sm:
8
,
md:
8
,
lg:
24
,
xl:
48
,
xxl:
48
}"
>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
>
<nz-form-item>
<nz-form-label
nzFor=
"no"
>
规则编号
</nz-form-label>
<nz-form-control>
<input
nz-input
[(
ngModel
)]="
q
.
no
"
name=
"no"
placeholder=
"请输入"
id=
"no"
>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
>
<nz-form-item>
<nz-form-label
nzFor=
"status"
>
使用状态
</nz-form-label>
<nz-form-control>
<nz-select
[(
ngModel
)]="
q
.
status
"
name=
"status"
id=
"status"
[
nzPlaceHolder
]="'请选择'"
[
nzShowSearch
]="
true
"
>
<nz-option
*
ngFor=
"let i of status; let idx = index"
[
nzLabel
]="
i
.
text
"
[
nzValue
]="
idx
"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
*
ngIf=
"expandForm"
>
<nz-form-item>
<nz-form-label
nzFor=
"callNo"
>
调用次数
</nz-form-label>
<nz-form-control>
<input
nz-input
id=
"callNo"
>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
*
ngIf=
"expandForm"
>
<nz-form-item>
<nz-form-label
nzFor=
"updatedAt"
>
更新日期
</nz-form-label>
<nz-form-control>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
*
ngIf=
"expandForm"
>
<nz-form-item>
<nz-form-label
nzFor=
"status2"
>
使用状态
</nz-form-label>
<nz-form-control>
<nz-select
[
nzPlaceHolder
]="'请选择'"
nzId=
"status2"
[
nzShowSearch
]="
true
"
>
<nz-option
*
ngFor=
"let i of status; let idx = index"
[
nzLabel
]="
i
.
text
"
[
nzValue
]="
idx
"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
nzMd=
"8"
nzSm=
"24"
*
ngIf=
"expandForm"
>
<nz-form-item>
<nz-form-label
nzFor=
"status3"
>
使用状态
</nz-form-label>
<nz-form-control>
<nz-select
[
nzPlaceHolder
]="'请选择'"
nzId=
"status3"
[
nzShowSearch
]="
true
"
>
<nz-option
*
ngFor=
"let i of status; let idx = index"
[
nzLabel
]="
i
.
text
"
[
nzValue
]="
idx
"
></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
24
"
>
<button
nz-button
type=
"submit"
[
nzType
]="'
primary
'"
[
nzLoading
]="
loading
"
>
查询
</button>
<button
nz-button
type=
"reset"
(
click
)="
reset
()"
class=
"mx-sm"
>
重置
</button>
<a
(
click
)="
expandForm=
!expandForm"
>
{{expandForm ? '收起' : '展开'}}
<i
class=
"anticon"
[
class
.
anticon-down
]="!
expandForm
"
[
class
.
anticon-up
]="
expandForm
"
></i>
</a>
</div>
</div>
</form>
</page-header>
<nz-list
[
nzLoading
]="
loading
"
[
nzDataSource
]="
list
"
[
nzRenderItem
]="
item
"
[
nzGrid
]="{
gutter:
24
,
lg:
8
,
md:
12
,
sm:
24
,
xs:
24
}"
>
<ng-template
#
item
let-item
>
<nz-list-item>
<nz-card
nzHoverable
*
ngIf=
"item !== null"
[
nzActions
]="[
op1
]"
>
<ng-template
#
op1
>
<a
[
routerLink
]="['./
detail
',
item
.
id
]"
>
查看
</a>
</ng-template>
<nz-card-meta
[
nzAvatar
]="
nzAvatar
"
[
nzTitle
]="
nzTitle
"
[
nzDescription
]="
nzDescription
"
>
<ng-template
#
nzTitle
>
<a
(
click
)="
msg
.
success
('标题:'
+
item
.
id
);"
>
{{item.name}}
</a>
</ng-template>
<ng-template
#
nzDescription
>
<ellipsis>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</ellipsis>
</ng-template>
</nz-card-meta>
</nz-card>
</nz-list-item>
</ng-template>
</nz-list>
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-assets.component.ts
View file @
baee629e
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ListService
}
from
'@core/services/list/list.service'
;
@
Component
({
@
Component
({
selector
:
'app-fixed-assets'
,
selector
:
'app-fixed-assets'
,
templateUrl
:
'./fixed-assets.component.html'
,
templateUrl
:
'./fixed-assets.component.html'
,
styleUrls
:
[
'./fixed-assets.component.less'
]
styleUrls
:
[
'./fixed-assets.component.less'
]
,
})
})
export
class
FixedAssetsComponent
implements
OnInit
{
export
class
FixedAssetsComponent
implements
OnInit
{
list
:
any
[]
=
[];
constructor
()
{
}
loading
=
true
;
q
:
any
=
{
pi
:
1
,
ps
:
10
,
sorter
:
''
,
status
:
null
,
statusList
:
[],
};
expandForm
=
false
;
constructor
(
private
listSrv
:
ListService
)
{}
ngOnInit
()
{
ngOnInit
()
{
}
this
.
loading
=
true
;
this
.
listSrv
.
getKindAssetList
(
2
).
subscribe
(
res
=>
{
this
.
list
=
res
[
'rows'
];
console
.
log
(
this
.
list
);
this
.
loading
=
false
;
});
// this.http.get('/api/list', { count: 8 }).subscribe((res: any) => {
// this.list = this.list.concat(res);
// this.loading = false;
// this.cdr.detectChanges();
// });
}
}
}
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-detail/fixed-detail.component.html
0 → 100644
View file @
baee629e
<page-header
[
title
]="'详情'"
></page-header>
<nz-collapse>
<nz-collapse-panel
*
ngFor=
"let panel of panels"
[
nzHeader
]="
panel
.
name
"
[
nzActive
]="
panel
.
active
"
[
nzDisabled
]="
panel
.
disabled
"
>
<ng-container
*
ngIf=
"panel.id == 1"
>
<ng-container
*
ngFor=
"let item of panel.items"
>
<span>
{{item.text}}
</span>
</ng-container>
</ng-container>
</nz-collapse-panel>
</nz-collapse>
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-detail/fixed-detail.component.less
0 → 100644
View file @
baee629e
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-detail/fixed-detail.component.spec.ts
0 → 100644
View file @
baee629e
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
FixedDetailComponent
}
from
'./fixed-detail.component'
;
describe
(
'FixedDetailComponent'
,
()
=>
{
let
component
:
FixedDetailComponent
;
let
fixture
:
ComponentFixture
<
FixedDetailComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
FixedDetailComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
FixedDetailComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/routes/fixed-assets/assets-info/fixed-assets/fixed-detail/fixed-detail.component.ts
0 → 100644
View file @
baee629e
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-fixed-detail'
,
templateUrl
:
'./fixed-detail.component.html'
,
styleUrls
:
[
'./fixed-detail.component.less'
],
})
export
class
FixedDetailComponent
implements
OnInit
{
panels
=
[
{
id
:
1
,
active
:
true
,
name
:
'基本情况'
,
disabled
:
false
,
items
:
[
{
text
:
'资产编号'
,
fieid
:
'num'
,
},
{
text
:
'资产名称'
,
fieid
:
'name'
,
},
{
text
:
'规格型号'
,
fieid
:
'modelNum'
,
},
{
text
:
'资产分类'
,
fieid
:
'assetClass'
,
},
{
text
:
'资产来源'
,
fieid
:
'source'
,
},
{
text
:
'资产状态'
,
fieid
:
'assetState'
,
},
{
text
:
'验收单号'
,
fieid
:
'acceptNum'
,
},
{
text
:
'领用单号'
,
fieid
:
'receiveNum'
,
},
{
text
:
'购入日期'
,
fieid
:
'buyDate'
,
},
{
text
:
'制造厂商'
,
fieid
:
'madeFirms'
,
},
{
text
:
'出厂编码'
,
fieid
:
'factoryCode'
,
},
{
text
:
'供应商'
,
fieid
:
'supplier'
,
},
{
text
:
'工作场景'
,
fieid
:
'workPlace'
,
},
{
text
:
'存放地'
,
fieid
:
'storage'
,
},
{
text
:
'管理部门'
,
fieid
:
'company.name'
,
},
{
text
:
'产权单位'
,
fieid
:
'belongUnit.name'
,
},
{
text
:
'使用单位'
,
fieid
:
'useUnit.name'
,
},
{
text
:
'所在项目部'
,
fieid
:
'belongProject'
,
},
],
},
{
id
:
2
,
active
:
false
,
disabled
:
false
,
name
:
'财务信息'
,
},
{
id
:
3
,
active
:
false
,
disabled
:
false
,
name
:
'资产折旧'
,
},
{
id
:
4
,
active
:
false
,
disabled
:
false
,
name
:
'车辆信息'
,
},
{
id
:
5
,
active
:
false
,
disabled
:
false
,
name
:
'技术参数'
,
},
{
id
:
6
,
active
:
false
,
disabled
:
false
,
name
:
'合格证'
,
},
{
id
:
7
,
active
:
false
,
disabled
:
false
,
name
:
'资产照片'
,
},
{
id
:
8
,
active
:
false
,
disabled
:
false
,
name
:
'附件及资料'
,
},
{
id
:
9
,
active
:
false
,
disabled
:
false
,
name
:
'附属设备及配件'
,
},
{
id
:
10
,
active
:
false
,
disabled
:
false
,
name
:
'折旧记录'
,
},
{
id
:
11
,
active
:
false
,
disabled
:
false
,
name
:
'资产维修保养记录'
,
},
{
id
:
12
,
active
:
false
,
disabled
:
false
,
name
:
'资产盘点记录'
,
},
{
id
:
13
,
active
:
false
,
disabled
:
false
,
name
:
'资产使用记录'
,
},
];
constructor
()
{}
ngOnInit
()
{}
}
src/app/routes/fixed-assets/fixed-assets-routing.module.ts
View file @
baee629e
This diff is collapsed.
Click to expand it.
src/app/routes/fixed-assets/fixed-assets.module.ts
View file @
baee629e
...
@@ -47,6 +47,7 @@ import { SharedModule } from '@shared';
...
@@ -47,6 +47,7 @@ import { SharedModule } from '@shared';
import
{
AssetsCateComponent
}
from
'./assets-info/assets-cate/assets-cate.component'
;
import
{
AssetsCateComponent
}
from
'./assets-info/assets-cate/assets-cate.component'
;
import
{
AssetsLeaseHouseComponent
}
from
'./assets-lease/house/house.component'
;
import
{
AssetsLeaseHouseComponent
}
from
'./assets-lease/house/house.component'
;
import
{
BusinessComponent
}
from
'./single-machine/business/business.component'
;
import
{
BusinessComponent
}
from
'./single-machine/business/business.component'
;
import
{
FixedDetailComponent
}
from
'./assets-info/fixed-assets/fixed-detail/fixed-detail.component'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
...
@@ -93,7 +94,8 @@ import { BusinessComponent } from './single-machine/business/business.component'
...
@@ -93,7 +94,8 @@ import { BusinessComponent } from './single-machine/business/business.component'
DeviceComponent
,
DeviceComponent
,
UserComponent
,
UserComponent
,
TypeComponent
,
TypeComponent
,
VendorComponent
VendorComponent
,
FixedDetailComponent
],
],
imports
:
[
SharedModule
,
FixedAssetsRoutingModule
]
imports
:
[
SharedModule
,
FixedAssetsRoutingModule
]
})
})
...
...
src/proxy.config.json
View file @
baee629e
{
{
"/asset"
:
{
"/asset"
:
{
"target"
:
"http://192.168.19.200:808
0
"
,
"target"
:
"http://192.168.19.200:808
1
"
,
"secure"
:
false
,
"secure"
:
false
,
"logLevel"
:
"debug"
,
"logLevel"
:
"debug"
,
"changeOrigin"
:
true
"changeOrigin"
:
true
...
...
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