更改了画像搜索方式

main
许宏杰 2 weeks ago
parent 8b0f295e27
commit d45a9373f2

@ -1,8 +1,8 @@
import request from "@/utils/request";
// 本地
// let api = "API"
let api = process.env.NODE_ENV === "production" ?location.origin: "API"
// 线上
let api = location.origin
// let api = location.origin
export default {
frimLogin() {
return request({

@ -15,9 +15,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分
// baseURL: process.env.VUE_APP_BASE_API,
//本地调试
baseURL: process.env.NODE_ENV === "production" ? location.origin +"/api/ggfw" : process.env.VUE_APP_BASE_API,
//!线上--2.17-198
baseURL:location.origin +"/api/ggfw",
// baseURL:location.origin +"/api/ggfw",
//!其他
// baseURL:location.origin,
// 超时

@ -44,11 +44,12 @@
<div class="input">
<el-input v-model="input" placeholder="请输入产品名称、批准文号/备案编号"></el-input>
</div>
<div class="sousuo" @click="gotoBgpage">
<!-- @click="gotoBgpage" -->
<div class="sousuo" @click="getsearchList()" >
<img src="@/assets/images/daping/searchicon.png" alt="" />
搜索
</div>
<div class="box-dialog" v-loading="loading" v-if="dialog">
<div class="box-dialog" v-loading="loading" v-show="!loading">
<div class="dialog-item" v-for='(item, index) in searchList' :key="index" @click="getValue(item)">
{{ item.name }}
</div>
@ -204,19 +205,19 @@ export default {
}
},
watch: {
async input(newValue, oldValue) {
// let data = await this.$api.productPortrayal.findByName({current:1,size:10});
if (newValue) {
this.loading = true;
this.dialog = true;
// let a = this.throttle(this.getsearchList,500)
this.getsearchList(newValue);
} else {
this.dialog = false;
this.searchList = [];
this.loading = false;
}
}
// async input(newValue, oldValue) {
// // let data = await this.$api.productPortrayal.findByName({current:1,size:10});
// if (newValue) {
// this.loading = true;
// this.dialog = true;
// // let a = this.throttle(this.getsearchList,500)
// this.getsearchList(newValue);
// } else {
// this.dialog = false;
// this.searchList = [];
// this.loading = false;
// }
// }
},
created() { this.dataNow(1) },
mounted() {
@ -226,6 +227,7 @@ export default {
this.userName = user.realName
},
methods: {
ListGO(item) {
this.$router.push({ path: "/bgpage", query: { code: item.code, name: item.name, type: item.type } })
},
@ -311,18 +313,20 @@ export default {
getValue(item) {
this.input = item.name;
this.getData = item;
setTimeout(() => {
this.dialog = false;
}, 200);
this.loading = true;
this.gotoBgpage()
},
async getsearchList(newValue) {
let data = await this.$api.productPortrayal.findByName({ name: newValue });
if (data.code == 200) {
async getsearchList() {
let res = await this.$api.productPortrayal.findByName({ name: this.input });
this.loading = false;
this.searchList = data.data;
if (this.searchList.length < 1) {
this.dialog = false;
}
this.searchList = res.data;
if(this.searchList.length>0){
this.loading = false
}else{
this.$modal.msgWarning("未搜索到结果!")
this.loading = true
}
},
tuichudengl() {

Loading…
Cancel
Save