mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-04 19:08:14 +00:00
feat: 1.修复任务详情有图片时,无修改点击离开依然会保存的bug
2.修复任务详情图片过大时保存不成功的bug 3.添加全局标注
This commit is contained in:
parent
34c005001d
commit
79feaaf801
@ -134,6 +134,37 @@ class DialogController extends AbstractController
|
||||
return Base::retSuccess('success', $list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/search/tag 02. 搜索标注会话
|
||||
*
|
||||
* @apiDescription 根据消息关键词搜索相关会话,需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
* @apiGroup dialog
|
||||
* @apiName search__tag
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
* @apiSuccess {Object} data 返回数据
|
||||
*/
|
||||
public function search__tag()
|
||||
{
|
||||
$user = User::auth();
|
||||
// 搜索会话
|
||||
$msgs = WebSocketDialog::select(['web_socket_dialogs.*', 'u.top_at', 'u.mark_unread', 'u.silence', 'u.color', 'u.updated_at as user_at', 'm.id as search_msg_id'])
|
||||
->join('web_socket_dialog_users as u', 'web_socket_dialogs.id', '=', 'u.dialog_id')
|
||||
->join('web_socket_dialog_msgs as m', 'web_socket_dialogs.id', '=', 'm.dialog_id')
|
||||
->where('u.userid', $user->userid)
|
||||
->where('m.tag', '>', 0)
|
||||
->orderByDesc('m.id')
|
||||
->take(50)
|
||||
->get();
|
||||
$msgs->transform(function (WebSocketDialog $item) use ($user) {
|
||||
return $item->formatData($user->userid);
|
||||
});
|
||||
//
|
||||
return Base::retSuccess('success', $msgs->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {get} api/dialog/one 03. 获取单个会话信息
|
||||
*
|
||||
|
||||
@ -105,11 +105,11 @@ class ProjectPermission extends AbstractModel
|
||||
self::TASK_LIST_REMOVE => [self::PERMISSIONS['project_leader']],
|
||||
self::TASK_LIST_SORT => $projectTaskList,
|
||||
self::TASK_ADD => $projectTaskList,
|
||||
self::TASK_UPDATE => $taskUpdate = [self::PERMISSIONS['project_leader'], self::PERMISSIONS['task_leader'], self::PERMISSIONS['task_assist']],
|
||||
self::TASK_STATUS => [self::PERMISSIONS['project_leader'], self::PERMISSIONS['task_leader']],
|
||||
self::TASK_REMOVE => $taskUpdate,
|
||||
self::TASK_ARCHIVED => $taskUpdate,
|
||||
self::TASK_MOVE => $taskUpdate
|
||||
self::TASK_UPDATE => [self::PERMISSIONS['project_leader'], self::PERMISSIONS['task_leader'], self::PERMISSIONS['task_assist']],
|
||||
self::TASK_STATUS => $taskStatus = [self::PERMISSIONS['project_leader'], self::PERMISSIONS['task_leader']],
|
||||
self::TASK_REMOVE => $taskStatus,
|
||||
self::TASK_ARCHIVED => $taskStatus,
|
||||
self::TASK_MOVE => $taskStatus
|
||||
];
|
||||
return self::firstOrCreate(
|
||||
['project_id' => $projectId],
|
||||
|
||||
@ -60,6 +60,8 @@ class ProjectTaskContent extends AbstractModel
|
||||
*/
|
||||
public static function saveContent($task_id, $content)
|
||||
{
|
||||
@ini_set("pcre.backtrack_limit", 999999999);
|
||||
//
|
||||
$oldContent = $content;
|
||||
$path = 'uploads/task/content/' . date("Ym") . '/' . $task_id . '/';
|
||||
//
|
||||
@ -80,11 +82,7 @@ class ProjectTaskContent extends AbstractModel
|
||||
$publicPath = public_path($filePath);
|
||||
Base::makeDir(dirname($publicPath));
|
||||
$result = file_put_contents($publicPath, $content);
|
||||
if(!$result){
|
||||
// todo 记录失败日志便于追查具体原因
|
||||
info("保存任务详情至文件失败");
|
||||
info($publicPath);
|
||||
info($oldContent);
|
||||
if(!$result && $oldContent){
|
||||
throw new ApiException("保存任务详情至文件失败,请重试");
|
||||
}
|
||||
//
|
||||
|
||||
@ -150,7 +150,7 @@ services:
|
||||
|
||||
approve:
|
||||
container_name: "dootask-approve-${APP_ID}"
|
||||
image: "kuaifan/dooapprove:0.0.8"
|
||||
image: "kuaifan/dooapprove:0.0.9"
|
||||
environment:
|
||||
TZ: "${TIMEZONE:-PRC}"
|
||||
MYSQL_HOST: "${DB_HOST}"
|
||||
|
||||
@ -1417,3 +1417,4 @@ APP推送
|
||||
修改状态
|
||||
移动任务
|
||||
任务协助人
|
||||
搜索项目名称
|
||||
|
||||
@ -18643,5 +18643,16 @@
|
||||
"de": "Auftrag autorisiert.",
|
||||
"fr": "Autorisations de tâches",
|
||||
"id": "Hak akses tugas"
|
||||
},
|
||||
{
|
||||
"key": "搜索项目名称",
|
||||
"zh": "",
|
||||
"zh-CHT": "搜索項目名稱",
|
||||
"en": "Search project name",
|
||||
"ko": "검색 항목 이름",
|
||||
"ja": "項目名を検索します",
|
||||
"de": "Name des suchprojekts:",
|
||||
"fr": "Recherche par nom d’article",
|
||||
"id": "Cari nama item"
|
||||
}
|
||||
]
|
||||
2
public/language/web/de.js
vendored
2
public/language/web/de.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/en.js
vendored
2
public/language/web/en.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/fr.js
vendored
2
public/language/web/fr.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/id.js
vendored
2
public/language/web/id.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/ja.js
vendored
2
public/language/web/ja.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/key.js
vendored
2
public/language/web/key.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/ko.js
vendored
2
public/language/web/ko.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/zh-CHT.js
vendored
2
public/language/web/zh-CHT.js
vendored
File diff suppressed because one or more lines are too long
2
public/language/web/zh.js
vendored
2
public/language/web/zh.js
vendored
@ -1 +1 @@
|
||||
if(typeof window.LANGUAGE_DATA==="undefined")window.LANGUAGE_DATA={};window.LANGUAGE_DATA["zh"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
|
||||
if(typeof window.LANGUAGE_DATA==="undefined")window.LANGUAGE_DATA={};window.LANGUAGE_DATA["zh"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
|
||||
@ -81,7 +81,7 @@
|
||||
<div v-if="completedCount > 0" class="project-checkbox">
|
||||
<Checkbox :value="projectData.cacheParameter.completedTask" @on-change="toggleCompleted">{{$L('显示已完成')}}</Checkbox>
|
||||
</div>
|
||||
<div v-if="flowList.length > 0" class="project-select">
|
||||
<div class="project-select">
|
||||
<Cascader ref="flow" :data="flowData" @on-change="flowChange" transfer-class-name="project-panel-flow-cascader" transfer>
|
||||
<span :class="`project-flow ${flowInfo.status || ''}`">{{ flowTitle }}</span>
|
||||
</Cascader>
|
||||
@ -857,7 +857,7 @@ export default {
|
||||
//
|
||||
const {project_user} = this.projectData;
|
||||
if ($A.isArray(project_user)) {
|
||||
const userItems = project_user.map((item, index) => {
|
||||
let userItems = project_user.map((item, index) => {
|
||||
const userInfo = cacheUserBasic.find(({userid}) => userid === item.userid) || {}
|
||||
const length = allTask.filter(({task_user, complete_at}) => {
|
||||
if (!this.projectData.cacheParameter.completedTask) {
|
||||
@ -870,12 +870,18 @@ export default {
|
||||
return {
|
||||
value: `user:${userInfo.userid}`,
|
||||
label: `${userInfo.nickname} (${length})`,
|
||||
class: `user-${index}`,
|
||||
userid: userInfo.userid || 0,
|
||||
length,
|
||||
}
|
||||
}).filter(({userid, length}) => userid > 0 && length > 0)
|
||||
if (userItems.length > 0) {
|
||||
userItems.sort((a, b) => {
|
||||
return a.userid == this.userId ? -1 : 1
|
||||
})
|
||||
userItems = userItems.map((item, index)=>{
|
||||
item.class = `user-${index}`
|
||||
return item;
|
||||
})
|
||||
list.push(...userItems)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1073,6 +1073,9 @@ export default {
|
||||
if (content == this.taskContent) {
|
||||
return;
|
||||
}
|
||||
if (content == this.taskContent.replace(/original-width="[^"]*"/g, "").replace(/original-height="[^"]*"/g, "").replace(/\" \//g, "\" /")) {
|
||||
return;
|
||||
}
|
||||
this.$set(this.taskDetail, 'content', content)
|
||||
successCallback = () => {
|
||||
this.$store.dispatch("saveTaskContent", {
|
||||
|
||||
@ -61,7 +61,8 @@
|
||||
:class="dialogClass(dialog)"
|
||||
@click="openDialog({
|
||||
dialog_id: dialog.id,
|
||||
search_msg_id: dialog.search_msg_id
|
||||
dialog_msg_id: dialog.search_msg_id,
|
||||
search_msg_id: dialog.search_msg_id,
|
||||
})"
|
||||
v-longpress="handleLongpress"
|
||||
:style="{'background-color':dialog.color}">
|
||||
@ -109,9 +110,12 @@
|
||||
<div class="dialog-line"></div>
|
||||
</li>
|
||||
</template>
|
||||
<li v-else-if="dialogSearchLoad === 0" class="nothing">
|
||||
<li v-else-if="dialogSearchLoad === 0 && dialogMarkLoad === 0" class="nothing">
|
||||
{{$L(dialogSearchKey ? `没有任何与"${dialogSearchKey}"相关的会话` : `没有任何会话`)}}
|
||||
</li>
|
||||
<li v-else class="nothing">
|
||||
<Loading/>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-else class="contacts">
|
||||
<template v-if="contactsFilter.length === 0">
|
||||
@ -230,6 +234,7 @@ export default {
|
||||
{type: 'user', name: '单聊'},
|
||||
{type: 'group', name: '群聊'},
|
||||
{type: 'bot', name: '机器人'},
|
||||
{type: 'mark', name: '标注'},
|
||||
],
|
||||
dialogHistory: MessengerObject.menuHistory,
|
||||
|
||||
@ -246,6 +251,8 @@ export default {
|
||||
operateVisible: false,
|
||||
|
||||
clickAgainSubscribe: null,
|
||||
|
||||
dialogMarkLoad: 0,
|
||||
}
|
||||
},
|
||||
|
||||
@ -286,7 +293,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['cacheDialogs', 'loadDialogs', 'dialogId', 'messengerSearchKey', 'appNotificationPermission', 'taskColorList']),
|
||||
...mapState(['cacheDialogs', 'loadDialogs', 'dialogId', 'dialogMsgId', 'dialogMsgs', 'messengerSearchKey', 'appNotificationPermission', 'taskColorList']),
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
@ -332,6 +339,19 @@ export default {
|
||||
if (dialogActive == '' && dialogSearchKey == '') {
|
||||
return this.cacheDialogs.filter(dialog => this.filterDialog(dialog)).sort(this.dialogSort);
|
||||
}
|
||||
if(dialogActive == 'mark' && !dialogSearchKey){
|
||||
const lists = [];
|
||||
this.dialogMsgs.filter(h=>h.tag).forEach(h=>{
|
||||
let dialog = $A.cloneJSON(this.cacheDialogs).find(p=>p.id == h.dialog_id)
|
||||
if(dialog){
|
||||
dialog.last_msg = h;
|
||||
dialog.search_msg_id = h.id;
|
||||
lists.push(dialog);
|
||||
}
|
||||
});
|
||||
this.searchTagDialog()
|
||||
return lists;
|
||||
}
|
||||
const list = this.cacheDialogs.filter(dialog => {
|
||||
if (!this.filterDialog(dialog)) {
|
||||
return false;
|
||||
@ -542,6 +562,10 @@ export default {
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
||||
dialogActive(){
|
||||
this.dialogSearchList = [];
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -612,7 +636,7 @@ export default {
|
||||
}
|
||||
return {
|
||||
top: dialog.top_at,
|
||||
active: dialog.id == this.dialogId,
|
||||
active: dialog.id == this.dialogId && (dialog.search_msg_id == this.dialogMsgId || !this.dialogMsgId),
|
||||
operate: this.operateVisible && dialog.id == this.operateItem.id,
|
||||
completed: $A.dialogCompleted(dialog)
|
||||
}
|
||||
@ -758,6 +782,29 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
searchTagDialog() {
|
||||
//
|
||||
this.dialogMarkLoad++;
|
||||
this.$store.dispatch("call", {
|
||||
url: 'dialog/search/tag',
|
||||
}).then(({data}) => {
|
||||
const msgIds = [];
|
||||
const lists = [];
|
||||
this.dialogList.forEach(h=>{
|
||||
lists.push(h);
|
||||
msgIds.push(h.search_msg_id)
|
||||
});
|
||||
data.some(item => {
|
||||
if (!item.last_msg || !msgIds.includes(item.search_msg_id)) {
|
||||
lists.push(Object.assign(item, {is_search: true}))
|
||||
}
|
||||
})
|
||||
this.dialogSearchList = lists;
|
||||
}).finally(_ => {
|
||||
this.dialogMarkLoad--;
|
||||
});
|
||||
},
|
||||
|
||||
getContactsList(page) {
|
||||
this.contactsLoad++;
|
||||
const key = this.contactsKey
|
||||
|
||||
3
resources/assets/js/store/actions.js
vendored
3
resources/assets/js/store/actions.js
vendored
@ -2485,13 +2485,16 @@ export default {
|
||||
openDialog({state, dispatch}, dialog_id) {
|
||||
return new Promise(resolve => {
|
||||
let search_msg_id;
|
||||
let dialog_msg_id;
|
||||
if ($A.isJson(dialog_id)) {
|
||||
search_msg_id = dialog_id.search_msg_id;
|
||||
dialog_msg_id = dialog_id.dialog_msg_id;
|
||||
dialog_id = dialog_id.dialog_id;
|
||||
}
|
||||
//
|
||||
requestAnimationFrame(_ => {
|
||||
state.dialogSearchMsgId = /^\d+$/.test(search_msg_id) ? search_msg_id : 0;
|
||||
state.dialogMsgId = /^\d+$/.test(dialog_msg_id) ? dialog_msg_id : 0;
|
||||
state.dialogId = /^\d+$/.test(dialog_id) ? dialog_id : 0;
|
||||
resolve()
|
||||
})
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -103,6 +103,7 @@ export default {
|
||||
|
||||
// 会话聊天
|
||||
dialogId: 0,
|
||||
dialogMsgId: 0,
|
||||
dialogSearchMsgId: 0,
|
||||
dialogIns: [],
|
||||
dialogMsgs: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user