Browse Source

update serive

luke 6 years ago
parent
commit
1950e0c7a4
2 changed files with 149 additions and 64 deletions
  1. 146 63
      service/src/pages/FastReply.vue
  2. 3 1
      service/src/pages/LeaveMessage.vue

+ 146 - 63
service/src/pages/FastReply.vue

@@ -1,8 +1,8 @@
 <template>
 	<div class="row allAlignment" style=" position: relative;">
-		<leftNav />
+		<leftNav/>
 		<div>
-			<hader />
+			<hader/>
 			<messageCenter></messageCenter>
 			<div>
 				<el-container class="row">
@@ -38,16 +38,18 @@
 
 							<!-- 私有库列表 -->
 							<div class="list row" v-for="(item) in ReplyArr" :key="item.id">
-								<div style="width:100%;" class="row item-center allAlignment" >
+								<div style="width:100%;" class="row item-center allAlignment">
 									<div class="row">
-										<span class="ellipsis" style="display:block;max-width:100px;">#{{item.title}}</span>
+										<span class="ellipsis"
+											  style="display:block;max-width:100px;">#{{item.title}}</span>
 										<span
 												class="ellipsis"
 												style="display:block;max-width:150px;margin-left:20px;"
 										>{{item.content}}</span>
 									</div>
 									<div class="fnc">
-										<i class="el-icon-edit-outline hover" style="margin-right:15px;" @click="popUpChange(item)"></i>
+										<i class="el-icon-edit-outline hover" style="margin-right:15px;"
+										   @click="popUpChange(item)"></i>
 										<i class="el-icon-delete hover" @click="clickDel(item.id)"></i>
 									</div>
 								</div>
@@ -67,12 +69,14 @@
 							  />
 							  <img style="width:16px;height:16px;" src="@/assets/img/serch.png" />
 							</div> -->
-							<div @click="popUpShow = true"  class="row center hover"
+							<div @click="popUpShow = true" class="row center hover"
 								 style="border-radius:5px;width:120px;margin-left:20px;height:40px;background:linear-gradient(180deg,rgba(245,245,245,1) 0%,rgba(238,238,238,1) 100%);border:1px solid #ddd;font-size:14px;color:#666;"
-							>新增快捷回复</div>
+							>新增快捷回复
+							</div>
 							<div @click="deleteFastReply" class="row center hover"
 								 style="border-radius:5px;width:60px;margin-left:10px;height:40px;background:linear-gradient(180deg,rgba(245,245,245,1) 0%,rgba(238,238,238,1) 100%);border:1px solid #ddd;font-size:14px;color:#666;"
-							>删除</div>
+							>删除
+							</div>
 						</div>
 						<div class="mainBox scroll">
 							<el-form ref="form" label-width="80px">
@@ -83,16 +87,19 @@
 											<div class="row" style="width:100%;height:100%;background:#E6EBFF;">
 												<div style="color:#666;font-weight:bold;color:#666;width:100%; position: relative;">
 													<p style="padding-right:40px;">快捷语</p>
-													<p class="row item-center"style="color:#666;font-size:14px; position: absolute;left:16%;top:0;">回复内容</p>
+													<p class="row item-center"
+													   style="color:#666;font-size:14px; position: absolute;left:16%;top:0;">
+														回复内容</p>
 												</div>
 											</div>
 										</el-checkbox>
 
-										<el-checkbox name="type" :label="item.id"  v-for="(item,index) in ReplyArr" :key="index">
+										<el-checkbox name="type" :label="item.id" v-for="(item,index) in ReplyArr"
+													 :key="index">
 											<div class="row" style="width:100%;height:100%;">
 												<div style="color:#666;color:#666;width:100%; position: relative;">
 													<!-- style="width:50px;" -->
-													<p  class="ellipsis">{{item.title}}</p>
+													<p class="ellipsis">{{item.title}}</p>
 													<p class="row item-center ellipsis addContent"
 													>{{item.content}}</p>
 												</div>
@@ -121,21 +128,23 @@
 							<el-select v-model="popUp.type" disabled placeholder="私人库模版" class="often">
 							</el-select>
 						</div>
