jeecg项目笔记

1.node-sass 安装不成功   

cnpm install node-sass

   https://segmentfault.com/a/1190000010984731      

使用 cnpm 安装 node-sass 会默认从淘宝镜像源下载,也是一个办法.

 
 
2.com.mysql.cj.jdbc.Driver         对应的url需加入时区 url=jdbc:mysql:///test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false
 
3.maven 项目启动命令mvn tomcat:run          在cmd路径下运行  操作系统无需安装eclipse和tomcat
 
4.文件上传下载 是上传到作为服务器的电脑上,也从这里下载,碰到一个问题,上传下载时网址是localhost,不是服务器电脑的IP地址,在前端传路径的时候需要修改,

 

 

5.vue v-model 可实现双向绑定 input组件和select组件都可使用

 

6.v-for 遍历循环 


<a-select placeholder="请选择" v-model="Task.selectPerson"  mode="multiple">
                        <template v-for='(li,key) in person'>

                          <a-select-option  v-bind:key="key" :value="li">{{li}}</a-select-option>

                        </template>
                        <!--<a-select-option value="1">阮海丽</a-select-option>-->
 </a-select>

View Code

 

7.js更改时间格式 


format(time, format) {
      var t = new Date(time);
      var tf = function (i) {
       return (i < 10 ? '0' : '') + i
      };
      return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
      switch (a) {
        case 'yyyy':
          return tf(t.getFullYear());
        case 'MM':
          return tf(t.getMonth() + 1);
        case 'mm':
          return tf(t.getMinutes());
        case 'dd':
          return tf(t.getDate());
        case 'HH':
          return tf(t.getHours());
        case 'ss':
          return tf(t.getSeconds());
        }
      })
    }
//写好format方法后调用format方法更改时间格式
 this.Task.deliverTime=this.format(new Date(),'yyyy-MM-dd HH:mm:ss');

View Code

 

 8.弹框跳转  碰到这个问题也是和老师一起花很大功夫才解决 

this.$refs.modalForm.edit(record);
this.$refs.modalForm.title="详情";
this.$refs.modalForm.disableSubmit = true;
modalForm 就是前面跳转时的ref属性给的 modalForm 当时没有理解 this.$refs.modalForm 从哪里来

<!--插槽 点击跳转到方法-->
<span slot="action" slot-scope="text, record">
            <a @click="handleDetail(record)">进度详情</a>
          </span>

          <span slot="action2" slot-scope="text, record">
            <a @click="handleDetail2(record)">装置详情</a>
          </span>

<!--跳转到的页面-->
<ProTaskQu ref="modalForm" @ok="modalFormOk"></ProTaskQu>

 <ProTaskQu2 ref="modalForm2" @ok="modalFormOk"></ProTaskQu2>


handleDetail:function(record){
      this.$refs.modalForm.edit(record);
      this.$refs.modalForm.title="详情";
      this.$refs.modalForm.disableSubmit = true;
      this.$refs.modalForm.data = this.deliverytaskInfo;
    },
    handleDetail2:function(record){
      this.$refs.modalForm2.edit(record);
      this.$refs.modalForm2.title="详情";
      this.$refs.modalForm2.disableSubmit = true;
      this.$refs.modalForm2.data = this.deliverytaskInfo;
      /* this.$refs.modalForm.data = this.deliverytask;*/
      console.log("************");
      console.log(this.$refs.modalForm.data);
    },

View Code

 

转载于:https://www.cnblogs.com/jianghuxiao/p/11294997.html

THE END
< <上一篇
下一篇>>