mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 19:06:39 +08:00
代码格式化与部分细节优化
This commit is contained in:
parent
9100dc1225
commit
a90b8d114a
@ -24,7 +24,7 @@
|
|||||||
<a-descriptions-item label="创建时间">{{ detail.createTime }}</a-descriptions-item>
|
<a-descriptions-item label="创建时间">{{ detail.createTime }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="创建人">{{ detail.createUserName }}</a-descriptions-item>
|
<a-descriptions-item label="创建人">{{ detail.createUserName }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="营业执照">
|
<a-descriptions-item label="营业执照">
|
||||||
<FilePreview :default-file-list="detail.businessLicense" />
|
<FilePreview :file-list="detail.businessLicense" />
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<a-card style="margin-bottom: 15px" size="small">
|
<a-card style="margin-bottom: 15px" size="small">
|
||||||
<a-descriptions :title="noticeDetail.title" :columns="4" size="small">
|
<a-descriptions :title="noticeDetail.title" :column="4" size="small">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button>
|
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||||
</template>
|
</template>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<a class="file-item" v-for="item in noticeDetail.attachment" :key="item.fileId" @click="onPrevFile(item)">{{ item.fileName }}</a>
|
<a class="file-item" v-for="item in noticeDetail.attachment" :key="item.fileId" @click="onPrevFile(item)">{{ item.fileName }}</a>
|
||||||
</div>
|
</div>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
<a-descriptions-item label="可见范围" :span="2">
|
<a-descriptions-item label="可见范围">
|
||||||
<template v-if="noticeDetail.allVisibleFlag">全部可见</template>
|
<template v-if="noticeDetail.allVisibleFlag">全部可见</template>
|
||||||
<div class="visible-list">
|
<div class="visible-list">
|
||||||
<div class="visible-item" v-for="item in noticeDetail.visibleRangeList" :key="item.dataId">
|
<div class="visible-item" v-for="item in noticeDetail.visibleRangeList" :key="item.dataId">
|
||||||
@ -59,86 +59,86 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import NoticeFormDrawer from './components/notice-form-drawer.vue';
|
import NoticeFormDrawer from './components/notice-form-drawer.vue';
|
||||||
import NoticeViewRecordList from './components/notice-view-record-list.vue';
|
import NoticeViewRecordList from './components/notice-view-record-list.vue';
|
||||||
import { noticeApi } from '/@/api/business/oa/notice-api';
|
import { noticeApi } from '/@/api/business/oa/notice-api';
|
||||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||||
import FilePreviewModal from '/@/components/support/file-preview-modal/index.vue';
|
import FilePreviewModal from '/@/components/support/file-preview-modal/index.vue';
|
||||||
import { smartSentry } from '/@/lib/smart-sentry';
|
import { smartSentry } from '/@/lib/smart-sentry';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
newsType: {
|
newsType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const activeKey = ref(1);
|
const activeKey = ref(1);
|
||||||
|
|
||||||
const noticeDetail = ref({});
|
const noticeDetail = ref({});
|
||||||
const noticeViewRecordList = ref();
|
const noticeViewRecordList = ref();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (route.query.noticeId) {
|
if (route.query.noticeId) {
|
||||||
queryNoticeDetail();
|
queryNoticeDetail();
|
||||||
noticeViewRecordList.value.onSearch();
|
noticeViewRecordList.value.onSearch();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 查询详情
|
||||||
|
async function queryNoticeDetail() {
|
||||||
|
try {
|
||||||
|
SmartLoading.show();
|
||||||
|
const result = await noticeApi.getUpdateNoticeInfo(route.query.noticeId);
|
||||||
|
noticeDetail.value = result.data;
|
||||||
|
} catch (err) {
|
||||||
|
smartSentry.captureError(err);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// 查询详情
|
// 点击编辑
|
||||||
async function queryNoticeDetail() {
|
const noticeFormDrawerRef = ref();
|
||||||
try {
|
function onEdit() {
|
||||||
SmartLoading.show();
|
noticeFormDrawerRef.value.showModal(noticeDetail.value.noticeId);
|
||||||
const result = await noticeApi.getUpdateNoticeInfo(route.query.noticeId);
|
|
||||||
noticeDetail.value = result.data;
|
|
||||||
} catch (err) {
|
|
||||||
smartSentry.captureError(err);
|
|
||||||
} finally {
|
|
||||||
SmartLoading.hide();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 点击编辑
|
// 预览附件
|
||||||
const noticeFormDrawerRef = ref();
|
const filePreviewRef = ref();
|
||||||
function onEdit() {
|
function onPrevFile(fileItem) {
|
||||||
noticeFormDrawerRef.value.showModal(noticeDetail.value.noticeId);
|
filePreviewRef.value.showPreview(fileItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 预览附件
|
|
||||||
const filePreviewRef = ref();
|
|
||||||
function onPrevFile(fileItem) {
|
|
||||||
filePreviewRef.value.showPreview(fileItem);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
:deep(.ant-descriptions-item-content) {
|
:deep(.ant-descriptions-item-content) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
.file-list {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
.file-item {
|
|
||||||
display: block;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
}
|
||||||
}
|
.file-list {
|
||||||
.visible-list {
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
.visible-item {
|
.file-item {
|
||||||
margin-right: 10px;
|
display: block;
|
||||||
color: #666;
|
margin-right: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
.visible-list {
|
||||||
.content-html {
|
display: flex;
|
||||||
img {
|
flex-wrap: wrap;
|
||||||
max-width: 100%;
|
.visible-item {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-html {
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -27,127 +27,119 @@
|
|||||||
<!--endprint-->
|
<!--endprint-->
|
||||||
</div>
|
</div>
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<div>附件:<file-preview :fileList="noticeDetail.attachment" /></div>
|
<div>
|
||||||
|
附件:
|
||||||
|
<file-preview v-if="!$lodash.isEmpty(noticeDetail.attachment)" :fileList="noticeDetail.attachment" />
|
||||||
|
<span v-else>无</span>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-card title="记录" size="small" class="smart-margin-top10">
|
<a-card title="记录" size="small" class="smart-margin-top10">
|
||||||
<NoticeViewRecordList ref="noticeViewRecordList" :noticeId="route.query.noticeId" />
|
<NoticeViewRecordList ref="noticeViewRecordList" :noticeId="route.query.noticeId" />
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 预览附件 -->
|
|
||||||
<FilePreviewModal ref="filePreviewRef" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import NoticeViewRecordList from './components/notice-view-record-list.vue';
|
import NoticeViewRecordList from './components/notice-view-record-list.vue';
|
||||||
import { noticeApi } from '/@/api/business/oa/notice-api';
|
import { noticeApi } from '/@/api/business/oa/notice-api';
|
||||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||||
import FilePreviewModal from '/@/components/support/file-preview-modal/index.vue';
|
import FilePreview from '/@/components/support/file-preview/index.vue';
|
||||||
import FilePreview from '/@/components/support/file-preview/index.vue';
|
import { smartSentry } from '/@/lib/smart-sentry';
|
||||||
import { smartSentry } from '/@/lib/smart-sentry';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const activeKey = ref(1);
|
const noticeDetail = ref({});
|
||||||
|
|
||||||
const noticeDetail = ref({});
|
onMounted(() => {
|
||||||
|
if (route.query.noticeId) {
|
||||||
|
queryNoticeDetail();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
const noticeViewRecordList = ref();
|
||||||
if (route.query.noticeId) {
|
|
||||||
queryNoticeDetail();
|
// 查询详情
|
||||||
|
async function queryNoticeDetail() {
|
||||||
|
try {
|
||||||
|
SmartLoading.show();
|
||||||
|
const result = await noticeApi.view(route.query.noticeId);
|
||||||
|
noticeDetail.value = result.data;
|
||||||
|
|
||||||
|
noticeViewRecordList.value.onSearch();
|
||||||
|
} catch (err) {
|
||||||
|
smartSentry.captureError(err);
|
||||||
|
} finally {
|
||||||
|
SmartLoading.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
const noticeViewRecordList = ref();
|
// 点击编辑
|
||||||
|
const noticeFormDrawerRef = ref();
|
||||||
// 查询详情
|
function onEdit() {
|
||||||
async function queryNoticeDetail() {
|
noticeFormDrawerRef.value.showModal(noticeDetail.value.noticeId);
|
||||||
try {
|
|
||||||
SmartLoading.show();
|
|
||||||
const result = await noticeApi.view(route.query.noticeId);
|
|
||||||
noticeDetail.value = result.data;
|
|
||||||
|
|
||||||
noticeViewRecordList.value.onSearch();
|
|
||||||
} catch (err) {
|
|
||||||
smartSentry.captureError(err);
|
|
||||||
} finally {
|
|
||||||
SmartLoading.hide();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 点击编辑
|
// 打印
|
||||||
const noticeFormDrawerRef = ref();
|
function print() {
|
||||||
function onEdit() {
|
let bdhtml = window.document.body.innerHTML;
|
||||||
noticeFormDrawerRef.value.showModal(noticeDetail.value.noticeId);
|
let sprnstr = '<!--startprint-->'; //必须在页面添加<!--startprint-->和<!--endprint-->而且需要打印的内容必须在它们之间
|
||||||
}
|
let eprnstr = '<!--endprint-->';
|
||||||
|
let prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr));
|
||||||
// 预览附件
|
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
|
||||||
const filePreviewRef = ref();
|
let newWin = window.open(''); //新打开一个空窗口
|
||||||
function onPrevFile(fileItem) {
|
newWin.document.body.innerHTML = prnhtml;
|
||||||
filePreviewRef.value.showPreview(fileItem);
|
newWin.document.close(); //在IE浏览器中使用必须添加这一句
|
||||||
}
|
newWin.focus(); //在IE浏览器中使用必须添加这一句
|
||||||
|
newWin.print(); //打印
|
||||||
// 打印
|
newWin.close(); //关闭窗口
|
||||||
function print() {
|
}
|
||||||
let bdhtml = window.document.body.innerHTML;
|
|
||||||
let sprnstr = '<!--startprint-->'; //必须在页面添加<!--startprint-->和<!--endprint-->而且需要打印的内容必须在它们之间
|
|
||||||
let eprnstr = '<!--endprint-->';
|
|
||||||
let prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr));
|
|
||||||
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
|
|
||||||
let newWin = window.open(''); //新打开一个空窗口
|
|
||||||
newWin.document.body.innerHTML = prnhtml;
|
|
||||||
newWin.document.close(); //在IE浏览器中使用必须添加这一句
|
|
||||||
newWin.focus(); //在IE浏览器中使用必须添加这一句
|
|
||||||
newWin.print(); //打印
|
|
||||||
newWin.close(); //关闭窗口
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
:deep(.ant-descriptions-item-content) {
|
:deep(.ant-descriptions-item-content) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
.file-list {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
.file-item {
|
|
||||||
display: block;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
}
|
||||||
}
|
.file-list {
|
||||||
.visible-list {
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
.visible-item {
|
.file-item {
|
||||||
margin-right: 10px;
|
display: block;
|
||||||
color: #666;
|
margin-right: 10px;
|
||||||
}
|
|
||||||
}
|
|
||||||
.content-header {
|
|
||||||
.content-header-title {
|
|
||||||
margin: 10px 0px;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.content-header-info {
|
|
||||||
margin: 10px 0px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #888;
|
|
||||||
text-align: center;
|
|
||||||
span {
|
|
||||||
margin: 0 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.visible-list {
|
||||||
.content-html {
|
display: flex;
|
||||||
img {
|
flex-wrap: wrap;
|
||||||
max-width: 100%;
|
.visible-item {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-header {
|
||||||
|
.content-header-title {
|
||||||
|
margin: 10px 0px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.content-header-info {
|
||||||
|
margin: 10px 0px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #888;
|
||||||
|
text-align: center;
|
||||||
|
span {
|
||||||
|
margin: 0 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-html {
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user