Kaynağa Gözat

添加了消息通知的添加通知功能和创业公司登记的上传文件功能

Q-ABAB 2 yıl önce
ebeveyn
işleme
a0c60fcc54
2 değiştirilmiş dosya ile 39 ekleme ve 9 silme
  1. 22 5
      src/views/firm.vue
  2. 17 4
      src/views/messageNotification.vue

+ 22 - 5
src/views/firm.vue

@@ -12,7 +12,7 @@
                 <el-button type="primary" class="btn2" >查询</el-button>
             </div>
         </div>
-        <el-button type="primary" class="btn" size="mini">上传文件</el-button>
+        <el-button type="primary" class="btn" @click="selectFile" size="mini">上传文件</el-button>
       </div>
       
       <div class="projectBlock">
@@ -54,7 +54,7 @@
           <template #default="scope">
               <div class="operations">
                       <el-button type="primary" class="bt1" size="mini" >查看信息</el-button>
-                      <el-button type="primary" class="bt1" size="mini" @click="edit(scope,scope)" >删除</el-button>
+                      <el-button type="primary" class="bt1" size="mini" @click="edit(scope.row)" >删除</el-button>
               </div>
           </template>
         </el-table-column>
@@ -76,7 +76,7 @@
             options4:[],
             tableData:[{
             projectName:'创业孵化基地企业情况信息表',
-            date:'2022年11月12日',
+            date:'2022年11月13日',
             size:'50k'
             },
             {
@@ -95,9 +95,26 @@
           }
         },
         methods:{
-          edit(){
-  
+          edit(data){
+            this.tableData = this.tableData.filter(item=>item.date!=data.date);
           },
+          selectFile(){
+            let input = document.createElement('input');
+            input.type='file';
+            input.accept='.doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.png, .jpg, .jpeg'
+            input.click();
+            input.addEventListener("change",()=>{
+              const fileLiu = input.files[0];
+              const NowDate = new Date(); 
+              let data = {
+                projectName:fileLiu.name,
+                size:Math.floor(fileLiu.size/1024/1024)+"MB",
+                date:`${NowDate.getFullYear()}年${NowDate.getMonth()+1}月${NowDate.getDate()}日`,
+              }
+              this.tableData.push(data);
+              input.remove();
+            })
+          }
           
         }
       }

+ 17 - 4
src/views/messageNotification.vue

@@ -8,7 +8,7 @@
     <div class="twoSelectInp">
       <div class="selectTwo">
           <div class="selectsBlock">
-              <el-input v-model="input" style="width:200px" placeholder="请输入"></el-input>
+              <el-input v-model="selectInput" style="width:200px" placeholder="请输入"></el-input>
               <el-button type="primary" class="btn2" >查询</el-button>
           </div>
       </div>
@@ -72,8 +72,7 @@
       title="添加全站通知"
       :visible.sync="dialogVisible"
       width="600px"
-      class="addDialog"
-      :before-close="init">
+      class="addDialog">
       <div class="addDialogLogo">LOGO</div>
       <div class="addDialogMid">
         <div class="addDialogTit">
@@ -152,6 +151,8 @@
       data() {
         return {
           textarea:'',
+          //查询框
+          selectInput:"",
           dialogVisible:false,
           dialogVisible1:false,
           dialogVisible2:false,
@@ -186,10 +187,22 @@
       },
       methods:{
         deletes(){
-          this.dialogVisible1=true;
+          this.dialogVisible1=false;
         },
         init(){
           //重置
+       
+          console.log(this.textarea)
+          console.log(this.input)
+          if(this.textarea==''||this.input=='')return;
+          const date = new Date();
+
+          let data = {
+            projectName:this.input,
+            date:`${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`,
+            founder:"覃罡彤",
+          }
+          this.tableData.push(data);
           this.dialogVisible=false;
           this.dialogVisible1=false;
           this.dialogVisible2=false;