当前位置: 移动技术网 > IT编程>网页制作>Html5 > starshot常见问题(New)

starshot常见问题(New)

2019年03月08日  | 移动技术网IT编程  | 我要评论
Element组件网址: http://element-cn.eleme.io/#/zh-CN/component/message Layer组件网址: https://www.layui.com/doc/modules/upload.html 测试接口: 用Postman或者网址http://lo ...

element组件网址:

 

layer组件网址:

 

测试接口:

postman或者网址http://localhost:8081/swagger-ui.html

 

vue前端--

导入:npm install

启动命令:npm run serve

 

1、vue导出表格到excel出现重复表格解决办法

<el-table-column></el-table-column>标签中有fixed属性,去掉即可。

 

 

2、vue导出excel表点击事件:

https://www.jianshu.com/p/82a1b90e41b1)

<el-col :span="4">

<el-button type="primary" @click="exportdiscoveryasset()"><i class="fa fa-plus" aria-hidden="true"></i> 导出</el-button>

</el-col>

操作放在methods里面:

 

//导出 start;

exportdiscoveryasset(){

this.$confirm('此操作将导出excel文件, 是否继续?', '提示', {

confirmbuttontext: '确定',

cancelbuttontext: '取消',

type: 'warning'

}).then(() => {

this.exceldata = this.data //你要导出的数据list。

this.export2excel()

}).catch(() => {

});

},

export2excel() {

let wb = xlsx.utils.table_to_book(document.getelementbyid('table1')),

wopts = {

booktype: 'xlsx',

booksst: false,

type: 'binary'

},

wbout = xlsx.write(wb, wopts);

 

filesaver.saveas(new blob([this.s2ab(wbout)], {

type: "application/octet-stream;charset=utf-8"

}), "互联网资产.xlsx");

},

s2ab(s) {

if (typeof arraybuffer !== 'undefind') {

var buf = new arraybuffer(s.length);

var view = new uint8array(buf);

for (var i = 0; i != s.length; i++) view[i] = s.charcodeat(i) & 0xff;

return buf;

} else {

var buf = new array(s.length);

for (var i = 0; i != s.length; i++) buf[i] = s.charcodeat(i) & 0xff;

return buf;

}

},

//导出 end;

 

3、模板下载:

//模板下载 start;

downloadexcel(){

this.$http.get('/ast/discovery-asset/downloaddiscoveryasset').then(response => {

this.$message('模板下载成功');

}).catch(error => {

console.log(error);

});

},

//模板下载 end;

 

后台controller方法:

@apioperation(value = "下载模板", httpmethod = "get")
@apiresponse(code = 200, message = "下载成功", response = discoveryasset.class)
@getmapping("/downloaddiscoveryasset")
public void downloadassetsuploadtemplate(httpservletresponse response) {
    filedownloader.downloadfile(response,"discoveryasset.xlsx");
}

 

4、后端端口被占用问题:

(1)cmd --> netstat -ano 列出端口占用情况;

也可以打开任务管理器清空java运行的程序。

5、idea中,maven项目依赖报错问题(dependencies中总是有红色波浪线)

原因推测:

因为本地多处引用这个jar包;

maven项目结构图里看到,存在一条红线,在idea的中文教程里有说到这一点, 这种红线代表依赖冲突,而且有时并不是因为冲突引起的,只是因为多个地方引用,所以也会出现红色线。而且在结构图里还有一条虚线,会告诉你哪里的jar也引用了这个jar包。

解决方案:

方案一:可以在项目结构图中右键报红的jar包,选择排除掉冲突(会在pom.xml中自动写上排除的标签)。

方案二:将波浪线的dependency,将其从pom中删除,保存后,再撤销回来,然后reimport。网上很多方案都是这样。

其实这个红线是不影响项目运行的,也可以选择不理睬。

 

6、vs code中启动报错(6 errors...),npm install不好使可能由于node_modules文件夹导致的:

 

 

7、java大数据量使用list存入数据库内存溢出--分批添加数据(每100条),需要清空listlist.clear())

 

csvfilediscoveryassets.add(discoveryasset);
   alllength++;
   int insertlength = csvfilediscoveryassets.size(); //数值最大为100;
   if(insertlength == 100) {
      //未超过100条数据,将数据存储到list;
      // 批量添加;
      this.batchinsert(csvfilediscoveryassets);
      csvfilediscoveryassets.clear();
   }else if(alllength % 100 == insertlength){
      this.batchinsert(csvfilediscoveryassets);
   }

 

8、模糊查询在mybatis配置文件xml中的写法:

 

<select id="test1" parametertype="java.util.map" resulttype="java.util.map">

select * from e_user 

<where>

1=1

<if test="user_name!=null and user_name!='' ">

and user_name = #{map.username,jdbctype=varcher}

</if>

<if test=”cuid!=null and cuid!=’’”>

and cuid like concat (‘%’,#{map.cuid},’%’)

</where>

</select>

 

9、

10、get put 和post请求区别:

get参数通过url传递,一般用于查询

put如果两个请求相同,后一个覆盖前一个,一般用于修改

post后一个请求不会覆盖前一个,放在requestbody(请求体)中,一般用于增加和删除

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网