Explorar o código

云模官网——后台管理系统页面

sunyadv %!s(int64=5) %!d(string=hai) anos
pai
achega
2ecae61128

+ 2 - 0
.idea/compiler.xml

@@ -9,11 +9,13 @@
         <outputRelativeToContentRoot value="true" />
         <module name="cloud-model" />
         <module name="website" />
+        <module name="ysofficial" />
       </profile>
     </annotationProcessing>
     <bytecodeTargetLevel target="8">
       <module name="cloud-model" target="1.8" />
       <module name="website" target="1.8" />
+      <module name="ysofficial" target="1.8" />
       <module name="yunsu" target="1.8" />
     </bytecodeTargetLevel>
   </component>

+ 1 - 0
.idea/encodings.xml

@@ -3,6 +3,7 @@
   <component name="Encoding">
     <file url="file://$PROJECT_DIR$" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/cloud-model" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/official_backend" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/website" charset="UTF-8" />
   </component>
 </project>

+ 1 - 0
.idea/misc.xml

@@ -9,6 +9,7 @@
         <option value="$PROJECT_DIR$/model/pom.xml" />
         <option value="$PROJECT_DIR$/pom.xml" />
         <option value="$PROJECT_DIR$/website/pom.xml" />
+        <option value="$PROJECT_DIR$/official_backend/pom.xml" />
       </list>
     </option>
   </component>

+ 1 - 0
.idea/modules.xml

@@ -4,6 +4,7 @@
     <modules>
       <module fileurl="file://$PROJECT_DIR$/cloud-model/cloud-model.iml" filepath="$PROJECT_DIR$/cloud-model/cloud-model.iml" />
       <module fileurl="file://$PROJECT_DIR$/website/website.iml" filepath="$PROJECT_DIR$/website/website.iml" />
+      <module fileurl="file://$PROJECT_DIR$/official_backend/ysofficial.iml" filepath="$PROJECT_DIR$/official_backend/ysofficial.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/yunsu.iml" filepath="$PROJECT_DIR$/.idea/yunsu.iml" />
     </modules>
   </component>

+ 4 - 4
official_frontend/src/components/Tinymce/components/EditorImage.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="upload-container">
     <el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true">
-      upload
+      上传
     </el-button>
     <el-dialog :visible.sync="dialogVisible">
       <el-upload
@@ -16,14 +16,14 @@
         list-type="picture-card"
       >
         <el-button size="small" type="primary">
-          Click upload
+          点击上传
         </el-button>
       </el-upload>
       <el-button @click="dialogVisible = false">
-        Cancel
+        取消
       </el-button>
       <el-button type="primary" @click="handleSubmit">
-        Confirm
+        确认
       </el-button>
     </el-dialog>
   </div>

+ 1 - 1
official_frontend/src/components/Tinymce/index.vue

@@ -117,7 +117,7 @@ export default {
       const _this = this
       window.tinymce.init({
         selector: `#${this.tinymceId}`,
-        language: this.languageTypeList['en'],
+        language: this.languageTypeList['zh'],
         height: this.height,
         body_class: 'panel-body ',
         object_resizing: false,

+ 26 - 0
official_frontend/src/router/index.js

@@ -129,6 +129,19 @@ export const constantRoutes = [
     ]
   },
 
+  {
+    path: '/product',
+    component: Layout,
+    children: [
+      {
+        path: '',
+        name: 'product',
+        component: () => import('@/views/product/product'),
+        meta: { title: '公司产品', icon: 'form' }
+      }
+    ]
+  },
+
   {
     path: '/comment',
     component: Layout,
@@ -142,6 +155,19 @@ export const constantRoutes = [
     ]
   },
 
+  {
+    path: '/application',
+    component: Layout,
+    children: [
+      {
+        path: '',
+        name: 'Comment',
+        component: () => import('@/views/application/application'),
+        meta: { title: '查看申请', icon: 'form' }
+      }
+    ]
+  },
+
   // 404 page must be placed at the end !!!
   { path: '*', redirect: '/404', hidden: true }
 ]

+ 47 - 0
official_frontend/src/views/application/application.vue

@@ -0,0 +1,47 @@
+<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>
+</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"
+          });
+        });
+    }
+  },
+  mounted() {
+    this.getComments();
+  }
+};
+</script>
+
+<style scoped>
+</style>
+

+ 234 - 0
official_frontend/src/views/product/product.vue

