feat: 1.修复任务详情有图片时,无修改点击离开依然会保存的bug

2.修复任务详情图片过大时保存不成功的bug
	3.添加全局标注
This commit is contained in:
weifashi 2023-11-29 16:57:02 +08:00
parent 34c005001d
commit 79feaaf801
20 changed files with 128 additions and 27 deletions

View File

@ -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. 获取单个会话信息
*

View File

@ -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],

View File

@ -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("保存任务详情至文件失败,请重试");
}
//

View File

@ -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}"

View File

@ -1417,3 +1417,4 @@ APP推送
修改状态
移动任务
任务协助人
搜索项目名称

View File

@ -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 darticle",
"id": "Cari nama item"
}
]

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

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

View File

@ -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"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]

View File

@ -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)
}
}

View File

@ -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", {

View File

@ -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

View File

@ -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()
})

View File

@ -103,6 +103,7 @@ export default {
// 会话聊天
dialogId: 0,
dialogMsgId: 0,
dialogSearchMsgId: 0,
dialogIns: [],
dialogMsgs: [],