|
@@ -24,7 +24,7 @@
|
|
|
<div class="border-b-[1px] mx-16"></div>
|
|
|
|
|
|
<div style="overflow: hidden; overflow-y: scroll" class="h-200 mb-12">
|
|
|
- <div ref="editorFather" :class="`min-h-160 mx-12 my-16 w-[93%] mb-20 text-sm `">
|
|
|
+ <div ref="editorFather" :class="`min-h-160 mx-12 my-16 w-[93%] mb-20 text-base `">
|
|
|
<div
|
|
|
ref="editor"
|
|
|
class="inputSectionContent"
|
|
@@ -163,7 +163,9 @@
|
|
|
size="large"
|
|
|
type="primary"
|
|
|
round
|
|
|
- :color="handlePublishRule(noteJson?.imgUrls.length, noteJson.endPlace)"
|
|
|
+ :color="
|
|
|
+ handlePublishRule(noteJson?.imgUrls.length, noteJson.endPlace, noteJson.projectTitle)
|
|
|
+ "
|
|
|
block
|
|
|
:loading="publishLoading"
|
|
|
@click="handlePublish"
|
|
@@ -319,7 +321,9 @@
|
|
|
size="large"
|
|
|
type="primary"
|
|
|
round
|
|
|
- :color="handlePublishRule(noteJson?.imgUrls.length, noteJson.endPlace)"
|
|
|
+ :color="
|
|
|
+ handlePublishRule(noteJson?.imgUrls.length, noteJson.endPlace, noteJson.projectTitle)
|
|
|
+ "
|
|
|
block
|
|
|
:loading="publishLoading"
|
|
|
@click="handlePublish"
|
|
@@ -598,6 +602,7 @@ async function handleSaveDraft() {
|
|
|
}
|
|
|
})
|
|
|
showToast('草稿保存成功')
|
|
|
+
|
|
|
// 后端保存草稿没有对 topics 做新增的处理
|
|
|
navigateTo({
|
|
|
path: '/profile/notes?tab=draft',
|
|
@@ -607,20 +612,6 @@ async function handleSaveDraft() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 预览
|
|
|
-const previewOptions = reactive({
|
|
|
- show: false
|
|
|
-})
|
|
|
-
|
|
|
-function handlePreview() {
|
|
|
- previewOptions.show = !previewOptions.show
|
|
|
- const innerHTML = editor.value.innerHTML
|
|
|
- .replace('ql-editor', '')
|
|
|
- .replace('contenteditable', 'true')
|
|
|
-
|
|
|
- noteJson.tourTourismProjectTravelNotesWriteContentDto.content = innerHTML ?? ''
|
|
|
-}
|
|
|
-
|
|
|
// 收集个人信息
|
|
|
const userInfoOptions = reactive({
|
|
|
show: false
|
|
@@ -632,8 +623,8 @@ function handleCollectUserInfoOk() {
|
|
|
|
|
|
const publishResultModalOptions = ref(false)
|
|
|
|
|
|
-function handlePublishRule(length, endPlace) {
|
|
|
- if (!length || !endPlace) {
|
|
|
+function handlePublishRule(length, endPlace, title) {
|
|
|
+ if (!length || !endPlace || !title) {
|
|
|
return '#999999'
|
|
|
} else {
|
|
|
return '#FD9A00'
|
|
@@ -659,7 +650,14 @@ async function handlePublish() {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ if (!noteJson.projectTitle) {
|
|
|
+ showNotify({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请输入游记标题',
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!noteJson.endPlace) {
|
|
|
showNotify({
|
|
|
type: 'warning',
|
|
@@ -761,14 +759,14 @@ const topicList = ref([])
|
|
|
const eitList = ref([])
|
|
|
const showTopicEit = ref(null)
|
|
|
|
|
|
-// 记录点击话题和@ 后的几个数字。
|
|
|
-const queryParmas = reactive({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- name: ''
|
|
|
-})
|
|
|
+// // 记录点击话题和@ 后的几个数字。
|
|
|
+// const queryParmas = reactive({
|
|
|
+// pageNum: 1,
|
|
|
+// pageSize: 10,
|
|
|
+// name: ''
|
|
|
+// })
|
|
|
|
|
|
-const topicLoading = ref(false)
|
|
|
+// const topicLoading = ref(false)
|
|
|
// async function getTopicList(parmas, searchText) {
|
|
|
// try {
|
|
|
// // if (!topicLoading.value) return
|
|
@@ -996,8 +994,8 @@ const handleClickOutside = (event) => {
|
|
|
let projectTitleRefCompEl = projectTitleRef.value
|
|
|
const isChatInputCompEl =
|
|
|
[checkboxRefs.value[0], checkboxRefs.value[1]].some((o) => o === event.target) ||
|
|
|
- editorFather.value.contains(event.target) ||
|
|
|
- projectTitleRefCompEl.contains(event.target)
|
|
|
+ editorFather.value?.contains(event.target) ||
|
|
|
+ projectTitleRefCompEl?.contains(event.target)
|
|
|
|
|
|
if (!isChatInputCompEl) {
|
|
|
// 不是点输入框部分
|
|
@@ -1005,10 +1003,28 @@ const handleClickOutside = (event) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 预览
|
|
|
+const previewOptions = reactive({
|
|
|
+ show: false
|
|
|
+})
|
|
|
+
|
|
|
+function handlePreview() {
|
|
|
+ previewOptions.show = !previewOptions.show
|
|
|
+
|
|
|
+ if (previewOptions.show) {
|
|
|
+ const innerHTML = editor.value?.innerHTML
|
|
|
+ ?.replace('ql-editor', '')
|
|
|
+ ?.replace('contenteditable', 'true')
|
|
|
+
|
|
|
+ defaultNoteJson.tourTourismProjectTravelNotesWriteContentDto.content = innerHTML ?? ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
watch(
|
|
|
editor,
|
|
|
(val) => {
|
|
|
- if (val && !quillContent) initEdit()
|
|
|
+ // && !quillContent
|
|
|
+ if (val) initEdit()
|
|
|
},
|
|
|
{ immediate: true }
|
|
|
)
|
|
@@ -1021,7 +1037,7 @@ onMounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-/* @import '../../assets/css/quill.snow.css'; */
|
|
|
+// @import '../../assets/css/quill.snow.css';
|
|
|
|
|
|
::v-deep .van-field:focus {
|
|
|
caret-color: #ff9300 !important;
|
|
@@ -1038,7 +1054,7 @@ onMounted(() => {
|
|
|
}
|
|
|
|
|
|
::v-deep .mention {
|
|
|
- color: #2c405b;
|
|
|
+ color: #356eff;
|
|
|
font-weight: bold;
|
|
|
margin-left: 4px;
|
|
|
background-color: transparent;
|
|
@@ -1058,8 +1074,8 @@ onMounted(() => {
|
|
|
color: #606266;
|
|
|
}
|
|
|
|
|
|
-.ql-mention-list-item.selected {
|
|
|
- background-color: #f5f7fa !important;
|
|
|
+::v-deep .ql-mention-list-item.selected {
|
|
|
+ background-color: #fff7e6 !important;
|
|
|
}
|
|
|
|
|
|
.member-item {
|