Przeglądaj źródła

修改更改登录

zs 8 miesięcy temu
rodzic
commit
f5ff583aab

+ 34 - 1
src/components/custom/custom-layout.vue

@@ -10,7 +10,23 @@
           </div>
         </div>
         <div class="right">
-          <div class="right_1">
+          <div class="right_1" v-if="user && user.id">
+            <el-dropdown>
+              <span class="el-dropdown-link">
+                {{ user.nick_name || '暂无昵称' }}
+                <el-icon class="el-icon--right">
+                  <arrow-down />
+                </el-icon>
+              </span>
+              <template #dropdown>
+                <el-dropdown-menu>
+                  <el-dropdown-item> 个人中心 </el-dropdown-item>
+                  <el-dropdown-item @click="toOut"> 退出登录 </el-dropdown-item>
+                </el-dropdown-menu>
+              </template>
+            </el-dropdown>
+          </div>
+          <div class="right_1" v-else>
             <span @click="toLogin('0')">注册</span>
             <span>|</span>
             <span @click="toLogin('1')">登录</span>
@@ -85,10 +101,15 @@
 </template>
 
 <script setup>
+import { ArrowDown } from '@element-plus/icons-vue'
 import { siteInfo, footInfo, menuList } from '@/layout/site'
 // 接口
 import { DesignStore } from '@/store/api/platform/design'
 const designStore = DesignStore()
+import { UserStore } from '@/store/user'
+const userStore = UserStore()
+const user = computed(() => userStore.user)
+
 const router = useRouter()
 const route = useRoute()
 const $checkRes = inject('$checkRes')
