This commit is contained in:
2026-01-25 20:25:52 +08:00
parent 20506c9608
commit 8b3494c95b
2 changed files with 16 additions and 23 deletions

View File

@ -25,7 +25,6 @@
<!-- 编辑器 --> <!-- 编辑器 -->
<Editor :style="`height: 480px; overflow-y: hidden`" :model-value="textContent" :defaultConfig="editorConfig" <Editor :style="`height: 480px; overflow-y: hidden`" :model-value="textContent" :defaultConfig="editorConfig"
:mode="mode" @onCreated="handleCreated" @onChange="handChange" /> :mode="mode" @onCreated="handleCreated" @onChange="handChange" />
</div> </div>
<div v-if="outRow.id" style="display: flex; justify-content: center;"> <div v-if="outRow.id" style="display: flex; justify-content: center;">
<!-- <el-button style="display: block;" type="primary" @click="ConsultationShow = true">网上会商</el-button> --> <!-- <el-button style="display: block;" type="primary" @click="ConsultationShow = true">网上会商</el-button> -->
@ -51,6 +50,8 @@ import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue"; import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
import { gsxtYpbgAddEntity, gsxtYpbgEditEntity, gsxtYpbgId } from "@/api/huiShangyp/strategicApi.js" import { gsxtYpbgAddEntity, gsxtYpbgEditEntity, gsxtYpbgId } from "@/api/huiShangyp/strategicApi.js"
const emit = defineEmits(["updateDate", 'ok']); const emit = defineEmits(["updateDate", 'ok']);
const { proxy } = getCurrentInstance();
const { D_BZ_YPLX } = proxy.$dict("D_BZ_YPLX")
const props = defineProps({ const props = defineProps({
dic: Object, dic: Object,
}); });
@ -59,7 +60,6 @@ const props = defineProps({
const ConsultationShow = ref(false) const ConsultationShow = ref(false)
const showText = ref(false); const showText = ref(false);
const textContent = ref() const textContent = ref()
const { proxy } = getCurrentInstance();
const editorRef = shallowRef(); const editorRef = shallowRef();
const dialogForm = ref(false); //弹窗 const dialogForm = ref(false); //弹窗
const mode = "default"; const mode = "default";
@ -107,18 +107,13 @@ const rules = reactive({
{ required: true, message: "请输入经验内容", trigger: "blur" } { required: true, message: "请输入经验内容", trigger: "blur" }
] ]
}); });
const formData = ref(); const formData = ref([
watch(() =>props.dic.D_BZ_YPLX, (newVal) => {
if(newVal){
formData.value=[
{ label: "报告名称", prop: "bgmc", type: "input", width: "100%", blur: setEditorTextContent }, { label: "报告名称", prop: "bgmc", type: "input", width: "100%", blur: setEditorTextContent },
{ {
label: "报告类型", prop: "bglx", type: "select", width: "100%", options: props.dic.D_BZ_YPLX label: "报告类型", prop: "bglx", type: "select", width: "100%", options: D_BZ_YPLX
}, },
{ label: "报告内容", prop: "bgnr", type: "slot", width: "100%", blur: setEditorTextContent }, { label: "报告内容", prop: "bgnr", type: "slot", width: "100%", blur: setEditorTextContent },
] ]);
}
})
const listQuery = ref({ const listQuery = ref({
bgmc: "", bgmc: "",
@ -133,15 +128,16 @@ const outRow = ref({})
// 初始化数据 // 初始化数据
const init = (type, reportData, row) => { const init = (type, row) => {
if(row){
listQuery.value = { listQuery.value = {
bgmc: reportData.bgmc, bgmc: row.bgmc,
bgnr: reportData.bgnr, bgnr: row.bgnr,
id: reportData.id, id: row.id,
bglx: reportData.bglx, bglx: row.bglx,
} }
outRow.value = { ...row } outRow.value = { ...row }
}
dialogForm.value = true; dialogForm.value = true;
title.value = type == "add" ? "新增" :type == "edit"? "编辑" : "详情"; title.value = type == "add" ? "新增" :type == "edit"? "编辑" : "详情";
setEditorTextContent() setEditorTextContent()
@ -153,9 +149,7 @@ const getText = (val, row = {}) => {
function setEditorTextContent() { function setEditorTextContent() {
let html = dataBt.value; let html = dataBt.value;
html += `<p style="text-align: center;"><span style="font-size: 22px;">${listQuery.value.bgnr || ''}</span></p>`
html += `<p style="text-align: center;"><span style="font-size: 22px;">${listQuery.value.bgmc || ''}</span></p>`
html += `<p>${listQuery.value.fj || ''}</p>` html += `<p>${listQuery.value.fj || ''}</p>`
textContent.value = html textContent.value = html
} }

View File

@ -11,7 +11,7 @@
<el-icon style="vertical-align: middle"> <el-icon style="vertical-align: middle">
<CirclePlus /> <CirclePlus />
</el-icon> </el-icon>
<span style="vertical-align: middle">自建研判</span> <span style="vertical-align: middle">创建报告</span>
</el-button> </el-button>
</template> </template>
</PageTitle> </PageTitle>
@ -193,7 +193,6 @@ const selfCreateResearch = (type = 'add') => {
} }
/** 创建报告 */ /** 创建报告 */
const createReport = (type,row) => { const createReport = (type,row) => {
console.log(row);
reportTc.value.init(type, row) reportTc.value.init(type, row)
// currRow.value = { ...row } // currRow.value = { ...row }
// isShowReport.value = true // isShowReport.value = true