Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QLNS_N01
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Hiếu
QLNS_N01
Commits
1f63c01a
Commit
1f63c01a
authored
Jun 09, 2019
by
phùng văn dung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 09/06/2019
parent
d7fc59c8
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
81 additions
and
44 deletions
+81
-44
pom.xml
pom.xml
+1
-0
src/main/resources/application.properties
src/main/resources/application.properties
+5
-4
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+21
-1
src/main/resources/public/layout/layout3.html
src/main/resources/public/layout/layout3.html
+1
-1
src/main/resources/public/pages/employee/employeeController.js
...ain/resources/public/pages/employee/employeeController.js
+2
-2
src/main/resources/public/pages/project/project.html
src/main/resources/public/pages/project/project.html
+0
-4
src/main/resources/public/pages/project/project/projectAddViews.html
...sources/public/pages/project/project/projectAddViews.html
+5
-6
src/main/resources/public/pages/project/project/projectController.js
...sources/public/pages/project/project/projectController.js
+42
-17
src/main/resources/public/pages/project/project/projectListViews.html
...ources/public/pages/project/project/projectListViews.html
+4
-3
src/main/resources/public/pages/project/projectController.js
src/main/resources/public/pages/project/projectController.js
+0
-6
No files found.
pom.xml
View file @
1f63c01a
...
...
@@ -17,6 +17,7 @@
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
</properties>
<dependencies>
...
...
src/main/resources/application.properties
View file @
1f63c01a
server.port
=
808
0
server.port
=
808
1
spring.datasource.driver-class-name
=
com.mysql.cj
.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql
.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://localhost:3306/qtvp_01
spring.datasource.username
=
root
spring.datasource.password
=
12345678
...
...
@@ -8,7 +8,8 @@ spring.datasource.password=12345678
spring.jpa.show-sql
=
true
spring.jpa.hibernate.ddl-auto
=
update
spring.jpa.properties.hibernate.dialect
=
org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.properties.hibernate.current_session_context_class
=
org.springframework.orm.hibernate5.SpringSessionContext
server.servlet.session.timeout
=
30s
# ===============================
...
...
@@ -18,7 +19,7 @@ spring.mail.host=smtp.gmail.com
spring.mail.port
=
587
spring.mail.username
=
hieunv2496@gmail.com
spring.mail.password
=
anhieu1996
>>>>>>>
master
spring.mail.properties.mail.smtp.starttls.enable
=
true
spring.mail.properties.mail.smtp.starttls.required
=
true
spring.mail.properties.mail.smtp.auth
=
true
...
...
src/main/resources/public/js/app.js
View file @
1f63c01a
...
...
@@ -52,7 +52,27 @@ angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRout
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/project/project/projectListViews.html
"
,
controller
:
"
projectController
"
controller
:
"
showProject
"
}
}
})
.
state
(
"
addproject
"
,
{
parent
:
'
layout3
'
,
url
:
"
/addproject
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/project/project/projectAddViews.html
"
,
controller
:
"
insertProject
"
}
}
})
.
state
(
"
editproject
"
,
{
parent
:
'
layout3
'
,
url
:
"
/editproject
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/project/project/projectAddViews.html
"
,
controller
:
"
editProject
"
}
}
})
...
...
src/main/resources/public/layout/layout3.html
View file @
1f63c01a
...
...
@@ -33,7 +33,7 @@
<!-- Sidebar -->
<ul
class=
"sidebar navbar-nav"
>
<li
class=
"nav-item dropdown"
>
<a
class=
"nav-link dropdown-toggle"
href=
"#"
id=
"pagesDropdown"
role=
"button"
data-toggle=
"dropdown"
<a
class=
"nav-link dropdown-toggle"
id=
"pagesDropdown"
role=
"button"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<i
class=
"fas fa-fw fa-folder"
></i>
<span>
Quản Trị Văn Phòng
</span>
...
...
src/main/resources/public/pages/employee/employeeController.js
View file @
1f63c01a
...
...
@@ -26,7 +26,7 @@ angular.module("myApp").controller("employeeController", function($scope, $http)
console
.
log
(
$scope
.
emp
);
$http
({
method
:
'
POST
'
,
url
:
"
http://localhost:808
0
/list_employee/
"
,
url
:
"
http://localhost:808
1
/list_employee/
"
,
data
:
$scope
.
emp
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
...
...
@@ -79,7 +79,7 @@ angular.module("myApp").controller("employeeController", function($scope, $http)
$http
({
method
:
'
GET
'
,
url
:
"
http://localhost:808
0
/list_employee/
"
url
:
"
http://localhost:808
1
/list_employee/
"
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
...
...
src/main/resources/public/pages/project/project.html
deleted
100644 → 0
View file @
d7fc59c8
<div
class=
"container"
>
Project works
</div>
src/main/resources/public/pages/project/project/projectAddViews.html
View file @
1f63c01a
<div
class=
"card-header"
>
<i
class=
"fas fa-table"
></i>
Thêm mới dự án
</div>
<div
class=
"card-body"
ng-app=
"ProjectApiModule"
>
<div
class=
"card-body"
>
<form
ng-controller=
"insertProject"
ng-submit=
"insert_project()"
>
<div
class=
"form-group"
>
<div
class=
"form-row"
>
<div
class=
"col-md-6"
>
<div
class=
"form-label-group"
>
<input
type=
"text"
ng-model=
"
lstP
roject.name"
id=
"name"
class=
"form-control"
<input
type=
"text"
ng-model=
"
p
roject.name"
id=
"name"
class=
"form-control"
placeholder=
"Tên Dự Án"
required=
"required"
autofocus=
"autofocus"
>
<label
for=
"name"
>
Tên Dự Án
</label>
<span>
{{lstProject.name}}
</span>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-label-group"
>
<input
type=
"text"
ng-model=
"
lstP
roject.descriptions"
id=
"descriptions"
<input
type=
"text"
ng-model=
"
p
roject.descriptions"
id=
"descriptions"
class=
"form-control"
placeholder=
"Mô tả ngắn"
required=
"required"
>
...
...
@@ -29,14 +28,14 @@
<div
class=
"form-row"
>
<div
class=
"col-md-6"
>
<div
class=
"form-label-group"
>
<input
type=
"date"
ng-model=
"
lstP
roject.startDate"
id=
"startDate"
class=
"form-control"
<input
type=
"date"
ng-model=
"
p
roject.startDate"
id=
"startDate"
class=
"form-control"
placeholder=
"Ngày Bắt Đầu"
required=
"required"
>
<label
for=
"startDate"
>
Ngày Bắt Đầu
</label>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-label-group"
>
<input
type=
"date"
ng-model=
"
lstP
roject.endDate"
id=
"endDate"
class=
"form-control"
<input
type=
"date"
ng-model=
"
p
roject.endDate"
id=
"endDate"
class=
"form-control"
placeholder=
"nick skype"
required=
"required"
>
<label
for=
"endDate"
>
Ngày Kết Thuc
</label>
</div>
...
...
src/main/resources/public/pages/project/project/projectController.js
View file @
1f63c01a
...
...
@@ -8,7 +8,6 @@ function showProject($scope, $http) {
$http
.
get
(
"
http://localhost:8081/quan-tri/danh-sach-du-an
"
).
then
(
successCallback
,
errorCallback
);
function
successCallback
(
response
)
{
//success code
console
.
log
(
response
.
data
);
{
$scope
.
listProject
=
response
.
data
...
...
@@ -20,8 +19,7 @@ function showProject($scope, $http) {
console
.
log
(
"
can't get data!!
"
);
}
};
// tạo controllers insert APT
// tạo controllers insert API
function
insertProject
(
$scope
,
$http
)
{
$scope
.
insert_project
=
function
()
{
$http
({
...
...
@@ -31,7 +29,7 @@ function insertProject($scope, $http) {
url
:
'
http://localhost:8081/quan-tri/them-du-an
'
,
//truyền dữ liệu nhập trên cline vào data
data
:
angular
.
toJson
(
$scope
.
lstP
roject
),
data
:
angular
.
toJson
(
$scope
.
p
roject
),
//kiểu dữ liệu API
headers
:
{
'
Content-Type
'
:
'
application/json
'
...
...
@@ -41,7 +39,7 @@ function insertProject($scope, $http) {
//tạo funtion nếu thành công!
function
successCallback
(
response
)
{
$window
.
location
.
href
=
'
http://localhost:8081
'
;
$window
.
location
.
href
=
'
http://localhost:8081
/#!/
'
;
}
//tạo funtion kiểm tra nếu thất bại
...
...
@@ -63,22 +61,49 @@ function deleteProject($scope, $window, $http) {
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}).
then
(
function
(
response
)
{
$window
.
location
.
href
=
'
http://localhost:8081
'
;
},
function
(
data
,
status
)
{
});
}).
then
(
successCallback
,
errorCallback
);
//tạo funtion nếu thành công!
function
successCallback
(
response
)
{
$window
.
location
.
href
=
'
http://localhost:8081/#!/
'
;
}
//tạo funtion kiểm tra nếu thất bại
function
errorCallback
(
error
)
{
//error code
console
.
log
(
"
can't insert data!!
"
);
}
}
};
};
//tạo controller sửa theo id
function
updateProject
(
$scope
,
$window
,
$http
)
{
$scope
.
updateProject
=
function
(
project
)
{
if
(
confirm
(
"
Bạn có muốn sửa không ?
"
))
{
$http
({
method
:
'
PUT
'
,
url
:
'
http://localhost:8081/quan-tri/xoa-du-an
'
,
data
:
$scope
.
project
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}).
then
(
successCallback
,
errorCallback
);
//tạo service lấy id của đường dẫn
angular
.
module
(
'
ProjectApiModule.Services
'
,
[]).
factory
(
'
projectGetService
'
,
function
(
$resource
)
{
return
$resource
(
'
http://localhost:8081/quan-tri/chi-tiet-du-an/:id
'
,
{
id
:
'
@myCarId
'
},
{
update
:
{
method
:
'
PUT
'
//tạo funtion nếu thành công!
function
successCallback
(
response
)
{
$window
.
location
.
href
=
'
http://localhost:8081/#!/
'
;
}
});
});
//service kiểm tra id có tồn tại không
\ No newline at end of file
//tạo funtion kiểm tra nếu thất bại
function
errorCallback
(
error
)
{
//error code
console
.
log
(
"
can't insert data!!
"
);
}
}
};
};
function
editProject
(
$scope
){
}
\ No newline at end of file
src/main/resources/public/pages/project/project/projectListViews.html
View file @
1f63c01a
...
...
@@ -3,9 +3,9 @@
<div
class=
"card-header"
>
<i
class=
"fas fa-table"
></i>
Danh Sách Dự Án
</div>
<div
class=
"card-body"
ng-app=
"ProjectApiModule"
>
<div
class=
"card-body"
>
<div
class=
"table-responsive"
ng-controller=
"showProject"
>
<a
href=
"#
"
class=
"btn btn-primary btn-circle btn-sm"
style=
"margin-bottom: 10px;"
>
Thêm
</a>
<a
ui-sref=
"addproject
"
class=
"btn btn-primary btn-circle btn-sm"
style=
"margin-bottom: 10px;"
>
Thêm
</a>
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"margin-bottom: 10px;"
>
<table
class=
"table table-bordered"
id=
"dataTable"
width=
"100%"
cellspacing=
"0"
>
...
...
@@ -27,7 +27,8 @@
<td>
{{ project.endDate | date:"dd/MM/yyyy" }}
</td>
<td>
{{ project.statusGet }}
</td>
<td><a
data-ng-href=
"#"
class=
"btn btn-info btn-circle btn-sm"
>
Xem
</a>
<a
data-ng-href=
"#"
class=
"btn btn-warning btn-circle btn-sm"
>
Xem
</a>
<a
ui-sref=
"editproject"
class=
"btn btn-warning btn-circle btn-sm"
>
Sửa
</a>
<a
class=
"btn btn-danger btn-circle btn-sm"
ng-controller=
"deleteProject"
data-ng-click=
"deleteProject(project)"
>
Xóa
</a>
...
...
src/main/resources/public/pages/project/projectController.js
deleted
100644 → 0
View file @
d7fc59c8
/**
*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
projectController
"
,
function
(
$scope
,
$http
,
$window
)
{
console
.
log
(
"
projectController
"
);
});
\ No newline at end of file
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