对接手机端
This commit is contained in:
@@ -3,9 +3,25 @@
|
||||
<div class="fixed">
|
||||
<div class="header-search">
|
||||
<van-icon @click="iconClick" class="icon" name="arrow-left"/>
|
||||
<van-dropdown-menu v-if="activeTab == 'documentLibrary'">
|
||||
<van-dropdown-item @change="selectModelChange" v-model="selectModel" :options="option"/>
|
||||
</van-dropdown-menu>
|
||||
<van-search v-model="value"
|
||||
class="search-text"
|
||||
v-if="activeTab == 'documentLibrary'"
|
||||
show-action
|
||||
left-icon="none"
|
||||
@search="onSearch"
|
||||
@clear="onClear"
|
||||
@cancel="onClear"
|
||||
:action-text="$t('reset')"
|
||||
:placeholder="$t('phoneSearch')"/>
|
||||
<van-search v-model="value"
|
||||
show-action
|
||||
v-else
|
||||
@search="onSearch"
|
||||
@clear="onClear"
|
||||
@cancel="onClear"
|
||||
:action-text="$t('reset')"
|
||||
:placeholder="$t('phoneSearch')"/>
|
||||
</div>
|
||||
@@ -20,7 +36,10 @@
|
||||
</div>
|
||||
<div class="content-box">
|
||||
<div class="search-top">
|
||||
{{$t('searchScope')}}:<span>{{searchValue}}</span>
|
||||
{{$t('searchScope')}}:
|
||||
<span v-if="activeTab == 'documentLibrary' && searchValue">
|
||||
{{selectModelName}}:</span>
|
||||
<span>{{searchValue}}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="activeTab == 'whole'">
|
||||
@@ -33,8 +52,7 @@
|
||||
>
|
||||
<div class="content-box-content" @click="dataClick(item)" v-for="(item,index) in list" :key="index">
|
||||
<div v-if="item.module_type_flag == 'WDK'">
|
||||
<div class="content-box-title">
|
||||
{{item.serial_number || '--'}}
|
||||
<div class="content-box-title" v-html="item.serial_number || '--'">
|
||||
</div>
|
||||
<div class="content-box-type">
|
||||
<span class="content-box-left"
|
||||
@@ -50,7 +68,7 @@
|
||||
<div class="content-box-type">
|
||||
<span class="content-box-left"
|
||||
:class="{'content-box-left-En-WDK':language == 'en-us' ? true : false}">{{$t('category')}}</span>
|
||||
<span class="content-box-text">{{item.module_type || '--'}}</span>
|
||||
<span class="content-box-text" v-html="item.module_type || '--'"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="item.module_type_flag == 'WTZSK' || item.module_type_flag == 'ZSFX'">
|
||||
@@ -72,7 +90,7 @@
|
||||
<div class="content-box-type">
|
||||
<span class="content-box-left-problemKnow"
|
||||
:class="{'content-box-left-problemKnow-En':language == 'en-us' ? true : false}">{{$t('category')}}</span>
|
||||
<span class="content-box-text">{{item.module_type || '--'}}</span>
|
||||
<span class="content-box-text" v-html="item.module_type || '--'"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="item.module_type_flag == 'FGYB'">
|
||||
@@ -91,7 +109,7 @@
|
||||
<div class="content-box-type">
|
||||
<span class="content-box-left-monthly"
|
||||
:class="{'content-box-left-monthly-En':language == 'en-us' ? true : false}">{{$t('category')}}</span>
|
||||
<span class="content-box-text">{{item.module_type || '--'}}</span>
|
||||
<span class="content-box-text" v-html="item.module_type || '--'"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -205,12 +223,18 @@
|
||||
wholeUrl: 'search/document/getFullTextInfoList',
|
||||
documentLibraryUrl: 'search/document/getParagraphInfoList',
|
||||
problemKnowledgeBaseUrl: '/search/document/getProblemKnowledgeBasePage',
|
||||
monthlyReportRegulationsUrl: '/search/lawsMonthlyReport/page'
|
||||
}
|
||||
monthlyReportRegulationsUrl: '/search/lawsMonthlyReport/page',
|
||||
queryCondition: 'search/document/queryCondition'
|
||||
},
|
||||
selectModel: '',
|
||||
option: [],
|
||||
searchOption: [],
|
||||
selectModelNameSearch: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = 'NIO GRP'
|
||||
this.getCondition()
|
||||
if (this.$route.query.searchValue) {
|
||||
this.value = this.$route.query.searchValue
|
||||
this.searchValue = this.$route.query.searchValue
|
||||
@@ -220,10 +244,63 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectModelChange(event) {
|
||||
let content = this.option.filter((res) => {
|
||||
return res.value === event
|
||||
})
|
||||
if (content && content.length > 0) {
|
||||
this.selectModelNameSearch = content[0].text
|
||||
} else {
|
||||
this.selectModelNameSearch = ''
|
||||
}
|
||||
},
|
||||
getCondition() {
|
||||
let query = {
|
||||
flag: 1,
|
||||
searchFlag: 1
|
||||
}
|
||||
getAction(this.url.queryCondition, query).then((res) => {
|
||||
if (res.success) {
|
||||
let searchOption = res.result || []
|
||||
if (searchOption.length > 0) {
|
||||
this.selectModel = searchOption[0].db_field_name
|
||||
this.selectModelNameSearch = searchOption[0].db_field_txt
|
||||
for (let i = 0; i < searchOption.length; i++) {
|
||||
this.option.push({
|
||||
text: searchOption[i].db_field_txt,
|
||||
value: searchOption[i].db_field_name
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.searchOption = []
|
||||
}
|
||||
})
|
||||
},
|
||||
iconClick() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
onSearch() {
|
||||
this.searchValue = this.value
|
||||
this.selectModelName = this.selectModelNameSearch
|
||||
if (this.activeTab == 'whole') {
|
||||
this.list = []
|
||||
} else if (this.activeTab == 'documentLibrary') {
|
||||
this.documentLibraryList = []
|
||||
} else if (this.activeTab == 'problemKnowledgeBase') {
|
||||
this.problemKnowledgeBaseList = []
|
||||
} else if (this.activeTab == 'monthlyReportRegulations') {
|
||||
this.monthlyReportRegulationsList = []
|
||||
}
|
||||
this.loading = true
|
||||
this.finished = false
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
onClear() {
|
||||
this.searchValue = ''
|
||||
this.value = ''
|
||||
this.selectModelName = ''
|
||||
if (this.activeTab == 'whole') {
|
||||
this.list = []
|
||||
} else if (this.activeTab == 'documentLibrary') {
|
||||
@@ -239,6 +316,9 @@
|
||||
this.getList()
|
||||
},
|
||||
activeChange() {
|
||||
this.searchValue = ''
|
||||
this.value = ''
|
||||
this.selectModelName = ''
|
||||
if (this.activeTab == 'whole') {
|
||||
this.list = []
|
||||
} else if (this.activeTab == 'documentLibrary') {
|
||||
@@ -310,6 +390,8 @@
|
||||
})
|
||||
} else if (this.activeTab == 'documentLibrary') {
|
||||
url = this.url.documentLibraryUrl
|
||||
params.mapOne[this.selectModel] = this.value
|
||||
params.selectValue = ''
|
||||
this.getDocumentLibrary(url, params)
|
||||
} else if (this.activeTab == 'problemKnowledgeBase') {
|
||||
url = this.url.problemKnowledgeBaseUrl
|
||||
@@ -588,7 +670,49 @@
|
||||
.content-box-left-monthly-En {
|
||||
width: 2.11rem;
|
||||
}
|
||||
|
||||
::v-deep .highlight-class {
|
||||
color: #21c9cc!important;
|
||||
color: #21c9cc !important;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-menu {
|
||||
height: 1.1rem;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-menu__title--active {
|
||||
color: #21c9cc;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-item__option--active {
|
||||
color: #21c9cc;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-item__option--active .van-dropdown-item__icon {
|
||||
color: #21c9cc;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-menu .van-dropdown-menu__bar {
|
||||
height: 1.1rem;
|
||||
background: #F5F6F7;
|
||||
font-size: 0.38rem;
|
||||
box-shadow: none;
|
||||
width: 2rem;
|
||||
border-top-left-radius: 0.2rem;
|
||||
border-bottom-left-radius: 0.2rem;
|
||||
border-right: 0.02rem #E6E7EC solid;
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
|
||||
::v-deep .van-dropdown-menu__title::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.search-text {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.search-text .van-search__content {
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -2,10 +2,10 @@
|
||||
<div class="box">
|
||||
<div class="fixed">
|
||||
<div class="header-search">
|
||||
<van-icon class="icon" name="arrow-left"/>
|
||||
<!-- <van-icon class="icon" name="arrow-left"/>-->
|
||||
<van-search v-model="value"
|
||||
show-action
|
||||
:action-text="$t('reset')"
|
||||
@search="onSearch"
|
||||
@clear="onClear"
|
||||
:placeholder="$t('phoneSearch')"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -237,6 +237,12 @@
|
||||
// this.getToDoProcess()
|
||||
},
|
||||
methods: {
|
||||
onSearch(){
|
||||
|
||||
},
|
||||
onClear(){
|
||||
|
||||
},
|
||||
onChange(value) {
|
||||
if (value == 'search') {
|
||||
this.$router.push({
|
||||
@@ -500,7 +506,7 @@
|
||||
}
|
||||
|
||||
::v-deep .van-search {
|
||||
padding: 0 0 0 0.2rem;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::v-deep .van-search__action {
|
||||
|
||||
Reference in New Issue
Block a user