Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
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
ulakbus
ulakbus-ui
Commits
2742b23c
Commit
2742b23c
authored
Nov 24, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reload function reuse
linkedmodel wf add_cmd list_cmd attributes
parent
dc7c64f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
crud_controller.js
app/components/crud/crud_controller.js
+9
-12
form_service.js
app/zetalib/form_service.js
+7
-5
No files found.
app/components/crud/crud_controller.js
View file @
2742b23c
...
...
@@ -182,24 +182,13 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
Generator
.
doItemAction
(
$scope
,
key
,
cmd
);
};
$scope
.
pagination
=
{
page
:
1
,
total_pages
:
8
};
$scope
.
getNumber
=
function
(
num
)
{
return
new
Array
(
num
);
};
// reloadData must be a json object
$scope
.
reload
=
function
(
reloadData
)
{
$scope
.
form_params
.
cmd
=
$scope
.
reload_cmd
;
$scope
.
form_params
=
angular
.
extend
(
$scope
.
form_params
,
reloadData
);
$log
.
debug
(
'reload data'
,
$scope
);
Generator
.
get_wf
(
$scope
);
};
}
if
(
$routeParams
.
cmd
===
'reload'
)
{
$scope
.
cmd
=
'reload'
;
Generator
.
get_wf
(
$scope
);
$scope
.
reload
({});
}
if
(
$routeParams
.
cmd
===
'reset'
)
{
...
...
@@ -207,6 +196,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
$scope
.
cmd
=
'reset'
;
Generator
.
get_wf
(
$scope
);
}
// reloadData must be a json object
$scope
.
reload
=
function
(
reloadData
)
{
$scope
.
form_params
.
cmd
=
$scope
.
reload_cmd
;
$scope
.
form_params
=
angular
.
extend
(
$scope
.
form_params
,
reloadData
);
$log
.
debug
(
'reload data'
,
$scope
);
Generator
.
get_wf
(
$scope
);
};
})
.
directive
(
'crudListDirective'
,
function
()
{
...
...
app/zetalib/form_service.js
View file @
2742b23c
...
...
@@ -197,12 +197,14 @@ angular.module('formService', [])
if
(
v
.
type
===
'model'
)
{
var
formitem
=
scope
.
form
[
scope
.
form
.
indexOf
(
k
)];
var
modelscope
=
{
"url"
:
scope
.
url
,
"form_params"
:
{
model
:
v
.
model_name
}};
var
modelscope
=
{
"url"
:
v
.
wf
,
"form_params"
:
{
model
:
v
.
model_name
,
cmd
:
v
.
list_cmd
}};
formitem
=
{
type
:
"template"
,
templateUrl
:
"shared/templates/foreignKey.html"
,
title
:
v
.
title
,
wf
:
v
.
wf
,
add_cmd
:
v
.
add_cmd
,
name
:
v
.
model_name
,
model_name
:
v
.
model_name
,
titleMap
:
generator
.
get_list
(
modelscope
).
then
(
function
(
res
)
{
...
...
@@ -597,15 +599,15 @@ angular.module('formService', [])
resolve
:
{
items
:
function
()
{
return
Generator
.
get_form
({
url
:
'crud'
,
form_params
:
{
'model'
:
scope
.
form
.
model_name
,
"cmd"
:
"form"
}
url
:
scope
.
form
.
wf
,
form_params
:
{
model
:
scope
.
form
.
model_name
,
cmd
:
scope
.
form
.
add_cmd
}
});
}
}
});
modalInstance
.
result
.
then
(
function
(
child
model
,
key
)
{
Generator
.
submit
(
child
model
);
modalInstance
.
result
.
then
(
function
(
child
scope
,
key
)
{
Generator
.
submit
(
child
scope
);
$route
.
reload
();
});
});
...
...
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