소스 검색

系统消息

linwenxin 1 년 전
부모
커밋
efe337a9a8
2개의 변경된 파일50개의 추가작업 그리고 37개의 파일을 삭제
  1. 0 1
      src/views/setting/notification/announcement/index.vue
  2. 50 36
      src/views/setting/notification/systemMessage/index.vue

+ 0 - 1
src/views/setting/notification/announcement/index.vue

@@ -354,7 +354,6 @@ export default {
 					})
 				}}>编辑</el-button> : null}
 				<el-button type="text" onClick={() => {
-
 					this.$refs.tabPage.addTab({
 						activeKey: "detail",
 						key: "detail",

+ 50 - 36
src/views/setting/notification/systemMessage/index.vue

@@ -1,19 +1,28 @@
 <template>
-	<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
-		:operationColumnWidth="200" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
-		:column-parsing="columnParsing" :operation="operation" :exportList="exportList">
-		<el-dialog title="" width="500px" custom-class="diy-dialog" append-to-body :modal="true" :visible.sync="formDialog2"
-			:show-close="true" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="formCancel">
-			<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
-				<zj-form-module :title="formDialogTitles[formDialogType]" label-width="100px" :showPackUp="false"
-					:form-data="formData" :form-items="formItems2">
-				</zj-form-module>
-			</zj-form-container>
-			<div slot="footer" class="dialog-footer">
-				<el-button size="mini" @click="formCancel">取 消</el-button>
+	<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: '列表页面', essential: true }]">
+		<template slot-scope="{activeKey, data}">
+			<div :style="{
+				width: '100%',
+				height: activeKey == 'list' ? '100%' : '0px',
+				overflow: 'hidden'
+			}">
+				<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
+					:operationColumnWidth="200" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+					:column-parsing="columnParsing" :operation="operation" :exportList="exportList">
+				</template-page>
 			</div>
-		</el-dialog>
-	</template-page>
+			<div v-if="~['detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
+				<zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
+					<zj-form-module :title="data.label" label-width="100px" :showPackUp="false" :form-data="formData"
+						:form-items="formItems2">
+					</zj-form-module>
+				</zj-form-container>
+				<div slot="footer" class="dialog-footer">
+					<el-button size="mini" @click="data.removeTab()">取 消</el-button>
+				</div>
+			</div>
+		</template>
+	</zj-tab-page>
 </template>
 
 <script>
@@ -44,9 +53,6 @@ export default {
 			recordSelected: [],
 			/** 表单变量 */
 			formDialogType: 0,
-			formDialogTitles: ["新增", "编辑", "详情"],
-			formDialog: false,
-			formDialog2: false,
 			formData: {
 				type: "A",
 				title: "",
@@ -129,7 +135,7 @@ export default {
 	},
 	methods: {
 		// 列表请求函数
-		getList:noticeListPageV2,
+		getList: noticeListPageV2,
 		// 列表导出函数
 		exportList: noticePageExport,
 		// 表格列解析渲染数据更改
@@ -144,40 +150,48 @@ export default {
 		operation(h, { row, index, column }) {
 			return (<div class='operation-btns'>
 				<el-button type="text" onClick={() => {
-					getNoticeDetail({
-						noticeId: row.noticeId
-					}).then(res => {
-						Object.assign(this.formData, res.data, {
-							files: res.data.files ? res.data.files.map(item => ({
-								...item,
-								size: item.fileSize,
-								type: item.fileType,
-							})) : []
-						})
-						this.formDialogType = 2
-						this.openForm('formDialog2')
+					this.$refs.tabPage.addTab({
+						activeKey: "detail",
+						key: "detail",
+						label: "查看",
+						triggerEvent: () => {
+							this.formCancel()
+							this.$nextTick(() => {
+								getNoticeDetail({
+									noticeId: row.noticeId
+								}).then(res => {
+									Object.assign(this.formData, res.data, {
+										files: res.data.files ? res.data.files.map(item => ({
+											...item,
+											size: item.fileSize,
+											type: item.fileType,
+										})) : []
+									})
+									this.formDialogType = 2
+									this.openForm()
+								})
+							})
+						},
+						closeEvent: () => {
+						}
 					})
 				}}>查看</el-button>
 			</div>)
 		},
-		openForm(key = 'formDialog') {
+		openForm() {
 			if (JSON.parse(localStorage.getItem("greemall_user")).type == 2) {
 				getListaa({ pageNum: 1, pageSize: -1, type: 1 }).then((res) => {
 					this.websitList = res.data.records
-					this[key] = true;
 				})
 			} else {
 				memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [] }).then(res => {
 					this.workerList = res.data.records
-					this[key] = true;
 				})
 			}
 		},
 		formCancel() {
-			this.$refs.formRef.$refs.inlineForm.clearValidate()
+			this.$refs?.formRef?.$refs?.inlineForm?.clearValidate()
 			this.$data.formData = this.$options.data().formData
-			this.formDialog = false
-			this.formDialog2 = false
 			this.websitList = []
 		},
 	}