-						<div  class="row" style="margin-top: 15px;">
+						<div class="row" style="margin-top: 15px;">
 							<p>关键词<span>*</span></p>
-							<input class="oftenTitle" v-model="popUp.title" placeholder="请输入关键词" />
+							<input class="oftenTitle" v-model="popUp.title" placeholder="请输入关键词"/>
 						</div>
-						<div  class="row" style="margin-top: 15px;">
+						<div class="row" style="margin-top: 15px;">
 							<p>回复内容<span>*</span></p>
 							<textarea class="text" v-model="popUp.content" placeholder="请输入你要回复的内容"></textarea>
 						</div>
 						<div style="height:40px;margin-top:20px;" class="row average">
 							<div @click="popUpEsc" class="row center hover"
 								 style="width:80px;height:40px;border:1px solid rgba(221,221,221,1);background:linear-gradient(180deg,rgba(245,245,245,1) 0%,rgba(238,238,238,1) 100%);border-radius:5px;font-size:16px;color:#666;"
-							>取消</div>
-							<div @click="newly()"  class="row center hover"
+							>取消
+							</div>
+							<div @click="newly()" class="row center hover"
 								 style="width:80px;height:40px;background:rgba(83,153,245,1);color:#FFF;border-radius:5px;font-size:16px;"
-							>确定</div>
+							>确定
+							</div>
 						</div>
 					</div>
 				</div>
@@ -157,7 +166,7 @@
 						</div>
 						<div class="row" style="margin-top: 15px;">
 							<p>关键词<span>*</span></p>
-							<input class="oftenTitle" v-model="changePopUp.title"  placeholder="请输入关键词" />
+							<input class="oftenTitle" v-model="changePopUp.title" placeholder="请输入关键词"/>
 						</div>
 						<div class="row" style="margin-top: 15px;">
 							<p>回复内容<span>*</span></p>
@@ -169,12 +178,14 @@
 									@click="popUpChangeShow = false,changePopUp = ''"
 									class="row center hover"
 									style="width:80px;height:40px;border:1px solid rgba(221,221,221,1);background:linear-gradient(180deg,rgba(245,245,245,1) 0%,rgba(238,238,238,1) 100%);border-radius:5px;font-size:16px;color:#666;"
-							>取消</div>
+							>取消
+							</div>
 							<div
 									@click="changeFastreply()"
 									class="row center hover"
 									style="width:80px;height:40px;background:rgba(83,153,245,1);color:#FFF;border-radius:5px;font-size:16px;"
-							>确定</div>
+							>确定
+							</div>
 						</div>
 					</div>
 				</div>
@@ -198,26 +209,26 @@
 				leftSerch: "", //左侧搜索
 				matchingSerch: "", //右侧匹配搜索
 				popUpShow: false, //添加常用语开关
-				popUpChangeShow:false, // 修改常用语开关
+				popUpChangeShow: false, // 修改常用语开关
 				deleteArr: [],
 				popUp: {
 					//新增快捷回复
-					status:1,
-					content:'',//回复内容
-					title:''//关键字
+					status: 1,
+					content: '',//回复内容
+					title: ''//关键字
 				},
-				changePopUp:{ }, // 修改的快捷语
+				changePopUp: {}, // 修改的快捷语
 				ReplyArr: [], //快捷回复列表
 				// page: 1, //分页
 				// pageSize: 5, //分页大小
 				// total: 25, //分页总条目
