tanyanfei 4 years ago
parent
commit
4a27d8aa06

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "vue": "^2.6.6",
     "vue-baidu-map": "^0.21.22",
     "vue-router": "^3.0.1",
+    "vue-wordcloud": "^1.1.1",
     "vuedraggable": "^2.24.3",
     "vuex": "^3.0.1",
     "wangeditor": "^3.1.1"

+ 28 - 0
src/api.js

@@ -386,4 +386,32 @@ export default {
 	getIndexData: params => {
 		return axios.get(`${baseURL}/api/admin/index`, { params: params });
 	},
+	//导出
+	getJournalData: params => {
+		return axios.get(`${baseURL}/api/admin/journal/download`);
+	},
+	upJournalData: params => {
+		return axios.post(`${baseURL}/api/admin/journal/upload`,params);
+	},
+	getOrganizerData: params => {
+		return axios.get(`${baseURL}/api/admin/organizer/download`);
+	},
+	upOrganizerData: params => {
+		return axios.post(`${baseURL}/api/admin/organizer/upload`,params);
+	},
+	getSubjectData: params => {
+		return axios.get(`${baseURL}/api/admin/subject/download`);
+	},
+	upSubjectData: params => {
+		return axios.post(`${baseURL}/api/admin/subject/upload`,params);
+	},
+	getSignupData: params => {
+		return axios.get(`${baseURL}/api/admin/signup/download`);
+	},
+	getVerifierData: params => {
+		return axios.get(`${baseURL}/api/admin/verifier/download`);
+	},
+	getHotelData: params => {
+		return axios.get(`${baseURL}/api/admin/hotel/download`);
+	},
 }

+ 25 - 2
src/views/Index.vue

@@ -41,8 +41,15 @@
           </div>
         </div>
       </div>
-      <div class="header-item">
-        <div>搜索热词</div>
+      <div class="header-item" >
+         <wordcloud  v-if='form.search_hot_word'
+          style="width:100%;height:100px;"
+          :data="form.search_hot_word"  
+          nameKey="name"  :fontSize='[10,24]'
+          valueKey="value" 
+          :color="myColors"
+          :showTooltip="false">
+          </wordcloud>
       </div>
     </div>
     <div class="index-main">
@@ -117,6 +124,7 @@
 </template>
 <script>
 import echarts from "echarts";
+import wordcloud from 'vue-wordcloud'
 export default {
   data() {
     return {
@@ -129,8 +137,12 @@ export default {
         { article_header: "中国生态效率时空演化研究", count: "132" },
         { article_header: "中国生态效率时空演化研究", count: "132" },
       ],
+      myColors: ['#1f77b4', '#629fc9', '#94bedb', '#c9e0ef'],
     };
   },
+  components: {
+    wordcloud
+  },
   computed: {
   },
   methods: {
@@ -724,6 +736,7 @@ export default {
     getData() {
       this.$api.getIndexData({}).then((res) => {
         this.form = res.data.data;
+        this.form.search_hot_word=this.form.search_hot_word.concat(this.form.search_hot_word)
         let organizer_journal_x = [];
         let organizer_journal_y = [];
         let journal_article_x = [];
@@ -772,6 +785,16 @@ export default {
   },
   created(){
     this.getData();
+    var color=[]
+    for(let i=0;i<5;i++){
+        let c='rgb(' + [
+                    Math.round(Math.random() * 160),
+                    Math.round(Math.random() * 160),
+                    Math.round(Math.random() * 160)
+                ].join(',') + ')';
+        color.push(c)
+    }
+    this.myColors=color
   },
 };
 </script>

+ 20 - 1
src/views/conference/Apply.vue

@@ -55,7 +55,7 @@
                         <el-button @click="getData" type="primary">搜索</el-button>
                     </el-form-item>
                     <el-form-item style="float:right" >
-                        <el-button plain icon="el-icon-download" type="primary">导出Excel</el-button>
+                        <el-button @click="download" plain icon="el-icon-download" type="primary">导出Excel</el-button>
                     </el-form-item>
                 </el-form>
             </div>
@@ -290,6 +290,25 @@ export default {
         }
     },
     methods:{
+        download(){
+            this.$api.getSignupData().then(res=>{
+                var elink = document.createElement("a");
+                let blob = new Blob([res.data], {
+                    type: "application/vnd.ms-excel,charset=UTF-8",
+                });
+                let objUrl = URL.createObjectURL(blob);
+                let file_name = decodeURIComponent(
+                    res.headers["content-disposition"].split("=")[1]
+                );
+                console.log(file_name);
+                elink.download = file_name;
+                elink.style.display = "none";
+                elink.href = objUrl;
+                document.body.appendChild(elink);
+                elink.click();
+                document.body.removeChild(elink);
+            })
+        },
         gopage(size){
             if(size){
                 this.form.page_size=size

+ 20 - 1
src/views/conference/Checker.vue

@@ -30,7 +30,7 @@
                     </el-form-item>
                     <el-form-item style="float:right" >
                          <el-button @click="dialogVisible=true"  icon="el-icon-plud" type="primary">添加核销员</el-button>
-                        <el-button plain icon="el-icon-download" type="primary">导出Excel</el-button>
+                        <el-button @click="download" plain icon="el-icon-download" type="primary">导出Excel</el-button>
                     </el-form-item>
                 </el-form>
             </div>
@@ -158,6 +158,25 @@ export default {
         }
     },
     methods:{
+        download(){
+            this.$api.getVerifierData().then(res=>{
+                var elink = document.createElement("a");
+                let blob = new Blob([res.data], {
+                    type: "application/vnd.ms-excel,charset=UTF-8",
+                });
+                let objUrl = URL.createObjectURL(blob);
+                let file_name = decodeURIComponent(
+                    res.headers["content-disposition"].split("=")[1]
+                );
+                console.log(file_name);
+                elink.download = file_name;
+                elink.style.display = "none";
+                elink.href = objUrl;
+                document.body.appendChild(elink);
+                elink.click();
+                document.body.removeChild(elink);
+            })
+        },
         gopage(size){
             if(size){
                 this.form.page_size=size

+ 20 - 1
src/views/conference/Hotel.vue

@@ -52,7 +52,7 @@
                     </el-form-item>
                     <el-form-item style="float:right" >
                         <el-button @click="dialogVisible=true,dialogTitle='添加酒店',status='add'"  icon="el-icon-plud" type="primary">添加酒店</el-button>
-                        <el-button plain icon="el-icon-download" type="primary">导出Excel</el-button>
+                        <el-button @click="download" plain icon="el-icon-download" type="primary">导出Excel</el-button>
                     </el-form-item>
                 </el-form>
             </div>
@@ -151,6 +151,25 @@ export default {
         }
     },
     methods:{
+        download(){
+            this.$api.getHotelData().then(res=>{
+                var elink = document.createElement("a");
+                let blob = new Blob([res.data], {
+                    type: "application/vnd.ms-excel,charset=UTF-8",
+                });
+                let objUrl = URL.createObjectURL(blob);
+                let file_name = decodeURIComponent(
+                    res.headers["content-disposition"].split("=")[1]
+                );
+                console.log(file_name);
+                elink.download = file_name;
+                elink.style.display = "none";
+                elink.href = objUrl;
+                document.body.appendChild(elink);
+                elink.click();
+                document.body.removeChild(elink);
+            })
+        },
         viewUser(data){
             this.dialogVisible1=true
             this.$api.getSignupList(data).then(res=>{

+ 83 - 1
src/views/journalQun/Journal.vue

@@ -66,6 +66,12 @@
           <el-form-item>
             <el-button type="primary" @click="search">搜索</el-button>
           </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="dialogVisible1=true" plain icon="el-icon-upload" type="primary">导入</el-button>
+          </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="download" plain icon="el-icon-download" type="primary">导出</el-button>
+          </el-form-item>
           <el-form-item style="float: right">
             <el-button @click="add" type="primary">添加期刊</el-button>
           </el-form-item>
@@ -164,6 +170,26 @@
           <el-button size="small" type="primary" @click="save">确 定</el-button>
         </span>
       </el-dialog>
+      <el-dialog
+        class="fu-dialog"
+        title="导入期刊" width="400px"
+        :close-on-click-modal="false"
+        :visible.sync="dialogVisible1"
+      > 
+        <el-upload
+          class="upload-demo"
+          action="/api/admin/uploadfile"
+          :show-file-list="false"
+          :on-success="handleAvatarSuccess1">
+          <el-button size="small" type="primary">点击上传</el-button>
+          <div slot="tip" class="el-upload__tip">只能上传.xls/.xlsx文件,且不超过500M</div>
+        </el-upload>
+        <div>{{file}}</div>
+         <span slot="footer" class="dialog-footer">
+          <el-button size="small" type="normal" @click="dialogVisible1=false">取消</el-button>
+          <el-button size="small" type="primary" @click="upload">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </section>
 </template>
@@ -183,11 +209,64 @@ export default {
       input: "",
       dialogVisible: false,
       dialogTitle: "",
+      dialogVisible1:false,
       form1: {},
+      file:''
     };
   },
   methods: {
+    save() {
+      this.$refs["form1"].validate((valid) => {
+        if (valid) {
+          let parm = this.form1;
+          let id = this.form1.id;
+          this.$api.updateJournal(parm).then((res) => {
+              if (res.data.code == 0) {
+                this.$message({
+                  type: "success",
+                  message: "保存成功!",
+                });
+                this.getData();
+              } else {
+                // this.$message.error("保存失败!");
+              }
+              this.dialogVisible = false;
+            });
+        }
+      });
+    },
+    upload(){
+      this.$api.upJournalData({file:this.file}).then(res=>{
+          this.dialogVisible1=true;
+          this.getData();
+          this.$message({
+            message: "上传成功",
+            type: "success",
+          });
+      })
+    },
+    download(){
+      this.$api.getJournalData().then(res=>{
+          var elink = document.createElement("a");
+          let blob = new Blob([res.data], {
+            type: "application/vnd.ms-excel,charset=UTF-8",
+          });
+          let objUrl = URL.createObjectURL(blob);
+          let file_name = decodeURIComponent(
+            res.headers["content-disposition"].split("=")[1]
+          );
+          console.log(file_name);
+          elink.download = file_name;
+          elink.style.display = "none";
+          elink.href = objUrl;
+          document.body.appendChild(elink);
+          elink.click();
+          document.body.removeChild(elink);
+      })
+    },
     showQrcode(row){
+      this.form1.journal_id = row.journal_id;
+      this.form1.id = row.id;
       this.form1.qrcode = row.qrcode;
       this.dialogVisible = true;
     },
@@ -199,7 +278,10 @@ export default {
     },
     //封面
     handleAvatarSuccess(res, file) {
-      this.$set(this.form1,'img',file.response.data)
+      this.$set(this.form1,'qrcode',file.response.data)
+    },
+    handleAvatarSuccess1(res, file) {
+      this.file=file.response.data;
     },
     gopage(size) {
       if (size) {

+ 60 - 0
src/views/journalQun/Organizer.vue

@@ -141,6 +141,12 @@ a {
           <el-form-item>
             <el-button type="primary" @click="search">搜索</el-button>
           </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="dialogVisible1=true" plain icon="el-icon-upload" type="primary">导入</el-button>
+          </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="download" plain icon="el-icon-download" type="primary">导出</el-button>
+          </el-form-item>
           <el-form-item style="float: right">
             <el-button @click="add" type="primary">添加主办单位</el-button>
           </el-form-item>
@@ -219,6 +225,26 @@ a {
         <el-button size="small" type="primary" @click="save">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+        class="fu-dialog"
+        title="导入" width="400px"
+        :close-on-click-modal="false"
+        :visible.sync="dialogVisible1"
+      > 
+        <el-upload
+          class="upload-demo"
+          action="/api/admin/uploadfile"
+          :show-file-list="false"
+          :on-success="handleAvatarSuccess1">
+          <el-button size="small" type="primary">点击上传</el-button>
+          <div slot="tip" class="el-upload__tip">只能上传.xls/.xlsx文件,且不超过500M</div>
+          <div>{{file}}</div>
+        </el-upload>
+         <span slot="footer" class="dialog-footer">
+          <el-button size="small" type="normal" @click="dialogVisible1=false">取消</el-button>
+          <el-button size="small" type="primary" @click="upload">确 定</el-button>
+        </span>
+      </el-dialog>
   </section>
 </template>
 <script>
@@ -237,19 +263,53 @@ export default {
       loading: false,
       dialogTitle:"",
       dialogVisible:false,
+      dialogVisible1:false,
       rules: {
         name: [{ required: true, message: "请输入单位名称", trigger: "blur" }],
         desc: [{ required: true, message: "请输入单位简介", trigger: "blur" }],
         img: [{ required: true, message: "请上传单位封面", trigger: "blur" }],
       },
       form1:{},
+      file:''
     };
   },
   methods: {
+     upload(){
+      this.$api.upOrganizerData({file:this.file}).then(res=>{
+        this.dialogVisible1=false;
+        this.getData();
+          this.$message({
+            message: "上传成功",
+            type: "success",
+          });
+      })
+    },
+    download(){
+      this.$api.getOrganizerData().then(res=>{
+          var elink = document.createElement("a");
+          let blob = new Blob([res.data], {
+            type: "application/vnd.ms-excel,charset=UTF-8",
+          });
+          let objUrl = URL.createObjectURL(blob);
+          let file_name = decodeURIComponent(
+            res.headers["content-disposition"].split("=")[1]
+          );
+          console.log(file_name);
+          elink.download = file_name;
+          elink.style.display = "none";
+          elink.href = objUrl;
+          document.body.appendChild(elink);
+          elink.click();
+          document.body.removeChild(elink);
+      })
+    },
     //封面
     handleAvatarSuccess(res, file) {
       this.$set(this.form1,'img',file.response.data)
     },
+    handleAvatarSuccess1(res, file) {
+      this.file=file.response.data;
+    },
     search() {
       let parm = this.form;
       this.getData();

+ 61 - 1
src/views/journalQun/Subject.vue

@@ -141,6 +141,12 @@ a {
           <el-form-item>
             <el-button type="primary" @click="search">搜索</el-button>
           </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="dialogVisible1=true" plain icon="el-icon-upload" type="primary">导入</el-button>
+          </el-form-item>
+          <el-form-item style="float:right" >
+                <el-button @click="download" plain icon="el-icon-download" type="primary">导出</el-button>
+          </el-form-item>
           <el-form-item style="float: right">
             <el-button @click="add" type="primary">添加学科</el-button>
           </el-form-item>
@@ -205,6 +211,26 @@ a {
         <el-button size="small" type="primary" @click="save">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+        class="fu-dialog"
+        title="导入" width="400px"
+        :close-on-click-modal="false"
+        :visible.sync="dialogVisible1"
+      > 
+        <el-upload
+          class="upload-demo"
+          action="/api/admin/uploadfile"
+          :show-file-list="false"
+          :on-success="handleAvatarSuccess1">
+          <el-button size="small" type="primary">点击上传</el-button>
+          <div slot="tip" class="el-upload__tip">只能上传.xls/.xlsx文件,且不超过500M</div>
+          <div>{{file}}</div>
+        </el-upload>
+         <span slot="footer" class="dialog-footer">
+          <el-button size="small" type="normal" @click="dialogVisible1=false">取消</el-button>
+          <el-button size="small" type="primary" @click="upload">确 定</el-button>
+        </span>
+      </el-dialog>
   </section>
 </template>
 <script>
@@ -223,14 +249,48 @@ export default {
       loading: false,
       dialogTitle:"",
       dialogVisible:false,
+      dialogVisible1:false,
       rules: {
         name: [{ required: true, message: "请输入学科名称", trigger: "blur" }],
         desc: [{ required: true, message: "请输入学科简介", trigger: "blur" }]
       },
-      form1:{}
+      form1:{},
+      file:''
     };
   },
   methods: {
+    upload(){
+      this.$api.upSubjectData({file:this.file}).then(res=>{
+          this.dialogVisible1=false;
+          this.getData();
+          this.$message({
+            message: "上传成功",
+            type: "success",
+          });
+      })
+    },
+    download(){
+      this.$api.getSubjectData().then(res=>{
+          var elink = document.createElement("a");
+          let blob = new Blob([res.data], {
+            type: "application/vnd.ms-excel,charset=UTF-8",
+          });
+          let objUrl = URL.createObjectURL(blob);
+          let file_name = decodeURIComponent(
+            res.headers["content-disposition"].split("=")[1]
+          );
+          console.log(file_name);
+          elink.download = file_name;
+          elink.style.display = "none";
+          elink.href = objUrl;
+          document.body.appendChild(elink);
+          elink.click();
+          document.body.removeChild(elink);
+      })
+    },
+    handleAvatarSuccess1(res, file) {
+      this.file=file.response.data;
+    },
     //封面
     handleAvatarSuccess(res, file) {
       this.form1.img = file.response.data;