@@ -0,0 +1,234 @@
+<template>
+    <div class="app-container">
+        <el-button type="primary" @click="openDialog(false, null)" :loading="loading">添加</el-button>
+        <el-table :data="cooperations" style="width: 100%">
+            <el-table-column type="index" width="50"></el-table-column>
+            <el-table-column label="产品图片" width="200">
+                <template slot-scope="scope">
+                    <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">
+                <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>
+            </el-table-column>
+        </el-table>
+
+        <!-- 添加和编辑的dialog -->
+        <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-form-item>
+                <el-form-item label="产品描述" prop="description">
+                    <el-input v-model="cooperationsForm.description" placeholder="请输入产品描述" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="产品地址" prop="type">
+                    <el-input v-model="cooperationsForm.type" placeholder="请输入产品地址" clearable></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-upload ref="upload" action="customize" :http-request="uploadDiscardFile" :limit="1" :before-remove="beforeRemove">
+                        <el-button type="primary" :loading="loading">上传一张图片</el-button>
+                    </el-upload>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="addDialogVisible = false">取消</el-button>
+                <el-button type="primary" @click="addCooperation()" :loading="loading">提交</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import request from "@/utils/request";
+    export default {
+        data() {
+            return {
+                editing: false,
+                loading: false,
+                addDialogVisible: false,
+                cooperations: [],
+                cooperationsForm: {
+                    id: null,
+                    name: null,
+                    description: null,
+                    type: null,
+                    image: null
+                },
+                rules: {
+                    name: [{ required: true, message: "请输入活动名称", trigger: "blur" }],
+                    type: [{ required: true, message: "请选择合作方种类", trigger: "change"}]
+                }
+            };
+        },
+        methods: {
+            //打开对话框
+            openDialog(isEdit, index) {
+                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.image = null;
+                } else {
+                    this.cooperationsForm.id = null;
+                    this.cooperationsForm.name = "";
+                    this.cooperationsForm.description = "";
+                    this.cooperationsForm.type = 0;
+                    this.cooperationsForm.image = null;
+                }
+                this.addDialogVisible = true;
+            },
+
+            //获取合作信息
+            getCooperations() {
+                this.loading = true;
+                request({
+                    url: "/cooperations/getCooperations",
+                    method: "post"
+                })
+                .then(response => {
+                    this.cooperations = response.data.cooperations;
+                    this.loading = false;
+                })
+                .catch(error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    this.loading = false;
+                });
+            },
+
+            //删除合作信息
+            deleteCooperation(id) {
+                request({
+                    url: "/cooperations/deleteCooperation",
+                    method: "post",
+                    params: { id: id }
+                })
+                .then(response => {
+                    this.$message({
+                        message: "删除成功",
+                        type: "success"
+                    });
+                    this.getCooperations();
+                    this.addDialogVisible = false;
+                    this.loading = false;
+                })
+                .catch(error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                    this.loading = false;
+                });
+            },
+
+            //添加/编辑合作信息
+            addCooperation() {
+                this.$refs.form.validate(valid => {
+                    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);
+                        //新增记录 并且 没有图片时
+                        if (this.cooperationsForm.image == null && this.editing == false) {
+                            //如果没上传文件的话
+                            this.$message({
+                                message: "尚未上传图片",
+                                type: "error"
+                            });
+                            return;
+                            //有图片时
+                        } else if (this.cooperationsForm.image != null) {
+                            form.append("multipartFile", this.cooperationsForm.image);
+                        }
+                        if (this.cooperationsForm.id != null) {
+                            form.append("id", this.cooperationsForm.id);
+                        }
+                        request({
+                            url: this.editing? "/cooperations/editCooperation" : "/cooperations/addCooperation",
+                            method: "post",
+                            data: form
+                        })
+                        .then(response => {
+                            this.$refs.upload.clearFiles();
+                            this.getCooperations();
+                            this.addDialogVisible = false;
+                            this.loading = false;
+                            this.$message({
+                                message: "添加成功",
+                                type: "success"
+                            });
+                        })
+                        .catch(error => {
+                            this.$message({
+                                message: error,
+                                type: "error"
+                            });
+                            this.loading = false;
+                        });
+                    }
+                });
+            },
+
+            //切换置顶
+            switchSticky(id) {
+                request({
+                    url: "/cooperations/switchCooperationSticky",
+                    method: "post",
+                    params: { id: id }
+                })
+                .then(response => {
+                    this.$message({
+                        message: "操作成功",
+                        type: "success"
+                    });
+                    this.getCooperations();
+                })
+                .catch(error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+
+            //文件上传的部分操作
+            uploadDiscardFile(params) {
+                this.cooperationsForm.image = params.file;
+                return false;
+            },
+
+            //文件上传的移除操作
+            beforeRemove(params) {
+                this.cooperationsForm.image = null;
+            }
+        },
+        mounted() {
+            this.getCooperations();
+        }
+    };
+</script>
+
+<style scoped>
+</style>
+