Browse Source

修改提交

soft5566 2 năm trước cách đây
mục cha
commit
bc33aee2a4

+ 1 - 0
package.json

@@ -23,6 +23,7 @@
 		"core-js": "3.6.5",
 		"cos-js-sdk-v5": "^1.5.0",
 		"cos-nodejs-sdk-v5": "^2.12.6",
+		"dompurify": "^3.1.3",
 		"echarts": "^5.4.3",
 		"element-ui": "2.13.2",
 		"js-cookie": "2.2.0",

+ 34 - 18
src/components/pl-upload/index.vue

@@ -19,7 +19,7 @@
 	// 	getFileList,
 	// 	uploadhimage
 	// } from '@/api/fileInfo'
-	
+
 	import COS from 'cos-js-sdk-v5'
 
 	export default {
@@ -35,6 +35,9 @@
 			linkUrl: {
 				type: String
 			}, // 关联主键图片
+			fileUrl: {
+				type: [Array, String]
+			}, // 关联编辑图片
 			limitCount: {
 				type: Number,
 				default: 6
@@ -99,22 +102,35 @@
 						this.hideUpload = this.fileList.length >= this.limitCount
 						this.refreshUploadFile()
 					} else {
-						getFileList(this.linkId).then((res) => {
-							// console.log('getImageFiles', res);
-							const tempData = res.data
-							if (typeof tempData !== 'undefined' && tempData !== '') {
-								for (var i = 0; i < tempData.length; i++) {
-									this.fileList.push(tempData[i])
-									this.uploadFileList.push(tempData[i])
-								}
-							} else {
-								this.fileList = []
+						const tempData = this.fileUrl
+						if (tempData.length > 0) {
+							for (var i = 0; i < tempData.length; i++) {
+								let t = {
+									url: tempData[i]
+								};
+								this.fileList.push(t)
+								this.uploadFileList.push(t)
 							}
-							this.hideUpload = this.fileList.length >= this.limitCount
-							this.refreshUploadFile()
-						}).catch((err) => {
-							this.$message.error(err.message)
-						})
+						} else {
+							this.fileList = []
+						}
+
+						// getFileList(this.linkId).then((res) => {
+						// 	// console.log('getImageFiles', res);
+						// 	const tempData = res.data
+						// 	if (typeof tempData !== 'undefined' && tempData !== '') {
+						// 		for (var i = 0; i < tempData.length; i++) {
+						// 			this.fileList.push(tempData[i])
+						// 			this.uploadFileList.push(tempData[i])
+						// 		}
+						// 	} else {
+						// 		this.fileList = []
+						// 	}
+						// 	this.hideUpload = this.fileList.length >= this.limitCount
+						// 	this.refreshUploadFile()
+						// }).catch((err) => {
+						// 	this.$message.error(err.message)
+						// })
 					}
 				}
 				this.hideUpload = this.fileList.length >= this.limitCount
@@ -186,11 +202,11 @@
 							objData.linkId = ''
 							objData.name = ''
 							objData.url = `https://${data.Location}`
-							
+
 							self.uploadFileList.push(objData)
 							self.fileList = self.uploadFileList
 							setTimeout(() => {
-								// console.log("附件信息",self.fileList)
+								// console.log("附件信息", self.uploadFileList)
 								self.refreshUploadFile()
 								loading.close()
 							}, 1000)

+ 8 - 4
src/views/businessInfo/index.vue

@@ -125,6 +125,7 @@
 				<el-button class="add-user-confirm-btn" @click="handle_get_article"> 确定 </el-button>
 			</div>
 		</el-dialog>
+		<!-- 资讯详情 -->
 		<el-dialog custom-class="dialog-have-title" :visible.sync="dialog_show_article" title="资讯详情" width="50%">
 			<div>
 				<div style="display: flex; justify-content: space-around;">
@@ -140,7 +141,7 @@
 						</viewer>
 					</div>
 				</div>
-				<div v-html="article_detail.content" class="show-article"></div>
+				<div v-html="sanitizeHtml(article_detail.content)" class="show-article"></div>
 			</div>
 		</el-dialog>
 	</div>
@@ -153,11 +154,11 @@
 		updateArticle,
 		delArticle,
 		topArticle
-	} from '@/api/businessInfo'
+	} from '@/api/businessInfo';
 	import {
 		isEmpty
-	} from '@/js/common'
-
+	} from '@/js/common';
+	
 	export default {
 		data() {
 			return {
@@ -231,6 +232,9 @@
 			document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
 		},
 		methods: {
+			sanitizeHtml(html) {
+				return html.replace('data-src', 'src');
+			},
 			// 显示文章详情
 			show_article_detail(row) {
 				// console.log(row);

+ 5 - 2
src/views/residentialhostelMgr/index.vue

@@ -272,7 +272,8 @@
 							</span>
 						</div>
 						<el-form-item label="" :required="true" prop="fileUrl" style="margin-bottom: -10px;">
-							<pl-upload v-model="formModifyHostel.fileUrl" :linkId="formModifyHostel.id" :limitCount="6" :type="1"></pl-upload>
+							<pl-upload v-model="formModifyHostel.fileUrl" :fileUrl="formModifyHostel.fileUrl" :linkId="formModifyHostel.id" :limitCount="6"
+								:type="1"></pl-upload>
 						</el-form-item>
 					</el-col>
 				</el-row>
@@ -1593,7 +1594,9 @@
 				this.formModifyHostel.bankName = row.bankName;
 				this.formModifyHostel.type = row.type;
 				this.formModifyHostel.linkProUrl = row.linkProUrl;
-				// this.formModifyHostel.fileUrl = row.bankName;
+				this.formModifyHostel.fileUrl = []
+				if (row.fileInfoList.length > 0)
+					this.formModifyHostel.fileUrl.push(row.fileInfoList[0].url);
 
 				this.dialogModifyHostelFormVisible = true;
 				// console.log(this.formModifyHostel.fileUrl);

+ 30 - 9
src/views/strategyMgr/index.vue

@@ -115,13 +115,12 @@
 		<!-- 发布人设置 -->
 		<el-dialog title="发布人设置" custom-class="configuration-window" :visible.sync="setPublisherVisible" :close-on-click-modal="false"
 			:close-on-press-escape="false" @close="setPublisherVisible = false">
-			<el-row style="display: none;">
-				<el-col :span="24" style="display: flex; justify-content: space-between; padding: 0;">
+			<el-row>
+				<el-col :span="24" style="display: flex; justify-content: center; padding: 0;">
 					<div>
-						<el-input v-model="publisherSearch.key" style="width: 180px; margin-right: 10px;" clearable placeholder="请输入用户名"></el-input>
-						<el-button type="primary" class="configure-btn" @click="btn_search">查询</el-button>
+						<el-input v-model="publisherSearch.key" style="width: 180px; margin-right: 10px;" @input="publisherSearchChange" clearable
+							placeholder="请输入用户名"></el-input>
 					</div>
-					<el-button class="configure-btn" @click="show_add_publisher_dialog = true">确定设置</el-button>
 				</el-col>
 			</el-row>
 			<el-row>
@@ -649,6 +648,7 @@
 				},
 				tableData: [], // 攻略分页列表
 				tableData_publisher: [], // 发布人列表
+				tableData_publisher_0: [], // 发布人列表
 				cond_data: {},
 				// 分页参数
 				pagination: {
@@ -748,6 +748,26 @@
 			document.removeEventListener('fullscreenchange', this.handleFullScreenChange);
 		},
 		methods: {
+			publisherSearchChange() {
+				// 进行查询
+				if (this.publisherSearch.key === "") {
+					// 如果查询字符串为空,则复制所有数据
+					this.tableData_publisher = this.tableData_publisher_0.slice();
+				} else {
+					// 如果查询字符串不为空,则进行模糊匹配
+					this.tableData_publisher = this.tableData_publisher_0.filter(item => item.name.includes(this.publisherSearch.key));
+				}
+				// 按照mark字段倒序排序,再按照id字段升序排序
+				this.tableData_publisher.sort((a, b) => {
+					// 首先按照mark字段倒序排序
+					if (b.mark - a.mark !== 0) {
+						return b.mark - a.mark;
+					} else {
+						// 如果mark相同,则按照id字段升序排序
+						return a.id - b.id;
+					}
+				});
+			},
 			// 绑定 或 解绑发布人
 			bindingPuhlisherIds(id, param) {
 				if (param == 'add') {
@@ -797,9 +817,10 @@
 				let that = this;
 				publisherList(that.currentUserId).then((res) => {
 					// console.log(res.data.pageList);
+					that.tableData_publisher_0 = [];
+					that.tableData_publisher = [];
 					if (res.code === 200) {
 						let tempData = res.data.pageList;
-						that.tableData_publisher = [];
 						if (typeof tempData !== 'undefined' && tempData !== '') {
 							let ids = '';
 							for (let i = 0; i < tempData.length; i++) {
@@ -809,24 +830,24 @@
 									name: tempData[i].user_name,
 									mark: tempData[i].mark
 								};
-								that.tableData_publisher.push(tdata);
+								that.tableData_publisher_0.push(tdata);
+								this.publisherSearchChange();
 								if (tempData[i].mark == 1) {
 									ids = ids + tempData[i].id + ',';
 								}
 							}
 							that.bindedPublisherIds = ids.substring(0, ids.length - 1);
 						} else {
-							that.tableData_publisher = [];
 							that.$message.warning('没有符合条件的数据!')
 						}
 					} else {
-						that.tableData_publisher = [];
 						that.$message.warning('没有符合条件的数据!')
 					}
 				}).catch((err) => {
 					// console.log(err);
 					that.$message.error(err.message)
 				});
+
 				// 显示对话框窗口
 				that.setPublisherVisible = true;
 			},