no message
This commit is contained in:
parent
52722eda17
commit
22862edc13
@ -26,11 +26,8 @@ use function Swoole\Coroutine\Http\get;
|
|||||||
class ProjectController extends AbstractController
|
class ProjectController extends AbstractController
|
||||||
{
|
{
|
||||||
private $projectSelect = [
|
private $projectSelect = [
|
||||||
'*',
|
'projects.*',
|
||||||
'projects.id AS id',
|
'project_users.owner',
|
||||||
'projects.userid AS userid',
|
|
||||||
'projects.created_at AS created_at',
|
|
||||||
'projects.updated_at AS updated_at',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,20 +118,20 @@ class ProjectController extends AbstractController
|
|||||||
$columns = Request::input('columns');
|
$columns = Request::input('columns');
|
||||||
if (!is_array($columns)) $columns = [];
|
if (!is_array($columns)) $columns = [];
|
||||||
$insertColumns = [];
|
$insertColumns = [];
|
||||||
$inorder = 0;
|
$sort = 0;
|
||||||
foreach ($columns AS $column) {
|
foreach ($columns AS $column) {
|
||||||
$column = trim($column);
|
$column = trim($column);
|
||||||
if ($column) {
|
if ($column) {
|
||||||
$insertColumns[] = [
|
$insertColumns[] = [
|
||||||
'name' => $column,
|
'name' => $column,
|
||||||
'inorder' => $inorder++,
|
'sort' => $sort++,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($insertColumns)) {
|
if (empty($insertColumns)) {
|
||||||
$insertColumns[] = [
|
$insertColumns[] = [
|
||||||
'name' => 'Default',
|
'name' => 'Default',
|
||||||
'inorder' => 0,
|
'sort' => 0,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (count($insertColumns) > 30) {
|
if (count($insertColumns) > 30) {
|
||||||
|
@ -13,10 +13,16 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property string|null $name 名称
|
* @property string|null $name 名称
|
||||||
* @property string|null $desc 描述、备注
|
* @property string|null $desc 描述、备注
|
||||||
* @property int|null $userid 创建人
|
* @property int|null $userid 创建人
|
||||||
* @property int|null $dialog_id 聊天会话ID
|
* @property int|mixed $dialog_id 聊天会话ID
|
||||||
* @property \Illuminate\Support\Carbon|null $created_at
|
* @property \Illuminate\Support\Carbon|null $created_at
|
||||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||||
|
* @property-read int $task_complete
|
||||||
|
* @property-read int $task_my_complete
|
||||||
|
* @property-read int $task_my_num
|
||||||
|
* @property-read int $task_my_percent
|
||||||
|
* @property-read int $task_num
|
||||||
|
* @property-read int $task_percent
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectColumn[] $projectColumn
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectColumn[] $projectColumn
|
||||||
* @property-read int|null $project_column_count
|
* @property-read int|null $project_column_count
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectLog[] $projectLog
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProjectLog[] $projectLog
|
||||||
@ -43,6 +49,93 @@ class Project extends AbstractModel
|
|||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
protected $appends = [
|
||||||
|
'task_num',
|
||||||
|
'task_complete',
|
||||||
|
'task_percent',
|
||||||
|
'task_my_num',
|
||||||
|
'task_my_complete',
|
||||||
|
'task_my_percent',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成子任务数据
|
||||||
|
*/
|
||||||
|
private function generateTaskData()
|
||||||
|
{
|
||||||
|
if (!isset($this->attributes['task_num'])) {
|
||||||
|
$builder = ProjectTask::whereProjectId($this->id)->whereParentId(0)->whereNull('archived_at');
|
||||||
|
$this->attributes['task_num'] = $builder->count();
|
||||||
|
$this->attributes['task_complete'] = $builder->whereNotNull('complete_at')->count();
|
||||||
|
$this->attributes['task_percent'] = $this->attributes['task_num'] ? intval($this->attributes['task_complete'] / $this->attributes['task_num'] * 100) : 0;
|
||||||
|
//
|
||||||
|
$builder = ProjectTask::whereProjectId($this->id)->whereParentId(0)->whereNull('archived_at');
|
||||||
|
$this->attributes['task_my_num'] = $builder->whereUserid(User::token2userid())->count();
|
||||||
|
$this->attributes['task_my_complete'] = $builder->whereUserid(User::token2userid())->whereNotNull('complete_at')->count();
|
||||||
|
$this->attributes['task_my_percent'] = $this->attributes['task_my_num'] ? intval($this->attributes['task_my_complete'] / $this->attributes['task_my_num'] * 100) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务数量
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskNumAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_num'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务完成数量
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskCompleteAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_complete'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务完成率
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskPercentAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_percent'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务数量(我的)
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskMyNumAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_my_num'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务完成数量(我的)
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskMyCompleteAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_my_complete'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务完成率(我的)
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTaskMyPercentAttribute()
|
||||||
|
{
|
||||||
|
$this->generateTaskData();
|
||||||
|
return $this->attributes['task_my_percent'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
* @return int|mixed
|
* @return int|mixed
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
"lodash": "^4.17.19",
|
"lodash": "^4.17.19",
|
||||||
"postcss": "^8.1.14",
|
"postcss": "^8.1.14",
|
||||||
"resolve-url-loader": "^3.1.3",
|
"resolve-url-loader": "^3.1.3",
|
||||||
"sass": "^1.34.0",
|
"sass": "^1.34.1",
|
||||||
"sass-loader": "^11.1.1",
|
"sass-loader": "^12.0.0",
|
||||||
"stylus": "^0.54.8",
|
"stylus": "^0.54.8",
|
||||||
"stylus-loader": "^3.0.2",
|
"stylus-loader": "^3.0.2",
|
||||||
"vue": "^2.6.12",
|
"vue": "^2.6.12",
|
||||||
|
@ -33,7 +33,10 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="menu-project">
|
<li class="menu-project">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(item, key) in projectList" :key="key" @click="toggleRoute('project/' + item.id)" :class="classNameRoute('project/' + item.id)">{{item.name}}</li>
|
<li v-for="(item, key) in projectList" :key="key" @click="toggleRoute('project/' + item.id)" :class="classNameRoute('project/' + item.id)">
|
||||||
|
<div class="title">{{item.name}}</div>
|
||||||
|
<div v-if="item.task_my_num > 0" class="num">{{item.task_my_num}}</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<Loading v-if="loadIng > 0"/>
|
<Loading v-if="loadIng > 0"/>
|
||||||
</li>
|
</li>
|
||||||
@ -62,7 +65,7 @@
|
|||||||
<Option v-for="(item, index) in columns" :value="index" :key="index">{{ item.label }}</Option>
|
<Option v-for="(item, index) in columns" :value="index" :key="index">{{ item.label }}</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="addData.columns.length > 0" :label="$L('任务分类')">
|
<FormItem v-if="addData.columns.length > 0" :label="$L('任务列表')">
|
||||||
<div style="line-height:38px">
|
<div style="line-height:38px">
|
||||||
<span v-for="(item, index) in addData.columns">
|
<span v-for="(item, index) in addData.columns">
|
||||||
<Tag @on-close="() => { addData.columns.splice(index, 1)}" closable size="large" color="primary">{{item}}</Tag>
|
<Tag @on-close="() => { addData.columns.splice(index, 1)}" closable size="large" color="primary">{{item}}</Tag>
|
||||||
@ -70,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin-top:4px;"></div>
|
<div style="margin-top:4px;"></div>
|
||||||
<div style="margin-bottom:-16px">
|
<div style="margin-bottom:-16px">
|
||||||
<Button icon="ios-add" type="dashed" @click="addColumns">{{$L('添加分类')}}</Button>
|
<Button icon="ios-add" type="dashed" @click="addColumns">{{$L('添加列表')}}</Button>
|
||||||
</div>
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div v-for="(item, key) in list" :key="key">
|
<div v-for="(item, key) in list" :key="key">
|
||||||
<Row class="task-row" :style="item.color ? {backgroundColor: item.color, borderBottomColor: item.color} : {}">
|
<Row class="task-row" :style="item.color ? {backgroundColor: item.color, borderBottomColor: item.color} : {}">
|
||||||
<em v-if="item.p_name && item.parent_id === 0" class="priority-color" :style="{backgroundColor:item.p_color}"></em>
|
<em v-if="item.p_name && item.parent_id === 0" class="priority-color" :style="{backgroundColor:item.p_color}"></em>
|
||||||
<Col span="12" :class="['row-item', item.complete_at ? 'complete' : '']">
|
<Col span="12" :class="['row-name', item.complete_at ? 'complete' : '']">
|
||||||
<Icon
|
<Icon
|
||||||
v-if="item.sub_num > 0"
|
v-if="item.sub_num > 0"
|
||||||
:class="['sub-icon', item.sub_open ? 'active' : '']"
|
:class="['sub-icon', item.sub_open ? 'active' : '']"
|
||||||
@ -60,20 +60,20 @@
|
|||||||
<div v-if="item.msg_num > 0" class="item-icon">{{item.msg_num}}<Icon type="ios-chatbubbles-outline" /></div>
|
<div v-if="item.msg_num > 0" class="item-icon">{{item.msg_num}}<Icon type="ios-chatbubbles-outline" /></div>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="3">
|
<Col span="3" class="row-column">
|
||||||
<div v-if="item.parent_id === 0">{{item.column_name}}</div>
|
<div v-if="item.parent_id === 0" class="task-column">{{item.column_name}}</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="3">
|
<Col span="3" class="row-priority">
|
||||||
<TaskPriority v-if="item.p_name && item.parent_id === 0" :backgroundColor="item.p_color">{{item.p_name}}</TaskPriority>
|
<TaskPriority v-if="item.p_name && item.parent_id === 0" :backgroundColor="item.p_color">{{item.p_name}}</TaskPriority>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="3" class="row-member">
|
<Col span="3" class="row-user">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(user, keyu) in item.task_user" :key="keyu" v-if="keyu < 3">
|
<li v-for="(user, keyu) in item.task_user" :key="keyu" v-if="keyu < 3">
|
||||||
<UserAvatar :userid="user.userid" size="32" :borderWitdh="2" :borderColor="item.color"/>
|
<UserAvatar :userid="user.userid" size="32" :borderWitdh="2" :borderColor="item.color"/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="3">
|
<Col span="3" class="row-time">
|
||||||
<ETooltip
|
<ETooltip
|
||||||
v-if="!item.complete_at && item.end_at"
|
v-if="!item.complete_at && item.end_at"
|
||||||
:class="['task-time', item.today ? 'today' : '', item.overdue ? 'overdue' : '']"
|
:class="['task-time', item.today ? 'today' : '', item.overdue ? 'overdue' : '']"
|
||||||
|
22
resources/assets/sass/manage-wrapper.scss
vendored
22
resources/assets/sass/manage-wrapper.scss
vendored
@ -112,14 +112,11 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0 8px 0 30px;
|
padding: 0 8px 0 30px;
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
margin: 4px auto;
|
margin: 4px auto;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: #333333;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -131,6 +128,19 @@
|
|||||||
background: url("data:image/svg+xml;base64,PHN2ZyB0PSIxNjIyMzkwODExNTQxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI0OTk3IiB3aWR0aD0iNDgiIGhlaWdodD0iNDgiPjxwYXRoIGQ9Ik0zNjYuMTgyNCAxMDguMjM2OEw4MTIuMDMyIDQyOC4wMzJhMTAyLjQgMTAyLjQgMCAwIDEgMCAxNjYuNTAyNEwzNjYuMTgyNCA5MTQuMzI5NmExMDIuNCAxMDIuNCAwIDAgMS0xNjIuMDk5Mi04My4yNTEyVjE5MS40ODhhMTAyLjQgMTAyLjQgMCAwIDEgMTYyLjA5OTItODMuMjUxMnoiIHAtaWQ9IjI0OTk4IiBmaWxsPSIjOTk5OTk5Ij48L3BhdGg+PC9zdmc+") no-repeat center center;
|
background: url("data:image/svg+xml;base64,PHN2ZyB0PSIxNjIyMzkwODExNTQxIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI0OTk3IiB3aWR0aD0iNDgiIGhlaWdodD0iNDgiPjxwYXRoIGQ9Ik0zNjYuMTgyNCAxMDguMjM2OEw4MTIuMDMyIDQyOC4wMzJhMTAyLjQgMTAyLjQgMCAwIDEgMCAxNjYuNTAyNEwzNjYuMTgyNCA5MTQuMzI5NmExMDIuNCAxMDIuNCAwIDAgMS0xNjIuMDk5Mi04My4yNTEyVjE5MS40ODhhMTAyLjQgMTAyLjQgMCAwIDEgMTYyLjA5OTItODMuMjUxMnoiIHAtaWQ9IjI0OTk4IiBmaWxsPSIjOTk5OTk5Ij48L3BhdGg+PC9zdmc+") no-repeat center center;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
|
.title {
|
||||||
|
flex: 1;
|
||||||
|
color: #333333;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
}
|
||||||
|
.num {
|
||||||
|
font-size: 12px;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
&.active {
|
&.active {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
103
resources/assets/sass/project-list.scss
vendored
103
resources/assets/sass/project-list.scss
vendored
@ -515,52 +515,9 @@
|
|||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0 0 10px #e6ecfa;
|
box-shadow: 0 0 10px #e6ecfa;
|
||||||
}
|
}
|
||||||
.task-rows {
|
|
||||||
.task-rows {
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
&:before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
box-shadow: rgb(0 0 0 / 8%) 0 0 8px 1px;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
.task-row {
|
|
||||||
background-color: #fcfcfd;
|
|
||||||
> div {
|
|
||||||
&.row-item {
|
|
||||||
padding-left: 56px;
|
|
||||||
.item-title {
|
|
||||||
color: #6C7D8C;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.task-row {
|
.task-row {
|
||||||
> div {
|
> div {
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
.task-time {
|
|
||||||
&.overdue,
|
|
||||||
&.today {
|
|
||||||
color: #ffffff;
|
|
||||||
padding: 1px 5px;
|
|
||||||
font-size: 13px;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
&.overdue {
|
|
||||||
font-weight: 600;
|
|
||||||
background-color: #ed4014;
|
|
||||||
}
|
|
||||||
&.today {
|
|
||||||
font-weight: 500;
|
|
||||||
background-color: #ff9900;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.row-title {
|
&.row-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@ -579,7 +536,7 @@
|
|||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.row-item {
|
&.row-name {
|
||||||
padding-left: 34px;
|
padding-left: 34px;
|
||||||
.loading {
|
.loading {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
@ -659,7 +616,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.row-member {
|
&.row-column {
|
||||||
|
.task-column {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.row-user {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
> ul {
|
> ul {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
@ -676,6 +640,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.row-time {
|
||||||
|
.task-time {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
&.overdue,
|
||||||
|
&.today {
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 1px 5px;
|
||||||
|
font-size: 13px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
&.overdue {
|
||||||
|
font-weight: 600;
|
||||||
|
background-color: #ed4014;
|
||||||
|
}
|
||||||
|
&.today {
|
||||||
|
font-weight: 500;
|
||||||
|
background-color: #ff9900;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
&.row-add {
|
&.row-add {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -689,7 +675,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.task-rows {
|
||||||
|
.task-rows {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
box-shadow: rgba(0, 0, 0, 0.08) 0 0 8px 1px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.task-row {
|
||||||
|
background-color: #fcfcfd;
|
||||||
|
> div {
|
||||||
|
&.row-name {
|
||||||
|
padding-left: 56px;
|
||||||
|
.item-title {
|
||||||
|
color: #6C7D8C;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user