feat:战略研判修改
This commit is contained in:
@ -1,27 +1,26 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">战略研判{{ title }} </span>
|
||||
<span class="title">战术研判{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" v-if="title != '详情'" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-bottom: 0px;" class="form_cnt">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules" :disabled="title === '详情'">
|
||||
<template #bmList>
|
||||
<div class="table-box">
|
||||
<el-table :data="tableList" border style="width: 100%">
|
||||
<el-table-column prop="ypbmmc" label="部门" width="150" align="center" />
|
||||
<el-table-column label="研判素材" width="280" align="center">
|
||||
<el-table-column label="研判素材" width="380" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.scyq" :disabled="true" placeholder="请输入研判素材" />
|
||||
<el-input v-model="row.scyq" placeholder="请输入研判素材" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<UploadFile v-model="row.fj" :disabled="true" :limit="1" :isImg="false"
|
||||
:isAll="true" />
|
||||
<UploadFile v-model="row.fj" :limit="1" :isImg="false" :isAll="true" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="wcqk" label="完成状态" width="120" align="center">
|
||||
@ -91,17 +90,29 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* @typedef {Object} JudgmentDept 研判部门对象
|
||||
* @property {string} ypbmdm - 研判部门代码
|
||||
* @property {string} ypbmmc - 研判部门名称
|
||||
* @property {string} scyq - 素材要求
|
||||
* @property {Array} fj - 附件数组
|
||||
* @property {string} wcqk - 完成情况(01 准备中、02 已完成)
|
||||
*/
|
||||
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import UploadFile from "@/components/MyComponents/Upload/index.vue";
|
||||
// import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue"
|
||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, watch, computed } from "vue";
|
||||
import { sjzlAddEntity, sjzlEditEntity, sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js'
|
||||
import { sjzlGetInfo, sjzlPerfectlnfo, sjzlFstz, sjzlQryp, sjzlPerfectSorce } from '@//api/yj.js'
|
||||
import { selfBuildJudgment } from "@/api/huiShangyp/tacticalApi.js"
|
||||
// import { tacticalGet, strategicDelete } from "@/api/huiShangyp/strategicApi.js";
|
||||
import { getItem } from '@//utils/storage.js'
|
||||
|
||||
const emit = defineEmits(["updateDate", "getList"]);
|
||||
const props = defineProps({
|
||||
dict: Object
|
||||
dict: Object,
|
||||
/** 报告类型 01 战术研判 02战略研判 */
|
||||
bglx: String,
|
||||
});
|
||||
const imgMsg = ref([])
|
||||
const { proxy } = getCurrentInstance();
|
||||
@ -147,7 +158,7 @@ watch(() => props.dict, (val) => {
|
||||
formData.value = [
|
||||
{ label: "研判议题", prop: "ypyt", type: "input", width: '48%' },
|
||||
{ label: "研判时间", prop: "ypsj", type: "datetime", width: '48%' },
|
||||
{ label: "报告类型", prop: "bglx", type: "radio", options: props.dict.D_BZ_YPLX, width: '48%' },
|
||||
{ label: "报告类型", prop: "bglx", type: "radio", options: props.dict.D_BZ_YPLX, width: '48%', disabled: true },
|
||||
{ label: "研判方式", prop: "ypfs", type: "radio", options: props.dict.D_BZ_YPFS, width: '48%' },
|
||||
{ label: "参与研判部门", prop: "jsdxBmDm", type: "department", multiple: true, depMc: 'jsdxBmMc', width: '48%' },
|
||||
{ label: "研判要求", prop: "ypyq", type: "textarea", width: '100%' },
|
||||
@ -165,6 +176,8 @@ function updateDis(row) {
|
||||
const isFinish = row.wcqk === '02'
|
||||
return isShiQingBaoZhongXin.value || !iscjr || isFinish
|
||||
}
|
||||
|
||||
/** 获取附件数组 */
|
||||
function getFjArr(fj) {
|
||||
if (typeof fj !== 'string' || !fj) return []
|
||||
let fjArr = []
|
||||
@ -176,15 +189,16 @@ function getFjArr(fj) {
|
||||
return fjArr
|
||||
}
|
||||
watch(() => listQuery.value.jsdxBmDm, (val) => {
|
||||
/** @type {Array<{ypbmdm: string, ypbmmc: string, scyq: string, fj: Array, wcqk: string}>} 参与研判部门数据数组 */
|
||||
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
const arr = Array.isArray(val) ? val : []
|
||||
/** @type {Array} 参与研判部门*/
|
||||
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||
|
||||
tableList.value = arr.map((item, i) => {
|
||||
/** 找原来的对象 */
|
||||
const curr = cyypList.find(item2 => item2.ypbmdm == item) || {}
|
||||
/** 是否是新增 */
|
||||
const isAddForm = !listQuery.value.id
|
||||
const isAddForm = !listQuery.value?.id
|
||||
return {
|
||||
// id: null,
|
||||
// sjzlid: null, // 研判战略研判ID
|
||||
@ -203,13 +217,24 @@ watch(() => listQuery.value.jsdxBmDm, (val) => {
|
||||
const init = (type, row, wjlb) => {
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : type == "edit" ? "编辑" : "详情";
|
||||
outRow.value = row || {}
|
||||
if (row) { getDataById(row.id) }
|
||||
outRow.value = row
|
||||
if (row) {
|
||||
getDataById(row.id)
|
||||
} else {
|
||||
listQuery.value = {
|
||||
bglx: props.bglx, // 报告类型 01 战术研判 02战略研判
|
||||
ypfs: undefined, // 研判方式
|
||||
ypsj: undefined, // 研判时间
|
||||
ypyq: undefined, // 研判要求
|
||||
cyypList: [], // 参与研判部门数据数组
|
||||
}
|
||||
}
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
sjzlGetInfo(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
|
||||
@ -219,17 +244,17 @@ const getDataById = (id) => {
|
||||
})
|
||||
});
|
||||
};
|
||||
/** 获取附件json字符串 */
|
||||
function getFjString(arr) {
|
||||
arr = Array.isArray(arr) ? arr : []
|
||||
return JSON.stringify(arr)
|
||||
}
|
||||
/**获取下发部门数据 */
|
||||
const getXfbmList = () => {
|
||||
/** @type {Array<JudgmentDept>} 参与研判部门数据数组 */
|
||||
const cyypList = Array.isArray(listQuery.value.cyypList) ? listQuery.value.cyypList : []
|
||||
|
||||
return tableList.value.map((item, i) => {
|
||||
|
||||
/** 找原来的对象 */
|
||||
/** @type {JudgmentDept} 找原来的对象 */
|
||||
const curr = cyypList.find(item => item.ypbmdm == item.ypbmdm) || {}
|
||||
return {
|
||||
id: curr.id || null,
|
||||
@ -252,21 +277,14 @@ const submit = () => {
|
||||
let params = {
|
||||
...listQuery.value,
|
||||
cyypList: xfbmList,
|
||||
// cyypList: listQuery.value.jsdxBmDm.map((item, index) => {
|
||||
// return {
|
||||
// ypbmdm: item,
|
||||
// ypbmmc: listQuery.value.jsdxBmMc[index],
|
||||
// ypcylx: '01'
|
||||
// }
|
||||
// })
|
||||
};
|
||||
try {
|
||||
loading.value = true;
|
||||
let res
|
||||
if (title.value == "新增") {
|
||||
res = await sjzlAddEntity(params)
|
||||
res = await selfBuildJudgment(params)
|
||||
} else {
|
||||
res = await sjzlEditEntity(params)
|
||||
// res = await sjzlEditEntity(params)// 目前没有修改
|
||||
}
|
||||
if (res && res > 0) {
|
||||
loading.value = false;
|
||||
@ -358,7 +376,7 @@ const submitMaterialAction = async () => {
|
||||
closeMaterialDialog()
|
||||
if (outRow.value.id) { getDataById(outRow.value.id) }
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
||||
} finally {
|
||||
materialLoading.value = false
|
||||
}
|
||||
@ -384,7 +402,7 @@ const sendNotice = () => {
|
||||
proxy.$message({ type: "success", message: "下发通知成功" });
|
||||
close();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
} finally {
|
||||
noticeLoading.value = false;
|
||||
}
|
||||
@ -405,7 +423,7 @@ const confirmJudgment = () => {
|
||||
proxy.$message({ type: "success", message: "确认研判成功" });
|
||||
close();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
} finally {
|
||||
confirmLoading.value = false;
|
||||
}
|
||||
|
||||
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">创建会议{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||
<!-- <template #glxsmc>
|
||||
<el-input placeholder="请选择关联线索" @click="chooseVisiblexS = true" readonly v-model="listQuery.glxsmc"></el-input>
|
||||
</template> -->
|
||||
<template #chryList>
|
||||
<el-input placeholder="请选择参会人员" @click="openMeetings = true" readonly v-model="listQuery.rymc"></el-input>
|
||||
</template>
|
||||
</FormMessage>
|
||||
</div>
|
||||
</div>
|
||||
<Personnel v-model="openMeetings" />
|
||||
<ChooseUser v-model="chooseVisible" :Single="false" @choosedUsers="handleUserSelected" :roleIds="roleIds" />
|
||||
<Xslist v-model="chooseVisiblexS" @choosed="choosed" :roleIds="roleIdsxs"></Xslist>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ChooseUser from "@/components/ChooseList/ChooseUser/index.vue";
|
||||
// import Xslist from '@/components/ChooseList/ChooseXs/index.vue'
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
|
||||
import Personnel from '@/views/backOfficeSystem/JudgmentHome/MeetingRoom/components/Communications/personnel.vue'
|
||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, } from "vue";
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const emit = defineEmits(["updateDate"]);
|
||||
|
||||
const roleIds = ref([]); //角色id
|
||||
const chooseVisible = ref(false);
|
||||
const roleIdsxs = ref([]); //角色id
|
||||
const chooseVisiblexS = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const dialogForm = ref(false); //弹窗
|
||||
const rules = reactive({
|
||||
hskssj: [{ required: true, message: "请选择会商开始时间", trigger: "change" }],
|
||||
hsjssj: [{ required: true, message: "请选择会商结束时间", trigger: "change" }],
|
||||
hsnr: [{ required: true, message: "请输入会商内容", trigger: "blur" }],
|
||||
hsbt: [{ required: true, message: "请输入会商标题", trigger: "blur" }],
|
||||
// glxsmc: [{ required: true, message: "请选择关联线索", trigger: "change" }],
|
||||
chryList: [{ required: true, message: "请选择参会人员", trigger: "change" }],
|
||||
});
|
||||
const formData = ref([
|
||||
{ label: "会商开始时间", prop: "hskssj", type: "datetime" },
|
||||
{ label: "会商结束时间", prop: "hsjssj", type: "datetime" },
|
||||
{ label: "会商内容", prop: "hsnr", type: "textarea", width: "100%" },
|
||||
// { label: "关联线索", prop: "glxsmc", type: "slot", },
|
||||
{ label: "会商标题", prop: "hsbt", type: "input" },
|
||||
// { label: "参会人员", prop: "chryList", type: "slot" ,width:'100%'},
|
||||
]);
|
||||
const listQuery = ref({}); //表单
|
||||
const loading = ref(false);
|
||||
const elform = ref();
|
||||
const title = ref("");
|
||||
const outRow = ref({})
|
||||
// 初始化数据
|
||||
const init = (type, row, outRowObj = {}) => {
|
||||
outRow.value = outRowObj
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : "编辑";
|
||||
if (row) {
|
||||
getDataById(row.id)
|
||||
} else {
|
||||
listQuery.value = {
|
||||
hskssj: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
hsjssj: dayjs().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"),
|
||||
}
|
||||
}
|
||||
};
|
||||
// 根据id查询详情
|
||||
const getDataById = (id) => {
|
||||
qcckGet({ id }, "/mosty-gsxt/wshs/selectByid").then((res) => {
|
||||
res.rymc = res.chryList ? res.chryList.map(v => v.chryxm).join(",") : '';
|
||||
res.chryList = res.chryList ? res.chryList.map(item => item.chryid) : [];
|
||||
roleIds.value = res.chryList;
|
||||
roleIdsxs.value = res.glxsid ? [res.glxsid] : [];
|
||||
listQuery.value = res;
|
||||
});
|
||||
};
|
||||
|
||||
const handleUserSelected = (userData) => {
|
||||
roleIds.value = userData.map(item => item.id);
|
||||
listQuery.value.chryList = userData.map(item => item.id)
|
||||
listQuery.value.rymc = userData.map(item => item.userName).join("、");
|
||||
};
|
||||
|
||||
const choosed = (data) => {
|
||||
listQuery.value.glxsmc = data[0].xsMc;
|
||||
listQuery.value.glxsid = data[0].id;
|
||||
roleIdsxs.value = data.map(item => item.id);
|
||||
};
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit((data) => {
|
||||
let url = title.value == "新增" ? "/mosty-gsxt/wshs/add" : "/mosty-gsxt/wshs/update";
|
||||
let params = {
|
||||
...data,
|
||||
glxsid: outRow.value.id,
|
||||
glxsmc: outRow.value.xsMc,
|
||||
};
|
||||
loading.value = true;
|
||||
qcckPost(params, url).then(() => {
|
||||
loading.value = false;
|
||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||
emit("updateDate");
|
||||
close();
|
||||
}).catch(() => { loading.value = false; });
|
||||
});
|
||||
};
|
||||
|
||||
// 关闭
|
||||
const close = () => {
|
||||
listQuery.value = {};
|
||||
roleIds.value = [];
|
||||
roleIdsxs.value = [];
|
||||
dialogForm.value = false;
|
||||
loading.value = false;
|
||||
};
|
||||
// 选择参会人员
|
||||
const openMeetings = ref(false)
|
||||
|
||||
defineExpose({ init });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/css/layout.scss";
|
||||
@import "~@/assets/css/element-plus.scss";
|
||||
</style>
|
||||
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">报告{{ title }} </span>
|
||||
<div>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="submit">保存</el-button>
|
||||
<el-button size="small" @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules">
|
||||
<template #bgnr>
|
||||
<el-input v-model="listQuery.bgnr" style="width: 100%" placeholder="请输入关键字" class="input-with-select">
|
||||
<template #append>
|
||||
<el-button :icon="Search" type="primary">搜索</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<template #fj><el-button type="primary" @click="showText = true">附件上传</el-button></template>
|
||||
</FormMessage>
|
||||
<div class="cntBox">
|
||||
<!-- 工具栏 -->
|
||||
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" :defaultConfig="toolbarConfig"
|
||||
:mode="mode" />
|
||||
<!-- 编辑器 -->
|
||||
<Editor :style="`height: 480px; overflow-y: hidden`" v-model="textContent" :defaultConfig="editorConfig"
|
||||
:mode="mode" @onCreated="handleCreated" @onChange="handChange" />
|
||||
|
||||
</div>
|
||||
<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="downloadWithStyles(textContent)">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文字解析 -->
|
||||
<ExtractionText v-model="showText" @change="getText"></ExtractionText>
|
||||
<!-- 网上会商 -->
|
||||
<!-- <Consultation v-model="ConsultationShow" /> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { timeValidate } from '@/utils/tools.js'
|
||||
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 Consultation from './consultation.vue'
|
||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||
import { ref, defineExpose, reactive, defineEmits, getCurrentInstance, shallowRef, onBeforeUnmount, watch } from "vue";
|
||||
import { gsxtYpbgAddEntity, gsxtYpbgEditEntity } from "@/api/huiShangyp/tacticalApi.js"
|
||||
|
||||
const emit = defineEmits(["updateDate", 'ok']);
|
||||
const props = defineProps({
|
||||
dic: Object,
|
||||
});
|
||||
|
||||
|
||||
const ConsultationShow = ref(false)
|
||||
const showText = ref(false);
|
||||
const textContent = ref()
|
||||
const { proxy } = getCurrentInstance();
|
||||
const editorRef = shallowRef();
|
||||
const dialogForm = ref(false); //弹窗
|
||||
const mode = "default";
|
||||
const dataBt = ref(`<p class="html_bt">
|
||||
<h4 style=\"text-align: center;\"><span style=\"color: rgb(225, 60, 57); font-size: 32px; font-family: 标楷体;\">林芝市公安局情指中心</span></h4>
|
||||
<h4 style=\"text-align: center;\"><span style=\"color: rgb(225, 60, 57); font-size: 32px; font-family: 标楷体;\">研判专刊(初稿)</span></h4></p>
|
||||
<p style="text-align: center;"><span style="color: rgb(225, 60, 57); font-size: 22px; font-family: 标楷体;">市公安局情指中心编</span></p>
|
||||
<p style="text-align: center;"><span style="color: rgb(225, 60, 57); font-size: 22px; font-family: 标楷体;"> ${timeValidate(new Date(), 'td')}</span></p>
|
||||
<hr/>`)
|
||||
//编辑器配置
|
||||
const editorConfig = {
|
||||
withCredentials: true, //允许跨域
|
||||
placeholder: props.placeholder, //提示语
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
// 自定义上传图片
|
||||
async customUpload(file, insertFn) {
|
||||
let fileBlob = await compressImage(file);
|
||||
let fileData = new File([fileBlob], fileBlob.name, { type: fileBlob.type });
|
||||
if (fileData.size > 2 * 1024 * 1024) {
|
||||
ElMessage({ message: "图片超过2MB", type: "success" });
|
||||
} else {
|
||||
await uploadFn(fileData, insertFn);
|
||||
}
|
||||
}
|
||||
},
|
||||
uploadVideo: {
|
||||
// 自定义上传视频
|
||||
async customUpload(file, insertFn) {
|
||||
await uploadFn(file, insertFn);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//工具配置
|
||||
const toolbarConfig = {
|
||||
excludeKeys: ["blockquote", "codeBlock"] //清除不必要的工具,引用和代码块
|
||||
};
|
||||
const rules = reactive({
|
||||
jymc: [
|
||||
{ required: true, message: "请输入经验名称", trigger: "blur" }
|
||||
],
|
||||
fbnr: [
|
||||
{ required: true, message: "请输入经验内容", trigger: "blur" }
|
||||
]
|
||||
});
|
||||
const formData = ref([
|
||||
{ label: "报告名称", prop: "bgmc", type: "input", width: "100%", blur: setEditorTextContent },
|
||||
{ label: "报告内容", prop: "bgnr", type: "slot", width: "100%", blur: setEditorTextContent },
|
||||
// { label: "附件内容", prop: "fj", type: "slot", width: "100%" },
|
||||
]);
|
||||
const listQuery = ref({
|
||||
bgmc: "",
|
||||
bgnr: "",
|
||||
fj: ""
|
||||
}); //表单
|
||||
const loading = ref(false);
|
||||
const elform = ref();
|
||||
const title = ref("");
|
||||
/** 外面行数据 */
|
||||
const outRow = ref({})
|
||||
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, reportData, row) => {
|
||||
|
||||
listQuery.value = {
|
||||
bgmc: reportData.bgmc,
|
||||
bgnr: reportData.bgnr,
|
||||
id: reportData.id,
|
||||
// fj: reportData.fj
|
||||
}
|
||||
outRow.value = { ...row }
|
||||
dialogForm.value = true;
|
||||
title.value = type == "add" ? "新增" : "编辑";
|
||||
setEditorTextContent()
|
||||
};
|
||||
const getText = (val, row = {}) => {
|
||||
listQuery.value.fj = val.text;
|
||||
setEditorTextContent()
|
||||
}
|
||||
|
||||
function setEditorTextContent() {
|
||||
let html = dataBt.value;
|
||||
|
||||
|
||||
html += `<p style="text-align: center;"><span style="font-size: 22px;">${listQuery.value.bgmc || ''}</span></p>`
|
||||
html += `<p>${listQuery.value.fj || ''}</p>`
|
||||
textContent.value = html
|
||||
}
|
||||
|
||||
// watch(() => listQuery.value, (val) => {
|
||||
|
||||
// },
|
||||
// {
|
||||
// deep: true, immediate: true
|
||||
// })
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit((data) => {
|
||||
// let url = title.value == "新增" ? "/mosty-gsxt/gsxt/jyfx/add" : "/mosty-gsxt/gsxt/jyfx/edit";
|
||||
|
||||
let params = {
|
||||
...data,
|
||||
ypid: outRow.value.id,
|
||||
ypmc: outRow.value.ypyt
|
||||
};
|
||||
const apiFun = !listQuery.value.id ? gsxtYpbgAddEntity : gsxtYpbgEditEntity
|
||||
if (!listQuery.value.id) delete params.id
|
||||
apiFun(params).then(() => {
|
||||
loading.value = false;
|
||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||
emit("ok");
|
||||
close();
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
})
|
||||
});
|
||||
};
|
||||
//编辑器创建成功
|
||||
const handleCreated = (editor) => {
|
||||
editorRef.value = editor;
|
||||
};
|
||||
//内容发生变化
|
||||
const handChange = (editor) => {
|
||||
// 判断是否是一个空段落,是空就传空文本
|
||||
|
||||
|
||||
};
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value;
|
||||
if (editor) editor.destroy();
|
||||
});
|
||||
|
||||
|
||||
// 关闭
|
||||
const close = () => {
|
||||
listQuery.value = {};
|
||||
loading.value = false;
|
||||
dialogForm.value = false;
|
||||
listQuery.value = {}
|
||||
};
|
||||
|
||||
|
||||
// 带样式的下载方法
|
||||
const downloadWithStyles = (textContent) => {
|
||||
|
||||
const wordDocument = `
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>富文本导出</title>
|
||||
<style>
|
||||
/* 应用两端对齐样式 */
|
||||
body {
|
||||
text-align: justify;
|
||||
text-justify: inter-character; /* 中文文本两端对齐 */
|
||||
font-family: "Microsoft YaHei", Arial, sans-serif;
|
||||
}
|
||||
p {
|
||||
text-align: justify;
|
||||
text-justify: inter-character;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${textContent}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
const blob = new Blob([wordDocument], {
|
||||
type: 'application/msword'
|
||||
});
|
||||
|
||||
saveAs(blob, '战略研判报告.doc');
|
||||
};
|
||||
|
||||
defineExpose({ init });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/css/layout.scss";
|
||||
@import "~@/assets/css/element-plus.scss";
|
||||
|
||||
.boxlist {
|
||||
width: 99%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
::v-deep .el-textarea__inner {
|
||||
min-height: 550px !important;
|
||||
}
|
||||
|
||||
.html_bt>>>p {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.html_bt {
|
||||
h4 {
|
||||
margin: 10px 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.cntBox {
|
||||
width: 80vw;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
@ -2,12 +2,12 @@
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="战略研判">
|
||||
<!-- <el-button type="primary" @click="getDataById('add', '')">
|
||||
<el-button type="primary" @click="selfCreateResearch('add')">
|
||||
<el-icon style="vertical-align: middle">
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button> -->
|
||||
<span style="vertical-align: middle">自建研判</span>
|
||||
</el-button>
|
||||
|
||||
</PageTitle>
|
||||
</div>
|
||||
@ -29,6 +29,8 @@
|
||||
<template #controls="{ row }">
|
||||
<!-- <el-link size="small" type="primary" @click="getDataById('edit', row)">修改</el-link> -->
|
||||
<el-link size="small" type="primary" @click="getDataById('detail', row)">详情</el-link>
|
||||
<el-link size="small" type="primary" @click="createReport(row)">{{ row.ypbg?.id ? '编辑' : '创建' }}报告</el-link>
|
||||
<el-link size="small" type="success" @click="createMeeting(row)">创建会议</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteFile(row)">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
@ -38,7 +40,12 @@
|
||||
}"></Pages>
|
||||
</div>
|
||||
</div>
|
||||
<AddForm ref="addForm" @getList="getList" :dict="{ D_BZ_YPFS, D_BZ_YPLX }" />
|
||||
<AddForm ref="addForm" :bglx="bglx" @getList="getList" :dict="{ D_BZ_YPFS, D_BZ_YPLX }" />
|
||||
|
||||
<!-- 创建报告 -->
|
||||
<addReport ref="reportTc" :row="currRow" :dic="{ D_GS_BQ_LX }" @ok="getList" />
|
||||
<!-- 创建报告 -->
|
||||
<addMeeting ref="meetingTc" :row="currRow" @updateDate="getList" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -47,12 +54,18 @@ import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { tacticalGet, strategicDelete } from "@/api/huiShangyp/strategicApi.js";
|
||||
import { tacticalGet, strategicDelete } from "@/api/huiShangyp/tacticalApi.js";
|
||||
import { reactive, ref, onMounted, getCurrentInstance, watch, computed, nextTick } from "vue";
|
||||
import addReport from "./addReport.vue";
|
||||
import AddForm from "./addForm.vue";
|
||||
import addMeeting from "./addMeeting.vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
||||
const detailDiloag = ref();
|
||||
const { D_BZ_YPFS, D_BZ_YPLX, D_GS_BQ_LX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX", "D_GS_BQ_LX")
|
||||
|
||||
/** 报告弹框 */
|
||||
const reportTc = ref();
|
||||
/** 会议弹框 */
|
||||
const meetingTc = ref();
|
||||
const searchBox = ref(); //搜索框
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
@ -64,10 +77,9 @@ onMounted(() => {
|
||||
addForm.value && addForm.value.init('edit', {
|
||||
id: route.query.id
|
||||
});
|
||||
router.replace({ path: '/strategicResearch' })// 移除id 避免刷新一直带参数
|
||||
router.replace({ path: '/tacticalResearch' })// 移除id 避免刷新一直带参数
|
||||
})
|
||||
}
|
||||
|
||||
getList()
|
||||
});
|
||||
/** 是否市情报指挥中心 */
|
||||
@ -104,8 +116,12 @@ const pageData = reactive({
|
||||
{ label: "发起部门", prop: "ssbm" },
|
||||
]
|
||||
});
|
||||
const queryFrom = ref({});
|
||||
|
||||
const isShowReport = ref(false)
|
||||
const currRow = ref({})
|
||||
const queryFrom = ref({});
|
||||
/** 报告类型 01 战术研判 02 战略研判*/
|
||||
const bglx = ref('02')
|
||||
// 搜索
|
||||
const onSearch = (val) => {
|
||||
const promes = {
|
||||
@ -146,6 +162,7 @@ const tabHeightFn = () => {
|
||||
tabHeightFn();
|
||||
};
|
||||
};
|
||||
// const route = useRoute()
|
||||
|
||||
const addForm = ref(null)
|
||||
const getDataById = (type, row) => {
|
||||
@ -168,6 +185,24 @@ const deleteFile = (row) => {
|
||||
proxy.$message.info('已取消删除');
|
||||
});
|
||||
}
|
||||
|
||||
const selfCreateResearch = (type = 'add') => {
|
||||
addForm.value.init(type, null, '01');
|
||||
}
|
||||
/** 创建报告 */
|
||||
const createReport = (row) => {
|
||||
const type = !row.id ? 'add' : 'edit'
|
||||
reportTc.value.init(type, row?.ypbg || {}, row)
|
||||
// currRow.value = { ...row }
|
||||
// isShowReport.value = true
|
||||
}
|
||||
/** 创建会议 */
|
||||
const createMeeting = (row) => {
|
||||
meetingTc.value.init('add', null, row)
|
||||
// currRow.value = { ...row }
|
||||
// isShowReport.value = true
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user