This commit is contained in:
kuaifan 2021-12-11 11:04:09 +08:00
parent 42fc52a067
commit 49bbf826b9
19 changed files with 376 additions and 210 deletions

View File

@ -69,7 +69,7 @@ class ProjectController extends AbstractController
* - keys.name 项目名称
*
* @apiParam {Number} [page] 当前页,默认:1
* @apiParam {Number} [pagesize] 每页显示数量,默认:100,最大:200
* @apiParam {Number} [pagesize] 每页显示数量,默认:50,最大:100
*/
public function lists()
{
@ -93,13 +93,21 @@ class ProjectController extends AbstractController
//
$keys = Request::input('keys');
if (is_array($keys)) {
$buildClone = $builder->clone();
if ($keys['name']) {
$builder->where("projects.name", "like", "%{$keys['name']}%");
}
}
$list = $builder->orderByDesc('projects.id')->paginate(Base::getPaginate(200, 100));
$list = $builder->orderByDesc('projects.id')->paginate(Base::getPaginate(100, 50));
//
return Base::retSuccess('success', $list);
$data = $list->toArray();
if (isset($buildClone)) {
$data['total_all'] = $buildClone->count();
} else {
$data['total_all'] = $data['total'];
}
//
return Base::retSuccess('success', $data);
}
/**

View File

@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.3.56",
"version": "0.3.69",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",

434
public/css/app.css vendored
View File

@ -5900,74 +5900,87 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
background-repeat: no-repeat;
background-size: contain;
margin-right: 8px;
background-image: url("../images/file/other.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.upload:before {
background-image: url("../images/file/upload.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.updir:before {
background-image: url("../images/file/updir.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.folder:before {
background-image: url("../images/file/folder.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.document:before {
background-image: url("../images/file/document.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.mind:before {
background-image: url("../images/file/mind.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.sheet:before {
background-image: url("../images/file/sheet.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.flow:before {
background-image: url("../images/file/flow.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.word:before {
background-image: url("../images/file/word.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.excel:before {
background-image: url("../images/file/excel.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.ppt:before {
background-image: url("../images/file/ppt.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.compress:before {
background-image: url("../images/file/compress.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.image:before {
background-image: url("../images/file/image.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.media:before {
background-image: url("../images/file/media.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.pdf:before {
background-image: url("../images/file/pdf.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.text:before {
background-image: url("../images/file/text.svg");
.page-file .file-wrapper .file-table .file-nbox .file-name.archive:before {
background-image: url("../images/file/archive.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.cad:before {
background-image: url("../images/file/cad.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.other:before {
background-image: url("../images/file/other.svg");
.page-file .file-wrapper .file-table .file-nbox .file-name.code:before {
background-image: url("../images/file/code.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.document:before {
background-image: url("../images/file/document.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.excel:before {
background-image: url("../images/file/excel.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.flow:before {
background-image: url("../images/file/flow.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.folder:before {
background-image: url("../images/file/folder.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.media:before {
background-image: url("../images/file/media.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.mind:before {
background-image: url("../images/file/mind.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.ofd:before {
background-image: url("../images/file/ofd.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.pdf:before {
background-image: url("../images/file/pdf.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.picture:before {
background-image: url("../images/file/picture.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.ppt:before {
background-image: url("../images/file/ppt.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.sheet:before {
background-image: url("../images/file/sheet.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.tif:before {
background-image: url("../images/file/tif.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.txt:before {
background-image: url("../images/file/txt.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.updir:before {
background-image: url("../images/file/updir.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.upload:before {
background-image: url("../images/file/upload.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.word:before {
background-image: url("../images/file/word.svg");
}
.page-file .file-wrapper .file-table .file-nbox .file-name.wps:before {
background-image: url("../images/file/wps.svg");
}
.page-file .file-wrapper .file-table .file-nbox .taskfont {
@ -6069,6 +6082,7 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
background-size: contain;
margin-top: 12px;
position: relative;
background-image: url("../images/file/other.svg");
}
.page-file .file-wrapper .file-list > ul > li .file-icon .share-icon,
@ -6096,72 +6110,84 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
opacity: 0.38;
}
.page-file .file-wrapper .file-list > ul > li.upload .file-icon {
background-image: url("../images/file/upload.svg");
}
.page-file .file-wrapper .file-list > ul > li.updir .file-icon {
background-image: url("../images/file/updir.svg");
}
.page-file .file-wrapper .file-list > ul > li.folder .file-icon {
background-image: url("../images/file/folder.svg");
}
.page-file .file-wrapper .file-list > ul > li.document .file-icon {
background-image: url("../images/file/document.svg");
}
.page-file .file-wrapper .file-list > ul > li.mind .file-icon {
background-image: url("../images/file/mind.svg");
}
.page-file .file-wrapper .file-list > ul > li.sheet .file-icon {
background-image: url("../images/file/sheet.svg");
}
.page-file .file-wrapper .file-list > ul > li.flow .file-icon {
background-image: url("../images/file/flow.svg");
}
.page-file .file-wrapper .file-list > ul > li.word .file-icon {
background-image: url("../images/file/word.svg");
}
.page-file .file-wrapper .file-list > ul > li.excel .file-icon {
background-image: url("../images/file/excel.svg");
}
.page-file .file-wrapper .file-list > ul > li.ppt .file-icon {
background-image: url("../images/file/ppt.svg");
}
.page-file .file-wrapper .file-list > ul > li.compress .file-icon {
background-image: url("../images/file/compress.svg");
}
.page-file .file-wrapper .file-list > ul > li.image .file-icon {
background-image: url("../images/file/image.svg");
}
.page-file .file-wrapper .file-list > ul > li.media .file-icon {
background-image: url("../images/file/media.svg");
}
.page-file .file-wrapper .file-list > ul > li.pdf .file-icon {
background-image: url("../images/file/pdf.svg");
}
.page-file .file-wrapper .file-list > ul > li.text .file-icon {
background-image: url("../images/file/text.svg");
.page-file .file-wrapper .file-list > ul > li.archive .file-icon {
background-image: url("../images/file/archive.svg");
}
.page-file .file-wrapper .file-list > ul > li.cad .file-icon {
background-image: url("../images/file/cad.svg");
}
.page-file .file-wrapper .file-list > ul > li.other .file-icon {
background-image: url("../images/file/other.svg");
.page-file .file-wrapper .file-list > ul > li.code .file-icon {
background-image: url("../images/file/code.svg");
}
.page-file .file-wrapper .file-list > ul > li.document .file-icon {
background-image: url("../images/file/document.svg");
}
.page-file .file-wrapper .file-list > ul > li.excel .file-icon {
background-image: url("../images/file/excel.svg");
}
.page-file .file-wrapper .file-list > ul > li.flow .file-icon {
background-image: url("../images/file/flow.svg");
}
.page-file .file-wrapper .file-list > ul > li.folder .file-icon {
background-image: url("../images/file/folder.svg");
}
.page-file .file-wrapper .file-list > ul > li.media .file-icon {
background-image: url("../images/file/media.svg");
}
.page-file .file-wrapper .file-list > ul > li.mind .file-icon {
background-image: url("../images/file/mind.svg");
}
.page-file .file-wrapper .file-list > ul > li.ofd .file-icon {
background-image: url("../images/file/ofd.svg");
}
.page-file .file-wrapper .file-list > ul > li.pdf .file-icon {
background-image: url("../images/file/pdf.svg");
}
.page-file .file-wrapper .file-list > ul > li.picture .file-icon {
background-image: url("../images/file/picture.svg");
}
.page-file .file-wrapper .file-list > ul > li.ppt .file-icon {
background-image: url("../images/file/ppt.svg");
}
.page-file .file-wrapper .file-list > ul > li.sheet .file-icon {
background-image: url("../images/file/sheet.svg");
}
.page-file .file-wrapper .file-list > ul > li.tif .file-icon {
background-image: url("../images/file/tif.svg");
}
.page-file .file-wrapper .file-list > ul > li.txt .file-icon {
background-image: url("../images/file/txt.svg");
}
.page-file .file-wrapper .file-list > ul > li.updir .file-icon {
background-image: url("../images/file/updir.svg");
}
.page-file .file-wrapper .file-list > ul > li.upload .file-icon {
background-image: url("../images/file/upload.svg");
}
.page-file .file-wrapper .file-list > ul > li.word .file-icon {
background-image: url("../images/file/word.svg");
}
.page-file .file-wrapper .file-list > ul > li.wps .file-icon {
background-image: url("../images/file/wps.svg");
}
.page-file .file-wrapper .file-list > ul > li.highlight {
@ -6210,74 +6236,87 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
background-repeat: no-repeat;
background-size: contain;
margin-right: 8px;
background-image: url("../images/file/other.svg");
}
.page-file-dropdown-menu .file-item.upload:before {
background-image: url("../images/file/upload.svg");
}
.page-file-dropdown-menu .file-item.updir:before {
background-image: url("../images/file/updir.svg");
}
.page-file-dropdown-menu .file-item.folder:before {
background-image: url("../images/file/folder.svg");
}
.page-file-dropdown-menu .file-item.document:before {
background-image: url("../images/file/document.svg");
}
.page-file-dropdown-menu .file-item.mind:before {
background-image: url("../images/file/mind.svg");
}
.page-file-dropdown-menu .file-item.sheet:before {
background-image: url("../images/file/sheet.svg");
}
.page-file-dropdown-menu .file-item.flow:before {
background-image: url("../images/file/flow.svg");
}
.page-file-dropdown-menu .file-item.word:before {
background-image: url("../images/file/word.svg");
}
.page-file-dropdown-menu .file-item.excel:before {
background-image: url("../images/file/excel.svg");
}
.page-file-dropdown-menu .file-item.ppt:before {
background-image: url("../images/file/ppt.svg");
}
.page-file-dropdown-menu .file-item.compress:before {
background-image: url("../images/file/compress.svg");
}
.page-file-dropdown-menu .file-item.image:before {
background-image: url("../images/file/image.svg");
}
.page-file-dropdown-menu .file-item.media:before {
background-image: url("../images/file/media.svg");
}
.page-file-dropdown-menu .file-item.pdf:before {
background-image: url("../images/file/pdf.svg");
}
.page-file-dropdown-menu .file-item.text:before {
background-image: url("../images/file/text.svg");
.page-file-dropdown-menu .file-item.archive:before {
background-image: url("../images/file/archive.svg");
}
.page-file-dropdown-menu .file-item.cad:before {
background-image: url("../images/file/cad.svg");
}
.page-file-dropdown-menu .file-item.other:before {
background-image: url("../images/file/other.svg");
.page-file-dropdown-menu .file-item.code:before {
background-image: url("../images/file/code.svg");
}
.page-file-dropdown-menu .file-item.document:before {
background-image: url("../images/file/document.svg");
}
.page-file-dropdown-menu .file-item.excel:before {
background-image: url("../images/file/excel.svg");
}
.page-file-dropdown-menu .file-item.flow:before {
background-image: url("../images/file/flow.svg");
}
.page-file-dropdown-menu .file-item.folder:before {
background-image: url("../images/file/folder.svg");
}
.page-file-dropdown-menu .file-item.media:before {
background-image: url("../images/file/media.svg");
}
.page-file-dropdown-menu .file-item.mind:before {
background-image: url("../images/file/mind.svg");
}
.page-file-dropdown-menu .file-item.ofd:before {
background-image: url("../images/file/ofd.svg");
}
.page-file-dropdown-menu .file-item.pdf:before {
background-image: url("../images/file/pdf.svg");
}
.page-file-dropdown-menu .file-item.picture:before {
background-image: url("../images/file/picture.svg");
}
.page-file-dropdown-menu .file-item.ppt:before {
background-image: url("../images/file/ppt.svg");
}
.page-file-dropdown-menu .file-item.sheet:before {
background-image: url("../images/file/sheet.svg");
}
.page-file-dropdown-menu .file-item.tif:before {
background-image: url("../images/file/tif.svg");
}
.page-file-dropdown-menu .file-item.txt:before {
background-image: url("../images/file/txt.svg");
}
.page-file-dropdown-menu .file-item.updir:before {
background-image: url("../images/file/updir.svg");
}
.page-file-dropdown-menu .file-item.upload:before {
background-image: url("../images/file/upload.svg");
}
.page-file-dropdown-menu .file-item.word:before {
background-image: url("../images/file/word.svg");
}
.page-file-dropdown-menu .file-item.wps:before {
background-image: url("../images/file/wps.svg");
}
.page-file-drawer .overlay-content {
@ -6714,6 +6753,33 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
background-color: #ffffff;
}
.page-manage .manage-box-menu .manage-project-search {
width: 80%;
padding: 0 3px;
margin: 12px 0 -2px;
border-radius: 12px;
background-color: #ffffff;
overflow: hidden;
}
.page-manage .manage-box-menu .manage-project-search .ivu-input {
padding-left: 30px;
border-color: transparent;
background-color: transparent;
}
.page-manage .manage-box-menu .manage-project-search .ivu-input:hover, .page-manage .manage-box-menu .manage-project-search .ivu-input:focus {
box-shadow: none;
}
.page-manage .manage-box-menu .manage-project-search.loading .ivu-icon-ios-search {
animation: icon-loading-load 0.6s infinite linear;
}
.page-manage .manage-box-menu .manage-project-search.loading .ivu-icon-ios-search:before {
content: "\F45B";
}
.page-manage .manage-box-menu .manage-box-new {
width: 80%;
height: 38px;
@ -6993,7 +7059,7 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
border-bottom: 1px solid #efefef;
}
.page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loading {
.page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loading, .page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loaded {
margin: 0;
height: 52px;
display: flex;
@ -7001,7 +7067,7 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
justify-content: center;
}
.page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loading .common-loading {
.page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loading .common-loading, .page-messenger .messenger-wrapper .messenger-select .messenger-list > ul.contacts > li.loaded .common-loading {
width: 20px;
height: 20px;
margin: 0;
@ -9936,6 +10002,10 @@ body .ivu-drawer-bottom .ivu-drawer-content .ivu-drawer-close .ivu-icon {
margin-top: 6px;
}
.task-detail .task-info .scroller .add-input.loading .ivu-icon-ios-loading {
animation: icon-loading-load 0.6s infinite linear;
}
.task-detail .task-info .scroller .add-button {
cursor: pointer;
color: #bbbbbb;

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

1
public/js/build/107.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/build/312.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/js/build/750.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@
:before-upload="handleBeforeUpload"/>
</div>
<Spin fix v-if="uploadIng > 0">
<Icon type="ios-loading" class="upload-control-spin-icon-load"></Icon>
<Icon type="ios-loading" class="icon-loading"></Icon>
<div>{{$L('正在上传文件...')}}</div>
</Spin>
<Modal v-model="transfer" class="mdeditor-transfer" footer-hide fullscreen transfer :closable="false">
@ -52,7 +52,7 @@
@on-upload-image="handleUploadImageUpload"/>
</div>
<Spin fix v-if="uploadIng > 0">
<Icon type="ios-loading" class="upload-control-spin-icon-load"></Icon>
<Icon type="ios-loading" class="icon-loading"></Icon>
<div>{{$L('正在上传文件...')}}</div>
</Spin>
</Modal>

View File

@ -83,6 +83,12 @@
<Loading v-if="loadIng > 0"/>
</li>
</ul>
<div
v-if="projectTotal > 100"
class="manage-project-search"
:class="{loading:projectKeyLoading > 0}">
<Input prefix="ios-search" v-model="projectKeyValue" :placeholder="$L('共' + projectTotal + '个项目,搜索...')" clearable />
</div>
<Button class="manage-box-new" type="primary" icon="md-add" @click="onAddShow">{{$L('新建项目')}}</Button>
</div>
@ -192,6 +198,10 @@ export default {
columns: [],
projectKeyValue: '',
projectKeyAlready: {},
projectKeyLoading: 0,
openMenu: {},
visibleMenu: false,
show768Menu: false,
@ -232,6 +242,7 @@ export default {
'userIsAdmin',
'dialogs',
'projects',
'projectTotal',
'taskId',
'dialogMsgPush',
]),
@ -276,9 +287,14 @@ export default {
},
projectLists() {
return this.projects.sort((a, b) => {
const {projectKeyValue, projects} = this;
const data = projects.sort((a, b) => {
return b.id - a.id;
});
if (projectKeyValue) {
return data.filter(({name}) => name.toLowerCase().indexOf(projectKeyValue.toLowerCase()) > -1);
}
return data;
}
},
@ -339,6 +355,17 @@ export default {
}
},
projectKeyValue(val) {
if (val == '') {
return;
}
setTimeout(() => {
if (this.projectKeyValue == val) {
this.searchProject();
}
}, 600);
},
natificationHidden(val) {
clearTimeout(this.notificationTimeout);
if (!val) {
@ -455,6 +482,26 @@ export default {
});
},
searchProject() {
if (this.projectKeyAlready[this.projectKeyValue] === true) {
return;
}
this.projectKeyAlready[this.projectKeyValue] = true;
//
setTimeout(() => {
this.projectKeyLoading++;
}, 1000)
this.$store.dispatch("getProjects", {
keys: {
name: this.projectKeyValue
}
}).then(() => {
this.projectKeyLoading--;
}).catch(() => {
this.projectKeyLoading--;
});
},
selectChange(index) {
this.$nextTick(() => {
this.$set(this.addData, 'columns', this.columns[index].value.join(','));

View File

@ -322,6 +322,7 @@
class="add-input"
:placeholder="$L('+ 输入子任务,回车添加子任务')"
:icon="addsubLoad > 0 ? 'ios-loading' : ''"
:class="{loading: addsubLoad > 0}"
@on-blur="addsubChackClose"
@on-keydown="addsubKeydown"/>
<div v-else class="add-button" @click="addsubOpen">

View File

@ -180,6 +180,7 @@ export default {
state.userToken = userInfo.token;
state.userIsAdmin = state.method.inArray('admin', userInfo.identity);
state.method.setStorage("userInfo", state.userInfo);
state.projects = [];
dispatch("getProjects");
dispatch("getDialogs");
dispatch("websocketConnection");
@ -419,22 +420,30 @@ export default {
* 获取项目
* @param state
* @param dispatch
* @param data
* @returns {Promise<unknown>}
*/
getProjects({state, dispatch}) {
if (state.userId === 0) {
state.projects = [];
return;
}
if (state.cacheProjects.length > 0) {
state.projects = state.cacheProjects;
}
dispatch("call", {
url: 'project/lists',
}).then(result => {
state.projects = [];
dispatch("saveProject", result.data.data);
}).catch(e => {
console.error(e);
getProjects({state, dispatch}, data) {
return new Promise(function (resolve, reject) {
if (state.userId === 0) {
state.projects = [];
reject({msg: 'Parameter error'});
return;
}
if (state.cacheProjects.length > 0) {
state.projects = state.cacheProjects;
}
dispatch("call", {
url: 'project/lists',
data: data || {}
}).then(result => {
state.projectTotal = result.data.total_all;
dispatch("saveProject", result.data.data);
resolve(result)
}).catch(e => {
console.error(e);
reject(e)
});
});
},

View File

@ -305,6 +305,7 @@ state.fileContent = {};
// 项目任务
state.projectId = 0;
state.projects = [];
state.projectTotal = 0;
state.projectLoad = 0;
state.projectStatistics = {};
state.columns = [];

View File

@ -317,6 +317,11 @@
}
.add-input {
margin-top: 6px;
&.loading {
.ivu-icon-ios-loading {
animation: icon-loading-load 0.6s infinite linear;
}
}
}
.add-button {
cursor: pointer;

View File

@ -222,6 +222,31 @@
}
}
}
.manage-project-search {
width: 80%;
padding: 0 3px;
margin: 12px 0 -2px;
border-radius: 12px;
background-color: #ffffff;
overflow: hidden;
.ivu-input {
padding-left: 30px;
border-color: transparent;
background-color: transparent;
&:hover,
&:focus {
box-shadow: none;
}
}
&.loading {
.ivu-icon-ios-search {
animation: icon-loading-load 0.6s infinite linear;
&:before {
content: "\F45B";
}
}
}
}
.manage-box-new {
width: 80%;
height: 38px;