重构系统附件字段逻辑
修改各模块附件功能
This commit is contained in:
@@ -13,6 +13,7 @@ use Gdoo\Project\Models\Task;
|
||||
use Gdoo\Project\Models\Log;
|
||||
|
||||
use Gdoo\Index\Controllers\DefaultController;
|
||||
use Gdoo\Index\Services\AttachmentService;
|
||||
|
||||
class CommentController extends DefaultController
|
||||
{
|
||||
@@ -43,7 +44,9 @@ class CommentController extends DefaultController
|
||||
|
||||
$task_id = $request->input('task_id');
|
||||
|
||||
$attachment = AttachmentService::edit('', 'project_task_log', 'attachment', 'project');
|
||||
return $this->render([
|
||||
'attachment' => $attachment,
|
||||
'task_id' => $task_id,
|
||||
]);
|
||||
}
|
||||
@@ -68,7 +71,9 @@ class CommentController extends DefaultController
|
||||
$id = $request->input('id');
|
||||
$log = Log::find($id);
|
||||
|
||||
$attachment = AttachmentService::edit($log['attachment'], 'project_task_log', 'attachment', 'project');
|
||||
return $this->render([
|
||||
'attachment' => $attachment,
|
||||
'log' => $log,
|
||||
]);
|
||||
}
|
||||
@@ -84,8 +89,13 @@ class CommentController extends DefaultController
|
||||
return $this->json('请先选择数据。');
|
||||
}
|
||||
|
||||
$rows = Log::whereIn('id', $id)->get();
|
||||
Log::whereIn('id', $id)->delete();
|
||||
|
||||
foreach($rows as $row) {
|
||||
AttachmentService::remove($row['attachment']);
|
||||
}
|
||||
|
||||
return $this->json('恭喜你,删除评论成功。', true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,9 @@ class ProjectController extends DefaultController
|
||||
public function index()
|
||||
{
|
||||
$search = search_form([
|
||||
'advanced' => '',
|
||||
'referer' => 1,
|
||||
'status' => 0
|
||||
'status' => 1
|
||||
], [
|
||||
['text', 'project.title', '名称'],
|
||||
['text', 'project.user_id', '拥有者'],
|
||||
@@ -62,25 +63,14 @@ class ProjectController extends DefaultController
|
||||
|
||||
$rows = $model->paginate()->appends($query);
|
||||
|
||||
$tabs = [
|
||||
'name' => 'status',
|
||||
'items' => Project::$tabs
|
||||
];
|
||||
|
||||
return $this->display([
|
||||
'auth_id' => $auth_id,
|
||||
'rows' => $rows,
|
||||
'search' => $search,
|
||||
'tabs' => $tabs,
|
||||
'query' => $query,
|
||||
'search' => $search
|
||||
]);
|
||||
}
|
||||
|
||||
// 项目详情
|
||||
public function show(Request $request)
|
||||
{
|
||||
return $this->display([]);
|
||||
}
|
||||
|
||||
// 添加项目
|
||||
public function add(Request $request)
|
||||
{
|
||||
|
||||
@@ -27,14 +27,29 @@ class TaskController extends DefaultController
|
||||
public function index(Request $request)
|
||||
{
|
||||
$search = search_form([
|
||||
'advanced' => '',
|
||||
'project_id' => '',
|
||||
'tpl' => 'gantt',
|
||||
'referer' => '',
|
||||
'tpl' => 'index',
|
||||
], [
|
||||
['text','project_task.name','任务名称'],
|
||||
['text','project_task.user_id','执行者'],
|
||||
]);
|
||||
['form_type' => 'text', 'name' => '任务名称', 'field' => 'project_task.name', 'value' => '', 'options' => []],
|
||||
['form_type' => 'text', 'name' => '执行者', 'field' => 'project_task.user_id', 'value' => '', 'options' => []],
|
||||
], 'model');
|
||||
|
||||
$header = [
|
||||
'master_name' => '项目任务',
|
||||
'simple_search_form' => 1,
|
||||
'table' => 'project_task',
|
||||
'master_table' => 'project_task',
|
||||
];
|
||||
|
||||
/*
|
||||
$header['buttons'] = [
|
||||
['name' => '删除', 'icon' => 'fa-remove', 'action' => 'delete', 'display' => $this->access['delete']],
|
||||
['name' => '导出', 'icon' => 'fa-share', 'action' => 'export', 'display' => 1],
|
||||
];
|
||||
*/
|
||||
|
||||
$header['search_form'] = $search;
|
||||
$query = $search['query'];
|
||||
|
||||
if ($request->ajax() && $request->wantsJson()) {
|
||||
@@ -62,38 +77,14 @@ class TaskController extends DefaultController
|
||||
'add_task' => $project['user_id'] == $user_id,
|
||||
];
|
||||
|
||||
// 返回页面
|
||||
$referer = session()->get('referer_'.$request->module().'_project_index');
|
||||
|
||||
return $this->display([
|
||||
'header' => $header,
|
||||
'project' => $project,
|
||||
'search' => $search,
|
||||
'query' => $query,
|
||||
'referer' => $referer,
|
||||
'permission' => $permission,
|
||||
|
||||
], 'index/'.$query['tpl']);
|
||||
}
|
||||
|
||||
// 显示任务
|
||||
public function show(Request $request)
|
||||
{
|
||||
$search = search_form([
|
||||
'project_id' => ''
|
||||
], [
|
||||
['text','project.title','任务名称'],
|
||||
['text','project.created_at','执行者'],
|
||||
]);
|
||||
|
||||
$project_id = $request->input('project_id');
|
||||
$project = Project::find($project_id);
|
||||
|
||||
return $this->render([
|
||||
'project' => $project,
|
||||
'search' => $search,
|
||||
]);
|
||||
}
|
||||
|
||||
// 移动任务
|
||||
public function drag(Request $request)
|
||||
{
|
||||
@@ -180,8 +171,11 @@ class TaskController extends DefaultController
|
||||
->get();
|
||||
|
||||
$tpl = $type == 'item' ? 'item/add' : 'add';
|
||||
|
||||
$attachment = AttachmentService::edit('', 'project_task', 'attachment', 'project');
|
||||
return $this->render([
|
||||
'items' => $items,
|
||||
'attachment' => $attachment,
|
||||
'project_id' => $project_id,
|
||||
'parent_id' => $parent_id,
|
||||
'type' => $type,
|
||||
@@ -300,12 +294,15 @@ class TaskController extends DefaultController
|
||||
];
|
||||
}
|
||||
$tpl = $type == 'item' ? 'item/edit' : 'edit';
|
||||
|
||||
$attachment = AttachmentService::edit($task['attachment'], 'project_task', 'attachment', 'project');
|
||||
return $this->render([
|
||||
'task' => $task,
|
||||
'logs' => $logs,
|
||||
'items' => $items,
|
||||
'tasks' => $tasks,
|
||||
'type' => $type,
|
||||
'attachment' => $attachment,
|
||||
'permission' => $permission,
|
||||
], $tpl);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
<style>
|
||||
.modal-body { overflow:hidden; }
|
||||
</style>
|
||||
|
||||
<form method="post" action="{{url()}}" id="comment-form" name="comment-form">
|
||||
<div class="panel m-b-none">
|
||||
|
||||
<table class="table table-form m-b-none">
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<textarea class="form-control" type="text" name="content" id="content"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="left">
|
||||
{{attachment_uploader('comment_attachment', $comment['attachment'], 'project_task_log')}}
|
||||
@include('attachment/create')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="task_id" value="{{$task_id}}">
|
||||
|
||||
</form>
|
||||
@@ -4,26 +4,19 @@
|
||||
|
||||
<form method="post" action="{{url()}}" id="comment-form" name="comment-form">
|
||||
<div class="panel m-b-none">
|
||||
|
||||
<table class="table table-form m-b-none">
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<textarea class="form-control" type="text" name="content" id="content"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="left">
|
||||
{{attachment_uploader('comment_attachment', $comment['attachment'], 'project_task_log')}}
|
||||
@include('attachment/create')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{$comment->id}}">
|
||||
|
||||
</form>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="panel">
|
||||
|
||||
<div class="wrapper-sm">
|
||||
<div class="wrapper-xs">
|
||||
@include('project/query')
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
@if($row->tasks->count())
|
||||
<span class="text-base badge bg-danger">{{$row->tasks->count()}}</span>
|
||||
@endif
|
||||
<a class="m-t-sm" href="{{url('task/index', ['project_id' => $row->id])}}">
|
||||
<a class="m-t-sm" data-toggle="tab-frame-url" data-name="项目任务详情" data-id="project_task_index" data-url="project/task/index?project_id={{$row->id}}" href="javascript:;">
|
||||
{{$row->name}}
|
||||
</a>
|
||||
</h4>
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="col-sm-1 hidden-xs">
|
||||
</div>
|
||||
<div class="col-sm-11 text-right text-center-xs">
|
||||
{{$rows->render()}}
|
||||
{{$rows->links()}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
</style>
|
||||
|
||||
<form method="post" action="{{url()}}" id="task-form" name="task-form">
|
||||
|
||||
<input type="hidden" name="type" value="{{$type}}">
|
||||
|
||||
@if($type == 'subtask')
|
||||
<input type="hidden" name="parent_id" value="{{$parent_id}}">
|
||||
@endif
|
||||
@@ -72,7 +72,7 @@
|
||||
<tr>
|
||||
<td align="right">附件</td>
|
||||
<td align="left">
|
||||
{{attachment_uploader('attachment', '', 'project_task')}}
|
||||
@include('attachment/create')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<style>
|
||||
.modal-body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wrapper-sm {
|
||||
background-color: #f0f3f4;
|
||||
}
|
||||
.modal-body {
|
||||
overflow: hidden;
|
||||
}
|
||||
.wrapper-sm {
|
||||
background-color: #f0f3f4;
|
||||
}
|
||||
</style>
|
||||
<div class="wrapper-sm">
|
||||
|
||||
@@ -126,9 +125,9 @@
|
||||
<td align="right">附件</td>
|
||||
<td align="left">
|
||||
@if($permission['attachment'])
|
||||
{{attachment_uploader('attachment', $task['attachment'], 'project_task')}}
|
||||
@include('attachment/create')
|
||||
@else
|
||||
{{attachment_show('attachment', $task['attachment'], 'project_task')}}
|
||||
@include('attachment/show')
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@@ -179,10 +178,8 @@
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="task-log" id="task-log-{{$task->id}}">
|
||||
|
||||
<div class="panel b-a m-b-none">
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
<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">
|
||||
<style type="text/css">
|
||||
/* 新样式 */
|
||||
html, body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gantt_side_content.gantt_right {
|
||||
padding-left: 10px;
|
||||
}
|
||||
@@ -18,7 +16,7 @@ html, body {
|
||||
}
|
||||
|
||||
.gantt_container {
|
||||
border: 1px solid #eee;
|
||||
border: 1px solid #fff;
|
||||
border-top: 1px solid #cecece;
|
||||
}
|
||||
|
||||
@@ -106,52 +104,8 @@ html, body {
|
||||
|
||||
</style>
|
||||
|
||||
<div class="panel">
|
||||
|
||||
<div class="wrapper-sm b-b">
|
||||
<span class="text-md">{{$project['name']}}</span> <span class="text-muted">{{$project['description']}}</span>
|
||||
</div>
|
||||
|
||||
<div class="wrapper-xs" id="gantt-wrapper">
|
||||
|
||||
<form id="search-task-form" class="form-inline" name="mytasksearch" method="get">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'index'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'index') active @endif">列表</a>
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'gantt'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'gantt') active @endif">甘特图</a>
|
||||
<!--
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'board'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'board') active @endif">看板</a>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{url($referer)}}" class="btn btn-sm btn-default"><i class="fa fa-reply"></i> 返回</a>
|
||||
|
||||
@if(isset($access['add']))
|
||||
|
||||
@if($permission['add_item'])
|
||||
<a href="javascript:addItem();" title="添加列表" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加列表</a>
|
||||
@endif
|
||||
|
||||
@if($permission['add_task'])
|
||||
<a href="javascript:addTask();" title="添加任务" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加任务</a>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@include('searchForm')
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#search-task-form').searchForm({
|
||||
data: {{json_encode($search['forms'])}},
|
||||
init:function(e) {
|
||||
var self = this;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel no-border" id="{{$header['master_table']}}-controller">
|
||||
@include('task/index/header')
|
||||
<div id="gantt-view"></div>
|
||||
</div>
|
||||
|
||||
@@ -163,7 +117,6 @@ var params = {project_id:project_id};
|
||||
gantt.config.columns = [
|
||||
{name:"name", label:"任务列表", tree:true, width:'*', resize: true}
|
||||
];
|
||||
|
||||
gantt.config.scale_unit = 'month';
|
||||
gantt.config.date_scale = '%Y - %m';
|
||||
gantt.config.scale_height = 50;
|
||||
@@ -284,7 +237,7 @@ gantt._do_autosize = function() {
|
||||
// 设置高度
|
||||
var height = $('#gantt-wrapper').outerHeight();
|
||||
var iframeHeight = $(window).height();
|
||||
$('#gantt-view').height(iframeHeight - height - 68 + 'px');
|
||||
$('#gantt-view').height(iframeHeight - height - 102 + 'px');
|
||||
|
||||
var resize = this._get_resize_options();
|
||||
var boxSizes = this._get_box_styles();
|
||||
@@ -308,15 +261,6 @@ gantt._do_autosize = function() {
|
||||
gantt.init("gantt-view");
|
||||
gantt.load(app.url('project/task/index', params));
|
||||
|
||||
$('#search-submit').on('click', function() {
|
||||
var query = $('#search-task-form').serializeArray();
|
||||
$.map(query, function(row) {
|
||||
params[row.name] = row.value;
|
||||
});
|
||||
dataReload();
|
||||
return false;
|
||||
});
|
||||
|
||||
function dataReload() {
|
||||
gantt.clearAll();
|
||||
gantt.load(app.url('project/task/index', params));
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<div class="wrapper-sm b-b">
|
||||
<span class="text-md">{{$project['name']}}</span> <span class="text-muted">{{$project['description']}}</span>
|
||||
</div>
|
||||
|
||||
<div id="index-wrapper">
|
||||
<form id="{{$header['master_table']}}-search-form" class="form-inline" name="mytasksearch" method="get">
|
||||
|
||||
<div class="pull-right wrapper-xs">
|
||||
<div class="btn-group">
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'index'])}}" class="btn btn-sm btn-default @if($header['search_form']['query']['tpl'] == 'index') active @endif">列表</a>
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'gantt'])}}" class="btn btn-sm btn-default @if($header['search_form']['query']['tpl'] == 'gantt') active @endif">甘特图</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('left_buttons')
|
||||
@if(isset($access['add']))
|
||||
@if($permission['add_item'])
|
||||
<a href="javascript:addItem();" title="添加列表" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加列表</a>
|
||||
@endif
|
||||
|
||||
@if($permission['add_task'])
|
||||
<a href="javascript:addTask();" title="添加任务" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加任务</a>
|
||||
@endif
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@include('headers')
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
.ag-theme-balham .ag-root {
|
||||
border-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,40 +1,8 @@
|
||||
<div class="panel">
|
||||
|
||||
<div class="wrapper-sm b-b">
|
||||
<span class="text-md">{{$project['name']}}</span> <span class="text-muted">{{$project['description']}}</span>
|
||||
</div>
|
||||
|
||||
<div class="wrapper-xs" id="index-wrapper">
|
||||
<form id="search-task-form" class="form-inline" name="mytasksearch" method="get">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'index'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'index') active @endif">列表</a>
|
||||
<a href="{{url('index', ['project_id' => $project['id'], 'tpl' => 'gantt'])}}" class="btn btn-sm btn-default @if($query['tpl'] == 'gantt') active @endif">甘特图</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{url($referer)}}" class="btn btn-sm btn-default"><i class="fa fa-reply"></i> 返回</a>
|
||||
|
||||
@if(isset($access['add']))
|
||||
|
||||
@if($permission['add_item'])
|
||||
<a href="javascript:addItem();" title="添加列表" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加列表</a>
|
||||
@endif
|
||||
|
||||
@if($permission['add_task'])
|
||||
<a href="javascript:addTask();" title="添加任务" class="hinted btn btn-sm btn-info"><i class="icon icon-plus"></i> 添加任务</a>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@include('searchForm')
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="{{$header['master_table']}}-controller">
|
||||
@include('task/index/header')
|
||||
<div class="gdoo-list-grid">
|
||||
<div id="jqgrid-table" class="ag-theme-balham" style="width:100%;"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -43,25 +11,6 @@ var project_id = "{{(int)$project['id']}}";
|
||||
var params = {project_id:project_id};
|
||||
var auth_id = '{{auth()->id()}}';
|
||||
|
||||
function progressRenderer(params) {
|
||||
var data = params.data;
|
||||
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) {
|
||||
if (params.value) {
|
||||
return '<span class="hinted" title="任务持续' + params.value + '">' + params.value + '</span>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
(function($) {
|
||||
grid = new agGridOptions();
|
||||
grid.remoteDataUrl = '{{url()}}';
|
||||
@@ -90,6 +39,25 @@ function durationRenderer(params) {
|
||||
return data.tree_path;
|
||||
};
|
||||
|
||||
function progressRenderer(params) {
|
||||
var data = params.data;
|
||||
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) {
|
||||
if (params.value) {
|
||||
return '<span class="hinted" title="任务持续' + params.value + '">' + params.value + '</span>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
grid.columnDefs.push(
|
||||
{cellClass:'text-center', sortable: false, field: 'user_name', headerName: '执行者', width: 140},
|
||||
{cellClass:'text-center', sortable: false, field: 'users', headerName: '参与者', minWidth: 200},
|
||||
@@ -115,24 +83,11 @@ function durationRenderer(params) {
|
||||
};
|
||||
|
||||
var gridDiv = document.querySelector("#jqgrid-table");
|
||||
gridDiv.style.height = getPanelHeight(12);
|
||||
gridDiv.style.height = getPanelHeight(11);
|
||||
|
||||
new agGrid.Grid(gridDiv, grid);
|
||||
grid.remoteData();
|
||||
|
||||
var search = $('#search-task-form').searchForm({
|
||||
data: JSON.parse('{{json_encode($search["forms"])}}'),
|
||||
init:function(e) {
|
||||
var self = this;
|
||||
}
|
||||
});
|
||||
search.find('#search-submit').on('click', function() {
|
||||
var query = search.serializeArray();
|
||||
params.page = 1;
|
||||
grid.remoteData(params);
|
||||
return false;
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
function dataReload() {
|
||||
@@ -141,7 +96,6 @@ function dataReload() {
|
||||
}
|
||||
|
||||
function getTask(id) {
|
||||
console.log(grid.api.getRowNode(id));
|
||||
return grid.api.getRowNode(id);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,59 @@
|
||||
<script>
|
||||
(function($) {
|
||||
var table = '{{$header["master_table"]}}';
|
||||
var search = JSON.parse('{{json_encode($header["search_form"])}}');
|
||||
search.advanced = {};
|
||||
search.simple = {};
|
||||
search.advanced.el = $('#' + table + '-search-form-advanced').searchForm({
|
||||
data: search.forms,
|
||||
advanced: true
|
||||
});
|
||||
search.simple.el = $('#' + table + '-search-form').searchForm({
|
||||
data: search.forms
|
||||
});
|
||||
search.simple.el.find('#search-submit').on('click', function() {
|
||||
var query = search.simple.el.serializeArray();
|
||||
search.queryType = 'simple';
|
||||
$.map(query, function(row) {
|
||||
params[row.name] = row.value;
|
||||
});
|
||||
dataReload();
|
||||
return false;
|
||||
});
|
||||
|
||||
// 过滤数据
|
||||
var panel = $('#' + table + '-controller');
|
||||
panel.on('click', '[data-toggle="' + table + '"]', function() {
|
||||
var data = $(this).data();
|
||||
if (data.action == 'filter') {
|
||||
$(search.advanced.el).dialog({
|
||||
title: '高级搜索',
|
||||
modalClass: 'no-padder',
|
||||
buttons: [{
|
||||
text: "取消",
|
||||
'class': "btn-default",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},{
|
||||
text: "确定",
|
||||
'class': "btn-info",
|
||||
click: function() {
|
||||
var query = search.advanced.el.serializeArray();
|
||||
search.queryType = 'advanced';
|
||||
$.map(query, function(row) {
|
||||
params[row.name] = row.value;
|
||||
});
|
||||
dataReload();
|
||||
$(this).dialog("close");
|
||||
return false;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
function formsBox(title, url, id, success, remove, error)
|
||||
{
|
||||
var options = {
|
||||
@@ -11,7 +66,7 @@ function formsBox(title, url, id, success, remove, error)
|
||||
|
||||
if (typeof success === 'function') {
|
||||
options.buttons.push({
|
||||
text: '<i class="fa fa-check"></i> 提交',
|
||||
text: '<i class="fa fa-check"></i> 保存',
|
||||
class: 'btn-info',
|
||||
click: function() {
|
||||
var me = this;
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
<style>
|
||||
.modal-body { overflow:hidden; }
|
||||
</style>
|
||||
|
||||
<form method="post" enctype="multipart/form-data" id="mytaskform" name="mytaskform">
|
||||
<div class="panel m-b-none">
|
||||
|
||||
<table class="table table-form m-b-none">
|
||||
|
||||
<tr>
|
||||
<td align="right" width="15%">名称</td>
|
||||
<td align="left">
|
||||
<input type="text" name="name" id="name" value="{{$task['name']}}" class="form-control input-sm">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">列表</td>
|
||||
<td align="left">
|
||||
<select class="form-control input-inline input-sm" id="item_id" name="item_id">
|
||||
<option value="1">测试日程1_</option>
|
||||
<option value="2">abc123</option>
|
||||
<option value="408">一般事件</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">执行者</td>
|
||||
<td align="left">
|
||||
{{App\Support\Dialog::user('user','user_id', $task['user_id'], 0, 0)}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">参与者</td>
|
||||
<td align="left">
|
||||
{{App\Support\Dialog::user('user', 'users', $task['users'], 1, 0)}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">时间</td>
|
||||
<td align="left">
|
||||
<input type="text" name="start_at" autocomplete="off" data-toggle="datetime" value="@datetime($task->start_at,time())" id="start_at" class="form-control input-sm input-inline">
|
||||
-
|
||||
<input type="text" name="end_at" autocomplete="off" data-toggle="datetime" value="@datetime($task->end_at)" id="end_at" class="form-control input-sm input-inline">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">备注</td>
|
||||
<td>
|
||||
<textarea class="form-control" type="text" name="purchase_plan[remark]" id="remark" placeholder="暂无备注"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">附件</td>
|
||||
<td align="left">
|
||||
{{attachment_uploader('attachment', $task['attachment'])}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">子任务</td>
|
||||
<td>
|
||||
<a href="#" class="option"><i class="fa fa-fw fa-plus"></i>添加子任务</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">评论</td>
|
||||
<td>
|
||||
<a href="#" class="option"><i class="fa fa-fw fa-plus"></i>添加评论</a>
|
||||
<!--
|
||||
<textarea class="form-control" rows="2" type="text" name="comment" id="comment" placeholder="内容"></textarea>
|
||||
{{attachment_uploader('comment_attachment', '', false)}}
|
||||
<a href="#" class="btn btn-sm btn-success"> 提交</a>
|
||||
-->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right">活动</td>
|
||||
<td>
|
||||
<div class="project-task-log">
|
||||
@if($logs)
|
||||
@foreach($logs as $log)
|
||||
<p><span class="time">@datetime($log->created_at)</span>{{$log->description}}</p>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{$task->id}}">
|
||||
<input type="hidden" name="project_id" value="{{$project_id}}">
|
||||
|
||||
</form>
|
||||
Reference in New Issue
Block a user