zs 1 rok temu
rodzic
commit
773cbbe4e3

+ 9 - 0
src/store/api/user/company.js

@@ -13,6 +13,14 @@ export const CompanyStore = defineStore('company', () => {
     const res = await axios.$get(`${url}`, cond)
     return res
   }
+  const list = async ({ skip = 0, limit = undefined, ...info } = {}) => {
+    let cond = {}
+    if (skip) cond.skip = skip
+    if (limit) cond.limit = limit
+    cond = { ...cond, ...info }
+    const res = await axios.$get(`${url}/list`, cond)
+    return res
+  }
   const fetch = async (payload) => {
     const res = await axios.$get(`${url}/${payload}`)
     return res
@@ -36,6 +44,7 @@ export const CompanyStore = defineStore('company', () => {
   }
   return {
     query,
+    list,
     fetch,
     detail,
     create,

+ 9 - 0
src/store/api/user/expert.js

@@ -13,6 +13,14 @@ export const ExpertStore = defineStore('expert', () => {
     const res = await axios.$get(`${url}`, cond)
     return res
   }
+  const list = async ({ skip = 0, limit = undefined, ...info } = {}) => {
+    let cond = {}
+    if (skip) cond.skip = skip
+    if (limit) cond.limit = limit
+    cond = { ...cond, ...info }
+    const res = await axios.$get(`${url}/list`, cond)
+    return res
+  }
   const fetch = async (payload) => {
     const res = await axios.$get(`${url}/${payload}`)
     return res
@@ -36,6 +44,7 @@ export const ExpertStore = defineStore('expert', () => {
   }
   return {
     query,
+    list,
     fetch,
     detail,
     create,

+ 0 - 2
src/views/achievement/index.vue

@@ -258,7 +258,6 @@ const route = useRoute()
 import achievement from '@/assets/bg.png'
 // 加载中
 const loading = ref(false)
-const searchForm = ref({})
 // 列表
 const list = ref([])
 let skip = 0
@@ -315,7 +314,6 @@ const search = async (query = { skip: 0, limit }) => {
   const info = {
     skip: query.skip,
     limit: query.limit,
-    ...searchForm.value,
     is_use: '0',
     status: '1'
   }

+ 35 - 5
src/views/company/index.vue

@@ -268,7 +268,6 @@ import demand from '@/assets/innovation.png'
 const router = useRouter()
 // 加载中
 const loading = ref(false)
-const searchForm = ref({})
 // 列表
 const list = ref([])
 let skip = 0
@@ -326,11 +325,36 @@ const search = async (query = { skip: 0, limit }) => {
   const info = {
     skip: query.skip,
     limit: query.limit,
-    ...searchForm.value,
     is_show: '0',
     status: '1'
   }
-  const res = await store.query(info)
+  if (oneList.value.length > 0) {
+    const one = oneList.value.map((i) => {
+      return i.value
+    })
+    info.one = one
+  }
+  if (twoList.value.length > 0) {
+    info.two = twoList.value.map((i) => {
+      return i.value
+    })
+  }
+  if (thrList.value.length > 0) {
+    info.thr = thrList.value.map((i) => {
+      return i.label
+    })
+  }
+  if (fourList.value.length > 0) {
+    info.four = fourList.value.map((i) => {
+      return i.value
+    })
+  }
+  if (fiveList.value.length > 0) {
+    info.five = fiveList.value.map((i) => {
+      return i.value
+    })
+  }
+  const res = await store.list(info)
   if (res.errcode == '0') {
     list.value = res.data
     total.value = res.total
@@ -346,7 +370,7 @@ const getDict = (data, model) => {
   return get(res, 'label')
 }
 // 选择查询
-const toSelect = (item, num) => {
+const toSelect = async (item, num) => {
   if (item.is_active) return
   if (num == 'one') {
     for (const val of scaleList.value) {
@@ -388,9 +412,12 @@ const toSelect = (item, num) => {
     if (!five) fiveList.value.push(item)
     else fiveList.value = fiveList.value.filter((f) => f.value == item.value)
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 // 删除标签
-const toDel = (item, type) => {
+const toDel = async (item, type) => {
   if (type == 'one') {
     const one = oneList.value.filter((f) => f.value != item.value)
     oneList.value = one
@@ -426,6 +453,9 @@ const toDel = (item, type) => {
       if (i.value == item.value) i.is_active = !i.is_active
     }
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 const currentPage = ref(1)
 // 分页

+ 30 - 5
src/views/expert/index.vue

@@ -238,7 +238,6 @@ import demand from '@/assets/innovation.png'
 const router = useRouter()
 // 加载中
 const loading = ref(false)
-const searchForm = ref({})
 // 列表
 const list = ref([])
 let skip = 0
@@ -286,11 +285,31 @@ const search = async (query = { skip: 0, limit }) => {
   const info = {
     skip: query.skip,
     limit: query.limit,
-    ...searchForm.value,
     is_show: '0',
     status: '1'
   }
-  const res = await store.query(info)
+  if (oneList.value.length > 0) {
+    const one = oneList.value.map((i) => {
+      return i.value
+    })
+    info.one = one
+  }
+  if (twoList.value.length > 0) {
+    info.two = twoList.value.map((i) => {
+      return i.value
+    })
+  }
+  if (thrList.value.length > 0) {
+    info.thr = thrList.value.map((i) => {
+      return i.label
+    })
+  }
+  if (fourList.value.length > 0) {
+    info.four = fourList.value.map((i) => {
+      return i.value
+    })
+  }
+  const res = await store.list(info)
   if (res.errcode == '0') {
     list.value = res.data
     total.value = res.total
@@ -314,7 +333,7 @@ const toChat = (item) => {
   router.push({ path: '/chat', query: { id: item.user } })
 }
 // 选择查询
-const toSelect = (item, num) => {
+const toSelect = async (item, num) => {
   if (item.is_active) return
   if (num == 'one') {
     for (const val of fieldList.value) {
@@ -348,9 +367,12 @@ const toSelect = (item, num) => {
     if (!four) fourList.value.push(item)
     else fourList.value = fourList.value.filter((f) => f.value == item.value)
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 // 删除标签
-const toDel = (item, type) => {
+const toDel = async (item, type) => {
   if (type == 'one') {
     const one = oneList.value.filter((f) => f.value != item.value)
     oneList.value = one
@@ -379,6 +401,9 @@ const toDel = (item, type) => {
       if (i.value == item.value) i.is_active = !i.is_active
     }
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 const currentPage = ref(1)
 // 分页

+ 30 - 5
src/views/project/index.vue

@@ -220,7 +220,6 @@ import demand from '@/assets/innovation.png'
 const router = useRouter()
 // 加载中
 const loading = ref(false)
-const searchForm = ref({})
 // 列表
 const list = ref([])
 let skip = 0
@@ -274,11 +273,31 @@ const search = async (query = { skip: 0, limit }) => {
   const info = {
     skip: query.skip,
     limit: query.limit,
-    ...searchForm.value,
     is_use: '0',
     status: '1'
   }
-  const res = await store.query(info)
+  if (oneList.value.length > 0) {
+    const one = oneList.value.map((i) => {
+      return i.value
+    })
+    info.one = one
+  }
+  if (twoList.value.length > 0) {
+    info.two = twoList.value.map((i) => {
+      return i.value
+    })
+  }
+  if (thrList.value.length > 0) {
+    info.thr = thrList.value.map((i) => {
+      return i.label
+    })
+  }
+  if (fourList.value.length > 0) {
+    info.four = fourList.value.map((i) => {
+      return i.value
+    })
+  }
+  const res = await store.list(info)
   if (res.errcode == '0') {
     list.value = res.data
     total.value = res.total
@@ -293,7 +312,7 @@ const getDict = (data, model) => {
   return get(res, 'label')
 }
 // 选择查询
-const toSelect = (item, num) => {
+const toSelect = async (item, num) => {
   if (item.is_active) return
   if (num == 'one') {
     for (const val of fieldList.value) {
@@ -327,9 +346,12 @@ const toSelect = (item, num) => {
     if (!four) fourList.value.push(item)
     else fourList.value = fourList.value.filter((f) => f.value == item.value)
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 // 删除标签
-const toDel = (item, type) => {
+const toDel = async (item, type) => {
   if (type == 'one') {
     const one = oneList.value.filter((f) => f.value != item.value)
     oneList.value = one
@@ -358,6 +380,9 @@ const toDel = (item, type) => {
       if (i.value == item.value) i.is_active = !i.is_active
     }
   }
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
 }
 const currentPage = ref(1)
 // 分页