Procházet zdrojové kódy

Merge branch 'dev/v1.0.36_yf' of jianyu/web into feature/v1.0.36

yangfeng před 1 rokem
rodič
revize
f1f0602b0a

+ 13 - 0
apps/bigmember_pc/src/components/selector/TimeSelector.vue

@@ -41,6 +41,12 @@ export default {
     showExact: {
       type: Boolean,
       default: true
+    },
+    value: {
+      type: [Object, String],
+      default: () => {
+        return {}
+      }
     }
   },
   data() {
@@ -51,6 +57,13 @@ export default {
     prop: 'value',
     event: 'change'
   },
+  watch: {
+    value (val) {
+      if (val) {
+        this.setState(val)
+      }
+    }
+  },
   methods: {
     setState(data) {
       return this.$refs.content.setState(data)

+ 1 - 2
apps/bigmember_pc/src/views/search/components/search-header-card.vue

@@ -71,9 +71,8 @@ function goWorkSpaceCustom() {
 
 <style lang="scss" scoped>
 .search-header-card {
-  //
   .tab-header {
-    padding: 0 32px;
+    padding: 0 16px;
     height: 48px;
     line-height: 48px;
     border-bottom: 1px solid #ececec;

+ 1 - 1
apps/bigmember_pc/src/views/search/supply/constant/search-filters.js

@@ -49,7 +49,7 @@ const SearchSupplyBaseSchema = [
   {
     key: 'time',
     label: '发布时间:',
-    defaultVal: [],
+    defaultVal: {},
     _name: 'type',
     _type: 'component',
     expand: {

+ 15 - 0
apps/bigmember_pc/src/views/search/supply/index.vue

@@ -3,6 +3,7 @@ import SearchHeaderCard from '@/views/search/components/search-header-card.vue'
 import SearchSchemaFilter from '@/views/search/components/search-schema-filter.vue'
 import SearchList from '@/views/search/layout/search-list.vue'
 import { SupplyArticleItem } from '@jy/pc-ui'
+import { onMounted } from 'vue'
 import { SearchSupplyBaseSchema } from './constant/search-filters'
 // 导入业务模型
 import { useSearchSupplyModel, SearchSupplyModel } from './model/index'
@@ -18,6 +19,7 @@ const {
   searchTabs,
   inputKeywordsState,
   doSearch,
+  getFormatAPIParams,
   searchListProps,
   doChangePageNum,
   doChangePageSize,
@@ -38,6 +40,18 @@ function goDetail(item) {
   const routerUrl = `/swordfish/page_web_pc/demand/detail/${id}?matchKey=${inputKeywordsState.value.input}`
   window.open(routerUrl)
 }
+
+function goWorkSpaceCustom() {
+  const supplyData = {
+    showFilter: showFilter.value,
+    keywords: inputKeywordsState.value.input,
+    filterState: filterState.value,
+    ...getFormatAPIParams()
+  }
+  // 保存数据,进入工作台
+  sessionStorage.setItem('supplyData', JSON.stringify(supplyData))
+  window.location.replace('/page_workDesktop/work-bench/app/search/supply')
+}
 </script>
 
 <template>
@@ -48,6 +62,7 @@ function goDetail(item) {
         :tabs="searchTabs"
         placeholder="输入您想要查询的供应信息,多个关键词用空格隔开"
         @search="doSearch"
+        @goWorkSpace="goWorkSpaceCustom"
       >
         <div
           class="toggle-filter m-l-16px font-size-14px"

+ 21 - 2
apps/bigmember_pc/src/views/search/supply/model/base.js

@@ -41,7 +41,25 @@ export default function () {
   }
 
   function doSearch() {
-    return doQuery()
+    const supplyData = sessionStorage.getItem('supplyData')
+    if (supplyData) {
+      const data = JSON.parse(supplyData)
+      const { searchType, status, province, city, time, filterState: filterMap } = data
+      const params = {
+        searchType,
+        status,
+        province,
+        city,
+        time,
+        keywords: data.keywords || ''
+      }
+      inputKeywordsState.value.input = data.keywords
+      filterState.value = filterMap
+      sessionStorage.removeItem('supplyData')
+      return doQuery(params)
+    } else {
+      return doQuery()
+    }
   }
 
   // 列表状态
@@ -138,7 +156,6 @@ export default function () {
       getFormatAPIParams(),
       params
     )
-    console.log(result, 'result')
     return result
   }
 
@@ -148,10 +165,12 @@ export default function () {
     goToPublish,
     // 列表
     list,
+    listState,
     doQuery,
     searchListProps,
     // 搜索UI
     filterState,
+    getFormatAPIParams,
     doChangeFilter,
     searchTabs,
     inputKeywordsState,