Procházet zdrojové kódy

更新融资专家

wuhongyuq před 5 roky
rodič
revize
f8311b0d23

+ 1 - 1
src/layout/layout-part/menus.vue

@@ -42,7 +42,7 @@
           <span>数字延伸服务管理</span>
         </template>
         <el-menu-item-group>
-          <el-menu-item index="/companyuser/index">企业用户</el-menu-item>
+          <el-menu-item index="/specialist/index">融资专家</el-menu-item>
           <el-menu-item index="/otheruser/index">其他用户</el-menu-item>
         </el-menu-item-group>
       </el-submenu>

+ 99 - 0
src/layout/specialist/zhuanjiaForm.vue

@@ -0,0 +1,99 @@
+<template>
+  <div id="otheruserForm">
+    <el-row>
+      <el-col :span="24" class="form">
+        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+          <el-form-item label="名称" prop="name">
+            <el-input v-model="ruleForm.name" placeholder="请输入名称"></el-input>
+          </el-form-item>
+          <el-form-item label="性别" prop="gender">
+            <el-input v-model="ruleForm.gender" placeholder="请输入性别"></el-input>
+          </el-form-item>
+
+          <el-form-item label="图片" prop="image">
+            <upload :limit="1" :data="ruleForm.image" type="image" :url="`/files/teacher/upload`" @upload="uploadSuccess"></upload>
+          </el-form-item>
+          <el-form-item label="单位" prop="company">
+            <el-input v-model="ruleForm.company" placeholder="请输入单位"></el-input>
+          </el-form-item>
+          <el-form-item label="职务" prop="job">
+            <el-input v-model="ruleForm.job" placeholder="请输入职务"></el-input>
+          </el-form-item>
+
+          <el-form-item label="曾获荣誉或融资成果" prop="result">
+            <el-input v-model="ruleForm.result" placeholder="请输入曾获荣誉或融资成果"></el-input>
+          </el-form-item>
+          <el-form-item label="擅长领域" prop="field">
+            <el-input v-model="ruleForm.field" placeholder="请输入擅长领域"></el-input>
+          </el-form-item>
+
+          <el-form-item label="从事财政/金融类工作经历">
+            <!-- <span v-if="toDisplay()"> -->
+            <wang-editor v-model="ruleForm.work_history" placeholder="请输入从事财政/金融类工作经历"></wang-editor>
+            <!-- </span> -->
+          </el-form-item>
+
+          <el-form-item>
+            <el-button size="small" @click="resetForm('ruleForm')">取消</el-button>
+
+            <el-button type="danger" size="small" @click="submitForm('ruleForm')">提交</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import WangEditor from '@/components/wang-editor.vue';
+import upload from '@/components/upload.vue';
+export default {
+  name: 'otheruserForm',
+  props: {
+    ruleForm: null,
+  },
+  components: {
+    upload, //图片
+    WangEditor,
+  },
+  data: () => ({
+    rules: {
+      name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+      name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+      company: [{ required: true, message: '请输入单位', trigger: 'blur' }],
+
+      result: [{ required: true, message: '请输入曾获荣誉或融资成果', trigger: 'blur' }],
+      field: [{ required: true, message: '请输入擅长领域', trigger: 'blur' }],
+    },
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    submitForm() {
+      this.$emit('submitForm', { data: this.ruleForm });
+    },
+    resetForm() {
+      this.$emit('resetForm');
+    },
+    uploadSuccess({ type, data }) {
+      if (type !== 'logo') {
+        let arr = _.get(this.ruleForm, type);
+        if (arr !== undefined) {
+          this.ruleForm[type].push({ name: data.name, uri: data.uri });
+        } else {
+          let newArr = [{ name: data.name, uri: data.uri }];
+          this.$set(this.ruleForm, `${type}`, newArr);
+        }
+      } else {
+        this.$set(this.ruleForm, `${type}`, data.uri);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.form {
+  padding: 0 200px 0 0;
+}
+</style>

+ 77 - 0
src/layout/specialist/zhuanjiaList.vue

@@ -0,0 +1,77 @@
+<template>
+  <div id="otheruserList">
+    <el-row>
+      <el-col :span="24">
+        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
+          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
+          <el-table-column property="name" label="名称" align="center"> </el-table-column>
+          <el-table-column property="gender" label="性别" align="center"> </el-table-column>
+          <el-table-column property="company" label="单位" align="center"> </el-table-column>
+          <el-table-column property="job" label="职务" align="center"> </el-table-column>
+          <!-- <el-table-column property="result" label="曾获荣誉或融资成果" align="center"> </el-table-column> -->
+          <el-table-column property="field" label="擅长领域" align="center"> </el-table-column>
+
+          <el-table-column label="图片" align="center">
+            <template slot-scope="scope">
+              <span style="margin-left: 10px"> <el-image :src="scope.row.image"></el-image></span>
+            </template>
+          </el-table-column>
+
+          <el-table-column fixed="right" label="操作" align="center">
+            <template slot-scope="scope">
+              <el-button @click="$router.push({ path: '/specialist/detail', query: { id: scope.row.id } })" type="text"><i class="el-icon-edit"></i></el-button>
+              <el-button @click.prevent="deleteRow(scope.row.id)" type="text"><i class="el-icon-delete"></i></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-row class="page">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+          >
+          </el-pagination>
+        </el-row>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'otheruserList',
+  props: {
+    debtTable: null,
+    total: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    deleteRow(id) {
+      this.$emit('deleteRow', id);
+    },
+    clickRest(id) {
+      this.$emit('clickRest', id);
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.page {
+  text-align: center;
+  padding: 15px 0;
+}
+</style>

+ 10 - 0
src/router/index.js

@@ -118,6 +118,16 @@ const routes = [
     path: '/region/detail',
     component: () => import('../views/region/detail.vue'),
   },
+
+  //融资专家
+  {
+    path: '/specialist/index',
+    component: () => import('../views/specialist/index.vue'),
+  },
+  {
+    path: '/specialist/detail',
+    component: () => import('../views/specialist/detail.vue'),
+  },
 ];
 
 const router = new VueRouter({

+ 108 - 0
src/views/specialist/detail.vue

@@ -0,0 +1,108 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="debt">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle" :display="display"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <el-col :span="24" class="back">
+            <detailTop @goBack="goBack"></detailTop>
+          </el-col>
+          <el-col :span="24" class="info">
+            <zhuanjiaForm :ruleForm="ruleForm" @submitForm="submitForm" @resetForm="resetForm"></zhuanjiaForm>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/common/topInfo.vue';
+import detailTop from '@/layout/common/detailTop.vue';
+import zhuanjiaForm from '@/layout/specialist/zhuanjiaForm.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    topInfo, //头部导航
+    detailTop, //头部返回
+    zhuanjiaForm, //添加其他用户
+  },
+  data: () => ({
+    display: 'none',
+    topTitle: '新闻中心内容管理',
+    ruleForm: {},
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  methods: {
+    // ...otheruser(['query', 'fetch', 'update', 'create']),
+    // ...character({ charquery: 'query', charFetch: 'fetch' }),
+    async searchInfo() {
+      // if (this.id) {
+      //   const res = await this.fetch(this.id);
+      //   this.$set(this, `ruleForm`, res.data);
+      // }
+    },
+
+    // 提交
+    async submitForm({ data }) {
+      // let res;
+      // if (this.id) {
+      //   res = await this.update(data);
+      //   if (res.errcode === 0) {
+      //     this.$message({
+      //       message: '信息修改成功',
+      //       type: 'success',
+      //     });
+      //   }
+      // } else {
+      //   res = await this.create(data);
+      //   if (res.errcode === 0) {
+      //     this.$message({
+      //       message: '信息创建成功',
+      //       type: 'success',
+      //     });
+      //   }
+      // }
+      // if (this.$checkRes(res)) this.resetForm();
+      // console.log(res.data);
+    },
+    // 取消
+    resetForm() {
+      this.$router.push({ path: '/news/index' });
+    },
+    // 返回
+    goBack() {
+      this.$router.go(-1);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.debt {
+  padding: 20px;
+}
+.top {
+  border-bottom: 1px solid #ccc;
+}
+.main {
+  border-radius: 10px;
+  margin: 20px 0 0 0;
+  box-shadow: 0 0 3px #666;
+}
+.main .back {
+  padding: 10px 0 10px 15px;
+}
+</style>

+ 78 - 0
src/views/specialist/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <div id="index">
+    <el-col :span="24" class="debt">
+      <el-col :span="24" class="top">
+        <topInfo :topTitle="topTitle" :display="display" @clickBtn="clickBtn"></topInfo>
+      </el-col>
+      <el-col :span="24" class="search">
+        <searchInfo></searchInfo>
+      </el-col>
+      <el-col :span="24" class="main">
+        <zhuanjiaList :debtTable="debtTable" :total="total" @deleteRow="deleteRow" @clickRest="clickRest"></zhuanjiaList>
+      </el-col>
+    </el-col>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/common/topInfo.vue';
+import searchInfo from '@/layout/common/searchInfo.vue';
+import zhuanjiaList from '@/layout/specialist/zhuanjiaList.vue';
+// import { createNamespacedHelpers, mapGetters } from 'vuex';
+
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    topInfo, //头部导航
+    searchInfo, //搜素
+    zhuanjiaList, //其他用户列表
+  },
+  data: () => ({
+    topTitle: '新闻中心内容管理',
+    display: 'block',
+    debtTable: [
+      {
+        image: require('@/assets/logo.png'),
+        name: '专家1',
+        gender: '男',
+        company: 'sd',
+        job: '职务1',
+        field: 'it',
+      },
+    ],
+    total: 1,
+  }),
+  created() {
+    // this.searchInfo();
+  },
+  computed: {},
+  methods: {
+    // ...otheruser(['query', 'delete', 'update']),
+    // async searchInfo({ skip = 0, limit = 10, ...info } = {}) {
+    //   const res = await this.query({ skip, limit, ...info });
+    //   this.$set(this, `debtTable`, res.data);
+    //   this.$set(this, `total`, res.total);
+    // },
+    // 添加
+    clickBtn() {
+      this.$router.push({ path: '/zhidao/detail' });
+    },
+    async clickRest() {},
+    async deleteRow(id) {
+      // const res = await this.delete(id);
+      // this.$checkRes(res, '删除成功', '删除失败');
+      // this.searchInfo();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.debt {
+  padding: 20px;
+}
+.top {
+  border-bottom: 1px solid #ccc;
+}
+</style>