383 lines
9.9 KiB
Plaintext
383 lines
9.9 KiB
Plaintext
<script setup lang="ts">
|
|
import { getImg } from "./images";
|
|
import {
|
|
getNoticeList,
|
|
deleteWithdraw,
|
|
getManagerList,
|
|
getExternalManagerDetail, // news/重要通知-流程详情
|
|
externalWithdraw, // news/重要通知-撤回
|
|
getExternalManagerList, // news/重要通知-流程列表
|
|
} from "@/api/daikin/base";
|
|
import Editor from "@/views/home/intelligence/components/TinyECE.vue";
|
|
import UserPage from "../../home/intelligence/process/UserPages.vue";
|
|
import {
|
|
NModal,
|
|
NCard,
|
|
NForm,
|
|
NButton,
|
|
NFormItem,
|
|
NInput,
|
|
NRadio,
|
|
NSelect,
|
|
NSpace,
|
|
NRadioGroup,
|
|
useMessage,
|
|
treeDark,
|
|
} from "naive-ui";
|
|
import { useUserStore } from "@/stores/modules/user";
|
|
import HomeHead from "@/views/home/components/HomeHead.vue";
|
|
import { noticeld } from "@/stores/modules/noticeId";
|
|
import { saveArticle } from "@/api/daikin/base";
|
|
const editorContent = ref();
|
|
const { push } = useRouter();
|
|
const message = useMessage();
|
|
const not = noticeld();
|
|
const route = useRoute()
|
|
const activeNames = ref("2");
|
|
const Status = reactive({
|
|
reviewStatus: 1,
|
|
reviewSource: 2,
|
|
});
|
|
const cate = ref('7')
|
|
const activeName = ref("0");
|
|
const tabIndex = ref("0");
|
|
const tabs = ref([
|
|
{
|
|
name: "审核中",
|
|
icon: getImg("shhz2@2x.png"),
|
|
icons: getImg("shhz1@2x.png"),
|
|
id: 0,
|
|
},
|
|
{
|
|
name: "已审核",
|
|
icon: getImg("wanc2@2x.png"),
|
|
icons: getImg("wanc1@2x.png"),
|
|
id: 1,
|
|
},
|
|
{
|
|
name: "驳回/撤回",
|
|
icon: getImg("boh2@2x.png"),
|
|
icons: getImg("boh1@2x.png"),
|
|
id: 2,
|
|
},
|
|
]);
|
|
const listData = ref<any>([]);
|
|
|
|
const store2 = useUserStore();
|
|
// 二级
|
|
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
tabIndex.value = tab.index;
|
|
switch (tab.index) {
|
|
case "0":
|
|
getPageList("1");
|
|
break;
|
|
case "1":
|
|
// 审核通过
|
|
getPageList("3");
|
|
break;
|
|
case "2":
|
|
// 撤销驳回
|
|
getPageList("4");
|
|
break;
|
|
default:
|
|
getPageList("1");
|
|
break;
|
|
}
|
|
};
|
|
async function getPageList(reviewStatus: string) {
|
|
const { pageNum, pageSize } = pageInfo;
|
|
const resp = await getExternalManagerList({
|
|
pageNum,
|
|
pageSize,
|
|
reviewStatus,
|
|
cate: cate.value,
|
|
});
|
|
listData.value = [];
|
|
listData.value = resp.rows;
|
|
}
|
|
// 撤回按钮
|
|
const clickCancel = (data: any) => {
|
|
const { id, noticeId, reviewStatus } = data;
|
|
externalWithdraw(id).then((res) => {
|
|
console.log(res, "删除结果");
|
|
getPageList("1");
|
|
});
|
|
};
|
|
let formValue: any = ref({
|
|
type: "1",
|
|
cate: not.article.cate,
|
|
title: "",
|
|
tag: "",
|
|
source: "",
|
|
content: "",
|
|
reviewSource: "3",
|
|
isTop: "N",
|
|
treeSource: "1",
|
|
});
|
|
const pageInfo = reactive({
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
type: "1",
|
|
cate: "7",
|
|
total: 10,
|
|
});
|
|
onMounted(async () => {
|
|
cate.value = route.query.cate
|
|
getPageList("1");
|
|
});
|
|
function escapeHTML(html: string): string {
|
|
const tempElement = document.createElement("div");
|
|
tempElement.textContent = html;
|
|
return tempElement.innerHTML;
|
|
}
|
|
const handleClose = (tag: any) => {
|
|
dataList.value.splice(dataList.value.indexOf(tag), 1);
|
|
};
|
|
// 添加留言
|
|
async function save() {
|
|
let userIdList: any[] = [];
|
|
const cont = editorContent.value;
|
|
const content = escapeHTML(cont);
|
|
const { title, reviewSource, tag, treeSource, source, type, isTop } =
|
|
formValue.value;
|
|
const cate = not.article.cate;
|
|
// console.log(formValue.value, content,cate)
|
|
if (dataList.value) {
|
|
dataList.value.forEach((i: { userId: any }) => {
|
|
console.log(dataList.value);
|
|
userIdList.push(i.userId);
|
|
});
|
|
}
|
|
|
|
// console.log(formValue.value)
|
|
// if(userIdList.length<0) return
|
|
const { msg, code } = await saveArticle({
|
|
title,
|
|
tag: "",
|
|
isTop,
|
|
treeSource,
|
|
reviewSource,
|
|
source,
|
|
cate,
|
|
type,
|
|
content,
|
|
userIdList,
|
|
});
|
|
if (code === 200) {
|
|
message.success("新增成功");
|
|
} else {
|
|
message.success(msg);
|
|
}
|
|
push({ name: "external" });
|
|
}
|
|
// 编辑器数据
|
|
const handleChild = (data: string) => {
|
|
editorContent.value = data;
|
|
// console.log(data)
|
|
};
|
|
// 添加
|
|
const saveThis = (e: { preventDefault: () => void }) => {
|
|
e.preventDefault();
|
|
save();
|
|
};
|
|
const stores = noticeld();
|
|
const showModal = ref(false);
|
|
const setUserList = ref();
|
|
const dataList = ref();
|
|
const thisClick = () => {
|
|
showModal.value = true;
|
|
setUserList.value = dataList.value;
|
|
stores.article.reviewSource = formValue.value.reviewSource;
|
|
};
|
|
const CloseThis = (data: boolean) => {
|
|
showModal.value = data;
|
|
};
|
|
const handleChild1 = (data: any) => {
|
|
const { showModal: show, multipleSelection } = data;
|
|
console.log(show);
|
|
showModal.value = unref(show);
|
|
dataList.value = unref(multipleSelection);
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="page">
|
|
<HomeHead class="top">
|
|
<!-- <template #content>
|
|
<HomeHeadSearch />
|
|
</template> -->
|
|
</HomeHead>
|
|
<div class="back" @click="push({ name: 'external' })">返回首页</div>
|
|
<div class="bg-#fff p30px rounded-5px mt40px overflow-y-scroll h900px">
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
<el-tab-pane v-for="item in tabs" :key="item">
|
|
<template #label>
|
|
<span class="custom-tabs-label">
|
|
<img
|
|
:src="activeName == item.id ? item.icon : item.icons"
|
|
class="w25px h25px mr-5px mt--5px"
|
|
/>
|
|
<span class="text-20px">{{ item.name }}</span>
|
|
</span>
|
|
</template>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
<div
|
|
v-for="i in listData"
|
|
:key="i"
|
|
class="mt8px cursor-pointer flex items-center p15px pl20px text-18px"
|
|
>
|
|
<NTag
|
|
type="info"
|
|
v-if="i.reviewStatus == 5"
|
|
class="shrink-0 w80px inline-flex px8px py5px lh-1.5em text-14px rd-6px text-#fff/80 vertical-middle items-center justify-center bg-#547EE9 mr10px"
|
|
>
|
|
个人撤回
|
|
</NTag>
|
|
<NTag
|
|
type="info"
|
|
v-else-if="i.reviewStatus == 4"
|
|
class="shrink-0 w80px inline-flex px8px py5px lh-1.5em text-14px rd-6px text-#fff/80 vertical-middle items-center justify-center bg-#002FA7 mr10px"
|
|
>
|
|
领导驳回
|
|
</NTag>
|
|
<!-- <span v-for="s in cateList" :key="s">
|
|
<span
|
|
v-if="s.cate === i.cate"
|
|
class="shrink-0 w80px inline-flex px8px py5px lh-1.5em text-14px rd-6px text-#fff/80 vertical-middle items-center justify-center bg-gray mr10px"
|
|
:style="{ backgroundColor: s.color }"
|
|
>
|
|
{{ s.name }}
|
|
</span>
|
|
</span> -->
|
|
<el-dropdown>
|
|
<span
|
|
class="truncate flex-1 w0 text-#142142 hover:underline w400px max-w400px"
|
|
:title="i.title"
|
|
@click="clickTo(i)"
|
|
>
|
|
{{ i.title }}
|
|
</span>
|
|
<template #dropdown v-if="flg && i.firstReviewName">
|
|
<el-dropdown-menu>
|
|
<el-dropdown-item v-if="i.firstReviewName">
|
|
<div class="ml20px text-#808696 !text-12px flex">
|
|
<span class="min-w120px"
|
|
>初审人:{{ i.firstReviewName }}</span
|
|
>
|
|
<span class="ml20px">初审时间:{{ i.firstReviewTime }}</span>
|
|
</div>
|
|
</el-dropdown-item>
|
|
<el-dropdown-item v-if="i.ultimateReviewName">
|
|
<div class="ml20px text-#808696 !text-12px flex">
|
|
<span class="min-w120px"
|
|
>终审人:{{ i.ultimateReviewName }}</span
|
|
>
|
|
<span class="ml20px"
|
|
>终审时间:{{ i.ultimateReviewTime }}</span
|
|
>
|
|
</div>
|
|
</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</template>
|
|
</el-dropdown>
|
|
<span class="shrink-0 ml38px text-#808696 w220px">{{
|
|
i.createTime
|
|
}}</span>
|
|
<span
|
|
v-if="store2.user.isReview > 0 && i.publishName"
|
|
class="ml20px text-#808696 text-16px flex-1"
|
|
>来自: {{ i.publishName }}</span
|
|
>
|
|
<span v-if="tabIndex == 0" class="absolute right-10px top-18px">
|
|
<el-button @click="clickCancel(i)">撤回</el-button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped lang="less">
|
|
::-webkit-scrollbar {
|
|
width: 1px;
|
|
}
|
|
.back {
|
|
position: absolute;
|
|
top: 25px;
|
|
left: 25px;
|
|
color: #fff;
|
|
// z-index: 500;
|
|
font-size: 25px;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
justify-content: center;
|
|
}
|
|
.top {
|
|
right: 30px;
|
|
top: 0px;
|
|
}
|
|
.page {
|
|
width: 100%;
|
|
// height: 100px;
|
|
font-family: "PingFang SC";
|
|
user-select: none;
|
|
|
|
background-image: url("@/assets/images/bg.jpg");
|
|
background-color: #000;
|
|
background-position: 0 0;
|
|
background-repeat: no-repeat;
|
|
background-size: cover;
|
|
color: #fff;
|
|
|
|
line-height: 1;
|
|
.page-wrap {
|
|
display: grid;
|
|
grid-template-columns: 1fr 314px;
|
|
grid-template-rows: repeat(2, 1fr);
|
|
grid-column-gap: 30px;
|
|
grid-row-gap: 30px;
|
|
|
|
.page-main {
|
|
height: 830px;
|
|
grid-area: 1 / 1 / 3 / 2;
|
|
}
|
|
.page-side {
|
|
height: 100%;
|
|
grid-area: 1 / 2 / 2 / 3;
|
|
&:last-of-type {
|
|
height: 300px;
|
|
grid-area: 2 / 2 / 3 / 3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.main {
|
|
background-image: url("@/assets/images/bg-rs-main.svg");
|
|
background-position: 0 0;
|
|
background-repeat: repeat-x;
|
|
background-size: auto;
|
|
}
|
|
|
|
.box {
|
|
--title-h: 58px;
|
|
|
|
border: 0;
|
|
.box-title {
|
|
height: var(--title-h);
|
|
color: #fff;
|
|
background-color: #537deb;
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
padding: 0 24px;
|
|
cursor: pointer;
|
|
}
|
|
.box-content {
|
|
height: 100%;
|
|
max-height: calc(100% - var(--title-h));
|
|
}
|
|
}
|
|
.line {
|
|
border-bottom: 1px solid #eef3fb;
|
|
}
|
|
</style>
|