|
|
@@ -1,47 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <detail-template
|
|
|
- :headData="mainAreaData"
|
|
|
- :title="mainData.title"
|
|
|
- :tabs="['通告内容','详细信息']"
|
|
|
- ownertable="sat_notice"
|
|
|
- :disable="utils.isDisabled(mainData.status,['发布'])"
|
|
|
- :delParam="{id:20221101095103,content:{sat_noticeids:[router.currentRoute.value.query.id]}}"
|
|
|
- >
|
|
|
+ <detail-template :headData="mainAreaData" :title="mainData.title" :tabs="['通告内容', '详细信息']" ownertable="sat_notice"
|
|
|
+ :disable="utils.isDisabled(mainData.status, ['发布'])"
|
|
|
+ :delParam="{ id: 20221101095103, content: { sat_noticeids: [router.currentRoute.value.query.id] } }">
|
|
|
<template #operation>
|
|
|
- <editNotive @back="mianData()" :disabled="!utils.hasPermission('update') || mainData.status == '发布'" :rowData="mainData"></editNotive>
|
|
|
- <customBtn
|
|
|
- :disabled="!utils.hasPermission('open')"
|
|
|
- btnName="发布"
|
|
|
- idName="20221101095203"
|
|
|
- keyName="sat_noticeids"
|
|
|
- :id="[router.currentRoute.value.query.id]"
|
|
|
- type="primary"
|
|
|
- message="确定发布当前通告吗?"
|
|
|
- @onSuccess="mianData()"
|
|
|
- v-if="mainData.status == '新建'"
|
|
|
- size="middle"
|
|
|
- />
|
|
|
- <customBtn
|
|
|
- :disabled="!utils.hasPermission('noopen')"
|
|
|
- btnName="取消发布"
|
|
|
- idName="20221101095303"
|
|
|
- keyName="sat_noticeids"
|
|
|
- :id="[router.currentRoute.value.query.id]"
|
|
|
- type="primary"
|
|
|
- message="确定取消发布当前通告吗?"
|
|
|
- @onSuccess="mianData()"
|
|
|
- size="middle"
|
|
|
- v-else
|
|
|
- />
|
|
|
+ <editNotive @back="mianData()" :disabled="!utils.hasPermission('update') || mainData.status == '发布'"
|
|
|
+ :rowData="mainData"></editNotive>
|
|
|
+ <customBtn :disabled="!utils.hasPermission('open')" btnName="发布" idName="20221101095203" keyName="sat_noticeids"
|
|
|
+ :id="[router.currentRoute.value.query.id]" type="primary" message="确定发布当前通告吗?" @onSuccess="mianData()"
|
|
|
+ v-if="mainData.status == '新建'" size="middle" />
|
|
|
+ <customBtn :disabled="!utils.hasPermission('noopen')" btnName="取消发布" idName="20221101095303"
|
|
|
+ keyName="sat_noticeids" :id="[router.currentRoute.value.query.id]" type="primary" message="确定取消发布当前通告吗?"
|
|
|
+ @onSuccess="mianData()" size="middle" v-else />
|
|
|
</template>
|
|
|
<template #tab0>
|
|
|
<div id="editor-content"></div>
|
|
|
</template>
|
|
|
<template #tab1>
|
|
|
- <span class="normal-title" style="margin-bottom: 10px">基本信息</span>
|
|
|
+ <span class="normal-title">基本信息</span>
|
|
|
<defaultInfo :data="baseInfo"></defaultInfo>
|
|
|
- <span class="normal-title" style="margin: 10px 0">系统信息</span>
|
|
|
+ <block v-if="viewRange.length > 0">
|
|
|
+ <span class="normal-title">浏览范围</span>
|
|
|
+ <defaultInfo :data="viewRange"></defaultInfo>
|
|
|
+ </block>
|
|
|
+ <span class="normal-title">系统信息</span>
|
|
|
<defaultInfo :data="systemInfo"></defaultInfo>
|
|
|
</template>
|
|
|
<template #tab2>
|
|
|
@@ -53,7 +35,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import Api from '@/api/api'
|
|
|
-import utils from '@/utils/utils'
|
|
|
+import utils from '@/utils/utils'
|
|
|
import detailTemplate from '@/components/detailTemplate/index.vue'
|
|
|
import defaultInfo from '@/template/defaultInfo/index.vue'
|
|
|
import customBtn from '@/components/customHandleBtn/index.vue'
|
|
|
@@ -61,21 +43,22 @@ import editNotive from '../modules/editNotice.vue'
|
|
|
import fileTable from '../modules/fileTable.vue'
|
|
|
|
|
|
import { useRouter } from "vue-router";
|
|
|
-import {ref,defineProps,createVNode, defineComponent,onMounted, provide} from 'vue'
|
|
|
+import { ref, defineProps, createVNode, defineComponent, onMounted, provide } from 'vue'
|
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
const router = useRouter()
|
|
|
const mainAreaData = ref([])
|
|
|
const mainData = ref({})
|
|
|
let baseInfo = ref([])
|
|
|
+let viewRange = ref([])
|
|
|
let systemInfo = ref([])
|
|
|
let classList = ref([])
|
|
|
-provide('classList',() => classList.value)
|
|
|
-const mianData = async ()=>{
|
|
|
+provide('classList', () => classList.value)
|
|
|
+const mianData = async () => {
|
|
|
const res = await Api.requested({
|
|
|
"id": "20221101095003",
|
|
|
"content": {
|
|
|
- "sat_noticeid": router.currentRoute.value.query.id
|
|
|
+ "sat_noticeid": router.currentRoute.value.query.id
|
|
|
}
|
|
|
})
|
|
|
mainData.value = res.data
|
|
|
@@ -84,23 +67,68 @@ const mianData = async ()=>{
|
|
|
changeDataStructure(res.data)
|
|
|
|
|
|
baseInfo.value = [
|
|
|
- {label:'标题',value:mainData.value.title},
|
|
|
- {label:'版块',value:mainData.value.classname},
|
|
|
- {label:'状态',value:mainData.value.status},
|
|
|
+ { label: '标题', value: mainData.value.title },
|
|
|
+ { label: '版块', value: mainData.value.classname },
|
|
|
+ { label: '状态', value: mainData.value.status },
|
|
|
]
|
|
|
systemInfo.value = [
|
|
|
- {label:'创建人',value:mainData.value.createby},
|
|
|
- {label:'创建时间',value:mainData.value.createdate},
|
|
|
- {label:'最近编辑人',value:mainData.value.changeby},
|
|
|
- {label:'最近编辑时间',value:mainData.value.changedate},
|
|
|
- {label:'发布人',value:mainData.value.checkby},
|
|
|
- {label:'发布时间',value:mainData.value.checkdate},
|
|
|
+ { label: '创建人', value: mainData.value.createby },
|
|
|
+ { label: '创建时间', value: mainData.value.createdate },
|
|
|
+ { label: '最近编辑人', value: mainData.value.changeby },
|
|
|
+ { label: '最近编辑时间', value: mainData.value.changedate },
|
|
|
+ { label: '发布人', value: mainData.value.checkby },
|
|
|
+ { label: '发布时间', value: mainData.value.checkdate },
|
|
|
]
|
|
|
+ getViewRange()
|
|
|
}
|
|
|
|
|
|
+function getViewRange() {
|
|
|
+ let params = [
|
|
|
+ { type: "角色", "classname": "sysmanage.develop.optiontype.optiontype", "method": "optiontypeselect", "content": { "pageNumber": 1, "pageSize": 1000, "typename": "role", "parameter": {} } },
|
|
|
+ { type: "部门", "id": 20240402101602, "content": { "ownertable": "sat_notice", "pageNumber": 1, "pageSize": 20, "where": {} } },
|
|
|
+ { type: "人员", "id": 20240402101702, "content": { "ownertable": "sat_notice", "pageNumber": 1, "where": {} } },
|
|
|
+ { type: "区域", "id": 20240402101802, "content": { "ownertable": "sat_notice", "pageNumber": 1, "where": {} } },
|
|
|
+ { type: "经销商", "id": 20240402101902, "content": { "ownertable": "sat_notice", "pageNumber": 1, "where": {} } }
|
|
|
+ ];
|
|
|
+ Promise.all(params.map(item => {
|
|
|
+ item.content.ownerid = router.currentRoute.value.query.id;
|
|
|
+ item.content.pageSize = 9999
|
|
|
+ return Api.requested(item)
|
|
|
+ })).then(results => {
|
|
|
+ results.forEach((res, index) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ let value = ''
|
|
|
+ switch (params[index].type) {
|
|
|
+ case '角色':
|
|
|
+ let roleids = mainData.value.role;
|
|
|
+ value = res.data.filter(item => roleids.includes(item.roleid)).map(item => item.rolename).join(',')
|
|
|
+ break;
|
|
|
+ case '部门':
|
|
|
+ value = res.data.map(item => item.depname).join(',')
|
|
|
+ break;
|
|
|
+ case '人员':
|
|
|
+ value = res.data.map(item => item.name).join(',')
|
|
|
+ break;
|
|
|
+ case '区域':
|
|
|
+ value = res.data.map(item => item.areaname).join(',')
|
|
|
+ break;
|
|
|
+ case '经销商':
|
|
|
+ value = res.data.map(item => item.enterprisename).join(',')
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ viewRange.value.push({ label: params[index].type, value: value || "--" })
|
|
|
+ } else {
|
|
|
+ typeMap[params[index].type] = '获取失败'
|
|
|
+ viewRange.value.push({ label: params[index].type, value: '获取失败' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const getClassList = async () => {
|
|
|
let res = await Api.requested({
|
|
|
- 'id':20221101094603,
|
|
|
+ 'id': 20221101094603,
|
|
|
'content': {
|
|
|
'where': {
|
|
|
}
|
|
|
@@ -110,14 +138,19 @@ const getClassList = async () => {
|
|
|
}
|
|
|
|
|
|
const changeDataStructure = (data) => {
|
|
|
- mainAreaData.value = utils.FormLayout('detailsHead',data)
|
|
|
+ mainAreaData.value = utils.FormLayout('detailsHead', data)
|
|
|
}
|
|
|
-onMounted (()=>{
|
|
|
+onMounted(() => {
|
|
|
mianData()
|
|
|
getClassList()
|
|
|
})
|
|
|
</script>
|
|
|
<style>
|
|
|
+.normal-title {
|
|
|
+ margin: 10px;
|
|
|
+ margin-left: 0;
|
|
|
+}
|
|
|
+
|
|
|
#editor-content p img {
|
|
|
width: 100%;
|
|
|
}
|