feat: 知识报送页面开发路由缓存
parent
d4cb3d99f5
commit
51fc1a2b6d
@ -0,0 +1,50 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
/** 查询知识库分页 */
|
||||
|
||||
export const queryKnowledgePage = (data?: object) => {
|
||||
return http.request("get", "/know-sub/knowledge/queryKnowledgePage", {
|
||||
params: data
|
||||
});
|
||||
};
|
||||
/** 新增知识库*/
|
||||
export const saveKnowledge = (data?: object) => {
|
||||
return http.request("post", "/know-sub/knowledge/saveKnowledge", {
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改知识库(*/
|
||||
export const updateKnowledge = (data?: object) => {
|
||||
return http.request("post", "/know-sub/knowledge/updateKnowledge", {
|
||||
data
|
||||
});
|
||||
};
|
||||
/** 分页查询部门信息列表 */
|
||||
|
||||
export const queryDeptManageList = (data?: object) => {
|
||||
return http.request("get", "/know-sub/deptManage/list", {
|
||||
params: data
|
||||
});
|
||||
};
|
||||
/** 分页查询应用子库 */
|
||||
|
||||
export const queryApplicationSubLibrary = (data?: object) => {
|
||||
return http.request("get", "/know-sub/applicationSubLibrary/list", {
|
||||
params: data
|
||||
});
|
||||
};
|
||||
/** 删除知识库 */
|
||||
|
||||
export const deleteKnowledge = (data?: object) => {
|
||||
return http.request("get", "/know-sub/knowledge/deleteKnowledge", {
|
||||
params: data
|
||||
});
|
||||
};
|
||||
/** 查看知识的详细信息 */
|
||||
|
||||
export const queryKnowledgeDetail = (data?: object) => {
|
||||
return http.request("get", "/know-sub/knowledge/queryKnowledgeDetail", {
|
||||
params: data
|
||||
});
|
||||
};
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.0 MiB |
@ -0,0 +1,21 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { store } from "@/store";
|
||||
export const useKnowledgeCentreStore = defineStore({
|
||||
id: "knowledgeCentre",
|
||||
state: () => ({
|
||||
departmentList: [],
|
||||
applicationSubLibrary: []
|
||||
}),
|
||||
actions: {
|
||||
getDepartmentList(data) {
|
||||
this.departmentList = data;
|
||||
},
|
||||
getApplicationSubLibrary(data) {
|
||||
this.applicationSubLibrary = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export function useKnowledgeCentreStoreHooks() {
|
||||
return useKnowledgeCentreStore(store);
|
||||
}
|
@ -0,0 +1,236 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from "vue";
|
||||
import { ArrowDown } from "@element-plus/icons-vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import TransferRecords from "../compontents/TransferRecords.vue";
|
||||
import Details from "../compontents/Details.vue";
|
||||
defineOptions({
|
||||
name: "approval"
|
||||
});
|
||||
const loading = ref(false);
|
||||
const seachForm = reactive({
|
||||
title: "",
|
||||
publishDeptName: "",
|
||||
status: ""
|
||||
});
|
||||
const TransferRecordRef = ref();
|
||||
const DetailsRef = ref();
|
||||
const tabList = ref([
|
||||
{
|
||||
title: "待审批",
|
||||
id: ""
|
||||
},
|
||||
{
|
||||
title: "已审批",
|
||||
id: "1"
|
||||
}
|
||||
]);
|
||||
const pagination = reactive({
|
||||
total: 0,
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
background: true
|
||||
});
|
||||
const columns: TableColumnList = [
|
||||
{
|
||||
type: "selection",
|
||||
width: 55
|
||||
},
|
||||
{
|
||||
label: "ID",
|
||||
prop: "diseaseName"
|
||||
},
|
||||
{
|
||||
label: "知识标题",
|
||||
prop: "title",
|
||||
slot: "titleSlot"
|
||||
},
|
||||
{
|
||||
label: "发文部门",
|
||||
prop: "diseaseName"
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "diseaseName"
|
||||
},
|
||||
{
|
||||
label: "最新时间",
|
||||
prop: "diseaseName"
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
fixed: "right",
|
||||
width: 350,
|
||||
slot: "operation"
|
||||
}
|
||||
];
|
||||
const router = useRouter();
|
||||
const dataList = ref([
|
||||
{
|
||||
title: "企业职工退休网上办理"
|
||||
}
|
||||
]);
|
||||
const getData = async () => {
|
||||
// const params = {
|
||||
// pageNum: pagination.currentPage,
|
||||
// pageSize: pagination.pageSize,
|
||||
// diseaseName: seachForm.diseaseName,
|
||||
// diseaseType: seachForm.diseaseType
|
||||
// };
|
||||
// const res: any = await queryPageList(params);
|
||||
// dataList.value = res.data.records;
|
||||
// pagination.total = res.data.total;
|
||||
};
|
||||
function handleSizeChange(val: number) {
|
||||
pagination.pageSize = val;
|
||||
getData();
|
||||
}
|
||||
|
||||
function handleCurrentChange(val: number) {
|
||||
pagination.currentPage = val;
|
||||
getData();
|
||||
}
|
||||
const search = () => {
|
||||
pagination.currentPage = 1;
|
||||
pagination.pageSize = 10;
|
||||
getData();
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
seachForm.title = "";
|
||||
seachForm.publishDeptName = "";
|
||||
search();
|
||||
};
|
||||
const handleCommand = command => {
|
||||
console.log("Command", command);
|
||||
};
|
||||
const changeStatus = item => {
|
||||
seachForm.status = item.id;
|
||||
};
|
||||
const add = () => {
|
||||
router.push("/knowledgeCentre/addSubmission");
|
||||
};
|
||||
const openRecords = () => {
|
||||
TransferRecordRef.value.open();
|
||||
};
|
||||
const openDetails = row => {
|
||||
DetailsRef.value.open(row);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="submission app-main-content">
|
||||
<div class="seach">
|
||||
<div class="seach-title"><span>知识审批</span></div>
|
||||
<el-form :model="seachForm">
|
||||
<el-row>
|
||||
<el-form-item label="知识标题">
|
||||
<el-input v-model="seachForm.title" />
|
||||
</el-form-item>
|
||||
<el-form-item class="ml-4" label="发文部门">
|
||||
<el-input v-model="seachForm.publishDeptName" />
|
||||
</el-form-item>
|
||||
<el-button class="ml-8" @click="search" type="primary"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="main-table">
|
||||
<div class="main-table-header">
|
||||
<div class="tab-list">
|
||||
<div
|
||||
class="tab-list-item"
|
||||
:class="[seachForm.status === item.id ? 'actived' : '']"
|
||||
v-for="(item, index) in tabList"
|
||||
:key="index"
|
||||
@click="changeStatus(item)"
|
||||
>
|
||||
<span>{{ item.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-btn">
|
||||
<el-button @click="add" type="primary">批量通过</el-button>
|
||||
<el-button @click="add" type="primary">批量驳回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<pure-table
|
||||
showOverflowTooltip
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:header-cell-style="{
|
||||
background: 'var(--el-table-row-hover-bg-color)',
|
||||
color: 'var(--el-text-color-primary)'
|
||||
}"
|
||||
>
|
||||
<template #operation="{ row }">
|
||||
<el-button link type="primary" @click="openRecords(row)">
|
||||
流转记录
|
||||
</el-button>
|
||||
</template>
|
||||
<template #titleSlot="{ row }">
|
||||
<span class="table-title" @click="openDetails(row)">{{
|
||||
row.title
|
||||
}}</span>
|
||||
</template>
|
||||
</pure-table>
|
||||
</div>
|
||||
<TransferRecords ref="TransferRecordRef" />
|
||||
<Details ref="DetailsRef" />
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.submission {
|
||||
.main-table-header {
|
||||
display: flex;
|
||||
margin-bottom: 24px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #dfe1e2;
|
||||
.tab-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
.tab-list-item {
|
||||
padding: 16px 34px;
|
||||
border: 1px solid #dfe1e2;
|
||||
border-bottom: 0;
|
||||
background: #f5f7f9;
|
||||
font-size: 18px;
|
||||
color: #333333;
|
||||
cursor: pointer;
|
||||
}
|
||||
.actived {
|
||||
background: #ffffff;
|
||||
|
||||
color: #0052d9;
|
||||
border: 0;
|
||||
border-top: 3px solid #0052d9;
|
||||
}
|
||||
}
|
||||
.header-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.header-tabs {
|
||||
}
|
||||
.main-btn {
|
||||
width: 142px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #0052d9;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.table-title {
|
||||
font-size: 16px;
|
||||
color: #0052d9;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
width="600"
|
||||
append-to-body
|
||||
v-model="dialogVisible"
|
||||
:center="true"
|
||||
custom-class="KnowledgeDelete"
|
||||
><!-- 使用自定义头部组件 -->
|
||||
<template v-slot:header>
|
||||
<div class="KnowledgeDelete-header">
|
||||
<img :src="delIcon" alt="" />
|
||||
<span>知识删除</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="withdraw-content">
|
||||
<div class="label">删除原因</div>
|
||||
<el-input
|
||||
v-model="reason"
|
||||
maxlength="200"
|
||||
:rows="4"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
/>
|
||||
<div class="footer-btn">
|
||||
<div class="cancel_btn" @click="dialogVisible = false">取消</div>
|
||||
<!-- <div class="determine_btn">确定</div> -->
|
||||
<el-button
|
||||
size="large"
|
||||
@click="submit"
|
||||
style="width: 140px; margin: 0"
|
||||
class="footer-btn"
|
||||
type="primary"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import delIcon from "@/assets/knowledge/del.png";
|
||||
import { message } from "@/utils/message";
|
||||
const dialogVisible = ref(false);
|
||||
const reason = ref("");
|
||||
defineExpose({
|
||||
open(val) {
|
||||
id.value = val;
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
});
|
||||
const id = ref("");
|
||||
const closeDialog = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
const emit = defineEmits(["delOk"]);
|
||||
const submit = () => {
|
||||
if (reason.value) {
|
||||
emit("delOk", id.value, reason.value);
|
||||
closeDialog();
|
||||
} else {
|
||||
message("请填写原因", { type: "error" });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.KnowledgeDelete-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
height: 76px;
|
||||
border-bottom: 1px solid rgba(91, 139, 255, 0.3);
|
||||
position: relative;
|
||||
width: 100%;
|
||||
span {
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
color: #333333;
|
||||
}
|
||||
img {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
:deep(.el-dialog__header) {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.withdraw-content {
|
||||
.label {
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.desc {
|
||||
margin-top: 8px;
|
||||
font-size: 14px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,274 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
defineOptions({
|
||||
name: "TransferRecords"
|
||||
});
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const recordList = ref([
|
||||
{
|
||||
title: "知识报送",
|
||||
status: 0,
|
||||
time: "2024-03-12 12:24:23",
|
||||
name: "刘小华",
|
||||
department: "深圳市人力资源和社会保障局",
|
||||
desc: "说明说明说明说明说明说明说明说明说明"
|
||||
},
|
||||
{
|
||||
title: "驳回",
|
||||
status: 1,
|
||||
time: "2024-03-12 12:24:23",
|
||||
name: "刘小华",
|
||||
department: "深圳市人力资源和社会保障局",
|
||||
desc: "说明说明说明说明说明说明说明说明说明"
|
||||
},
|
||||
{
|
||||
title: "知识报送",
|
||||
status: 0,
|
||||
time: "2024-03-12 12:24:23",
|
||||
name: "刘小华",
|
||||
department: "深圳市人力资源和社会保障局",
|
||||
desc: "说明说明说明说明说明说明说明说明说明"
|
||||
},
|
||||
{
|
||||
title: "通过",
|
||||
status: 2,
|
||||
time: "2024-03-12 12:24:23",
|
||||
name: "刘小华",
|
||||
department: "深圳市人力资源和社会保障局",
|
||||
desc: "说明说明说明说明说明说明说明说明说明"
|
||||
},
|
||||
{
|
||||
title: "知识撤回",
|
||||
status: 3,
|
||||
time: "2024-03-12 12:24:23",
|
||||
name: "刘小华",
|
||||
department: "深圳市人力资源和社会保障局",
|
||||
desc: "说明说明说明说明说明说明说明说明说明"
|
||||
}
|
||||
]);
|
||||
defineExpose({
|
||||
open() {
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
const colorList = ["#0052D9", "#FF3429", "#00975E", "#FF9311"];
|
||||
const getStatusColor = index => {
|
||||
return {
|
||||
borderColor: colorList[index]
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer
|
||||
:size="900"
|
||||
append-to-body
|
||||
v-model="dialogVisible"
|
||||
:show-close="false"
|
||||
:with-header="false"
|
||||
:before-close="closeDialog"
|
||||
custom-class="TransferRecords"
|
||||
>
|
||||
<div class="TransferRecords">
|
||||
<div class="header-title">
|
||||
<div class="tip" />
|
||||
<span>流转记录</span>
|
||||
</div>
|
||||
<div class="line" />
|
||||
<div class="content">
|
||||
<div class="content-title">知识标题知识标题</div>
|
||||
<div class="record_list">
|
||||
<div
|
||||
class="record_list_item"
|
||||
v-for="(item, index) in recordList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="step_item">
|
||||
<div
|
||||
:style="getStatusColor(item.status)"
|
||||
class="step_item_drop"
|
||||
/>
|
||||
<div
|
||||
v-if="index !== recordList.length - 1"
|
||||
class="step_item_line"
|
||||
/>
|
||||
</div>
|
||||
<div class="step_content">
|
||||
<div class="step_content_head">
|
||||
<span>{{ item.title }}</span>
|
||||
<span class="time">{{ item.time }}</span>
|
||||
</div>
|
||||
<div class="step_content_item">
|
||||
<span class="label">姓名</span>
|
||||
<div class="value">{{ item.name }}</div>
|
||||
</div>
|
||||
<div class="step_content_item">
|
||||
<span class="label">部门</span>
|
||||
<div class="value">{{ item.department }}</div>
|
||||
</div>
|
||||
<div class="step_content_item">
|
||||
<span class="label">说明</span>
|
||||
<div class="value">{{ item.desc }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.TransferRecords {
|
||||
padding-left: 16px;
|
||||
:deep(.el-form-item__label) {
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
:deep(.hide .el-upload--picture-card) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// border-left: 6px solid #4287ff;
|
||||
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #2b3f54;
|
||||
|
||||
.tip {
|
||||
width: 6px;
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
line-height: 20px;
|
||||
background: #4287ff;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
position: relative;
|
||||
left: -20px;
|
||||
width: 860px;
|
||||
height: 1px;
|
||||
margin: 24px 0;
|
||||
background: rgb(91 139 255 / 30%);
|
||||
}
|
||||
.content {
|
||||
margin-top: 20px;
|
||||
.content-title {
|
||||
font-size: 20px;
|
||||
color: #333333;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.record_list {
|
||||
margin-top: 40px;
|
||||
.record_list_item {
|
||||
display: flex;
|
||||
|
||||
.step_item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.step_item_drop {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: #ffffff;
|
||||
border-radius: 50%;
|
||||
border: 3px solid #0052d9;
|
||||
}
|
||||
.step_item_line {
|
||||
width: 1px;
|
||||
flex: 1;
|
||||
background: #d9d9d9;
|
||||
position: relative;
|
||||
left: 6px;
|
||||
}
|
||||
.step_content {
|
||||
margin-left: 40px;
|
||||
padding-bottom: 40px;
|
||||
.step_content_head {
|
||||
font-size: 18px;
|
||||
color: #333333;
|
||||
.time {
|
||||
margin-left: 8px;
|
||||
font-size: 16px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.step_content_item {
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
color: #666666;
|
||||
margin-top: 10px;
|
||||
.label {
|
||||
width: 48px;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer_btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
|
||||
.reset {
|
||||
width: 188px;
|
||||
height: 48px;
|
||||
margin-right: 24px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 48px;
|
||||
color: #4287ff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border: 1px solid #4287ff;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 188px;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
line-height: 48px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: #4287ff;
|
||||
border: 1px solid #4287ff;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.upload_img {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.tip {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 200px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,513 @@
|
||||
<script setup lang="ts">
|
||||
import { ElMessage, UploadProps } from "element-plus";
|
||||
import { computed, reactive, ref } from "vue";
|
||||
import { Plus } from "@element-plus/icons-vue";
|
||||
|
||||
import WangEditor from "@/components/WangEditor/index.vue";
|
||||
import { useKnowledgeCentreStoreHooks } from "@/store/modules/knowledgeCentre";
|
||||
import { message } from "@/utils/message";
|
||||
const ruleFormRef = ref();
|
||||
const formData = reactive({
|
||||
operate: "",
|
||||
linkList: [
|
||||
{
|
||||
linkName: "",
|
||||
linkUrl: ""
|
||||
}
|
||||
],
|
||||
baseId: "",
|
||||
execTime: undefined,
|
||||
fileIdList: [],
|
||||
excerpt: "",
|
||||
publishDeptId: "",
|
||||
|
||||
knowledgeInfo: {
|
||||
timeliness: undefined,
|
||||
execTimeBegin: "",
|
||||
execTimeEnd: "",
|
||||
autoLoseEffect: undefined,
|
||||
territory: "",
|
||||
knowledgeTag: "",
|
||||
policyType: "",
|
||||
publishScope: "",
|
||||
publishDate: undefined
|
||||
},
|
||||
fileList: []
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
getDetails(data) {
|
||||
refWangEditor.value.initText(data.knowledgeContext.context);
|
||||
refWangEditor.value.initTitle(data.knowledge.title);
|
||||
const fileIdList = [];
|
||||
const fileList = [];
|
||||
data.fileInfoList.forEach(e => {
|
||||
fileIdList.push(e.fileBlobId);
|
||||
fileList.push({
|
||||
name: e.fileName
|
||||
});
|
||||
});
|
||||
const { baseId, excerpt, publishDeptId } = data.knowledge;
|
||||
const obj = {
|
||||
operate: "",
|
||||
linkList: data.knowledgeLinkList,
|
||||
baseId,
|
||||
execTime: [
|
||||
data.knowledgeInfo.execTimeBegin,
|
||||
data.knowledgeInfo.execTimeEnd
|
||||
],
|
||||
fileIdList,
|
||||
excerpt,
|
||||
publishDeptId,
|
||||
knowledgeInfo: data.knowledgeInfo,
|
||||
fileList
|
||||
};
|
||||
for (const key in obj) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (formData.hasOwnProperty(key)) {
|
||||
formData[key] = obj[key];
|
||||
}
|
||||
}
|
||||
console.log(formData);
|
||||
}
|
||||
});
|
||||
const departmentList = computed(() => {
|
||||
return useKnowledgeCentreStoreHooks().departmentList;
|
||||
});
|
||||
const applicationSubLibrary = computed(() => {
|
||||
return useKnowledgeCentreStoreHooks().applicationSubLibrary;
|
||||
});
|
||||
const refWangEditor = ref();
|
||||
const rules = {
|
||||
publishDeptId: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
baseId: [{ required: true, message: "请选择", trigger: "change" }],
|
||||
"knowledgeInfo.publishDate": [
|
||||
{ required: true, message: "请选择", trigger: "change" }
|
||||
],
|
||||
"knowledgeInfo.timeliness": [
|
||||
{ required: true, message: "请选择", trigger: "change" }
|
||||
]
|
||||
};
|
||||
|
||||
const handleSuccess: UploadProps["onSuccess"] = response => {
|
||||
if (response.code === 200) {
|
||||
formData.fileIdList.push(response.data);
|
||||
}
|
||||
};
|
||||
const handleRemove: UploadProps["onRemove"] = (file, uploadFiles) => {
|
||||
console.log(file, uploadFiles);
|
||||
const list = [];
|
||||
for (const item of uploadFiles) {
|
||||
list.push(item.response.data);
|
||||
}
|
||||
formData.fileIdList = list;
|
||||
};
|
||||
const beforeUpload: UploadProps["beforeUpload"] = async rawFile => {
|
||||
//上传图片格式和大小要求 png|jpg 10M
|
||||
|
||||
const type = rawFile.name.split(".")[rawFile.name.split(".").length - 1];
|
||||
if (rawFile.size / 1024 / 1024 > 10) {
|
||||
ElMessage.error("大小不能大于10M");
|
||||
return false;
|
||||
}
|
||||
// fileInfo.fileName = rawFile.name;
|
||||
return true;
|
||||
};
|
||||
const addUrl = () => {
|
||||
formData.linkList.push({
|
||||
linkName: "",
|
||||
linkUrl: ""
|
||||
});
|
||||
};
|
||||
const delUrl = index => {
|
||||
formData.linkList.splice(index, 1);
|
||||
};
|
||||
const emit = defineEmits(["save"]);
|
||||
const save = async (type, formEl) => {
|
||||
if (!refWangEditor.value.title || !refWangEditor.value.valueHtml) {
|
||||
message("请填写标题和正文", { type: "error" });
|
||||
return;
|
||||
}
|
||||
const { excerpt, fileIdList, linkList, publishDeptId, execTime, baseId } =
|
||||
formData;
|
||||
if (execTime && execTime.length > 0) {
|
||||
formData.knowledgeInfo.execTimeBegin = execTime[0];
|
||||
formData.knowledgeInfo.execTimeEnd = execTime[1];
|
||||
}
|
||||
const params = {
|
||||
operate: type,
|
||||
title: refWangEditor.value.title,
|
||||
content: refWangEditor.value.valueHtml,
|
||||
excerpt,
|
||||
fileIdList,
|
||||
linkList,
|
||||
publishDeptId,
|
||||
baseId,
|
||||
knowledgeInfo: formData.knowledgeInfo
|
||||
};
|
||||
|
||||
if (type === 2) {
|
||||
formEl.validate(async (valid, fields) => {
|
||||
if (valid) {
|
||||
emit("save", params);
|
||||
} else {
|
||||
return fields;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
emit("save", params);
|
||||
}
|
||||
};
|
||||
const changeType = val => {
|
||||
if (val === 1) {
|
||||
formData.execTime = [];
|
||||
}
|
||||
};
|
||||
const reset = () => {
|
||||
ruleFormRef.value.resetFields();
|
||||
formData.linkList = [
|
||||
{
|
||||
linkName: "",
|
||||
linkUrl: ""
|
||||
}
|
||||
];
|
||||
refWangEditor.value.initText("");
|
||||
refWangEditor.value.initTitle("");
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="template-submission">
|
||||
<el-scrollbar class="main-content" :show-scrollbar="false">
|
||||
<el-form
|
||||
ref="ruleFormRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<div class="main-card">
|
||||
<div class="main-card-title">
|
||||
<span>报送知识</span>
|
||||
</div>
|
||||
<el-row>
|
||||
<!-- <el-form-item class="ml-2" label="报送人姓名" prop="normalResult">
|
||||
<el-input v-model="formData.normalResult" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item class="ml-8" label="报送人部门" prop="normalResult">
|
||||
<el-input v-model="formData.normalResult" placeholder="请输入" />
|
||||
</el-form-item> -->
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="Editortext">
|
||||
<WangEditor ref="refWangEditor" />
|
||||
</div>
|
||||
<div class="main-card">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="摘要" prop="excerpt">
|
||||
<el-input
|
||||
size="large"
|
||||
v-model="formData.excerpt"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="相关附件" prop="fileList">
|
||||
<el-upload
|
||||
:file-list="formData.fileList"
|
||||
:limit="5"
|
||||
multiple
|
||||
action="/know-sub/file/upload"
|
||||
:on-success="handleSuccess"
|
||||
:on-remove="handleRemove"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<div class="upload-btn">
|
||||
<el-icon><Plus class="upload-btn-icon" /></el-icon>
|
||||
<span>上传素材</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="相关链接">
|
||||
<div
|
||||
class="url_list"
|
||||
v-for="(item, index) in formData.linkList"
|
||||
:key="index"
|
||||
>
|
||||
<el-row class="url_list_item">
|
||||
<el-input
|
||||
size="large"
|
||||
style="width: 500px"
|
||||
v-model="formData.linkList[index].linkName"
|
||||
placeholder="请输入链接标题"
|
||||
/>
|
||||
<el-input
|
||||
style="width: 600px; margin-left: 16px"
|
||||
size="large"
|
||||
v-model="formData.linkList[index].linkUrl"
|
||||
placeholder="请输入链接"
|
||||
><template #append>URL</template></el-input
|
||||
>
|
||||
<div v-if="index === 0" class="add_url" @click="addUrl">
|
||||
<el-icon><Plus class="upload-btn-icon" /></el-icon>
|
||||
<span>添加链接</span>
|
||||
</div>
|
||||
<div v-else @click="delUrl(index)" class="del_url">
|
||||
<span>删除</span>
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="main-card">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="发文部门" prop="publishDeptId">
|
||||
<el-select
|
||||
size="large"
|
||||
filterable
|
||||
v-model="formData.publishDeptId"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in departmentList"
|
||||
:key="item.id"
|
||||
:label="item.deptName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="应用子库" prop="baseId">
|
||||
<el-select
|
||||
size="large"
|
||||
filterable
|
||||
v-model="formData.baseId"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in applicationSubLibrary"
|
||||
:key="item.id"
|
||||
:label="item.baseName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="发布日期" prop="knowledgeInfo.publishDate">
|
||||
<el-date-picker
|
||||
v-model="formData.knowledgeInfo.publishDate"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择"
|
||||
size="large"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="有效日期" prop="knowledgeInfo.timeliness">
|
||||
<el-radio-group
|
||||
@change="changeType"
|
||||
v-model="formData.knowledgeInfo.timeliness"
|
||||
class="ml-4"
|
||||
>
|
||||
<el-radio :label="1" size="large">长期有效</el-radio>
|
||||
<el-radio :label="2" size="large">临时有效</el-radio>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-if="formData.knowledgeInfo.timeliness === 2"
|
||||
class="ml-4"
|
||||
v-model="formData.execTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="有效开始时间"
|
||||
end-placeholder="有效结束时间"
|
||||
size="large"
|
||||
/>
|
||||
<!-- <el-checkbox
|
||||
class="ml-4"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
v-model="formData.knowledgeInfo.autoLoseEffect"
|
||||
label="到期自动失效"
|
||||
size="large"
|
||||
/> -->
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属地域" prop="knowledgeInfo.territory">
|
||||
<el-input
|
||||
size="large"
|
||||
v-model="formData.knowledgeInfo.territory"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="知识标签" prop="knowledgeInfo.knowledgeTag">
|
||||
<el-input
|
||||
size="large"
|
||||
v-model="formData.knowledgeInfo.knowledgeTag"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="政策类型" prop="knowledgeInfo.policyType">
|
||||
<el-input
|
||||
size="large"
|
||||
v-model="formData.knowledgeInfo.policyType"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="公开范围" prop="knowledgeInfo.publishScope">
|
||||
<el-radio-group
|
||||
v-model="formData.knowledgeInfo.publishScope"
|
||||
class="ml-4"
|
||||
>
|
||||
<el-radio :label="0" size="large">公开</el-radio>
|
||||
<el-radio :label="1" size="large">不公开</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
|
||||
<div class="footer-content">
|
||||
<el-button
|
||||
@click="save(2, ruleFormRef)"
|
||||
size="large"
|
||||
style="width: 150px; height: 50px"
|
||||
type="primary"
|
||||
>发布</el-button
|
||||
>
|
||||
<div class="normal_btn" @click="save(1, ruleFormRef)">存草稿</div>
|
||||
<span class="reset_btn" @click="reset">重置</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.template-submission {
|
||||
margin: 0 80px;
|
||||
|
||||
.main-content {
|
||||
height: calc(100vh - 280px);
|
||||
overflow: auto;
|
||||
.main-card {
|
||||
width: 100%;
|
||||
|
||||
background: #ffffff;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
margin-bottom: 16px;
|
||||
padding: 24px;
|
||||
.main-card-title {
|
||||
margin-bottom: 24px;
|
||||
span {
|
||||
font-size: 24px;
|
||||
color: #333333;
|
||||
padding-left: 8px;
|
||||
border-left: 6px solid #0052d9;
|
||||
}
|
||||
}
|
||||
.upload-btn {
|
||||
width: 140px;
|
||||
height: 50px;
|
||||
background: #ffffff;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
border: 1px solid #0052d9;
|
||||
font-size: 16px;
|
||||
color: #0052d9;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.upload-btn-icon {
|
||||
color: #0052d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.url_list {
|
||||
.url_list_item {
|
||||
display: flex;
|
||||
margin-bottom: 32px;
|
||||
.add_url {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 16px;
|
||||
font-size: 16px;
|
||||
color: #0052d9;
|
||||
cursor: pointer;
|
||||
}
|
||||
.del_url {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 16px;
|
||||
font-size: 16px;
|
||||
color: #999999;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer-content {
|
||||
width: 100%;
|
||||
height: 99px;
|
||||
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.1);
|
||||
background: #ffffff;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
padding: 24px;
|
||||
margin-top: 16px;
|
||||
.normal_btn {
|
||||
width: 150px;
|
||||
height: 50px;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
border: 1px solid #0052d9;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
color: #0052d9;
|
||||
margin-right: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.reset_btn {
|
||||
margin-right: 40px;
|
||||
font-size: 16px;
|
||||
color: #999999;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.Editortext {
|
||||
background: #ffffff;
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import WangEditor from "@/components/WangEditor/index.vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
const refWangEditor = ref();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="Editortext">
|
||||
<WangEditor ref="refWangEditor" />
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped></style>
|
@ -0,0 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import MainTemplate from "../MainTemplate.vue";
|
||||
import { saveKnowledge } from "@/api/knowledgeCentre";
|
||||
import { useTabsStore } from "@/store/modules/tabs";
|
||||
import { message } from "@/utils/message";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
defineOptions({
|
||||
name: "addSubmission"
|
||||
});
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const tabs = useTabsStore();
|
||||
const save = async params => {
|
||||
const res: any = await saveKnowledge(params);
|
||||
if (res.code === 200) {
|
||||
message("新增成功", { type: "success" });
|
||||
tabs.closeCurrentTag({
|
||||
$router: router,
|
||||
$route: route
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<MainTemplate @save="save" />
|
||||
</div>
|
||||
</template>
|
@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import MainTemplate from "../MainTemplate.vue";
|
||||
import { updateKnowledge, queryKnowledgeDetail } from "@/api/knowledgeCentre";
|
||||
import { useTabsStore } from "@/store/modules/tabs";
|
||||
import { message } from "@/utils/message";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
defineOptions({
|
||||
name: "editSubmission"
|
||||
});
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const tabs = useTabsStore();
|
||||
const MainTemplateRef = ref();
|
||||
const save = async params => {
|
||||
const res: any = await updateKnowledge({
|
||||
...params,
|
||||
knowledgeId: route.query.id
|
||||
});
|
||||
if (res.code === 200) {
|
||||
message("编辑成功", { type: "success" });
|
||||
tabs.closeCurrentTag({
|
||||
$router: router,
|
||||
$route: route
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getDeatils = async () => {
|
||||
const res: any = await queryKnowledgeDetail({
|
||||
knowledgeId: route.query.id
|
||||
});
|
||||
MainTemplateRef.value.getDetails(res.data);
|
||||
};
|
||||
onMounted(() => {
|
||||
getDeatils();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<MainTemplate ref="MainTemplateRef" @save="save" />
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue