tanyanfei 5 년 전
부모
커밋
a2f664a591
10개의 변경된 파일263개의 추가작업 그리고 36개의 파일을 삭제
  1. 14 1
      src/api.js
  2. BIN
      src/images/bg_1.jpg
  3. BIN
      src/images/bg_2.jpg
  4. 4 0
      src/router.js
  5. 2 20
      src/views/Home.vue
  6. 16 1
      src/views/Index.vue
  7. 15 1
      src/views/Index1.vue
  8. 149 0
      src/views/material/Frendlink.vue
  9. 60 10
      src/views/material/Index.vue
  10. 3 3
      src/views/task/DangerTask.vue

+ 14 - 1
src/api.js

@@ -54,7 +54,7 @@ export default {
 		return axios.post(`${baseURL}/api/account/logout`, params);
 	},
 	getInfo: params => {
-		return axios.get(`${baseURL}/api/account/info`)
+		return axios.get(`${baseURL}/api/admin/user`)
 	},
 	uploadFile: params => {
 		return axios.post(`${baseURL}/api/admin/uploadfile`, params);
@@ -165,4 +165,17 @@ export default {
 	sendMessage: params => {
 		return axios.post(`${baseURL}/api/admin/messages`, params);
 	},
+	//资料
+	getDocumentionList: params => {
+		return axios.get(`${baseURL}/api/admin/documention/list`,{params:params})
+	},
+	saveDoc: params => {
+		return axios.post(`${baseURL}/api/admin/documention`, params);
+	},
+	deleteDoc: params => {
+		return axios.delete(`${baseURL}/api/admin/documention`, {params:params});
+	},
+	getFriendlinkList: params => {
+		return axios.get(`${baseURL}/api/admin/friendlink/list`,{params:params})
+	},
 }

BIN
src/images/bg_1.jpg


BIN
src/images/bg_2.jpg


+ 4 - 0
src/router.js

@@ -138,6 +138,10 @@ export default new Router({
         path: '/merterial',
         component: () => import('./views/material/Index.vue'),
         name: '资料管理'
+      },{
+        path: '/frendlink',
+        component: () => import('./views/material/Frendlink.vue'),
+        name: '友情链接'
       }]
     },
   ]

+ 2 - 20
src/views/Home.vue

@@ -19,7 +19,7 @@
 			<div class="settings">
 				<span>
 					<i class="el-icon-s-custom"></i>
-					admin
+					{{info.name}}
 				</span>
         <span class="logout" @click="logout"><i class="el-icon-switch-button"></i> 退出登录</span>
 			</div>