-				time:{},
+				time: {},
 			};
 		},
 		methods: {
 
 			/******************删除单条快捷回复*****************/
-			clickDel(e){
+			clickDel(e) {
 				this.$confirm('您确定要删除该条快捷回复吗?', '提示', {
 					confirmButtonText: '确定',
 					cancelButtonText: '取消',
@@ -234,7 +245,7 @@
 			},
 
 			/******************显示编辑快捷窗口*******************/
-			popUpChange(e){
+			popUpChange(e) {
 				this.changePopUp = e;
 				this.popUpChangeShow = true
 			},
@@ -278,19 +289,31 @@
 
 			/********************新增快捷回复******************/
 			newly() {
+				if (this.popUp.title == '' || this.popUp.title.split(" ").join("").length == 0) {
+					this.$message.error('关键词不能为空!');
+					return false;
+				}
+				if (this.popUp.content == ''|| this.popUp.content.split(" ").join("").length == 0) {
+					this.$message.error('回复内容不能为空!');
+					return false;
+				}
 				let obj = {
 					headers: {
-						apiToken: this.$md5("addwords" + "customer-service" + "words"  + "service"),
+						apiToken: this.$md5("addwords" + "customer-service" + "words" + "service"),
 						userToken: this.token
 					}
 				};
 				// this.popUp.status =  1;
-				this.post("api"+ this.$ports.FastReply.addWords,this.popUp,obj).then(res => {
+				this.post("api" + this.$ports.FastReply.addWords, this.popUp, obj).then(res => {
 					if (res.data.code == 1) {
 						this.succeed(1);
-						this.ReplyArr.push({id:res.data.data.id,content:this.popUp.content,title:this.popUp.title});
-						this.$set(this.popUp,'content','')
-						this.$set(this.popUp,'title','')
+						this.ReplyArr.push({
+							id: res.data.data.id,
+							content: this.popUp.content,
+							title: this.popUp.title
+						});
+						this.$set(this.popUp, 'content', '')
+						this.$set(this.popUp, 'title', '')
 						this.popUpShow = false;
 					} else {
 						this.succeed(2);
@@ -302,13 +325,13 @@
 			getFastReply() {
 				let obj = {
 					headers: {
-						apiToken: this.$md5("userwords" + "customer-service" + "index"+ "service"),
+						apiToken: this.$md5("userwords" + "customer-service" + "index" + "service"),
 						userToken: this.token
 					}
 				};
 				this.get("api" + this.$ports.FastReply.userWords, obj).then(res => {
 					// console.log(res);
-					if (res.data.code ==1) {
+					if (res.data.code == 1) {
 						//私有库
 						this.ReplyArr = res.data.data.userWords; // res.data.data.sysWords
 					}
@@ -319,13 +342,13 @@
 			deleteFastReply() {
 				let obj = {
 					headers: {
-						apiToken: this.$md5("deletewords" + "customer-service" + "words"  + "service"),
+						apiToken: this.$md5("deletewords" + "customer-service" + "words" + "service"),
 						userToken: this.token
 					}
 				};
 				// console.log(this.deleteArr);
 				if (this.deleteArr.length > 0) {
-					this.post("api"+this.$ports.FastReply.deleteWords, this.deleteArr, obj).then(
+					this.post("api" + this.$ports.FastReply.deleteWords, this.deleteArr, obj).then(
 						res => {
 							if (res.data.code) {
 								this.succeed(1);
@@ -365,26 +388,26 @@
 			// },
 
 			/********************修改快捷语********************/
-			changeFastreply(){
+			changeFastreply() {
 				let obj = {
 					headers: {
-						apiToken: this.$md5("updatewords" + "customer-service" + "words"  + "service"),
+						apiToken: this.$md5("updatewords" + "customer-service" + "words" + "service"),
 						userToken: this.token
 					}
 				};
-				this.post('api'+this.$ports.FastReply.updateWords,{
-					id:this.changePopUp.id,
-					content:this.changePopUp.content,
-					status:1,
-					title:this.changePopUp.title
-				},obj).then((res)=>{
-					if(res.data.code == 1){
+				this.post('api' + this.$ports.FastReply.updateWords, {
+					id: this.changePopUp.id,
+					content: this.changePopUp.content,
+					status: 1,
+					title: this.changePopUp.title
+				}, obj).then((res) => {
+					if (res.data.code == 1) {
 						//this.getFastReply();
 						// this.showFastReply();
 						this.popUpChangeShow = false;
 						this.changePopUp = '';
 						this.succeed(1)
-					}else{
+					} else {
 						this.succeed(2)
 					}
 					//console.log(res)
@@ -392,9 +415,9 @@
 			}
 		},
 		mounted() {
-			if(typeof this.$store.getters.get_user_info  != 'string'){
+			if (typeof this.$store.getters.get_user_info != 'string') {
 				this.token = this.$store.getters.get_user_info.token;
-			}else if(this.$store.getters.get_user_info!= ""){
+			} else if (this.$store.getters.get_user_info != "") {
 				this.token = JSON.parse(this.$store.getters.get_user_info).token;
 			}
 
@@ -412,20 +435,23 @@
 </script>
 
 <style>
-	.hover:hover{
+	.hover:hover {
 		cursor: pointer;
 	}
-	.editor{
-		color:#666;
-		font-size:16px;
-		font-weight:bold;
-		font-family:PingFang SC;
+
+	.editor {
+		color: #666;
+		font-size: 16px;
+		font-weight: bold;
+		font-family: PingFang SC;
 		text-align: center;
-		margin-top:20px;
+		margin-top: 20px;
 	}
+
 	p {
 		margin: 0;
 	}
+
 	.tit {
 		padding-left: 20px;
 		font-size: 14px;
@@ -433,21 +459,25 @@
 		height: 50px;
 		line-height: 50px;
 	}
+
 	.library {
 		height: 50px;
 		line-height: 50px;
 		border: 1px solid #d5e5ff;
 		border-right: none;
 	}
+
 	.library div {
 		width: 50%;
 		text-align: center;
 	}
+
 	/* .library div span {
 	} */
 	.line {
 		position: relative;
 	}
+
 	.line::after {
 		content: "";
 		display: inline-block;
@@ -469,27 +499,33 @@
 		font-weight: bold;
 		border-bottom: 1px solid #d5e5ff;
 	}
+
 	.library {
 		height: 50px;
 		line-height: 50px;
 		border: 1px solid #d5e5ff;
 	}
+
 	.library div {
 		width: 50%;
 		text-align: center;
 	}
+
 	.library div span {
 		color: #666666;
 		font-size: 14px;
 		padding-bottom: 13px;
 	}
+
 	div span.acty {
 		color: #5399f5;
 		border-bottom: 2px solid #5399f5;
 	}
+
 	.line {
 		position: relative;
 	}
+
 	.line::after {
 		content: "";
 		display: inline-block;
@@ -501,33 +537,41 @@
 		right: 0;
 		top: 15px;
 	}
+
 	.search {
 		margin: 20px 20px 22px;
 	}
+
 	.md20 {
 		margin-left: 20px;
 		margin-bottom: 20px;
 	}
+
 	.phrases span {
 		color: #666666;
 		font-size: 14px;
 	}
+
 	.list div span {
 		color: #999999;
 		font-size: 14px;
 	}
+
 	.list div span:nth-child(1) {
 		color: #666666;
 		font-weight: 400;
 	}
+
 	.list div {
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
 	}
+
 	.fnc {
 		margin-left: 37px;
 	}
+
 	.fnc i {
 		color: #999999;
 		display: inline-block;
@@ -539,9 +583,11 @@
 	.mainTitle {
 		height: 60px;
 	}
+
 	.mainTitle div {
 		position: relative;
 	}
+
 	.mainTitle div img {
 		position: absolute;
 		right: 12px;
@@ -549,27 +595,33 @@
 		bottom: 0;
 		margin: auto 0;
 	}
+
 	.mainTitle div input {
 		color: #ccc;
 	}
+
 	.mainTitle div input:focus {
 		outline: none;
 		color: #666;
 	}
+
 	.el-checkbox {
 		width: 100%;
 	}
+
 	.el-form-item__content {
 		margin-left: 0 !important;
 		line-height: 0;
 		height: 50px;
 	}
+
 	.el-checkbox {
 		padding-left: 30px;
 		height: 50px;
 		display: flex;
 		align-items: center;
 	}
+
 	/* .is-disabled{
 	  background: #E6EBFF;
 	} */
@@ -577,24 +629,30 @@
 	.el-checkbox:nth-child(even) {
 		background: #fff;
 	}
+
 	.el-checkbox:nth-child(odd) {
 		background: #eff2fd;
 	}
+
 	.el-checkbox:first-child {
 		background: #e6ebff;
 	}
+
 	.el-form-item {
 		margin-bottom: 0;
 	}
+
 	.el-main {
 		overflow: visible;
 		height: 92.1vh;
 	}
+
 	.el-checkbox__label {
 		padding-left: 50px;
 		display: block;
 		width: 100%;
 	}
+
 	.mainBox {
 		width: 100%;
 		height: 80%;
@@ -602,12 +660,14 @@
 		overflow-y: auto;
 		margin-right: 0;
 	}
-	.addContent{
-		color:#666;
-		font-size:14px;
+
+	.addContent {
+		color: #666;
+		font-size: 14px;
 		position: absolute;
-		left:16%;top:0;
-		width:70%;
+		left: 16%;
+		top: 0;
+		width: 70%;
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
@@ -621,11 +681,13 @@
 		top: 0;
 		z-index: 99;
 	}
+
 	.popUpBg {
 		width: 100%;
 		height: 100%;
 		background: rgba(0, 0, 0, 0.01);
 	}
+
 	.popUpBox {
 		position: absolute;
 		left: 0;
@@ -638,10 +700,12 @@
 		background: #fff;
 		box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
 	}
+
 	.popUpBoxData {
 		margin-top: 30px;
 		/* padding: 0 44px; */
 	}
+
 	.popUpBoxData p {
 		/* margin-top: 10px; */
 		color: #666;
@@ -651,46 +715,58 @@
 		line-height: 40px;
 		/* margin-bottom: 15px; */
 	}
+
 	.popUpBoxData p span {
 		color: #f60;
 	}
+
 	.often {
 		width: 200px;
 		height: 40px;
 		color: #999;
 		position: relative;
 	}
+
 	.el-input__inner {
 		border: 1px solid #ddd;
 		border-radius: 0px;
 		color: #666;
 		padding-left: 7px;
 	}
+
 	.el-select-dropdown__item {
 		padding-left: 10px;
 	}
+
 	.el-popper[x-placement^="bottom"] .popper__arrow::after {
 		display: none;
 	}
+
 	.el-popper[x-placement^="bottom"] .popper__arrow {
 		display: none;
 	}
+
 	.el-select .el-input__inner:focus {
 		border-color: #ddd;
 	}
+
 	.el-select-dropdown {
 		border-radius: 0;
 	}
+
 	.el-select .el-input.is-focus .el-input__inner {
 		border-color: #ddd;
 	}
+
 	.el-popper[x-placement^="bottom"] {
 		margin: 0;
 	}
+
 	.el-icon-arrow-up:before {
 		content: "\E78F";
 		color: #666;
 	}
+
 	.choose {
 		width: 100%;
 		position: absolute;
@@ -698,6 +774,7 @@
 		bottom: 0;
 		background: #000;
 	}
+
 	.oftenTitle {
 		width: 140px;
 		height: 40px;
@@ -705,14 +782,17 @@
 		padding-left: 7px;
 		color: #999;
 	}
+
 	.oftenTitle:focus {
 		outline: none;
 		color: #666;
 	}
+
 	.el-input__inner::-webkit-input-placeholder {
 		/* WebKit browsers */
 		color: #666;
 	}
+
 	.text {
 		width: 200px;
 		height: 120px;
@@ -722,12 +802,15 @@
 		font-size: 14px;
 		color: #999;
 	}
-	.list{
+
+	.list {
 		line-height: 50px;
 	}
-	.phrasesList{
+
+	.phrasesList {
 		padding-right: 20px;
 	}
+
 	.text:focus {
 		outline: none;
 

+ 3 - 1
service/src/pages/LeaveMessage.vue

@@ -526,9 +526,10 @@
 			margin-top: 20px;
 			background: #F5F5F5;
 			border: 1px solid #EEEEEE;
-			// padding: 20px;
+			 padding: 20px;
 			font-size: 14px;
 			color: #666;
+			word-wrap: break-word;
 		
 		}
 	}
@@ -542,6 +543,7 @@
 			padding: 20px;
 			font-size: 14px;
 			color: #666;
+			word-wrap: break-word;
 			// line-height: 1.8;
 		}