lrf 1 kuukausi sitten
vanhempi
commit
cd069367de
2 muutettua tiedostoa jossa 21 lisäystä ja 9 poistoa
  1. 12 7
      src/public/importMapping.ts
  2. 9 2
      src/service/util.service.ts

+ 12 - 7
src/public/importMapping.ts

@@ -16,6 +16,7 @@ const achievement = [
   { index: 13, field: 'person', zh: '负责人' },
   { index: 14, field: 'tel', zh: '联系电话' },
   { index: 15, field: 'brief', zh: '简介' },
+  { index: 16, field: 'tags', zh: '标签' },
 ];
 
 // project
@@ -34,6 +35,7 @@ const project = [
   { index: 12, field: 'track_unit', zh: '跟踪支持单位' },
   { index: 13, field: 'source', zh: '项目来源' },
   { index: 14, field: 'brief', zh: '简介' },
+  { index: 15, field: 'tags', zh: '标签' },
 ];
 
 // demand
@@ -56,6 +58,7 @@ const demand = [
   { index: 16, field: 'tec_name', zh: '技术需求名称' },
   { index: 17, field: 'question', zh: '待解决问题' },
   { index: 18, field: 'brief', zh: '简介' },
+  { index: 19, field: 'tags', zh: '标签' },
 ];
 
 // supply
@@ -65,13 +68,13 @@ const supply = [
   { index: 3, field: 'start_time', type: 'date', zh: '开始时间' },
   { index: 4, field: 'end_time', type: 'date', zh: '结束时间' },
   { index: 5, field: 'money', type: 'date', zh: '价格' },
-  { index: 6, field: 'type', type: 'dict', code: 'type', zh: '类型' },
-  { index: 7, field: 'field', zh: '行业领域' },
-  { index: 8, field: 'urgent', type: 'dict', code: 'urgent', zh: '需求紧急度' },
-  { index: 9, field: 'method', type: 'dict', code: 'method', zh: '合作方式' },
-  { index: 10, field: 'area', type: 'area', zh: '地区' },
-  { index: 11, field: 'source', zh: '项目来源' },
-  { index: 12, field: 'brief', zh: '简介' },
+  { index: 6, field: 'field', zh: '行业领域' },
+  { index: 7, field: 'urgent', type: 'dict', code: 'urgent', zh: '需求紧急度' },
+  { index: 8, field: 'method', type: 'dict', code: 'method', zh: '合作方式' },
+  { index: 9, field: 'area', type: 'area', zh: '地区' },
+  { index: 10, field: 'source', zh: '项目来源' },
+  { index: 11, field: 'brief', zh: '简介' },
+  { index: 12, field: 'tags', zh: '标签' },
 ];
 
 // company
@@ -101,6 +104,7 @@ const company = [
   { index: 23, field: 'address', zh: '地址' },
   { index: 24, field: 'products', zh: '产品' },
   { index: 25, field: 'brief', zh: '简介' },
+  { index: 26, field: 'tags', zh: '标签' },
 ];
 
 // companyYear
@@ -112,5 +116,6 @@ const companyYear = [
   { index: 5, field: 'esprofit_money', zh: '预计利润(万元)', type: 'number' },
   { index: 6, field: 'estax_money', zh: '预计税金(万元)', type: 'number' },
   { index: 7, field: 'essearch_money', zh: '预计研发费用(万元)', type: 'number' },
+  { index: 8, field: 'tags', zh: '标签' },
 ];
 export { achievement, project, demand, supply, company, companyYear };

+ 9 - 2
src/service/util.service.ts

@@ -1212,8 +1212,15 @@ export class UtilService {
         const mapping = mappingList.find(f => f.index === k);
         if (mapping) {
           const { field, type } = mapping;
-          if (type) val = await this.dealTypeValue(mapping, val);
-          obj[field] = val;
+          if (field !== 'tags') {
+            if (type) val = await this.dealTypeValue(mapping, val);
+            obj[field] = val;
+          } else {
+            if(val) {
+              const arr = val.split(';')
+              obj[field] = arr;
+            } 
+          }
         }
       }
       result.push(obj);