From c782c1100d2e4306cd1cc956e8f3442e99e1e6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com> Date: Tue, 7 Jun 2022 17:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=97=AE=E7=AD=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personal/pages/my-questions/index.vue | 89 +++++++++++++++++-- .../regulatoryRepository/standQA/index.vue | 62 +++++++++++-- 2 files changed, 141 insertions(+), 10 deletions(-) diff --git a/src/pages/personal/pages/my-questions/index.vue b/src/pages/personal/pages/my-questions/index.vue index dd5c5ad98..2cb8e07e0 100644 --- a/src/pages/personal/pages/my-questions/index.vue +++ b/src/pages/personal/pages/my-questions/index.vue @@ -13,7 +13,7 @@ - 查询 + 查询 清空 @@ -794,7 +794,7 @@ 选择标准 - + 相似历史问题: - - + + + {{item.problemDescription}} + {{item.questionTime}} + 取 消 @@ -1202,6 +1205,16 @@ import answerItem from "@/pages/personal/pages/my-questions/components/answerIte import questionItemInfo from "@/pages/personal/pages/my-questions/components/questionItemInfo"; import standItem from './components/stand-item' +function debounce(func, wait = 500){ + let timeout; + return function(event){ + clearTimeout(timeout) + timeout = setTimeout(() => { + func.call(this, event) + },wait) + } +} + export default { name: "index", components:{ @@ -1213,6 +1226,7 @@ export default { data(){ return{ mergeList: [], + historyList: [], //相似历史问题 handleSelectForm: { standName: '', //标准名称 numberName: '', //政策名称 @@ -1301,9 +1315,28 @@ export default { }) sessionStorage.setItem('mergeList', JSON.stringify(this.mergeList)) } + }, + 'questionForm.problemDescription':{ + handler(val){ + } } }, methods:{ + changeInput:debounce(function(val){ + if(val.length){ + this.$http.get('lawss/AskQuestions/resemblance',{ + problemDescription: val, + },{ + _this: this + }, res => { + this.historyList = res.data + }) + } + }), + //点击跳转问题详情 + historyJump(id){ + this.$router.push('/standQA') + }, // 点击查看 handlePreview(item) { let routeUrl = this.$router.resolve({ @@ -1489,16 +1522,19 @@ export default { }, sourceClick(){ + this.standList = [] this.questionSerach.classification = this.activeType this.questionSerach.standardEncdoing = '' this.standSearch() }, sourceClick2(){ + this.standList = [] this.questionSerach.classification = this.activeType this.ansSearch() }, //我的订阅 sourceClick3(){ + this.standList = [] this.questionSerach.classification = this.activeType this.subSearch() }, @@ -1568,7 +1604,43 @@ export default { }, //清空 delSearch(){ - + this.questionSerach = { + classification: 'INLAND', + type: '', + standardName: '', //标准名称 + standardEncdoing: '', //标准编号 + questioner: this.$store.getters.userInfo.userId, //提问人 + subscription: this.$store.getters.userInfo.userId, //订阅人 + answerer: this.$store.getters.userInfo.userId, //回答人 + problemDescription: '', //关键词/问题描述 + } + }, + searchBtn(){ + this.questionSerach.classification = this.activeType + switch (this.activeName) { + case 'myQue': + this.questionSerach.type = 'myQue' + this.questionSerach.subscription = '' + this.questionSerach.answerer = '' + break + case 'myAns': + this.questionSerach.type = 'myAns' + this.questionSerach.subscription = '' + this.questionSerach.questioner = '' + break + case 'mySub': + this.questionSerach.type = 'mySub' + this.questionSerach.questioner = '' + this.questionSerach.answerer = '' + break + } + this.$http.get('lawss/AskQuestions/retrieve',{ + ...this.questionSerach + },{ + _this: this + }, res => { + this.standList = res.data + }) }, //问题查询 queSearch(){ @@ -1797,4 +1869,11 @@ export default { /deep/.el-upload-dragger { height: 90px; } + .history-item{ + padding: 15px; + line-height: 1.5; + font-size: 14px; + color: #409EFF; + cursor: pointer; + } diff --git a/src/pages/regulatoryRepository/standQA/index.vue b/src/pages/regulatoryRepository/standQA/index.vue index 9185984f7..b5a863a90 100644 --- a/src/pages/regulatoryRepository/standQA/index.vue +++ b/src/pages/regulatoryRepository/standQA/index.vue @@ -13,7 +13,7 @@ - 查询 + 查询 清空 @@ -290,7 +290,7 @@ 选择标准 - + 相似历史问题: - - + + + {{item.problemDescription}} + {{item.questionTime}} + 取 消 @@ -698,6 +701,15 @@ import answerItem from "./components/answerItem"; import questionItemInfo from "./components/questionItemInfo"; import standItem from './components/stand-item' +function debounce(func, wait = 500){ + let timeout; + return function(event){ + clearTimeout(timeout) + timeout = setTimeout(() => { + func.call(this, event) + },wait) + } +} export default { name: "standQA", components:{ @@ -708,6 +720,7 @@ export default { }, data(){ return{ + historyList: [], pubOptions: [], //公共问题 handleSelectForm: { standName: '', //标准名称 @@ -783,6 +796,21 @@ export default { }); }, methods:{ + changeInput:debounce(function(val){ + if(val.length){ + this.$http.get('lawss/AskQuestions/resemblance',{ + problemDescription: val, + },{ + _this: this + }, res => { + this.historyList = res.data + }) + } + }), + //点击跳转问题详情 + historyJump(id){ + this.$router.push('/standQA') + }, // 点击查看 handlePreview(item) { let routeUrl = this.$router.resolve({ @@ -992,7 +1020,24 @@ export default { }, //清空 delSearch(){ - + this.questionSerach = { + classification: 'INLAND', + standardName: '', //标准名称 + standardEncdoing: '', //标准编号 + questioner: this.$store.getters.userInfo.userId, //提问人 + problemDescription: '', //关键词/问题描述 + } + }, + searchBtn(){ + this.questionSerach.classification = this.activeType + this.questionSerach.questioner = '' + this.$http.get('lawss/AskQuestions/retrieve',{ + ...this.questionSerach + },{ + _this: this + }, res => { + this.standList = res.data + }) }, //问题查询 queSearch(){ @@ -1208,4 +1253,11 @@ export default { /deep/.el-upload-dragger { height: 90px; } +.history-item{ + padding: 15px; + line-height: 1.5; + font-size: 14px; + color: #409EFF; + cursor: pointer; +}