lcw
This commit is contained in:
@ -13,19 +13,19 @@
|
||||
</FormMessage>
|
||||
<div class="cntBox">
|
||||
<!-- 工具栏 -->
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
<Toolbar
|
||||
style="border-bottom: 1px solid #ccc"
|
||||
:editor="editorRef"
|
||||
:defaultConfig="toolbarConfig"
|
||||
:mode="mode" />
|
||||
<!-- 编辑器 -->
|
||||
<Editor
|
||||
:style="`height: 480px; overflow-y: hidden`"
|
||||
v-model="textContent"
|
||||
<Editor
|
||||
:style="`height: 480px; overflow-y: hidden`"
|
||||
v-model="textContent"
|
||||
:defaultConfig="editorConfig"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
@onChange="handChange"
|
||||
:mode="mode"
|
||||
@onCreated="handleCreated"
|
||||
@onChange="handChange"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="listQuery.id" style="display: flex; justify-content: center;">
|
||||
@ -47,6 +47,7 @@ import ExtractionText from "@/components/ExtractionText/index.vue";
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
|
||||
import "@wangeditor/editor/dist/css/style.css";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
// import Consultation from './consultation.vue'
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
|
||||
@ -117,12 +118,33 @@ const elform = ref();
|
||||
const title = ref("");
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, row) => {
|
||||
if(row) listQuery.value = JSON.parse(JSON.stringify(row));
|
||||
const init = (type, row) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" :type == "edit"? "编辑" : "详情";
|
||||
|
||||
|
||||
if (row) {
|
||||
getDataById(row.id)
|
||||
}
|
||||
// listQuery.value = JSON.parse(JSON.stringify(row));
|
||||
|
||||
setEditorTextContent()
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
qcckGet({},'/mosty-gsxt/gsxtYpbg/'+id).then((res) => {
|
||||
listQuery.value = res || {};
|
||||
// /** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
// const cyypList = Array.isArray(res.cyypList) ? res.cyypList : []
|
||||
// listQuery.value.jsdxBmDm = cyypList.map(item => {
|
||||
// return item.ypbmdm
|
||||
// })
|
||||
// listQuery.value.jsdxBmMc = cyypList.map(item => {
|
||||
// return item.ypbmmc
|
||||
// })
|
||||
});
|
||||
};
|
||||
|
||||
const getText = (val) => {
|
||||
listQuery.value.fj = val.text;
|
||||
setEditorTextContent()
|
||||
@ -175,7 +197,7 @@ const handleCreated = (editor) => {
|
||||
};
|
||||
//内容发生变化
|
||||
const handChange = (editor) => {
|
||||
|
||||
|
||||
// 判断是否是一个空段落,是空就传空文本
|
||||
};
|
||||
onBeforeUnmount(() => {
|
||||
@ -183,12 +205,13 @@ onBeforeUnmount(() => {
|
||||
if (editor) editor.destroy();
|
||||
});
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
// 关闭
|
||||
const close = () => {
|
||||
loading.value = false;
|
||||
dialogForm.value = false;
|
||||
listQuery.value = {}
|
||||
router.replace({ path: '/strategicResearchs' })// 移除id 避免刷新一直带参数
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user