Jelajahi Sumber

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

wutt 5 tahun lalu
induk
melakukan
5fee66fd38

+ 1 - 1
official_frontend/src/main.js

@@ -4,7 +4,7 @@ import 'normalize.css/normalize.css' // A modern alternative to CSS resets
 
 import ElementUI from 'element-ui'
 import 'element-ui/lib/theme-chalk/index.css'
-import locale from 'element-ui/lib/locale/lang/en' // lang i18n
+import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
 
 import '@/styles/index.scss' // global css
 

+ 1 - 1
official_frontend/src/router/index.js

@@ -83,7 +83,7 @@ export const constantRoutes = [
         path: '',
         name: 'Advantage',
         component: () => import('@/views/article/advantage'),
-        meta: { title: '产品优势', icon: 'form' }
+        meta: { title: '公司优势', icon: 'form' }
       }
     ]
   },

+ 20 - 19
official_frontend/src/utils/request.js

@@ -5,31 +5,32 @@ import { getToken } from '@/utils/auth'
 
 // create an axios instance
 const service = axios.create({
-  // url = base url + request url
-  // baseURL: process.env.VUE_APP_BASE_API,
-  baseURL: "http://111.231.87.63:8088",
-  // withCredentials: true, // send cookies when cross-domain requests
-  timeout: 5000 // request timeout
+    // url = base url + request url
+    // baseURL: process.env.VUE_APP_BASE_API,
+    // baseURL: "http://111.231.87.63:8088",
+    baseURL: "http://192.168.101.166:8088",
+    // withCredentials: true, // send cookies when cross-domain requests
+    timeout: 5000 // request timeout
 })
 
 // request interceptor
 service.interceptors.request.use(
-  config => {
-    // do something before request is sent
+    config => {
+        // do something before request is sent
 
-    if (store.getters.token) {
-      // let each request carry token
-      // ['X-Token'] is a custom headers key
-      // please modify it according to the actual situation
-      config.headers['X-Token'] = getToken()
+        if (store.getters.token) {
+        // let each request carry token
+        // ['X-Token'] is a custom headers key
+        // please modify it according to the actual situation
+        config.headers['X-Token'] = getToken()
+        }
+        return config
+    },
+    error => {
+        // do something with request error
+        console.log(error) // for debug
+        return Promise.reject(error)
     }
-    return config
-  },
-  error => {
-    // do something with request error
-    console.log(error) // for debug
-    return Promise.reject(error)
-  }
 )
 
 // response interceptor

+ 96 - 36
official_frontend/src/views/application/application.vue

@@ -1,44 +1,104 @@
 <template>
-  <div class="app-container">
-    <el-table :data="comments" style="width: 100%">
-      <el-table-column type="index" width="50"></el-table-column>
-      <el-table-column prop="name" label="姓名" width="100"></el-table-column>
-      <el-table-column prop="phone" label="联系方式" width="120"></el-table-column>
-      <el-table-column prop="comment" label="留言"></el-table-column>
-      <el-table-column prop="indate" label="时间" width="160"></el-table-column>
-    </el-table>
-  </div>
+    <div class="app-container">
+        <el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%">
+            <el-table-column type="index" width="50"></el-table-column>
+            <el-table-column prop="name" label="姓名" width="100"></el-table-column>
+            <el-table-column prop="phone" label="联系方式" width="120"></el-table-column>
+            <el-table-column prop="businessName" label="企业名称"></el-table-column>
+            <el-table-column prop="email" label="邮箱"></el-table-column>
+            <el-table-column prop="content" label="留言"></el-table-column>
+            <el-table-column prop="indate" label="时间" width="160"></el-table-column>
+            <el-table-column label="操作" width="130">
+                <template slot-scope="scope">
+                    <el-button type="primary" v-if="scope.row.isPass == 0" @click="switchSticky(scope.row.id)">接收</el-button>
+                    <span v-else>已接收</span>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <!--工具条-->
+		<el-col :span="24" class="toolbar" style="margin-top:30px;">
+			<el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;">
+            </el-pagination>
+		</el-col>
+    </div>
 </template>
 
 <script>
-import request from "@/utils/request";
-export default {
-  data() {
-    return {
-      comments: []
-    };
-  },
-  methods: {
-    getComments() {
-      request({
-        url: "/comment/getComments",
-        method: "post"
-      })
-        .then(response => {
-          this.comments = response.data;
-        })
-        .catch(error => {
-          console.log(error);
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        });
+    import request from "@/utils/request";
+    export default {
+    data() {
+        return {
+            listLoading: false,
+            list: [],
+            total: 0,
+            page: 1,
+            size: 20,
+            
+        };
+    },
+    methods: {
+        getList() {
+            request({
+                url: "/article/onlineApplyList",
+                method: "post",
+                params: { 
+                    page: this.page,
+                    size: this.size
+                }
+            })
+            .then(response => {
+                this.list = response.data.records;
+                this.total = response.data.total
+            })
+            .catch(error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+        },
+
+        handleSizeChange(val) {
+            this.size = val;
+            this.getList();
+        },
+
+        handleCurrentChange(val) {
+            this.page = val;
+            this.getList();
+        },
+
+        switchSticky(id) {
+            request({
+                url: "/article/onlineApplyUpdate",
+                method: "post",
+                params: { 
+                    id: id,
+                    isPass: 1
+                }
+            })
+            .then(response => {
+                this.getList();
+            })
+            .catch(error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+        }
+    },
+    mounted() {
+        this.getList();
     }
-  },
-  mounted() {
-    this.getComments();
-  }
 };
 </script>
 

+ 29 - 35
official_frontend/src/views/product/product.vue

@@ -8,19 +8,11 @@
                     <el-image style="width: 200px; height: 200px" :src="scope.row.imageUrl"></el-image>
                 </template>
             </el-table-column>
-            <el-table-column prop="name" label="产品名称" width="150"></el-table-column>
-            <el-table-column prop="description" label="产品描述"></el-table-column>
-            <el-table-column label="产品地址" width="150">
+            <el-table-column prop="title" label="产品名称" width="150"></el-table-column>
+            <el-table-column prop="introduction" label="产品描述"></el-table-column>
+            <el-table-column prop="address" label="产品地址" width="300"></el-table-column>
+            <el-table-column label="操作" width="180">
                 <template slot-scope="scope">
-                    <span v-if="scope.row.type == 0">客户</span>
-                    <span v-else-if="scope.row.type == 1">高校</span>
-                    <span v-else>未知</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="操作" width="300">
-                <template slot-scope="scope">
-                    <el-button v-if="scope.row.sticky == 0" @click="switchSticky(scope.row.id)">置顶</el-button>
-                    <el-button v-else @click="switchSticky(scope.row.id)" type="primary">取消置顶</el-button>
                     <el-button @click="openDialog(true, scope.$index)" :loading="loading">编辑</el-button>
                     <el-button type="danger" @click="deleteCooperation(scope.row.id)" :loading="loading">删除</el-button>
                 </template>
@@ -31,13 +23,13 @@
         <el-dialog title="公司产品" :visible.sync="addDialogVisible" width="500px">
             <el-form ref="form" :model="cooperationsForm" :rules="rules" label-width="80px">
                 <el-form-item label="产品名称" prop="name">
-                    <el-input v-model="cooperationsForm.name" placeholder="请输入产品名称" clearable></el-input>
+                    <el-input v-model="cooperationsForm.title" placeholder="请输入产品名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="产品描述" prop="description">
-                    <el-input v-model="cooperationsForm.description" placeholder="请输入产品描述" clearable></el-input>
+                    <el-input v-model="cooperationsForm.introduction" placeholder="请输入产品描述" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="产品地址" prop="type">
-                    <el-input v-model="cooperationsForm.type" placeholder="请输入产品地址" clearable></el-input>
+                    <el-input v-model="cooperationsForm.address" placeholder="请输入产品地址" clearable></el-input>
                 </el-form-item>
                 <el-form-item>
                     <el-upload ref="upload" action="customize" :http-request="uploadDiscardFile" :limit="1" :before-remove="beforeRemove">
@@ -64,14 +56,15 @@
                 cooperations: [],
                 cooperationsForm: {
                     id: null,
-                    name: null,
-                    description: null,
-                    type: null,
+                    title: null,
+                    introduction: null,
+                    address: null,
                     image: null
                 },
                 rules: {
-                    name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
-                    type: [{ required: true, message: "请选择合作方种类", trigger: "change"}]
+                    title: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
+                    introduction: [{ required: true, message: "请输入产品描述", trigger: "blur"}],
+                    address: [{ required: true, message: "请输入产品地址", trigger: "blur"}]
                 }
             };
         },
@@ -81,15 +74,15 @@
                 this.editing = isEdit;
                 if (this.editing) {
                     this.cooperationsForm.id = this.cooperations[index].id;
-                    this.cooperationsForm.name = this.cooperations[index].name;
-                    this.cooperationsForm.description = this.cooperations[index].description;
-                    this.cooperationsForm.type = this.cooperations[index].type;
+                    this.cooperationsForm.title = this.cooperations[index].title;
+                    this.cooperationsForm.introduction = this.cooperations[index].introduction;
+                    this.cooperationsForm.address = this.cooperations[index].address;
                     this.cooperationsForm.image = null;
                 } else {
                     this.cooperationsForm.id = null;
-                    this.cooperationsForm.name = "";
-                    this.cooperationsForm.description = "";
-                    this.cooperationsForm.type = 0;
+                    this.cooperationsForm.title = "";
+                    this.cooperationsForm.introduction = "";
+                    this.cooperationsForm.address = "";
                     this.cooperationsForm.image = null;
                 }
                 this.addDialogVisible = true;
@@ -99,11 +92,12 @@
             getCooperations() {
                 this.loading = true;
                 request({
-                    url: "/cooperations/getCooperations",
-                    method: "post"
+                    url: "/companyproducts/companyProductsList",
+                    method: "post",
+                    params: {pageSize: 9999999}
                 })
                 .then(response => {
-                    this.cooperations = response.data.cooperations;
+                    this.cooperations = response.data.records;
                     this.loading = false;
                 })
                 .catch(error => {
@@ -118,7 +112,7 @@
             //删除合作信息
             deleteCooperation(id) {
                 request({
-                    url: "/cooperations/deleteCooperation",
+                    url: "/companyproducts/del",
                     method: "post",
                     params: { id: id }
                 })
@@ -146,9 +140,9 @@
                     if (valid) {
                         this.loading = true;
                         var form = new FormData();
-                        form.append("name", this.cooperationsForm.name);
-                        form.append("description", this.cooperationsForm.description);
-                        form.append("type", this.cooperationsForm.type);
+                        form.append("title", this.cooperationsForm.title);
+                        form.append("introduction", this.cooperationsForm.introduction);
+                        form.append("address", this.cooperationsForm.address);
                         //新增记录 并且 没有图片时
                         if (this.cooperationsForm.image == null && this.editing == false) {
                             //如果没上传文件的话
@@ -159,13 +153,13 @@
                             return;
                             //有图片时
                         } else if (this.cooperationsForm.image != null) {
-                            form.append("multipartFile", this.cooperationsForm.image);
+                            form.append("file", this.cooperationsForm.image);
                         }
                         if (this.cooperationsForm.id != null) {
                             form.append("id", this.cooperationsForm.id);
                         }
                         request({
-                            url: this.editing? "/cooperations/editCooperation" : "/cooperations/addCooperation",
+                            url: "/companyproducts/addAndUpdate",
                             method: "post",
                             data: form
                         })