完善打印相关功能
去掉无用的前端文件 修改版权描述
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
<script src="{{$asset_url}}/vendor/dhtmlxgantt/dhtmlxgantt_tooltip.js" type="text/javascript"></script>
|
||||
<script src="{{$asset_url}}/vendor/dhtmlxgantt/locale_cn.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" href="{{$asset_url}}/vendor/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
|
||||
<!--
|
||||
<script src="https://export.dhtmlx.com/gantt/api.js"></script>
|
||||
-->
|
||||
<style type="text/css">
|
||||
/* 新样式 */
|
||||
html, body {
|
||||
@@ -126,9 +123,6 @@ html, body {
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'board'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'board') active @endif">看板</a>
|
||||
-->
|
||||
</div>
|
||||
<!--
|
||||
<input value="导出PDF" class="btn btn-sm btn-default" type="button" onclick='exportToPDF()'>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<a href="{{url($referer)}}" class="btn btn-sm btn-default"><i class="fa fa-reply"></i> 返回</a>
|
||||
@@ -158,9 +152,7 @@ html, body {
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="gantt-view"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -189,7 +181,6 @@ gantt.config.show_links = false;
|
||||
gantt.config.order_branch = true;
|
||||
|
||||
// gantt.config.order_branch_free = true;
|
||||
|
||||
/*
|
||||
var date_to_str = gantt.date.date_to_str(gantt.config.api_date);
|
||||
var today = new Date();
|
||||
@@ -244,13 +235,13 @@ gantt.templates.tooltip_text = function(start, end, task) {
|
||||
gantt.attachEvent('onTaskDblClick', function (task_id) {
|
||||
var task = gantt.getTask(task_id);
|
||||
if(task.type == 'item') {
|
||||
editItem(task_id);
|
||||
editItem(task);
|
||||
}
|
||||
if(task.type == 'task') {
|
||||
editTask(task_id);
|
||||
editTask(task);
|
||||
}
|
||||
if(task.type == 'subtask') {
|
||||
editSubTask(task_id);
|
||||
editSubTask(task);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -279,22 +270,17 @@ gantt.attachEvent('onBeforeTaskDrag', function(task_id, mode, e) {
|
||||
});
|
||||
|
||||
gantt.attachEvent('onAfterTaskDrag', function(task_id, mode, e) {
|
||||
|
||||
var task = gantt.getTask(task_id);
|
||||
|
||||
var data = {id: task.id,progress: task.progress};
|
||||
|
||||
var date_to_str = gantt.date.date_to_str(gantt.config.api_date);
|
||||
data.start_date = date_to_str(task.start_date);
|
||||
data.end_date = date_to_str(task.end_date);
|
||||
|
||||
data.end_date = date_to_str(task.end_date);
|
||||
$.post('{{url("drag")}}', data, function(res) {
|
||||
gantt.render();
|
||||
}, 'json');
|
||||
});
|
||||
|
||||
gantt._do_autosize = function() {
|
||||
|
||||
// 设置高度
|
||||
var height = $('#gantt-wrapper').outerHeight();
|
||||
var iframeHeight = $(window).height();
|
||||
@@ -327,29 +313,15 @@ $('#search-submit').on('click', function() {
|
||||
$.map(query, function(row) {
|
||||
params[row.name] = row.value;
|
||||
});
|
||||
|
||||
dataReload();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function exportToPDF()
|
||||
{
|
||||
gantt.exportToPDF({
|
||||
locale:"cn",
|
||||
skin:'terrace',
|
||||
});
|
||||
}
|
||||
|
||||
function dataReload() {
|
||||
gantt.clearAll();
|
||||
gantt.load(app.url('project/task/index', params));
|
||||
}
|
||||
|
||||
function getTask(id) {
|
||||
return gantt.getTask(id);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('task/index/js')
|
||||
@@ -45,14 +45,14 @@ var auth_id = '{{auth()->id()}}';
|
||||
|
||||
function progressRenderer(params) {
|
||||
var data = params.data;
|
||||
if (data.type == 'task' || data.type == 'subtask') {
|
||||
if (params.value == 1) {
|
||||
return '<span class="label label-success">已完成</span>';
|
||||
} else {
|
||||
return '<span class="label label-' + (auth_id == data.user_id ? 'danger' : 'info') + '">进行中</span>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
if (data.type == 'task' || data.type == 'subtask') {
|
||||
if (params.value == 1) {
|
||||
return '<div class="label label-success">已完成</div>';
|
||||
} else {
|
||||
return '<div class="label label-' + (auth_id == data.user_id ? 'danger' : 'info') + '">进行中</div>';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function durationRenderer(params) {
|
||||
@@ -94,23 +94,23 @@ function durationRenderer(params) {
|
||||
{cellClass:'text-center', sortable: false, field: 'user_name', headerName: '执行者', width: 140},
|
||||
{cellClass:'text-center', sortable: false, field: 'users', headerName: '参与者', minWidth: 200},
|
||||
{cellClass:'text-center', cellRenderer: progressRenderer, sortable: false, field: 'progress', headerName: '状态', width: 100},
|
||||
{cellClass:'text-center', sortable: false, field: 'start_at', headerName: '开始时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'end_at', headerName: '结束时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'start_dt', headerName: '开始时间', width: 120},
|
||||
{cellClass:'text-center', sortable: false, field: 'end_dt', headerName: '结束时间', width: 120},
|
||||
{cellClass:'text-center', cellRenderer: durationRenderer, sortable: false, field: 'duration_date', headerName: '持续时间', width: 100},
|
||||
{cellClass:'text-center', sortable: false, field: 'created_at', headerName: '创建时间', width: 140},
|
||||
{cellClass:'text-center', field: 'id', headerName: 'ID', width: 80}
|
||||
{cellClass:'text-center', sortable: false, field: 'created_dt', headerName: '创建时间', width: 140},
|
||||
//{cellClass:'text-center', field: 'id', headerName: 'ID', width: 80}
|
||||
);
|
||||
|
||||
grid.onRowDoubleClicked = function (row) {
|
||||
var data = row.data;
|
||||
if(data.type == 'item') {
|
||||
editItem(data.id);
|
||||
editItem(data);
|
||||
}
|
||||
if(data.type == 'task') {
|
||||
editTask(data.id);
|
||||
editTask(data);
|
||||
}
|
||||
if(data.type == 'subtask') {
|
||||
editSubTask(data.id);
|
||||
editSubTask(data);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,9 +142,9 @@ function dataReload() {
|
||||
}
|
||||
|
||||
function getTask(id) {
|
||||
console.log(grid.api.getRowNode(id));
|
||||
return grid.api.getRowNode(id);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@include('task/index/js')
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
|
||||
function formsBox(title, url, id, success, remove, error)
|
||||
{
|
||||
var options = {
|
||||
@@ -67,12 +66,10 @@ function addItem() {
|
||||
});
|
||||
}
|
||||
|
||||
function editItem(id) {
|
||||
function editItem(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -84,14 +81,14 @@ function editItem(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务列表吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑任务列表', app.url('project/task/edit', {type:'item',id:id}), 'item-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑任务列表', app.url('project/task/edit', {type:'item',id:task.id}), 'item-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addTask() {
|
||||
@@ -100,12 +97,10 @@ function addTask() {
|
||||
});
|
||||
}
|
||||
|
||||
function editTask(id) {
|
||||
function editTask(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -117,14 +112,14 @@ function editTask(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑任务', app.url('project/task/edit', {type:'task',id:id}), 'task-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑任务', app.url('project/task/edit', {type:'task', id:task.id}), 'task-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addSubTask(id) {
|
||||
@@ -140,12 +135,10 @@ function addSubTask(id) {
|
||||
});
|
||||
}
|
||||
|
||||
function editSubTask(id) {
|
||||
|
||||
function editSubTask(task) {
|
||||
|
||||
var fun_edit = null, fun_delete = null;
|
||||
|
||||
var task = getTask(id);
|
||||
|
||||
if(task.option_edit == 1) {
|
||||
fun_edit = function(res) {
|
||||
saveResult.call(this, res);
|
||||
@@ -157,14 +150,14 @@ function editSubTask(id) {
|
||||
var me = this;
|
||||
$.messager.confirm('操作警告', '确定要删除任务吗?', function(btn) {
|
||||
if (btn == true) {
|
||||
$.post(app.url('project/task/delete'), {id: id}, function(res) {
|
||||
$.post(app.url('project/task/delete'), {id: task.id}, function(res) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
formsBox('编辑子任务', app.url('project/task/edit', {type:'subtask',id:id}), 'task-form-'+ id, fun_edit, fun_delete);
|
||||
formsBox('编辑子任务', app.url('project/task/edit', {type:'subtask',id:task.id}), 'task-form-'+ task.id, fun_edit, fun_delete);
|
||||
}
|
||||
|
||||
function addComment(task_id) {
|
||||
@@ -190,9 +183,7 @@ function editComment(id) {
|
||||
saveResult.call(me, res);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user