liyongli 1 ano atrás
pai
commit
078f333339
1 arquivos alterados com 7 adições e 15 exclusões
  1. 7 15
      src/view/finance/index.vue

+ 7 - 15
src/view/finance/index.vue

@@ -6,7 +6,7 @@
     <van-search
       :background="background"
       clearable
-      @update:model-value="upsearch"
+      v-model="search"
       shape="round"
       placeholder="请输入搜索关键词"
     />
@@ -182,7 +182,7 @@
   </div>
 </template>
 <script setup>
-import { ref, reactive } from 'vue';
+import { ref, reactive, watch } from 'vue';
 import { showDialog, showConfirmDialog, showToast } from 'vant';
 import {
   getEnrollList,
@@ -196,16 +196,6 @@ import {
 import Shanshipin from '@/components/shanshipin.vue';
 const theme = '#38379f';
 const background = '#e0f2fa';
-// import {
-//   isIpad,
-//   isIpod,
-//   isIphone,
-// } from '../../utils/isTerminal';
-/**
- * window.$originData.orginParames.title 页面标题
- * window.$originData.orginParames.parameters 固定参数值
- * window.$originData.urlParames url参数
- */
 const w = window.$originData.orginParames.availWidth || 0;
 const operateId = window.$originData.orginParames.operateId;
 const width = (w - 16) / 2;
@@ -222,6 +212,7 @@ const config = reactive({
   times: -1,
   isShanShiPin: window.$shanshipin.UserId,
 });
+const search = ref('');
 const t = config.isShanShiPin ? 5 : 1;
 const phone =
   window.$shanshipin.Phone && window.$shanshipin.Phone != 0
@@ -278,10 +269,11 @@ const getRankList = Call => {
 };
 
 let time = null;
-const upsearch = res => {
+watch(search, res => {
+  console.log(res);
   if (time) clearTimeout(time);
   time = setTimeout(() => {
-    const rex = new RegExp(res);
+    const rex = res ? new RegExp(res) : /[.\n]*/;
     for (let i = 0; i < list.value.length; i++) {
       const v = list.value[i];
       list.value[i].noShow = !rex.test(v.name);
@@ -293,7 +285,7 @@ const upsearch = res => {
     clearTimeout(time);
     time = null;
   }, 200);
-};
+});
 
 const getCode = () => {
   // 获取验证码