mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
no message
This commit is contained in:
parent
0e1d5e802c
commit
f34766ade0
@ -155,7 +155,7 @@ class UsersController extends AbstractController
|
|||||||
//
|
//
|
||||||
if (!Project::withTrashed()->whereUserid($user->userid)->wherePersonal(1)->exists()) {
|
if (!Project::withTrashed()->whereUserid($user->userid)->wherePersonal(1)->exists()) {
|
||||||
Project::createProject([
|
Project::createProject([
|
||||||
'name' => Doo::translate('个人项目'),
|
'name' => "📝 " . Doo::translate('个人项目'),
|
||||||
'desc' => Doo::translate('注册时系统自动创建项目,你可以自由删除。'),
|
'desc' => Doo::translate('注册时系统自动创建项目,你可以自由删除。'),
|
||||||
'personal' => 1,
|
'personal' => 1,
|
||||||
], $user->userid);
|
], $user->userid);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class AddProjectsPersonal extends Migration
|
|||||||
});
|
});
|
||||||
if ($isAdd) {
|
if ($isAdd) {
|
||||||
// 更新数据
|
// 更新数据
|
||||||
\App\Models\Project::whereName('个人项目')->chunkById(100, function ($lists) {
|
\App\Models\Project::where('name','like', '%个人项目%')->chunkById(100, function ($lists) {
|
||||||
/** @var \App\Models\Project $item */
|
/** @var \App\Models\Project $item */
|
||||||
foreach ($lists as $item) {
|
foreach ($lists as $item) {
|
||||||
if ($item->desc == '注册时系统自动创建项目,你可以自由删除。') {
|
if ($item->desc == '注册时系统自动创建项目,你可以自由删除。') {
|
||||||
|
|||||||
47
resources/assets/js/directives/emoji-class.js
vendored
47
resources/assets/js/directives/emoji-class.js
vendored
@ -169,6 +169,53 @@ function processEmoji(el, binding) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将文本中的emoji转换成HTML标签
|
||||||
|
* @param {string} text - 输入文本
|
||||||
|
* @param {string} className - 添加给emoji的类名
|
||||||
|
* @param {string} tagName - 包裹emoji的标签名,默认为'span'
|
||||||
|
* @returns {string} - 转换后的HTML字符串
|
||||||
|
*
|
||||||
|
* 示例:
|
||||||
|
* transformEmojiToHtml("我❤️你", "heart", "span")
|
||||||
|
* // 返回: "我<span class=\"heart\">❤️</span>你"
|
||||||
|
*/
|
||||||
|
export function transformEmojiToHtml(text, className, tagName = 'span') {
|
||||||
|
// 参数验证
|
||||||
|
if (typeof text !== 'string') return '';
|
||||||
|
if (!className || typeof className !== 'string') return text;
|
||||||
|
if (!tagName || typeof tagName !== 'string') tagName = 'span';
|
||||||
|
|
||||||
|
// 快速检查是否包含emoji
|
||||||
|
if (!containsEmoji(text)) return text;
|
||||||
|
|
||||||
|
// 重置正则索引并准备替换
|
||||||
|
emojiRegex.lastIndex = 0;
|
||||||
|
let result = '';
|
||||||
|
let lastIndex = 0;
|
||||||
|
let match;
|
||||||
|
|
||||||
|
// 逐个匹配emoji并替换
|
||||||
|
while ((match = emojiRegex.exec(text)) !== null) {
|
||||||
|
// 添加emoji前的文本
|
||||||
|
if (match.index > lastIndex) {
|
||||||
|
result += text.substring(lastIndex, match.index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加包装后的emoji
|
||||||
|
result += `<${tagName} class="${className}">${match[0]}</${tagName}>`;
|
||||||
|
|
||||||
|
lastIndex = emojiRegex.lastIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加剩余文本
|
||||||
|
if (lastIndex < text.length) {
|
||||||
|
result += text.substring(lastIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// 创建防抖处理函数 - 使用更短的防抖时间提高响应速度
|
// 创建防抖处理函数 - 使用更短的防抖时间提高响应速度
|
||||||
const debouncedProcessEmoji = debounce(processEmoji, 20);
|
const debouncedProcessEmoji = debounce(processEmoji, 20);
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,7 @@
|
|||||||
@click="toggleRoute('project', {projectId: item.id})">
|
@click="toggleRoute('project', {projectId: item.id})">
|
||||||
<div class="project-h1">
|
<div class="project-h1">
|
||||||
<em @click.stop="toggleOpenMenu(item.id)"></em>
|
<em @click.stop="toggleOpenMenu(item.id)"></em>
|
||||||
<div class="title">{{item.name}}</div>
|
<div class="title" v-html="transformEmojiToHtml(item.name, 'no-dark-content')"></div>
|
||||||
<div v-if="item.top_at" class="icon-top"></div>
|
<div v-if="item.top_at" class="icon-top"></div>
|
||||||
<div v-if="item.task_my_num - item.task_my_complete > 0" class="num">{{item.task_my_num - item.task_my_complete}}</div>
|
<div v-if="item.task_my_num - item.task_my_complete > 0" class="num">{{item.task_my_num - item.task_my_complete}}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -388,6 +388,7 @@ import ApproveDetails from "./manage/approve/details.vue";
|
|||||||
import notificationKoro from "notification-koro1";
|
import notificationKoro from "notification-koro1";
|
||||||
import emitter from "../store/events";
|
import emitter from "../store/events";
|
||||||
import SearchBox from "../components/SearchBox.vue";
|
import SearchBox from "../components/SearchBox.vue";
|
||||||
|
import {transformEmojiToHtml} from "../directives/emoji-class";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -753,6 +754,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
transformEmojiToHtml,
|
||||||
chackPass() {
|
chackPass() {
|
||||||
if (this.userInfo.changepass === 1) {
|
if (this.userInfo.changepass === 1) {
|
||||||
this.goForward({name: 'manage-setting-password'});
|
this.goForward({name: 'manage-setting-password'});
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<div class="project-item">
|
<div class="project-item">
|
||||||
<div class="item-left">
|
<div class="item-left">
|
||||||
<div class="project-h1">
|
<div class="project-h1">
|
||||||
<div class="project-name">{{item.name}}</div>
|
<div class="project-name" v-html="transformEmojiToHtml(item.name, 'no-dark-content')"></div>
|
||||||
<div v-if="item.top_at" class="icon-top"></div>
|
<div v-if="item.top_at" class="icon-top"></div>
|
||||||
<div v-if="item.task_my_num - item.task_my_complete > 0" class="num">{{item.task_my_num - item.task_my_complete}}</div>
|
<div v-if="item.task_my_num - item.task_my_complete > 0" class="num">{{item.task_my_num - item.task_my_complete}}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -86,6 +86,7 @@
|
|||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
import longpress from "../../../directives/longpress";
|
import longpress from "../../../directives/longpress";
|
||||||
import TransferDom from "../../../directives/transfer-dom";
|
import TransferDom from "../../../directives/transfer-dom";
|
||||||
|
import {transformEmojiToHtml} from "../../../directives/emoji-class";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ProjectList",
|
name: "ProjectList",
|
||||||
@ -139,6 +140,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
transformEmojiToHtml,
|
||||||
searchProject() {
|
searchProject() {
|
||||||
this.projectKeyLoading++;
|
this.projectKeyLoading++;
|
||||||
this.$store.dispatch("getProjects", {
|
this.$store.dispatch("getProjects", {
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<div class="project-back" @click="onBack">
|
<div class="project-back" @click="onBack">
|
||||||
<i class="taskfont"></i>
|
<i class="taskfont"></i>
|
||||||
</div>
|
</div>
|
||||||
<h1 @click="showName" class="user-select-auto">{{projectData.name}}</h1>
|
<h1 @click="showName" class="user-select-auto" v-html="transformEmojiToHtml(projectData.name, 'no-dark-content')"></h1>
|
||||||
<div v-if="loading" class="project-load"><Loading/></div>
|
<div v-if="loading" class="project-load"><Loading/></div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="project-icons">
|
<ul class="project-icons">
|
||||||
@ -575,6 +575,7 @@ import UserSelect from "../../../components/UserSelect.vue";
|
|||||||
import UserAvatarTip from "../../../components/UserAvatar/tip.vue";
|
import UserAvatarTip from "../../../components/UserAvatar/tip.vue";
|
||||||
import VMPreviewNostyle from "../../../components/VMEditor/nostyle.vue";
|
import VMPreviewNostyle from "../../../components/VMEditor/nostyle.vue";
|
||||||
import emitter from "../../../store/events";
|
import emitter from "../../../store/events";
|
||||||
|
import {transformEmojiToHtml} from "../../../directives/emoji-class";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ProjectPanel",
|
name: "ProjectPanel",
|
||||||
@ -1074,6 +1075,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
transformEmojiToHtml,
|
||||||
showName() {
|
showName() {
|
||||||
if (this.windowLandscape) {
|
if (this.windowLandscape) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin: 32px 20px 16px;
|
margin: 32px 32px 16px;
|
||||||
border-bottom: 1px solid #F4F4F5;
|
border-bottom: 1px solid #F4F4F5;
|
||||||
|
|
||||||
.calendar-titbox {
|
.calendar-titbox {
|
||||||
@ -71,7 +71,7 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 0 48px 6px;
|
padding: 0 32px 6px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user