|
@@ -36,10 +36,11 @@
|
|
|
</el-col>
|
|
|
<el-row class="other">
|
|
|
<el-col :span="8" class="other_1"
|
|
|
- ><span>技术领域:</span>{{ item.area || '暂无技术领域' }}</el-col
|
|
|
+ ><span>技术领域:</span
|
|
|
+ >{{ getDict(item.field || '暂无技术领域', 'field') }}</el-col
|
|
|
>
|
|
|
<el-col :span="8" class="other_1"
|
|
|
- ><span>需求地区:</span>{{ item.city || '暂无需求地区' }}</el-col
|
|
|
+ ><span>需求地区:</span>{{ item.area.join(',') || '暂无需求地区' }}</el-col
|
|
|
>
|
|
|
<el-col :span="8" class="other_1"
|
|
|
><span>单位:</span>{{ item.unit || '暂无单位' }}</el-col
|
|
@@ -70,12 +71,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+const $checkRes = inject('$checkRes')
|
|
|
+import { get } from 'lodash-es'
|
|
|
+// 接口
|
|
|
+import { DemandStore } from '@/store/api/platform/demand'
|
|
|
+import { DictDataStore } from '@/store/api/system/dictData'
|
|
|
+const store = DemandStore()
|
|
|
+const dictDataStore = DictDataStore()
|
|
|
// 图片引入
|
|
|
import demand from '@/assets/demand.png'
|
|
|
// 路由
|
|
|
const router = useRouter()
|
|
|
// 加载中
|
|
|
const loading = ref(false)
|
|
|
+const searchForm = ref({})
|
|
|
// 列表
|
|
|
const list = ref([
|
|
|
{
|
|
@@ -165,9 +174,16 @@ const list = ref([
|
|
|
unit: '浙江易丰安全科技有限公司'
|
|
|
}
|
|
|
])
|
|
|
-let total = ref(12)
|
|
|
let skip = 0
|
|
|
let limit = inject('limit')
|
|
|
+const total = ref(20)
|
|
|
+// 字典表
|
|
|
+const isUseList = ref([])
|
|
|
+const statusList = ref([])
|
|
|
+const methodList = ref([])
|
|
|
+const urgentList = ref([])
|
|
|
+const fieldList = ref([])
|
|
|
+const demandList = ref([])
|
|
|
const searchList = ref([
|
|
|
{
|
|
|
title: '技术领域',
|
|
@@ -249,21 +265,45 @@ onMounted(async () => {
|
|
|
await search({ skip, limit })
|
|
|
loading.value = false
|
|
|
})
|
|
|
-const search = async (e) => {
|
|
|
- const info = { skip: e.skip, limit: e.limit }
|
|
|
- console.log(info)
|
|
|
- // const res: IQueryResult = await userCheckAxios.query(info);
|
|
|
- // if (res.errcode == '0') {
|
|
|
- // list.value = res.data;
|
|
|
- // total.value = res.total;
|
|
|
- // }
|
|
|
-}
|
|
|
-// 查询其他信息
|
|
|
const searchOther = async () => {
|
|
|
- // let res: IQueryResult;
|
|
|
- // // 性别
|
|
|
- // res = await dictAxios.query({ type: 'common_gender' });
|
|
|
- // if (res.errcode == '0') genderList.value = res.data;
|
|
|
+ let result
|
|
|
+ // 是否使用
|
|
|
+ result = await dictDataStore.query({ code: 'isUse', is_use: '0' })
|
|
|
+ if ($checkRes(result)) isUseList.value = result.data
|
|
|
+ // 状态
|
|
|
+ result = await dictDataStore.query({ code: 'examStatus', is_use: '0' })
|
|
|
+ if ($checkRes(result)) statusList.value = result.data
|
|
|
+ // 合作方式
|
|
|
+ result = await dictDataStore.query({ code: 'method', is_use: '0' })
|
|
|
+ if ($checkRes(result)) methodList.value = result.data
|
|
|
+ // 需求紧急度
|
|
|
+ result = await dictDataStore.query({ code: 'urgent', is_use: '0' })
|
|
|
+ if ($checkRes(result)) urgentList.value = result.data
|
|
|
+ // 技术领域
|
|
|
+ result = await dictDataStore.query({ code: 'field', is_use: '0' })
|
|
|
+ if ($checkRes(result)) fieldList.value = result.data
|
|
|
+ // 需求状态
|
|
|
+ result = await dictDataStore.query({ code: 'demandStatus', is_use: '0' })
|
|
|
+ if ($checkRes(result)) demandList.value = result.data
|
|
|
+}
|
|
|
+const search = async (query = { skip: 0, limit }) => {
|
|
|
+ const info = { skip: query.skip, limit: query.limit, ...searchForm.value }
|
|
|
+ const res = await store.query(info)
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ list.value = res.data
|
|
|
+ total.value = res.total
|
|
|
+ }
|
|
|
+}
|
|
|
+// 字典数据转换
|
|
|
+const getDict = (data, model) => {
|
|
|
+ let res
|
|
|
+ if (model == 'is_use') res = isUseList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'status') res = statusList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'method') res = methodList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'urgent') res = urgentList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
|
|
|
+ else if (model == 'demand') res = demandList.value.find((f) => f.value == data)
|
|
|
+ return get(res, 'label')
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|