WZQ преди 1 година
родител
ревизия
1e19d5e3a0

+ 41 - 1
src/api/home/home.js

@@ -7,9 +7,15 @@ const requestBBQ = (url, ...arg) => baseRequest(`/homePage/hmsupervisioninspecti
7 7
 const requestDDL = (url, ...arg) => baseRequest(`/homePage/hmrelatedwebsitesconfig/` + url, ...arg)
8 8
 const requestRRT = (url, ...arg) => baseRequest(`/homePage/hmgovernmentaffairsconfig/` + url, ...arg)
9 9
 const requestEEC = (url, ...arg) => baseRequest(`/homePage/hminteractionconfig/` + url, ...arg)
10
-
10
+const requestRRY = (url, ...arg) => baseRequest(`/homePage/hmpartyhistoryedu/` + url, ...arg)
11
+const requestPPO = (url, ...arg) => baseRequest(`/homePage/hmcarouselconfig/` + url, ...arg)
12
+const requestUUO = (url, ...arg) => baseRequest(`/sys/user/` + url, ...arg)
11 13
 //
12 14
 export default {
15
+	pagelist(data) {
16
+		return requestUUO('list', data, 'get')
17
+	},
18
+
13 19
 	configPage(data) {
14 20
 		return request('page', data, 'get')
15 21
 	},
@@ -122,5 +128,39 @@ export default {
122 128
 	},
123 129
 	HDJLadd(data) {
124 130
 		return requestEEC('disposition', data, 'post')
131
+	},
132
+	//轮播信息管理
133
+	LUNBOTUlist(data) {
134
+		return requestRRY('findPage', data, 'get')
135
+	},
136
+	// 禁用启用
137
+	batchUpdateStatus(data) {
138
+		return requestRRY('batchUpdateStatus', data, 'post')
139
+	},
140
+	//add
141
+	LUNBOTUadd(data) {
142
+		return requestPPO('add', data, 'post')
143
+	},
144
+	LUNBOTUdetail(data) {
145
+		return requestPPO('detail', data, 'get')
146
+	},
147
+	LUNBOTUedit(data) {
148
+		return requestPPO('edit', data, 'post')
149
+	},
150
+	LUNBOTUdel(data) {
151
+		return requestPPO('delete', data, 'post')
152
+	},
153
+	//党史学习教育表
154
+	DANGSHIXXIadd(data) {
155
+		return requestRRY('add', data, 'post')
156
+	},
157
+	DANGSHIXXIdetail(data) {
158
+		return requestRRY('detail', data, 'get')
159
+	},
160
+	DANGSHIXXIedit(data) {
161
+		return requestRRY('edit', data, 'post')
162
+	},
163
+	DANGSHIXXIdel(data) {
164
+		return requestRRY('delete', data, 'post')
125 165
 	}
126 166
 }

+ 5 - 147
src/hook/enumMap.js

@@ -1,158 +1,16 @@
1 1
 // import { onMounted, ref, onBeforeUnmount, computed, reactive } from 'vue'
2 2
 import { enumMaplistStore } from '@/store'
3 3
 
4
-export function enumMap () {
4
+export function enumMap() {
5 5
 	const StoreDEl = enumMaplistStore()
6
-	const { enumMap, parentMap } = StoreDEl.enumMaplist
7
-	const cocName = (id = '') => {
8
-		const name = enumMap[id]
9
-		return name
10
-	}
11
-	const cocID = (id) => {
12
-		const name = enumMap[id]
13
-		return id
14
-	}
15
-	const getEnumByEnumCode = (enumCode) => {
16
-		for (const key of Object.keys(parentMap)) {
17
-			const arr = parentMap[key]
18
-			for (const enumData of arr) {
19
-				if (enumData.enumid == enumCode) {
20
-					// console.log(enumData)
21
-					if (!enumData.enumname) return console.log('取不到')
22
-					// console.log(enumData.enumname)
23
-					return enumData.enumname
24
-				}
25
-			}
26
-		}
27
-		console.warn('没有找到 enum code', enumCode)
28
-		return null
29
-	}
30
-	const getEnumListByEnumId = (enumId) => {
31
-		return parentMap[enumId]
32
-	}
33
-
34
-	const YES_NO_3 = [
35
-		{ value: '1', label: '能' },
36
-		{ value: '0', label: '否' },
37
-		{ value: '9', label: '其他或不确定' }
38
-	]
39
-
40
-	const cocDEl = (id) => {
41
-		for (const item of YES_NO_3) {
42
-			if (item.value == id) return item.label
43
-		}
44
-	}
45
-
46
-	const LEVEL_TYPE_3 = [
47
-		{ value: '1', label: 'Ⅰ级' },
48
-		{ value: '2', label: 'Ⅱ级' },
49
-		{ value: '3', label: 'Ⅲ级' },
50
-		{ value: '4', label: 'Ⅳ级' }
51
-	]
52
-
53
-	const cocDElⅣ = (id) => {
54
-		for (const item of LEVEL_TYPE_3) {
55
-			if (item.value == id) return item.label
56
-		}
57
-	}
58
-
59
-	const LEVEL_TYPE_5 = [
60
-		{ value: '1', label: 'Ⅰ级' },
61
-		{ value: '2', label: 'Ⅱ级' },
62
-		{ value: '3', label: 'Ⅲ级' },
63
-		{ value: '4', label: '无粮情检测技术' }
64
-	]
6
+	const res = StoreDEl.enumMaplist
65 7
 
66
-	const cocDElⅣV = (id) => {
67
-		for (const item of LEVEL_TYPE_5) {
68
-			if (item.value == id) return item.label
69
-		}
70
-	}
71
-
72
-	const TFXTXS = [
73
-		{ value: '0', label: '竖向通风' },
74
-		{ value: '1', label: '横向通风' },
75
-		{ value: '2', label: '径向通风' },
76
-		{ value: '3', label: '全网板通风' },
77
-		{ value: '4', label: '其它' }
78
-	]
79
-
80
-	const cocTFXTXS = (id) => {
81
-		for (const item of TFXTXS) {
82
-			if (item.value == id) return item.label
83
-		}
84
-	}
85
-	const DLMXS = [
86
-		{ value: '01', label: '“一字型”挡粮板' },
87
-		{ value: '02', label: '“三角形”挡粮门' },
88
-		{ value: '03', label: '“弧形”挡粮门' },
89
-		{ value: '04', label: '围包' },
90
-		{ value: '05', label: '其它型式' }
91
-	]
92 8
 	const cocDLMXS = (id) => {
93
-		for (const item of DLMXS) {
94
-			if (item.value == id) return item.label
95
-		}
96
-	}
97
-
98
-	const BUG_INSPECTION_TYPE = [
99
-		{ value: '01', label: '远程检测预警' },
100
-		{ value: '02', label: '人工手动筛查' },
101
-		{ value: '03', label: '其它' }
102
-	]
103
-	const cocBUG_INSPECTION_TYPE = (id) => {
104
-		for (const item of BUG_INSPECTION_TYPE) {
105
-			if (item.value == id) return item.label
106
-		}
107
-	}
108
-
109
-	const GRANARY_STATUS = [
110
-		{ value: '1', label: '完好' },
111
-		{ value: '2', label: '需小修' },
112
-		{ value: '3', label: '需大修' },
113
-		{ value: '4', label: '待报废' },
114
-		{ value: '5', label: '待拆除' },
115
-		{ value: '6', label: '死角仓' },
116
-		{ value: '9', label: '其他' }
117
-	]
118
-
119
-	const cocGRANARY_STATUS = (id) => {
120
-		for (const item of GRANARY_STATUS) {
121
-			if (item.value == id) return item.label
122
-		}
123
-	}
124
-	const PROPERTY_RIGHTS = [
125
-		{ value: '1', label: '自有' },
126
-		{ value: '2', label: '租赁' },
127
-		{ value: '3', label: '共有' },
128
-		{ value: '4', label: '混合' },
129
-		{ value: '9', label: '其他' }
130
-	]
131
-	const cocPROPERTY_RIGHTS = (id) => {
132
-		for (const item of PROPERTY_RIGHTS) {
133
-			if (item.value == id) return item.label
134
-		}
135
-	}
136
-	const YES_NO = [
137
-		{ value: '1', label: '是' },
138
-		{ value: '0', label: '否' }
139
-	]
140
-	const cocYES_NO = (id) => {
141
-		for (const item of YES_NO) {
142
-			if (item.value == id) return item.label
9
+		for (const item of res) {
10
+			if (item.id == id) return item.name
143 11
 		}
144 12
 	}
145 13
 	return {
146
-		cocYES_NO,
147
-		cocPROPERTY_RIGHTS,
148
-		cocName,
149
-		getEnumByEnumCode,
150
-		cocDEl,
151
-		cocDElⅣ,
152
-		cocDElⅣV,
153
-		cocTFXTXS,
154
-		cocDLMXS,
155
-		cocBUG_INSPECTION_TYPE,
156
-		cocGRANARY_STATUS
14
+		cocDLMXS
157 15
 	}
158 16
 }

+ 2 - 0
src/layout/components/userbar.vue

@@ -98,6 +98,7 @@
98 98
 				onOk() {
99 99
 					message.loading('正在清理中...', 1)
100 100
 					tool.data.clear()
101
+					localStorage.removeItem('enumMaplist')
101 102
 					setTimeout(() => {
102 103
 						router.replace({ path: '/login' })
103 104
 						location.reload()
@@ -128,6 +129,7 @@
128 129
 							tool.data.remove('MENU')
129 130
 							tool.data.remove('PERMISSIONS')
130 131
 							router.replace({ path: '/login' })
132
+							localStorage.removeItem('enumMaplist')
131 133
 						})
132 134
 						.catch(() => {
133 135
 							tool.data.clear()

+ 18 - 0
src/store/enumMap.js

@@ -0,0 +1,18 @@
1
+import { defineStore } from 'pinia'
2
+import businessDEl from '@/api/home/home.js'
3
+
4
+export const enumMaplistStore = defineStore('enumMaplist', () => {
5
+	// 定义state
6
+	const enumMaplist = ref(JSON.parse(localStorage.getItem('enumMaplist')) || [])
7
+
8
+	const businessDElasync = async () => {
9
+		const res = await businessDEl.pagelist()
10
+		console.log(444)
11
+		enumMaplist.value = []
12
+		enumMaplist.value = res
13
+		localStorage.setItem('enumMaplist', JSON.stringify(res))
14
+		console.log(res)
15
+	}
16
+
17
+	return { enumMaplist, businessDElasync }
18
+})

+ 1 - 0
src/store/index.js

@@ -3,3 +3,4 @@ export * from './search'
3 3
 export * from './iframe'
4 4
 export * from './keepAlive'
5 5
 export * from './viewTags'
6
+export * from './enumMap'

+ 4 - 1
src/views/auth/login/login.vue

@@ -107,7 +107,7 @@
107 107
 	import configData from '@/config'
108 108
 	import configApi from '@/api/dev/configApi'
109 109
 	import tool from '@/utils/tool'
110
-	import { globalStore, iframeStore, keepAliveStore, viewTagsStore } from '@/store'
110
+	import { globalStore, iframeStore, keepAliveStore, viewTagsStore, enumMaplistStore } from '@/store'
111 111
 	const { proxy } = getCurrentInstance()
112 112
 
113 113
 	const activeKey = ref('userAccount')
@@ -146,6 +146,8 @@
146 146
 	const kStore = keepAliveStore()
147 147
 	const iStore = iframeStore()
148 148
 	const vStore = viewTagsStore()
149
+	const StoreDEl = enumMaplistStore()
150
+	const businessDElasync = StoreDEl.businessDElasync
149 151
 
150 152
 	const setSysBaseConfig = store.setSysBaseConfig
151 153
 	const clearKeepLive = kStore.clearKeepLive
@@ -230,6 +232,7 @@
230 232
 				loading.value = false
231 233
 				loginCaptcha()
232 234
 			}
235
+			businessDElasync()
233 236
 		})
234 237
 	}
235 238
 	const configLang = (key) => {

+ 1 - 1
src/views/home/Configuration/index.vue

@@ -161,7 +161,7 @@
161 161
 	.box1 {
162 162
 		width: 250px;
163 163
 		height: 250px;
164
-		.img_del_add {
164
+		.img_del {
165 165
 			border: 1px solid #e4e4e4;
166 166
 			width: 160px;
167 167
 			height: 160px;

+ 38 - 52
src/views/home/LBmanagement/form.vue

@@ -1,23 +1,16 @@
1 1
 <template>
2
+	<!-- 轮播图配置 -->
2 3
 	<xn-form-container :title="'基本设置'" :width="800" :visible="visible" :destroy-on-close="true" @close="onClose">
3
-		<a-form
4
-			:model="formState"
5
-			ref="formStateRef"
6
-			:rules="formStateRules"
7
-			name="basic"
8
-			autocomplete="off"
9
-			@finish="onFinish"
10
-			@finishFailed="onFinishFailed"
11
-		>
4
+		<a-form :model="formState" ref="formStateRef" :rules="formStateRules" name="basic" autocomplete="off">
12 5
 			<div class="form">
13 6
 				<a-row>
14 7
 					<a-col :span="12">
15
-						<a-form-item class="form-item" label="跳转链接" name="systemName" :label-col="{ span: 10 }">
8
+						<a-form-item class="form-item" label="跳转链接" name="redirectUrl" :label-col="{ span: 10 }">
16 9
 							<a-input
17 10
 								placeholder="请输入跳转链接"
18 11
 								style="width: 600px"
19 12
 								:disabled="disabled"
20
-								v-model:value="formState.systemName"
13
+								v-model:value="formState.redirectUrl"
21 14
 							/>
22 15
 						</a-form-item>
23 16
 					</a-col>
@@ -33,15 +26,15 @@
33 26
 						:disabled="disabled"
34 27
 						:change="changeUpload"
35 28
 						listType="picture-card"
36
-						v-model:urls="formState.attachment"
29
+						v-model:urls="formState.carouselImage"
37 30
 					></DIYUPLoad>
38 31
 				</a-form-item>
39 32
 			</div>
40 33
 
41 34
 			<a-form-item>
42 35
 				<div class="item-submit">
43
-					<a-button class="btn1" :disabled="disabled" html-type="submit" @click="onClose">提交</a-button>
44
-					<a-button class="btn1" :disabled="disabled" type="primary" html-type="submit">保存</a-button>
36
+					<a-button class="btn1" :disabled="disabled" @click="onFinish(2)">提交</a-button>
37
+					<a-button class="btn1" :disabled="disabled" type="primary" @click="onFinish(1)">保存</a-button>
45 38
 				</div>
46 39
 			</a-form-item>
47 40
 		</a-form>
@@ -72,29 +65,26 @@
72 65
 					detail(row.id)
73 66
 				}
74 67
 			}
68
+			const rest = () => {
69
+				for (let key in formState.value) {
70
+					formState.value[key] = ''
71
+				}
72
+			}
75 73
 			const detail = async (v) => {
76
-				const res = await {}({ id: v })
74
+				const res = await business.LUNBOTUdetail({ id: v })
77 75
 				formState.value = res
78
-				formState.value.attachment = res.attachment.split(',')
79
-				formState.value.createUser = res.createUserName
80
-				console.log(formState.value)
76
+				formState.value.carouselImage = (res.carouselImage || '').split(',').filter((v) => v)
81 77
 			}
82 78
 			const onClose = () => {
83 79
 				visible.value = false
80
+				rest()
84 81
 			}
85 82
 			watch(
86 83
 				() => visible.value,
87 84
 				(newVal) => {
88 85
 					if (!newVal) {
89 86
 						setTimeout(() => {
90
-							formState.value = {
91
-								systemName: '',
92
-								createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
93
-								publishTime: '',
94
-								publishContent: '',
95
-								attachment: '',
96
-								id: ''
97
-							}
87
+							rest()
98 88
 						}, 0)
99 89
 					}
100 90
 				},
@@ -102,41 +92,37 @@
102 92
 			)
103 93
 
104 94
 			const formState = ref({
105
-				systemName: '',
106
-				createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
107
-				publishTime: '',
108
-				publishContent: '',
109
-				attachment: '',
110
-				id: ''
95
+				redirectUrl: '',
96
+				carouselImage: '',
97
+				status: 0
111 98
 			})
112 99
 			const formStateRules = ref({
113
-				systemName: [{ required: true, message: '请填写!', trigger: 'blur' }],
114
-				publishTime: [{ required: true, message: '请填写!', trigger: 'change' }],
115
-				attachment: [{ required: true, message: '请填写!', trigger: 'change' }]
100
+				// systemName: [{ required: true, message: '请填写!', trigger: 'blur' }],
101
+				// publishTime: [{ required: true, message: '请填写!', trigger: 'change' }],
102
+				// attachment: [{ required: true, message: '请填写!', trigger: 'change' }]
116 103
 			})
117 104
 			const formStateRef = ref(null)
118
-
119
-			const onFinish = async (values) => {
120
-				formState.value.attachment = values.attachment.join(',')
121
-				await handleAdd(formState.value)
122
-				emit('change')
123
-				formState.value = {
124
-					systemName: '',
125
-					createUser: '',
126
-					publishTime: '',
127
-					publishContent: '',
128
-					attachment: '',
129
-					id: ''
130
-				}
131
-				onClose()
105
+			const onFinish = async (status) => {
106
+				formStateRef.value.validate().then(async () => {
107
+					try {
108
+						if (Array.isArray(formState.value.carouselImage)) {
109
+							formState.value.carouselImage = formState.value.carouselImage.join(',')
110
+						}
111
+						formState.value.status = status
112
+						await handleAdd(formState.value)
113
+						emit('change')
114
+						onClose()
115
+					} catch (err) {
116
+						console.log(err)
117
+					}
118
+				})
132 119
 			}
133 120
 
134 121
 			const handleAdd = async (val) => {
135 122
 				if (records.value == 'edit') {
136
-					console.log(records.value)
137
-					const res = await {}(val)
123
+					const res = await business.LUNBOTUedit(val)
138 124
 				} else {
139
-					const res = await {}(val)
125
+					const res = await business.LUNBOTUadd(val)
140 126
 					console.log('add')
141 127
 				}
142 128
 			}

+ 47 - 56
src/views/home/LBmanagement/formCopy.vue

@@ -1,33 +1,25 @@
1 1
 <template>
2 2
 	<xn-form-container :title="'基本设置'" :width="800" :visible="visible" :destroy-on-close="true" @close="onClose">
3
-		<a-form
4
-			:model="formState"
5
-			ref="formStateRef"
6
-			:rules="formStateRules"
7
-			name="basic"
8
-			autocomplete="off"
9
-			@finish="onFinish"
10
-			@finishFailed="onFinishFailed"
11
-		>
12
-			<a-form-item ref="uploadDataList" class="form-item" label="轮播图" name="attachment" :label-col="{ span: 3 }">
3
+		<a-form :model="formState" ref="formStateRef" :rules="formStateRules" name="basic" autocomplete="off">
4
+			<a-form-item ref="uploadDataList" class="form-item" label="轮播图" name="carousel" :label-col="{ span: 3 }">
13 5
 				<DIYUPLoad
14 6
 					:beforeUpload="beforeUpload"
15 7
 					multiple
16 8
 					:disabled="disabled"
17 9
 					:change="changeUpload"
18 10
 					listType="picture-card"
19
-					v-model:urls="formState.attachment"
11
+					v-model:urls="formState.carousel"
20 12
 				></DIYUPLoad>
21 13
 			</a-form-item>
22 14
 			<div class="form">
23 15
 				<a-row>
24 16
 					<a-col :span="12">
25
-						<a-form-item class="form-item" label="标题" name="systemName" :label-col="{ span: 10 }">
17
+						<a-form-item class="form-item" label="标题" name="title" :label-col="{ span: 10 }">
26 18
 							<a-input
27 19
 								placeholder="请输入标题"
28 20
 								style="width: 600px"
29 21
 								:disabled="disabled"
30
-								v-model:value="formState.systemName"
22
+								v-model:value="formState.title"
31 23
 							/>
32 24
 						</a-form-item>
33 25
 					</a-col>
@@ -44,19 +36,19 @@
44 36
 						</a-form-item>
45 37
 					</a-col>
46 38
 					<a-col :span="12">
47
-						<a-form-item class="form-item" label="新闻来源" name="createUser" :label-col="{ span: 10 }">
48
-							<a-input style="width: 250px" :disabled="true" v-model:value="formState.createUser" />
39
+						<a-form-item class="form-item" label="新闻来源" name="source" :label-col="{ span: 10 }">
40
+							<a-input style="width: 250px" :disabled="disabled" v-model:value="formState.source" />
49 41
 						</a-form-item>
50 42
 					</a-col>
51 43
 				</a-row>
52 44
 
53 45
 				<a-row>
54 46
 					<a-col :span="12">
55
-						<a-form-item class="form-item" label="公告内容" name="createUser" :label-col="{ span: 10 }">
47
+						<a-form-item class="form-item" label="公告内容" name="announcementContent" :label-col="{ span: 10 }">
56 48
 							<a-textarea
57 49
 								style="width: 600px"
58 50
 								placeholder="请输入公告内容"
59
-								v-model:value="formState.publishContent"
51
+								v-model:value="formState.announcementContent"
60 52
 								:disabled="disabled"
61 53
 								allow-clear
62 54
 							/>
@@ -72,14 +64,14 @@
72 64
 						multiple
73 65
 						:disabled="disabled"
74 66
 						:change="changeUpload"
75
-						v-model:urls="formState.attachment"
67
+						v-model:urls="formState.attachments"
76 68
 					></DIYUPLoad>
77 69
 				</a-form-item>
78 70
 			</div>
79 71
 			<a-form-item>
80 72
 				<div class="item-submit">
81
-					<a-button class="btn1" :disabled="disabled" html-type="submit" @click="onClose">提交</a-button>
82
-					<a-button class="btn1" :disabled="disabled" type="primary" html-type="submit">保存</a-button>
73
+					<a-button class="btn1" :disabled="disabled" @click="onFinish(2)">提交</a-button>
74
+					<a-button class="btn1" :disabled="disabled" type="primary" @click="onFinish(1)">保存</a-button>
83 75
 				</div>
84 76
 			</a-form-item>
85 77
 		</a-form>
@@ -110,12 +102,16 @@
110 102
 					detail(row.id)
111 103
 				}
112 104
 			}
105
+			const rest = () => {
106
+				for (let key in formState.value) {
107
+					formState.value[key] = ''
108
+				}
109
+			}
113 110
 			const detail = async (v) => {
114
-				const res = await {}({ id: v })
111
+				const res = await business.DANGSHIXXIdetail({ id: v })
115 112
 				formState.value = res
116
-				formState.value.attachment = res.attachment.split(',')
117
-				formState.value.createUser = res.createUserName
118
-				console.log(formState.value)
113
+				formState.value.attachments = (res.attachments || '').split(',').filter((v) => v)
114
+				formState.value.carousel = (res.carousel || '').split(',').filter((v) => v)
119 115
 			}
120 116
 			const onClose = () => {
121 117
 				visible.value = false
@@ -125,14 +121,7 @@
125 121
 				(newVal) => {
126 122
 					if (!newVal) {
127 123
 						setTimeout(() => {
128
-							formState.value = {
129
-								systemName: '',
130
-								createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
131
-								publishTime: '',
132
-								publishContent: '',
133
-								attachment: '',
134
-								id: ''
135
-							}
124
+							rest()
136 125
 						}, 0)
137 126
 					}
138 127
 				},
@@ -140,41 +129,43 @@
140 129
 			)
141 130
 
142 131
 			const formState = ref({
143
-				systemName: '',
144
-				createUser: JSON.parse(localStorage.getItem('USER_INFO')).name,
132
+				carousel: '',
133
+				title: '',
145 134
 				publishTime: '',
146
-				publishContent: '',
147
-				attachment: '',
148
-				id: ''
135
+				source: '',
136
+				announcementContent: '',
137
+				attachments: '',
138
+				status: 0
149 139
 			})
150 140
 			const formStateRules = ref({
151
-				systemName: [{ required: true, message: '请填写!', trigger: 'blur' }],
152
-				publishTime: [{ required: true, message: '请填写!', trigger: 'change' }],
153
-				attachment: [{ required: true, message: '请填写!', trigger: 'change' }]
141
+				// systemName: [{ required: true, message: '请填写!', trigger: 'blur' }],
142
+				// publishTime: [{ required: true, message: '请填写!', trigger: 'change' }],
143
+				// attachment: [{ required: true, message: '请填写!', trigger: 'change' }]
154 144
 			})
155 145
 			const formStateRef = ref(null)
156 146
 
157
-			const onFinish = async (values) => {
158
-				formState.value.attachment = values.attachment.join(',')
159
-				await handleAdd(formState.value)
160
-				emit('change')
161
-				formState.value = {
162
-					systemName: '',
163
-					createUser: '',
164
-					publishTime: '',
165
-					publishContent: '',
166
-					attachment: '',
167
-					id: ''
168
-				}
169
-				onClose()
147
+			const onFinish = async (status) => {
148
+				formStateRef.value.validate().then(async () => {
149
+					try {
150
+						if (Array.isArray(formState.value.attachments) || Array.isArray(formState.value.carousel)) {
151
+							formState.value.attachments = formState.value.attachments.join(',')
152
+							formState.value.carousel = formState.value.carousel.join(',')
153
+						}
154
+						formState.value.status = status
155
+						await handleAdd(formState.value)
156
+						emit('change')
157
+						onClose()
158
+					} catch (err) {
159
+						console.log(err)
160
+					}
161
+				})
170 162
 			}
171 163
 
172 164
 			const handleAdd = async (val) => {
173 165
 				if (records.value == 'edit') {
174
-					console.log(records.value)
175
-					const res = await {}(val)
166
+					const res = await business.DANGSHIXXIedit(val)
176 167
 				} else {
177
-					const res = await {}(val)
168
+					const res = await business.DANGSHIXXIadd(val)
178 169
 					console.log('add')
179 170
 				}
180 171
 			}

+ 94 - 40
src/views/home/LBmanagement/index.vue

@@ -7,16 +7,17 @@
7 7
 					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
8 8
 						'标题'
9 9
 					}}</span>
10
-					<a-input style="width: 220px" v-model:value="SearchFormDel.unitName" placeholder="请输入" />
10
+					<a-input style="width: 220px" v-model:value="SearchFormDel.title" placeholder="请输入" />
11 11
 				</div>
12 12
 				<div class="silt-title">
13 13
 					<span style="width: 70px; margin-right: 8px; text-align: right; display: block; line-height: 30px">{{
14 14
 						'状态'
15 15
 					}}</span>
16 16
 
17
-					<a-select style="width: 220px" v-model:value="SearchFormDel.unitName">
18
-						<a-select-option :value="1">禁用</a-select-option>
17
+					<a-select style="width: 220px" v-model:value="SearchFormDel.status">
18
+						<a-select-option :value="3">禁用</a-select-option>
19 19
 						<a-select-option :value="2">启用</a-select-option>
20
+						<a-select-option :value="1">保存</a-select-option>
20 21
 					</a-select>
21 22
 				</div>
22 23
 				<div class="btnBox">
@@ -25,8 +26,8 @@
25 26
 				</div>
26 27
 			</a-space>
27 28
 			<div class="btnBox">
28
-				<a-button type="primary" class="primarySele" @click="onView('add', {}, 1)"> 新增轮播图配置 </a-button>
29
-				<a-button type="primary" class="primarySele" @click="onView('add', {}, 2)"> 新增党史学习教育 </a-button>
29
+				<a-button type="primary" class="primarySele" @click="onView('add', {}, 2)"> 新增轮播图配置 </a-button>
30
+				<a-button type="primary" class="primarySele" @click="onView('add', {}, 1)"> 新增党史学习教育 </a-button>
30 31
 				<a-button
31 32
 					class="btnl colro primarySele"
32 33
 					type="primary"
@@ -34,10 +35,7 @@
34 35
 					:loading="state.loading"
35 36
 					@click="start"
36 37
 				>
37
-					批量共享
38
-				</a-button>
39
-				<a-button class="btnl colro" type="primary" :disabled="!hasSelected" :loading="state.loading" @click="start">
40
-					批量禁用
38
+					批量操作(启用/禁用)
41 39
 				</a-button>
42 40
 			</div>
43 41
 		</a-card>
@@ -51,21 +49,31 @@
51 49
 				:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
52 50
 			>
53 51
 				<template #bodyCell="{ column, record }">
54
-					<template v-if="column.dataIndex === 'isShare'">
52
+					<template v-if="column.dataIndex === 'status'">
55 53
 						<div class="switch_del">
56 54
 							<a-switch
57
-								:checked="record.isShare == '0' ? false : true"
58
-								:checked-children="'是'"
59
-								:un-checked-children="'否'"
55
+								v-if="record.status !== 1"
56
+								:checked="record.status == 2 ? true : false"
57
+								:checked-children="'启用'"
58
+								:un-checked-children="'禁用'"
59
+								@change="handleSwitchChange(record)"
60
+								size="default"
61
+							/>
62
+							<a-switch
63
+								v-if="record.status == 1"
64
+								:checked="record.status == 1 ? false : true"
65
+								:checked-children="'启用'"
66
+								:un-checked-children="'保存'"
60 67
 								@change="handleSwitchChange(record)"
61 68
 								size="default"
62 69
 							/>
63 70
 						</div>
64 71
 					</template>
72
+					<template v-if="column.dataIndex === 'createUser'">
73
+						{{ cocDLMXS(record.createUser) }}
74
+					</template>
65 75
 					<template v-if="column.key === '操作'">
66 76
 						<a-button type="link" @click="onView('view', record)">查看</a-button>
67
-
68
-						<a-button type="link">状态</a-button>
69 77
 						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
70 78
 						<a-popconfirm title="确定要删除吗?" @confirm="onView('del', record)">
71 79
 							<a-button type="link">删除</a-button>
@@ -87,10 +95,11 @@
87 95
 	import { message } from 'ant-design-vue'
88 96
 	import Form from './form.vue'
89 97
 	import Formcode from './formCopy.vue'
98
+	import { enumMap } from '@/hook/enumMap.js'
99
+	const { cocDLMXS } = enumMap()
90 100
 	const router = useRouter()
91 101
 
92 102
 	const tableColumns = [
93
-		// { title: '序号', key: 'INDEX' },
94 103
 		{
95 104
 			title: '序号',
96 105
 			dataIndex: 'INDEX',
@@ -99,21 +108,43 @@
99 108
 				return `${index + 1}`
100 109
 			}
101 110
 		},
102
-		{ title: '标题', align: 'center', dataIndex: 'unitName' },
103
-		{ title: '来源', align: 'center', dataIndex: 'creditLevel' },
104
-		{ title: '状态', align: 'center', dataIndex: 'assessResult' },
105
-		{ title: '发布人', align: 'center', dataIndex: 'assessResultDepict' },
106
-		{ title: '发布时间', align: 'center', dataIndex: 'isShare' },
111
+		{
112
+			title: '标题',
113
+			align: 'center',
114
+			dataIndex: 'title',
115
+			customRender: ({ text, record, index }) => {
116
+				return `${record.title ? record.title : '-'}`
117
+			}
118
+		},
119
+		{
120
+			title: '来源',
121
+			align: 'center',
122
+			dataIndex: 'source',
123
+			customRender: ({ text, record, index }) => {
124
+				return `${record.source ? record.source : '-'}`
125
+			}
126
+		},
127
+		{ title: '状态', align: 'center', dataIndex: 'status' },
128
+		{
129
+			title: '发布人',
130
+			align: 'center',
131
+			dataIndex: 'createUser',
132
+			customRender: ({ text, record, index }) => {
133
+				return `${record.createUser ? record.createUser : '-'}`
134
+			}
135
+		},
136
+		{ title: '发布时间', align: 'center', dataIndex: 'publishTime' },
107 137
 		{ title: '操作', align: 'center', key: '操作' }
108 138
 	]
109 139
 
110 140
 	//共享
111 141
 	const handleSwitchChange = async (v) => {
112
-		// console.log(v)
113
-		if (v.isShare == 1) {
114
-			const res = await {}([{ id: v.id, isShare: 0 }])
115
-		} else {
116
-			const res = await {}([{ id: v.id, isShare: 1 }])
142
+		if (v.status == 1) {
143
+			const res = await business.batchUpdateStatus([{ id: v.id, status: 2, type: +v.type }])
144
+		} else if (v.status == 2) {
145
+			const res = await business.batchUpdateStatus([{ id: v.id, status: 3, type: +v.type }])
146
+		} else if (v.status == 3) {
147
+			const res = await business.batchUpdateStatus([{ id: v.id, status: 2, type: +v.type }])
117 148
 		}
118 149
 		message.success('操作成功')
119 150
 		await onSearch()
@@ -126,9 +157,10 @@
126 157
 	const hasSelected = computed(() => state.selectedRowKeys.length > 0)
127 158
 	const start = async () => {
128 159
 		state.loading = true
129
-		const res = await {}(del.value)
160
+		const res = await business.batchUpdateStatus(del.value)
130 161
 		setTimeout(() => {
131 162
 			state.loading = false
163
+			state.selectedRowKeys = []
132 164
 			message.success('操作成功')
133 165
 			onSearch()
134 166
 		}, 300)
@@ -140,40 +172,62 @@
140 172
 		state.selectedRowKeys = selectedRowKeys
141 173
 		del.value = state.selectedRowKeys.map((item) => {
142 174
 			return {
175
+				type: +item.type,
143 176
 				id: item.id,
144
-				isShare: 1
177
+				status: item.status === 1 ? 2 : item.status === 2 ? 3 : 2
145 178
 			}
146 179
 		})
147
-		console.log(del.value)
148 180
 	}
149 181
 
150
-	const { DEl, change, tableData, onSearch, handlePageChange, pagination, Search, onReset, SearchFormDel } =
151
-		listPagination({ unitName: '' }, business.configPage, {}, { isEntAppQuery: 1, sortOrder: 'ASCEND' })
182
+	const { change, tableData, onSearch, handlePageChange, pagination, Search, onReset, SearchFormDel } = listPagination(
183
+		{ title: '', status: '' },
184
+		business.LUNBOTUlist,
185
+		{},
186
+		{ isEntAppQuery: 1, sortOrder: 'ASCEND' }
187
+	)
188
+	const DEl = async (row) => {
189
+		const res = await business.LUNBOTUdel([{ id: row.id }])
190
+		onSearch()
191
+	}
192
+
193
+	const DElCOP = async (row) => {
194
+		const res = await business.DANGSHIXXIdel([{ id: row.id }])
195
+		onSearch()
196
+	}
152 197
 
153
-	setTimeout(() => {
154
-		tableData.value = [{ unitName: '33' }]
155
-	}, 900)
156 198
 	// 查看表单数据
157 199
 	const formRef = ref(null)
158 200
 	const formRefcode = ref(null)
159
-
201
+	// 状态,1党史教育 2轮播图配置;
160 202
 	const onView = (record, row, code) => {
161 203
 		switch (record) {
162 204
 			case 'add':
163 205
 				if (code == 1) {
164
-					formRef.value.onOpen(record, true, false)
165
-				} else {
166 206
 					formRefcode.value.onOpen(record, true, false)
207
+				} else {
208
+					formRef.value.onOpen(record, true, false)
167 209
 				}
168 210
 				break
169 211
 			case 'del':
170
-				DEl(row)
212
+				if (row.type == 1) {
213
+					DElCOP(row)
214
+				} else {
215
+					DEl(row)
216
+				}
171 217
 				break
172 218
 			case 'view':
173
-				formRef.value.onOpen(record, true, true, row)
219
+				if (row.type == 1) {
220
+					formRefcode.value.onOpen(record, true, true, row)
221
+				} else {
222
+					formRef.value.onOpen(record, true, true, row)
223
+				}
174 224
 				break
175 225
 			case 'edit':
176
-				formRef.value.onOpen(record, true, false, row)
226
+				if (row.type == 1) {
227
+					formRefcode.value.onOpen(record, true, false, row)
228
+				} else {
229
+					formRef.value.onOpen(record, true, false, row)
230
+				}
177 231
 				break
178 232
 			default:
179 233
 				break

+ 5 - 0
src/views/home/Related/index.vue

@@ -55,6 +55,9 @@
55 55
 							/>
56 56
 						</div>
57 57
 					</template>
58
+					<template v-if="column.dataIndex === 'createUser'">
59
+						{{ cocDLMXS(record.createUser) }}
60
+					</template>
58 61
 					<template v-if="column.key === '操作'">
59 62
 						<a-button type="link" @click="onView('view', record)">查看</a-button>
60 63
 						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
@@ -76,6 +79,8 @@
76 79
 	import { defineComponent } from 'vue'
77 80
 	import { message } from 'ant-design-vue'
78 81
 	import Form from './form.vue'
82
+	import { enumMap } from '@/hook/enumMap.js'
83
+	const { cocDLMXS } = enumMap()
79 84
 
80 85
 	const formRef = ref(null)
81 86
 	const router = useRouter()

+ 5 - 0
src/views/home/Supervision/index.vue

@@ -66,6 +66,9 @@
66 66
 							/>
67 67
 						</div>
68 68
 					</template>
69
+					<template v-if="column.dataIndex === 'createUser'">
70
+						{{ cocDLMXS(record.createUser) }}
71
+					</template>
69 72
 					<template v-if="column.key === '操作'">
70 73
 						<a-button type="link" @click="onView('view', record)">查看</a-button>
71 74
 						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
@@ -87,6 +90,8 @@
87 90
 	import { defineComponent } from 'vue'
88 91
 	import { message } from 'ant-design-vue'
89 92
 	import Form from './form.vue'
93
+	import { enumMap } from '@/hook/enumMap.js'
94
+	const { cocDLMXS } = enumMap()
90 95
 
91 96
 	const formRef = ref(null)
92 97
 	const router = useRouter()

+ 5 - 0
src/views/home/carousel/index.vue

@@ -66,6 +66,9 @@
66 66
 							/>
67 67
 						</div>
68 68
 					</template>
69
+					<template v-if="column.dataIndex === 'createUser'">
70
+						{{ cocDLMXS(record.createUser) }}
71
+					</template>
69 72
 					<template v-if="column.key === '操作'">
70 73
 						<a-button type="link" @click="onView('view', record)">查看</a-button>
71 74
 						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
@@ -87,6 +90,8 @@
87 90
 	import { defineComponent } from 'vue'
88 91
 	import { message } from 'ant-design-vue'
89 92
 	import Form from './form.vue'
93
+	import { enumMap } from '@/hook/enumMap.js'
94
+	const { cocDLMXS } = enumMap()
90 95
 	const router = useRouter()
91 96
 
92 97
 	const tableColumns = [

+ 8 - 4
src/views/home/tabloid/form.vue

@@ -93,10 +93,12 @@
93 93
 			}
94 94
 			const detail = async (v) => {
95 95
 				const res = await business.IMGXWdetail({ id: v })
96
-				formState.value.newsImages = (res.newsImages || '').split(',').filter((v) => v)
97
-
98
-				// (FeedbackDialog.row.sysOrgId || '').split(',').filter((v) => v)
99 96
 				formState.value = res
97
+				formState.value.newsImages = (res.newsImages || '').split(',').filter((v) => v)
98
+				// if (res.newsImages) {
99
+				// 	formState.value.newsImages = res.newsImages.split(',')
100
+				// 	console.log(formState.value.newsImages)
101
+				// }
100 102
 			}
101 103
 			const onClose = () => {
102 104
 				visible.value = false
@@ -132,7 +134,9 @@
132 134
 				formStateRef.value.validate().then(async () => {
133 135
 					try {
134 136
 						formState.value.status = status
135
-						formState.value.newsImages = (formState.value.newsImages || []).filter((v) => v).join(',')
137
+						if (Array.isArray(formState.value.newsImages)) {
138
+							formState.value.newsImages = formState.value.newsImages.join(',')
139
+						}
136 140
 						await handleAdd(formState.value, status)
137 141
 						emit('change')
138 142
 						onClose()

+ 5 - 1
src/views/home/tabloid/index.vue

@@ -66,6 +66,9 @@
66 66
 							/>
67 67
 						</div>
68 68
 					</template>
69
+					<template v-if="column.dataIndex === 'createUser'">
70
+						{{ cocDLMXS(record.createUser) }}
71
+					</template>
69 72
 					<template v-if="column.key === '操作'">
70 73
 						<a-button type="link" @click="onView('view', record)">查看</a-button>
71 74
 						<a-button type="link" @click="onView('edit', record)">编辑</a-button>
@@ -87,7 +90,8 @@
87 90
 	import { defineComponent } from 'vue'
88 91
 	import { message } from 'ant-design-vue'
89 92
 	import Form from './form.vue'
90
-
93
+	import { enumMap } from '@/hook/enumMap.js'
94
+	const { cocDLMXS } = enumMap()
91 95
 	const formRef = ref(null)
92 96
 	const router = useRouter()
93 97