@@ -153,6 +174,11 @@ const handleMousOut = (index) => {
 const getUrl = (item) => {
   if (item && item.length > 0) return `${import.meta.env.VITE_APP_HOST}${item[0].uri}`
 }
+// 退出登录
+const toOut = () => {
+  userStore.logOut()
+  router.push('/login')
+}
 </script>
 
 <style lang="scss" scoped>
@@ -192,6 +218,13 @@ const getUrl = (item) => {
           span {
             margin: 0 5px;
           }
+          .el-dropdown-link {
+            font-size: $global-font-size-18;
+            cursor: pointer;
+            color: #409eff;
+            display: flex;
+            align-items: center;
+          }
         }
         .right_2 {
           display: flex;

+ 168 - 11
src/views/detail/company.vue

@@ -4,18 +4,44 @@
       <el-image class="image" :src="lists" fit="fill" />
     </el-col>
     <div class="w_1300">
+      <div class="active">
+        <div class="active_1" v-show="industry && industry.length > 0">
+          <div class="active_left">行业:</div>
+          <div class="active_right">
+            <div class="active_label" v-for="(item, index) in industry" :key="index">
+              {{ item.title }}<el-icon @click="toDel(item, '1')"><Close /></el-icon>
+            </div>
+          </div>
+        </div>
+        <div class="active_1" v-show="pattern && pattern.length > 0">
+          <div class="active_left">企业类型:</div>
+          <div class="active_right">
+            <div class="active_label" v-for="(item, index) in pattern" :key="index">
+              {{ item.label }}<el-icon @click="toDel(item, '2')"><Close /></el-icon>
+            </div>
+          </div>
+        </div>
+        <div class="active_1" v-show="city && city.length > 0">
+          <div class="active_left">所在地:</div>
+          <div class="active_right">
+            <div class="active_label" v-for="(item, index) in city" :key="index">
+              {{ item.name }}<el-icon @click="toDel(item, '3')"><Close /></el-icon>
+            </div>
+          </div>
+        </div>
+      </div>
       <el-col :span="24" class="two">
         <div class="Seacher">
           <div class="Left">
             <span>行业</span>
           </div>
           <div v-if="!oneShow" class="Right">
-            <div class="label" v-for="(item, index) in plateList.slice(0, 6)" :key="index">
+            <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in plateList.slice(0, 6)" :key="index" @click="toSelect(item, '1')">
               {{ item.title }}
             </div>
           </div>
           <div v-else class="Right">
-            <div class="label" v-for="(item, index) in plateList" :key="index">
+            <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in plateList" :key="index" @click="toSelect(item, '1')">
               {{ item.title }}
             </div>
           </div>
@@ -33,7 +59,7 @@
             <span>企业类型</span>
           </div>
           <div class="Right">
-            <div class="label" v-for="(item, index) in patternList" :key="index">
+            <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in patternList" :key="index" @click="toSelect(item, '2')">
               {{ item.label }}
             </div>
           </div>
@@ -43,7 +69,7 @@
             <span>所在地</span>
           </div>
           <div class="Right">
-            <div class="label" v-for="(item, index) in cityList" :key="index">
+            <div class="label" :class="[item.is_active ? 'show' : '']" v-for="(item, index) in cityList" :key="index" @click="toSelect(item, '3')">
               {{ item.name }}
             </div>
           </div>
@@ -119,6 +145,10 @@ const cityList = ref([])
 const plateList = ref([])
 // 搜索
 const searchForm = ref({})
+// 查询
+const industry = ref([])
+const pattern = ref([])
+const city = ref([])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -137,7 +167,7 @@ const searchOther = async () => {
   // 企业类型
   result = await dictDataStore.query({ code: 'companyType', is_use: '0' })
   if ($checkRes(result)) patternList.value = result.data
-  patternList.value.unshift({ value: '-1', label: '不限' })
+  patternList.value.unshift({ id: '-1', value: '-1', label: '不限', is_active: true })
   // // 企业规模
   // result = await dictDataStore.query({ code: 'companyScale', is_use: '0' })
   // if ($checkRes(result)) scaleList.value = result.data
@@ -146,10 +176,10 @@ const searchOther = async () => {
   // if ($checkRes(result)) IndustryList.value = result.data
   result = await regionStore.list({ level: 'city', parent_code: 22 })
   if ($checkRes(result)) cityList.value = result.data
-  cityList.value.unshift({ code: '-1', name: '不限' })
+  cityList.value.unshift({ id: '-1', code: '-1', name: '不限', is_active: true })
   result = await sectorStore.query({ is_use: '0' })
   if ($checkRes(result)) plateList.value = result.data
-  plateList.value.unshift({ id: '-1', title: '不限' })
+  plateList.value.unshift({ id: '-1', title: '不限', is_active: true })
 }
 const search = async (query = { skip, limit }) => {
   skip = query.skip
@@ -200,6 +230,85 @@ const sizeChange = (limits) => {
   currentPage.value = 1
   search({ skip: 0, limit: limit })
 }
+const toSelect = (data, type) => {
+  if (data.id != '-1') {
+    if (type == '1') {
+      for (const val of plateList.value) {
+        if (data.id == val.id) val.is_active = true
+        if (val.id == '-1') val.is_active = false
+      }
+      const res = industry.value.find((i) => i.id == data.id)
+      if (!res) industry.value.push(data)
+    } else if (type == '2') {
+      for (const val of patternList.value) {
+        if (data.id == val.id) val.is_active = true
+        if (val.id == '-1') val.is_active = false
+      }
+      const res = pattern.value.find((i) => i.id == data.id)
+      if (!res) pattern.value.push(data)
+    } else {
+      for (const val of cityList.value) {
+        if (data.id == val.id) val.is_active = true
+        if (val.id == '-1') val.is_active = false
+      }
+      const res = city.value.find((i) => i.id == data.id)
+      if (!res) city.value.push(data)
+    }
+  } else {
+    if (type == '1') {
+      for (const val of plateList.value) {
+        if (val.id == '-1') val.is_active = true
+        else val.is_active = false
+      }
+      industry.value = []
+    } else if (type == '2') {
+      for (const val of patternList.value) {
+        if (val.id == '-1') val.is_active = true
+        else val.is_active = false
+      }
+      pattern.value = []
+    } else {
+      for (const val of cityList.value) {
+        if (val.id == '-1') val.is_active = true
+        else val.is_active = false
+      }
+      city.value = []
+    }
+  }
+}
+const toDel = (data, type) => {
+  if (type == '1') {
+    for (const val of plateList.value) {
+      if (data.id == val.id) val.is_active = false
+    }
+    industry.value = industry.value.filter((f) => f.id != data.id)
+    if (industry.value.length == 0) {
+      for (const val of plateList.value) {
+        if (val.id == '-1') val.is_active = true
+      }
+    }
+  } else if (type == '2') {
+    for (const val of patternList.value) {
+      if (data.id == val.id) val.is_active = false
+    }
+    pattern.value = pattern.value.filter((f) => f.id != data.id)
+    if (pattern.value.length == 0) {
+      for (const val of patternList.value) {
+        if (val.id == '-1') val.is_active = true
+      }
+    }
+  } else {
+    for (const val of cityList.value) {
+      if (data.id == val.id) val.is_active = false
+    }
+    city.value = city.value.filter((f) => f.id != data.id)
+    if (city.value.length == 0) {
+      for (const val of cityList.value) {
+        if (val.id == '-1') val.is_active = true
+      }
+    }
+  }
+}
 </script>
 <style scoped lang="scss">
 .main {
@@ -209,8 +318,53 @@ const sizeChange = (limits) => {
       height: 350px;
     }
   }
+  .active {
+    .active_1 {
+      display: inline-flex;
+      background: #f5f7f9;
+      border-radius: 2px;
+      min-height: 28px;
+      line-height: 28px;
+      margin: 0 10px 0 0;
+      position: relative;
+      background-color: #fff;
+      padding: 10px;
+      .active_left {
+        flex: 0 0 auto;
+        font-family: PingFangSC-Regular;
+        color: #525a68;
+        line-height: 36px;
+      }
+      .active_right {
+        font-family: PingFangSC-Regular;
+        color: rgba(0, 0, 0, 0.85);
+        line-height: 28px;
+        padding-right: 4px;
+        display: flex;
+        flex-wrap: wrap;
+        overflow: hidden;
+        .active_label {
+          overflow: hidden;
+          display: inline-block;
+          margin-right: 10px;
+          margin-top: 3px;
+          margin-bottom: 3px;
+          padding: 10px;
+          display: flex;
+          align-items: center;
+          flex: none;
+          box-sizing: border-box;
+          max-width: 100%;
+          height: 30px;
+          background: #f5f5f5;
+          border: 1px solid #f0f0f0;
+          border-radius: 2px;
+          cursor: default;
+        }
+      }
+    }
+  }
   .two {
-    margin: 25px 0;
     .Seacher {
       display: flex;
       justify-content: center;
@@ -242,6 +396,7 @@ const sizeChange = (limits) => {
         border-left: solid 1px #e5e5e5;
         background-color: #fff;
         .label {
+          margin-right: 3px;
           color: #313131;
           margin-bottom: 10px;
           padding: 8px 10px;
@@ -250,7 +405,7 @@ const sizeChange = (limits) => {
           border: solid 1px transparent;
           cursor: pointer;
         }
-        .label:first-child {
+        .show {
           color: #0a58c2;
           border: solid 1px #006dd2;
         }
@@ -283,12 +438,14 @@ const sizeChange = (limits) => {
   }
   .thr {
     display: flex;
+    align-items: center;
+    justify-content: center;
     flex-wrap: wrap;
     .list {
       float: left;
-      width: 390px;
+      width: 405px;
       padding: 15px;
-      margin: 0 0 25px 41px;
+      margin: 0 10px 25px 10px;
       background: #f0f8ff;
       color: #000;
       .name {

+ 14 - 4
src/views/detail/demandDetail.vue

@@ -10,7 +10,7 @@
           </div>
           <div class="name">{{ info.name || '暂无' }}</div>
           <div class="other">
-            <span class="other_1">{{ info.type || '暂无' }}</span>
+            <span class="other_1">{{ getDict(info.urgent, 'urgent') || '暂无' }}</span>
             <div class="other_2">
               <p>
                 资金预算:<span class="moeny">{{ info.money || '面议' }}</span>
@@ -48,7 +48,7 @@
               <span>{{ item.name || '暂无' }}</span>
             </h2>
             <div class="other">
-              <span class="other_1">{{ item.type || '暂无' }}</span>
+              <span class="other_1">{{ getDict(item.urgent, 'urgent') || '暂无' }}</span>
               <div class="other_2">
                 <span>应用行业:</span>
                 {{ item.field || '暂无' }}
@@ -60,7 +60,7 @@
               <div class="other_2 textOne">
                 <el-icon color="#0085f5"><Location /></el-icon>
                 {{ getArea(item.area) }}
-                <span class="state">{{ item.status || '未解决' }}</span>
+                <span class="state">{{ getDict(item.status, 'status') || '未解决' }}</span>
               </div>
             </div>
           </div>
@@ -93,6 +93,8 @@ const attributeList = ref([])
 const matureList = ref([])
 const sellList = ref([])
 const technologyList = ref([])
+const urgentList = ref([])
+const statusList = ref([])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -120,7 +122,7 @@ const searchAchieve = async () => {
   if (res.errcode == '0') list.value = res.data
 }
 const searchOther = async () => {
-  // let result
+  let result
   // // 成熟度
   // result = await dictDataStore.query({ code: 'mature', is_use: '0' })
   // if ($checkRes(result)) matureList.value = result.data
@@ -136,15 +138,23 @@ const searchOther = async () => {
   // // 技术分类
   // result = await dictDataStore.query({ code: 'technology', is_use: '0' })
   // if ($checkRes(result)) technologyList.value = result.data
+  // 需求紧急度
+  result = await dictDataStore.query({ code: 'urgent', is_use: '0' })
+  if ($checkRes(result)) urgentList.value = result.data
+  // 状态
+  result = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
+  if ($checkRes(result)) statusList.value = result.data
 }
 // 字典数据转换
 const getDict = (data, model) => {
   let res
   if (model == 'mature') res = matureList.value.find((f) => f.value == data)
+  else if (model == 'status') res = statusList.value.find((f) => f.value == data)
   else if (model == 'sell') res = sellList.value.find((f) => f.value == data)
   else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
   else if (model == 'attribute') res = attributeList.value.find((f) => f.value == data)
   else if (model == 'technology') res = technologyList.value.find((f) => f.value == data)
+  else if (model == 'urgent') res = urgentList.value.find((f) => f.value == data)
   return get(res, 'label')
 }
 // 地区

+ 11 - 3
src/views/detail/supplyDetail.vue

@@ -10,7 +10,7 @@
           </div>
           <div class="name">{{ info.name || '暂无' }}</div>
           <div class="other">
-            <span class="other_1">{{ info.type || '暂无' }}</span>
+            <span class="other_1">{{ getDict(info.urgent, 'urgent') || '暂无' }}</span>
             <div class="other_2">
               <p>
                 所属产业:<span class="moeny">{{ info.industry || '暂无' }}</span>
@@ -18,6 +18,9 @@
               <p>
                 应用行业:<span>{{ info.field || '暂无' }} </span>
               </p>
+              <p>
+                所属地区 :<span> {{ getArea(info.area) || '暂无' }}</span>
+              </p>
               <p>
                 截止时间:<span class="time">{{ info.time || '暂无' }}</span>
               </p>
@@ -39,7 +42,7 @@
               <span>{{ item.name || '暂无' }}</span>
             </h2>
             <div class="other">
-              <span class="other_1">{{ item.type || '暂无' }}</span>
+              <span class="other_1">{{ getDict(item.urgent, 'urgent') || '暂无' }}</span>
               <div class="other_2">
                 <span>应用行业:</span>
                 {{ item.field || '暂无' }}
@@ -88,6 +91,7 @@ const attributeList = ref([])
 const matureList = ref([])
 const sellList = ref([])
 const technologyList = ref([])
+const urgentList = ref([])
 // 请求
 onMounted(async () => {
   loading.value = true
@@ -115,7 +119,7 @@ const searchAchieve = async () => {
   if (res.errcode == '0') list.value = res.data
 }
 const searchOther = async () => {
-  // let result
+  let result
   // // 成熟度
   // result = await dictDataStore.query({ code: 'mature', is_use: '0' })
   // if ($checkRes(result)) matureList.value = result.data
@@ -131,6 +135,9 @@ const searchOther = async () => {
   // // 技术分类
   // result = await dictDataStore.query({ code: 'technology', is_use: '0' })
   // if ($checkRes(result)) technologyList.value = result.data
+  // 需求紧急度
+  result = await dictDataStore.query({ code: 'urgent', is_use: '0' })
+  if ($checkRes(result)) urgentList.value = result.data
 }
 // 字典数据转换
 const getDict = (data, model) => {
@@ -140,6 +147,7 @@ const getDict = (data, model) => {
   else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
   else if (model == 'attribute') res = attributeList.value.find((f) => f.value == data)
   else if (model == 'technology') res = technologyList.value.find((f) => f.value == data)
+  else if (model == 'urgent') res = urgentList.value.find((f) => f.value == data)
   return get(res, 'label')
 }
 // 地区

+ 13 - 5
src/views/nine/index.vue

@@ -340,12 +340,20 @@ const toSelect = (data, type) => {
       const res = sell.value.find((i) => i.id == data.id)
       if (!res) sell.value.push(data)
     } else if (type == '5') {
-      for (const val of moneyList.value) {
-        if (data.id == val.id) val.is_active = true
-        if (val.value == '0') val.is_active = false
+      if (data.value != '0') {
+        for (const val of moneyList.value) {
+          if (data.id == val.id) val.is_active = true
+          if (val.value == '0') val.is_active = false
+        }
+        const res = money.value.find((i) => i.id == data.id)
+        if (!res) money.value.push(data)
+      } else {
+        for (const val of moneyList.value) {
+          if (val.value == '0') val.is_active = true
+          else val.is_active = false
+        }
+        money.value = []
       }
-      const res = money.value.find((i) => i.id == data.id)
-      if (!res) money.value.push(data)
     } else {
       for (const val of cityList.value) {
         if (data.id == val.id) val.is_active = true

+ 5 - 0
src/views/thr/index.vue

@@ -52,6 +52,7 @@ const route = useRoute()
 const cityList = ref([])
 const typeList = ref([])
 const plateList = ref([])
+const statusList = ref([])
 // 列表
 const list = ref([])
 let skip = 0
@@ -87,6 +88,9 @@ const searchOther = async () => {
   res = await dictDataStore.query({ code: 'field', is_use: '0' })
   if (res.errcode == '0') typeList.value = res.data
   typeList.value.unshift({ id: '-1', value: '-1', label: '不限', is_active: true })
+  // 状态
+  res = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
+  if (res.errcode == '0') statusList.value = res.data
 }
 const search = async (query = { skip, limit }) => {
   skip = query.skip
@@ -126,6 +130,7 @@ const sizeChange = (limits) => {
 provide('plateList', plateList)
 provide('typeList', typeList)
 provide('cityList', cityList)
+provide('statusList', statusList)
 provide('list', list)
 provide('total', total)
 provide('sizeChange', sizeChange)

+ 12 - 1
src/views/thr/parts/demand.vue

@@ -104,7 +104,7 @@
           <div class="table-colunm textOne">{{ item.field || '暂无' }}</div>
           <div class="table-colunm table-colunm3 textOne">{{ getArea(item.area) }}</div>
           <div class="table-colunm table-colunm1 textOne">{{ item.money || '面议' }}</div>
-          <div class="table-colunm table-colunm1 textOne">{{ item.status || '未解决' }}</div>
+          <div class="table-colunm table-colunm1 textOne">{{ getDict(item.status, 'status') || '未解决' }}</div>
           <div class="table-colunm button" @click="toView(item)">查看详情</div>
         </div>
       </div>
@@ -115,6 +115,7 @@
   </div>
 </template>
 <script setup>
+import { get } from 'lodash-es'
 const router = useRouter()
 const list = inject('list')
 const total = inject('total')
@@ -124,6 +125,8 @@ const changePage = inject('changePage')
 const plateList = inject('plateList')
 const typeList = inject('typeList')
 const cityList = inject('cityList')
+const statusList = inject('statusList')
+
 const industry = inject('industry')
 const field = inject('field')
 const city = inject('city')
@@ -149,6 +152,14 @@ const getArea = (data) => {
   if (data) return data.join('-')
   else return '暂无'
 }
+// 字典数据转换
+const getDict = (data, model) => {
+  if (data) {
+    let res
+    if (model == 'status') res = statusList.value.find((f) => f.value == data)
+    return get(res, 'label')
+  }
+}
 const toSelect = (data, type) => {
   if (data.id != '-1') {
     if (type == '1') {