Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
limoxi committed Aug 30, 2024
1 parent 007d085 commit 8a24c08
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 134 deletions.
62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"build": "vite build"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"@vue/compiler-sfc": "^3.4.31",
"@vitejs/plugin-vue": "^5.1.3",
"@vue/compiler-sfc": "^3.4.38",
"autoprefixer-loader": "^3.2.0",
"less": "^4.2.0",
"less-loader": "^12.2.0",
"vite": "5.3.3",
"vite": "5.4.2",
"vue-style-loader": "^4.1.3"
},
"dependencies": {
Expand All @@ -30,47 +30,47 @@
"@milkdown/theme-nord": "^6.5.4",
"@milkdown/utils": "^6.5.4",
"@milkdown/vue": "^6.5.4",
"@primevue/themes": "^4.0.0",
"@primevue/themes": "^4.0.5",
"@remixicon/vue": "^4.2.0",
"@tiptap-pro/extension-file-handler": "^2.10.5",
"@tiptap/core": "^2.5.4",
"@tiptap/extension-bubble-menu": "^2.5.0",
"@tiptap/extension-color": "^2.5.1",
"@tiptap/extension-highlight": "^2.4.0",
"@tiptap/extension-image": "^2.5.0",
"@tiptap/extension-link": "^2.4.0",
"@tiptap/extension-list-item": "^2.5.4",
"@tiptap/extension-mention": "^2.5.4",
"@tiptap/extension-ordered-list": "^2.5.4",
"@tiptap/extension-placeholder": "^2.5.4",
"@tiptap/extension-task-item": "^2.5.4",
"@tiptap/extension-task-list": "^2.5.4",
"@tiptap/extension-text-style": "^2.5.1",
"@tiptap/extension-underline": "^2.4.0",
"@tiptap/pm": "^2.4.0",
"@tiptap/starter-kit": "^2.4.0",
"@tiptap/suggestion": "^2.5.4",
"@tiptap/vue-3": "^2.4.0",
"autoprefixer": "^10.4.19",
"axios": "1.7.2",
"@tiptap/core": "^2.6.6",
"@tiptap/extension-bubble-menu": "^2.6.6",
"@tiptap/extension-color": "^2.6.6",
"@tiptap/extension-highlight": "^2.6.6",
"@tiptap/extension-image": "^2.6.6",
"@tiptap/extension-link": "^2.6.6",
"@tiptap/extension-list-item": "^2.6.6",
"@tiptap/extension-mention": "^2.6.6",
"@tiptap/extension-ordered-list": "^2.6.6",
"@tiptap/extension-placeholder": "^2.6.6",
"@tiptap/extension-task-item": "^2.6.6",
"@tiptap/extension-task-list": "^2.6.6",
"@tiptap/extension-text-style": "^2.6.6",
"@tiptap/extension-underline": "^2.6.6",
"@tiptap/pm": "^2.6.6",
"@tiptap/starter-kit": "^2.6.6",
"@tiptap/suggestion": "^2.6.6",
"@tiptap/vue-3": "^2.6.6",
"autoprefixer": "^10.4.20",
"axios": "1.7.5",
"clipboard": "^2.0.11",
"echarts": "^5.5.1",
"event-source-polyfill": "^1.0.31",
"js-cookie": "^3.0.5",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"moment-range": "^4.0.2",
"pinia": "^2.1.7",
"pinia": "^2.2.2",
"pinyin-match": "^1.2.5",
"primevue": "^4.0.0",
"qs": "^6.12.3",
"primevue": "^4.0.4",
"qs": "^6.13.0",
"remixicon": "^4.3.0",
"tippy.js": "^6.3.7",
"view-ui-plus": "^1.3.18",
"view-ui-plus": "^1.3.19",
"vite-plugin-html": "^3.2.2",
"vue": "^3.4.31",
"vue-echarts": "^6.7.3",
"vue-router": "^4.4.0",
"vue": "^3.4.38",
"vue-echarts": "^7.0.3",
"vue-router": "^4.4.3",
"vue3-colorpicker": "^2.3.0",
"vuedraggable": "^4.1.0"
}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/styles/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ html {

@font-face {
font-family: teamdo;
src: url('./main.ttf');
src: url('./min-pmzd2.ttf');
}

.ProseMirror [contenteditable="false"] {
Expand Down Expand Up @@ -167,11 +167,11 @@ button:focus, button:active {
background: linear-gradient(to left, cornflowerblue 6px, 6px, white);
}

.hide{
.hide {
display: none !important;
}

.bgt{
.bgt {
background-color: transparent !important;
}

Expand Down
Binary file added src/assets/styles/min-pmzd2.ttf
Binary file not shown.
10 changes: 7 additions & 3 deletions src/components/editor_tiptap/editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<editor-content v-if="editor" :editor="editor" :class="classes" @click="onClickEditor"/>
</div>
<ImagePreview
v-model="showImage"
:preview-list="previewImages"/>
v-model="showImage"
:preview-list="previewImages"/>
</template>

<script setup>
Expand Down Expand Up @@ -126,7 +126,11 @@ const setContent = (content) => {
defineExpose({
getContent: () => {
return editor.value.getHTML()
let content = editor.value.getHTML()
if (content === '<p></p>') { // fix empty situation
content = ''
}
return content
},
getAttentions: () => {
const jsonData = editor.value.getJSON()
Expand Down
64 changes: 31 additions & 33 deletions src/components/modal/task_modal.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<Modal
v-model="taskModal.show"
:closable="false"
:lock-scroll="true"
:mask-closable="false"
class="aui-task-model"
footer-hide
style="top:8%"
width="65%"
v-model="taskModal.show"
:closable="false"
:lock-scroll="true"
:mask-closable="false"
class="aui-task-model"
footer-hide
style="top:8%"
width="65%"
>
<template #header>
<div class="aui-i-title">{{title}}</div>
<div class="aui-i-title">{{ title }}</div>
<div class="aui-i-action-bar">
<Icon v-if="!isCreateMode" class="aui-i-action-btn delete" type="md-trash" @click="handleDelete"/>
<Icon class="aui-i-action-btn save" type="md-done-all" @click="handleSubmit"/>
Expand All @@ -26,14 +26,14 @@
<FormItem label="任务类型" prop="type" style="float: left">
<Select v-model="form.type" aria-label="typeSelector" style="width:180px">
<Option v-for="option in taskTypeOptions" :key="option.value" :value="option.value">
{{option.label}}
{{ option.label }}
</Option>
</Select>
</FormItem>
<FormItem label="优先级" prop="importance" style="display: inline-block">
<Select v-model="form.importance" aria-label="importanceSelector" style="width:180px">
<Option v-for="option in importanceOptions" :key="option.value" :value="option.value">
{{option.label}}
{{ option.label }}
</Option>
</Select>
</FormItem>
Expand All @@ -46,20 +46,20 @@
</FormItem>
<FormItem :label="nameLabel" prop="name">
<Input
v-model="form.name"
:autosize="{minRows: 1,maxRows: 3}"
:maxlength="48"
:placeholder="form.type==='REQ'?'某人可以在何时何处做某事': ''"
show-word-limit
style="width: 90%" type="textarea"></Input>
v-model="form.name"
:autosize="{minRows: 1,maxRows: 3}"
:maxlength="48"
:placeholder="form.type==='REQ'?'某人可以在何时何处做某事': ''"
show-word-limit
style="width: 90%" type="textarea"></Input>
</FormItem>
<FormItem label="故事点" prop="sp">
<InputNumber
v-model="form.sp"
:max="28"
:min="0"
:precision="0"
:step="1"
v-model="form.sp"
:max="28"
:min="0"
:precision="0"
:step="1"
></InputNumber>
<span class="aui-i-spRemark">
<Icon type="md-alert"/>
Expand All @@ -78,7 +78,7 @@
</span>
</span>
<span v-if="userCount > 0" class="aui-i-users">
<span>参与者({{userCount}})&nbsp;&nbsp;</span>
<span>参与者({{ userCount }})&nbsp;&nbsp;</span>
<Tooltip v-for="user in task.users" :key="user.id" :content="user.nickname">
<Avatar :src="user.avatar||defaultAvatar" size="small"></Avatar>
</Tooltip>
Expand All @@ -89,22 +89,22 @@
:color="tag.color" closable type="dot"
@on-close="handleCloseTag(tag)"
>
{{tag.name}}
{{ tag.name }}
</Tag>
<Select
v-model="selectedTagId"
class="aui-i-tagFilter"
clearable
filterable
placeholder="添加标签"
@on-select="handleSelectTag"
v-model="selectedTagId"
class="aui-i-tagFilter"
clearable
filterable
placeholder="添加标签"
@on-select="handleSelectTag"
>
<Option v-for="tag in project.getTagsByBiz('normal_task')" :key="tag.id" :value="tag.id">
<Badge :color="tag.color" :text="tag.name"/>
</Option>
</Select>
</FormItem>
<FormItem label="详细描述" prop="desc">
<FormItem label="详细描述" prop="desc" v-if="taskModal.show">
<Editor v-if="!isCreateMode && task.createdAt<'2024-07-22 00:00:00'" ref="editorInst" :content="form.desc"/>
<TipTapEditor v-else ref="editorInst" :content="form.desc"></TipTapEditor>
</FormItem>
Expand Down Expand Up @@ -200,8 +200,6 @@ modalStore.$subscribe((_, state) => {
form.value.assignors = store.task?.users.filter(u => u.is_assignor) || []
form.value.tags = store.task?.tags || []
form.value.desc = store.task?.desc || ''
editorInst.value.resetContent(store.task?.desc || '')
selectedTagId.value = ''
}
})
Expand Down
22 changes: 13 additions & 9 deletions src/views/project/epics_action_bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@
clearable
v-model="selectedCreatorId"
placeholder="维护人"
@on-query-change="(query) => {queryAssignor = query}"
:remote-method="searchUser"
@on-change="handleSearch"
class="aui-i-filter"
>
<Option v-for="member in project.users.filter(user => {
return !!(PinyinMatch.match(user.nickname, queryAssignor))
|| user.nickname === queryAssignor
|| queryAssignor === ''
})" :value="member.id" :key="member.id">
<Option v-for="member in selectableUsers" :value="member.id" :key="member.id">
<img class="aui-user-selector-avatar" :src="member.avatar || defaultAvatar" alt="avatar"/> {{
member.nickname
}}
Expand Down Expand Up @@ -67,7 +63,7 @@ import ShareTasksModal from '@/components/modal/share_tasks_modal'
import {Icon, Message} from "view-ui-plus"
import {useModalStore, useTaskFilterStore, useTaskModeStore} from '@/store'
import {storeToRefs} from "pinia"
import PinyinMatch from "pinyin-match"
import PinyinMatch from "pinyin-match";
const modalStore = useModalStore()
const taskFilterStore = useTaskFilterStore()
Expand All @@ -76,8 +72,6 @@ const {updated: updated} = storeToRefs(taskFilterStore)
const taskModeStore = useTaskModeStore()
const {selectedTasks} = storeToRefs(taskModeStore)
const queryAssignor = ref('')
const project = inject('project')
const projectId = computed(() => project.value.id)
Expand All @@ -92,6 +86,8 @@ const filteredTaskInfo = ref('')
const selectedCreatorId = ref(0)
let showShareModal = ref(false)
const selectableUsers = ref(project.value?.users || [])
watch(showShareModal, (newVal, oldVal) => {
if (!newVal) {
onSwitchMode()
Expand All @@ -105,6 +101,14 @@ watch(updated, (newVal, oldVal) => {
}
})
const searchUser = (query) => {
selectableUsers.value = project.value?.users.filter(user => {
return !!(PinyinMatch.match(user.nickname, query))
|| user.nickname === query
|| query === ''
})
}
const handleSearch = () => {
const filters = {}
const orderFields = [`${orderDirection.value}${orderField.value}`]
Expand Down
Loading

0 comments on commit 8a24c08

Please sign in to comment.