guhongwei 4 năm trước cách đây
mục cha
commit
d71e571896

+ 2 - 2
src/views/techolchat/list/detail-model/fields.js

@@ -7,9 +7,9 @@ export const two = [
     list: 'companyType',
     type: 'select',
   },
-  { label: '企业所处发展阶段', model: 'parts', list: 'parts', type: 'select' },
+  { label: '发展阶段', model: 'parts', list: 'parts', type: 'select' },
   { label: '所属行业', model: 'profession' },
-  { label: '行业排名', model: 'order', list: 'order', type: 'select' },
+  { label: '行业排名', model: 'order', list: 'order', type: 'select' },
 ];
 
 export const three = [

+ 24 - 6
src/views/techolchat/list/detail-model/parts-models/two.vue

@@ -1,9 +1,17 @@
 <template>
-  <div id="one">
+  <div id="two">
     <el-row>
       <el-col :span="24" class="main">
         <el-form :model="form" :rules="rules" ref="form" label-width="80px">
-          1
+          <template v-for="(i, index) in question">
+            <el-col :span="8" :key="`question${index}`">
+              <el-form-item v-if="i.type === 'select'" :prop="`${index}`" :key="`question${index}`" :label="`${i.label}`">
+                <el-select v-model="form[i.model]">
+                  <el-option v-for="(item, index) in getList(i.list)" :key="index" :value="item" :label="item"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </template>
         </el-form>
       </el-col>
     </el-row>
@@ -11,25 +19,35 @@
 </template>
 
 <script>
-import { one } from '../fields.js';
+import { two } from '../fields.js';
+import * as select from '../select.js';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
-  name: 'one',
+  name: 'two',
   props: {
     form: { type: Object },
     rules: { type: Object },
   },
+  model: {
+    prop: 'form',
+    event: 'change',
+  },
   components: {},
   data: function() {
     return {
       disabled: false,
-      question: one,
+      question: two,
     };
   },
   created() {
     console.log(this.question);
   },
-  methods: {},
+  methods: {
+    // 获取列表
+    getList(type) {
+      return select[type];
+    },
+  },
   computed: {
     ...mapState(['user']),
   },