@@ -93,29 +93,11 @@ export default {
 			this.$api.getInfo().then(res=>{
 				this.info=res.data.data
 			})
-			this.$api.getSubList().then(res=>{
-			  let data=res.data.data
-			  let routes=this.$route
-			  let path=[]
-			  for(let i=0;i<data.length;i++){
-				  path.push({
-					  	path: '/',
-						name: data[i].name,
-						icon:'el-icon-s-custom',
-						children:[
-							{ path: '/new/'+data[i].id,  name: '新办'},
-							{ path: '/update/'+data[i].id,  name: '复审'},
-							{ path: '/change/'+data[i].id,  name: '换证'},
-						]
-				  })
-			  }
-			  this.menu=path
-          	})
 		}
 	},
 	created(){
 		// console.log(this.$route)
-		// this.getData()
+		this.getData()
 		var that=this;
 		setInterval(function(){
 			that.getDate();

+ 16 - 1
src/views/Index.vue

@@ -10,6 +10,7 @@
           top: 40px;
           right: 20px;
           cursor: pointer;
+          z-index: 999;
         }
         .min{
           display: none;
@@ -36,6 +37,19 @@
       .title{
         text-align: center;
         margin-bottom: 30px;
+        position: relative;
+        span{
+          position: absolute;
+          top: 10px;
+          width: 100%;
+          text-align: center;
+          left: 0;
+          left: 0;
+          right: 0;
+          margin: auto;
+          font-size: 25px;
+          line-height: 70px;
+        }
       }
       .datas{
         // margin-bottom: 60px;
@@ -147,7 +161,8 @@
         <img @click="max" class="max" src="../images/max.png" alt="">
         <img @click="min" class="min" src="../images/min.png" alt="">
         <h1 class="title">
-          <img src="../images/bt2.png" alt="">
+          <img height="90px" width="100%" src="../images/bg_1.jpg" alt="">
+          <span>监测系统</span>
         </h1>
         <ul class="datas">
           <li style="width:30%;">

+ 15 - 1
src/views/Index1.vue

@@ -10,6 +10,7 @@
           top: 40px;
           right: 20px;
           cursor: pointer;
+          z-index: 999;
         }
         .min{
           display: none;
@@ -36,6 +37,18 @@
       .title{
         text-align: center;
         margin-bottom: 30px;
+        position: relative;
+        span{
+          position: absolute;
+          top: 10px;
+          width: 80%;
+          text-align: center;
+          left: 0;
+          right: 0;
+          margin: auto;
+          font-size: 25px;
+          line-height: 70px;
+        }
       }
       .datas{
         // margin-bottom: 60px;
@@ -146,7 +159,8 @@
         <img @click="max" class="max" src="../images/max.png" alt="">
         <img @click="min" class="min" src="../images/min.png" alt="">
         <h1 class="title">
-          <img src="../images/bt1.png" alt="">
+          <img height="90px" width="100%" src="../images/bg_2.jpg" alt="">
+          <span>监测系统</span>
         </h1>
         <ul class="datas">
           <li style="width:30%;">

+ 149 - 0
src/views/material/Frendlink.vue

@@ -0,0 +1,149 @@
+<style lang="scss">
+    
+</style>
+<template>
+    <section>
+        <p>资料管理  >  友情链接</p>
+        <div class="filter">
+            <el-form label-width="70px" :inline="true" size="small" label-position="left">
+                <el-form-item label="名称">
+                        <el-input clearable placeholder="请输入名称" v-model="form.name"></el-input>
+                </el-form-item>
+                <el-form-item>
+                       <el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
+                       <el-button icon="el-icon-plus" @click="dialogVisible=true"  type="primary">新增友情链接</el-button>
+                </el-form-item>
+            </el-form>
+        </div>
+
+
+        <el-table
+                class="table"
+                :data="list" height="64vh"
+                border  v-loading="loading"
+                style="width: 100%">
+                <el-table-column
+                type="selection" fixed="left"
+                width="40">
+                </el-table-column>
+                <el-table-column
+                prop="name" 
+                label="名称">
+                </el-table-column>
+                <el-table-column
+                prop="ctime"  width="200"
+                label="时间">
+                </el-table-column>
+                <el-table-column fixed="right"
+                prop="zip"  width="170"
+                label="操作">
+                <template slot-scope="scope">
+                    <el-button icon="el-icon-edit" @click="download(scope.row.fileurl)" size="mini" type="warning">编辑</el-button>
+                    <el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>
+                </template>
+                </el-table-column>
+        </el-table>
+        <Page  ref="pageButton"  :total='total' @pageChange='gopage'/>
+        <el-dialog
+            title="新增资料" center
+            :visible.sync="dialogVisible"
+            width="500px">
+            <el-form label-width="60px">
+                <el-form-item label="名称">
+                    <el-input clearable   v-model="doc.name"></el-input>
+                </el-form-item>
+                <el-form-item label="附件">
+                     <input @change="upload('fileurl')" id='fileurl' type="file">
+                </el-form-item>
+            </el-form>
+        
+            <span slot="footer" class="dialog-footer">
+                <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+                <el-button size="small" type="primary" @click="add">确 定</el-button>
+            </span>
+        </el-dialog>
+    </section>
+</template>
+<script>
+import Page from '../../components/Page';
+export default {
+  components:{
+        Page
+  },
+  data(){
+    return{
+      form:{name:'',page:1,page_size:20},
+      activeName:"1",
+      total:1,
+      list:[{name:'2333'}],
+      loading:false,
+      dialogVisible:false,
+      doc:{}
+    }
+  },
+  methods:{
+        gopage(size){
+            if(size){
+                this.form.page_size=size
+            }
+            this.form.page=this.$refs.pageButton.page
+            this.getData()
+        },
+        getData(){
+            var parm=this.form;
+            this.loading=true
+            this.$api.getFriendlinkList(parm).then(res=>{
+                this.list=res.data.data.list
+                this.total=res.data.data.total
+                this.loading=false
+            })
+        },
+        del(id){
+                this.$confirm('确定删除吗', '提示', {
+                        type: 'warning'
+                    }).then(() => {
+                    this.$api.deleteDoc({id:id}).then((res)=>{
+                            this.$message({
+                                message: '删除成功',
+                                type: 'success'
+                            })
+                            this.getData()
+                    })
+                })
+        },
+        upload(type){
+            var file=document.getElementById(type).files;
+            var data=new FormData();
+                data.append("file",file[0])
+            this.$api.uploadFile(data).then(res=>{
+                if(res.data.code==0){
+                        let form=this.doc;
+                        this.$set(form,type,res.data.data.url)
+                        this.$message({message: '上传成功!',type: 'success'});
+                    }else{
+                        this.$message.error(res.data.message);
+                    }
+            })
+        },
+        download(url){
+            window.open(url);
+        },
+        add(){
+            let parm=this.doc;
+            this.$api.saveDoc(parm).then(res=>{
+                    if(res.data.code==0){
+                        this.$message({message: '添加成功!',type: 'success'});
+                        this.getData();
+                        this.dialogVisible=false;
+                    }else{
+                        this.$message.error(res.data.message);
+                    }
+            })
+            
+        },
+  },
+  created(){
+      this.getData()
+  }
+}
+</script>

+ 60 - 10
src/views/material/Index.vue

@@ -11,7 +11,7 @@
                 </el-form-item>
                 <el-form-item>
                        <el-button @click="form.page=1,getData()" type="primary" icon="el-icon-search">搜索</el-button>
-                       <el-button icon="el-icon-plus" @click="$router.push({path:'/company/add'})"  type="primary">新增资料</el-button>
+                       <el-button icon="el-icon-plus" @click="dialogVisible=true"  type="primary">新增资料</el-button>
                 </el-form-item>
             </el-form>
         </div>
@@ -38,12 +38,30 @@
                 prop="zip"  width="170"
                 label="操作">
                 <template slot-scope="scope">
-                    <el-button icon="el-icon-edit" @click="$router.push({path:'/company/add',query:{id:scope.row.id}})" size="mini" type="warning">编辑</el-button>
+                    <el-button icon="el-icon-download" @click="download(scope.row.fileurl)" size="mini" type="warning">下载</el-button>
                     <el-button icon="el-icon-delete" @click="del(scope.row.id)" size="mini"  type="danger">删除</el-button>
                 </template>
                 </el-table-column>
         </el-table>
         <Page  ref="pageButton"  :total='total' @pageChange='gopage'/>
+        <el-dialog
+            title="新增资料" center
+            :visible.sync="dialogVisible"
+            width="500px">
+            <el-form label-width="60px">
+                <el-form-item label="标题">
+                    <el-input clearable   v-model="doc.name"></el-input>
+                </el-form-item>
+                <el-form-item label="附件">
+                     <input @change="upload('fileurl')" id='fileurl' type="file">
+                </el-form-item>
+            </el-form>
+        
+            <span slot="footer" class="dialog-footer">
+                <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+                <el-button size="small" type="primary" @click="add">确 定</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 <script>
@@ -58,7 +76,9 @@ export default {
       activeName:"1",
       total:1,
       list:[{name:'2333'}],
-      loading:false
+      loading:false,
+      dialogVisible:false,
+      doc:{}
     }
   },
   methods:{
@@ -72,17 +92,17 @@ export default {
         getData(){
             var parm=this.form;
             this.loading=true
-            // this.$api.getClass(parm).then(res=>{
-            //     this.list=res.data.data.list
-            //     this.total=res.data.data.total
-            //     this.loading=false
-            // })
+            this.$api.getDocumentionList(parm).then(res=>{
+                this.list=res.data.data.list
+                this.total=res.data.data.total
+                this.loading=false
+            })
         },
         del(id){
                 this.$confirm('确定删除吗', '提示', {
                         type: 'warning'
                     }).then(() => {
-                    this.$api.deleteClass({id:id}).then((res)=>{
+                    this.$api.deleteDoc({id:id}).then((res)=>{
                             this.$message({
                                 message: '删除成功',
                                 type: 'success'
@@ -91,9 +111,39 @@ export default {
                     })
                 })
         },
+        upload(type){
+            var file=document.getElementById(type).files;
+            var data=new FormData();
+                data.append("file",file[0])
+            this.$api.uploadFile(data).then(res=>{
+                if(res.data.code==0){
+                        let form=this.doc;
+                        this.$set(form,type,res.data.data.url)
+                        this.$message({message: '上传成功!',type: 'success'});
+                    }else{
+                        this.$message.error(res.data.message);
+                    }
+            })
+        },
+        download(url){
+            window.open(url);
+        },
+        add(){
+            let parm=this.doc;
+            this.$api.saveDoc(parm).then(res=>{
+                    if(res.data.code==0){
+                        this.$message({message: '添加成功!',type: 'success'});
+                        this.getData();
+                        this.dialogVisible=false;
+                    }else{
+                        this.$message.error(res.data.message);
+                    }
+            })
+            
+        },
   },
   created(){
-    //   this.getData()
+      this.getData()
   }
 }
 </script>

+ 3 - 3
src/views/task/DangerTask.vue

@@ -246,7 +246,7 @@
             <el-button size="small" @click="dialogVisible = false">取 消</el-button>
             <el-button size="small" type="primary" @click="upload('file')">确 定</el-button>
         </span>
-        </el-dialog>
+    </el-dialog>
   </section>
 </template>
 <script>
@@ -300,7 +300,7 @@ export default {
             }
         },
         edit(data){
-            if(data.type != 'ent'){
+            // if(data.type != 'ent'){
                 this.form.riskpoint_id=data.id;
                 this.getData()  
                 this.findRsk(data.id)            
@@ -319,7 +319,7 @@ export default {
                         })
                         
                 })
-            }
+            // }
         },
         getData(){
             this.loading=true