|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
- <ion-button id="postSelectionLike" style="color: #02a6f1;font-size: 15px;" fill="clear" @click="onOpen">选择
|
|
|
+ <ion-button id="postSelectionLike" style="color: #02a6f1;font-size: 15px;" fill="clear" @click="onOpen()">选择
|
|
|
</ion-button>
|
|
|
<ion-page>
|
|
|
<ion-content class="ion-padding">
|
|
|
- <ion-modal trigger="postSelectionLike" :is-open="isOpen" @willPresent="onRest">
|
|
|
+ <ion-modal trigger="postSelectionLike" :is-open="isOpen" @willPresent="onRest()">
|
|
|
<ion-header class="header-theme2">
|
|
|
<ion-toolbar>
|
|
|
<ion-buttons slot="start">
|
|
|
- <ion-icon :icon="arrowBackOutline" @click="onOpen"></ion-icon>
|
|
|
+ <ion-icon :icon="arrowBackOutline" @click="onOpen()"></ion-icon>
|
|
|
</ion-buttons>
|
|
|
<ion-title>岗位名称</ion-title>
|
|
|
<ion-buttons slot="end">
|
|
|
- <ion-button fill="clear" @click="onConfirm">确定</ion-button>
|
|
|
+ <ion-button fill="clear" @click="onConfirm()">确定</ion-button>
|
|
|
</ion-buttons>
|
|
|
</ion-toolbar>
|
|
|
</ion-header>
|
|
@@ -19,7 +19,7 @@
|
|
|
<ion-item class="search-item" style="--border-style: unset; --inner-padding-end: 0px;--padding-start: 0px;">
|
|
|
<ion-input placeholder="请输入岗位名称" class="custom"
|
|
|
v-model="searchParams.professionName"
|
|
|
- @input="reload" :clear-on-edit="true"
|
|
|
+ @input="reload()" :clear-on-edit="true"
|
|
|
style="border: 1px solid #f2f2f5;border-radius: 14px;--padding-start: 10px;height: 35px;">
|
|
|
<ion-icon slot="start" :icon="searchOutline" aria-hidden="true"></ion-icon>
|
|
|
</ion-input>
|
|
@@ -28,8 +28,8 @@
|
|
|
<div class="list-content">
|
|
|
<ion-list>
|
|
|
<ion-item v-for="(record,key) in dataList" :key="key">
|
|
|
- <ion-label @click="onSelect(record)" >
|
|
|
- <span v-html="formatStr(record.professionName)"></span>({{record.parentProfessionName}})
|
|
|
+ <ion-label @click="onSelect(record)">
|
|
|
+ <span v-html="formatStr(record.professionName)"></span>({{ record.parentProfessionName }})
|
|
|
</ion-label>
|
|
|
</ion-item>
|
|
|
</ion-list>
|
|
@@ -85,15 +85,25 @@ export default defineComponent({
|
|
|
})
|
|
|
loading.value = false;
|
|
|
}
|
|
|
-
|
|
|
+ const reloadBool = ref(true);
|
|
|
const reload = () => {
|
|
|
dataList.value = [];
|
|
|
searchParams.pageIndex = 1;
|
|
|
- loadData();
|
|
|
+ if(reloadBool.value==false){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ reloadBool.value = false;
|
|
|
+ getProfessionLikeList(searchParams).then(data => {
|
|
|
+ dataList.value = dataList.value.concat(data.list);
|
|
|
+ total.value = data.total;
|
|
|
+ reloadBool.value = true;
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const onScroll = (e: any) => {
|
|
|
setTimeout(() => {
|
|
|
+ console.log("onScroll:", dataList.value.length)
|
|
|
e.target.complete();
|
|
|
if (pagination.value.total.value > pagination.value.current * pagination.value.pageSize) {
|
|
|
searchParams.pageIndex += 1;
|
|
@@ -103,7 +113,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const onConfirm = () => {
|
|
|
- if(searchParams.professionName){
|
|
|
+ if (searchParams.professionName) {
|
|
|
resultInfo.text = searchParams.professionName;
|
|
|
context.emit("resultInfo", resultInfo);
|
|
|
}
|
|
@@ -130,11 +140,11 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const formatStr = (str: any) => {
|
|
|
- if(!str){
|
|
|
+ if (!str) {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
- return str.replace(searchParams.professionName,'<span style="color: coral">'+searchParams.professionName+'</span>');
|
|
|
+ return str.replace(searchParams.professionName, '<span style="color: coral">' + searchParams.professionName + '</span>');
|
|
|
}
|
|
|
|
|
|
return {
|