|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="upload_record">
|
|
|
+ <div class="upload_infor">
|
|
|
<form>
|
|
|
<div class="dataName">
|
|
|
<span>资料名称</span><input type="text" class="inputStyle focusStyle" v-model="inforName" @focus="hideTip" @blur="checkName()">
|
|
|
@@ -27,10 +27,10 @@
|
|
|
<p>权限设置</p>
|
|
|
<div class="addByArea">
|
|
|
<span>按区域添加</span>
|
|
|
- <div v-for="(area, index) in areaList" :key="index">
|
|
|
- <input type="checkbox" value=""><span>{{area}}</span>
|
|
|
+ <div v-for="(item, index) in areaList" :key="index">
|
|
|
+ <input type="checkbox" :value="item.sign" v-model="checkedBoxList"><span>{{item.area}}</span>
|
|
|
</div>
|
|
|
- <button @click="addByArea">添加</button>
|
|
|
+ <button @click.prevent="addByArea">添加</button>
|
|
|
</div>
|
|
|
<div class="addByCustomize">
|
|
|
<span>自定义添加</span>
|
|
|
@@ -39,8 +39,8 @@
|
|
|
<option value="BMW"/>
|
|
|
<option value="Ford"/>
|
|
|
<option value="Volvo"/>
|
|
|
- </datalist>
|
|
|
- <button>添加</button>
|
|
|
+ </datalist>
|
|
|
+ <button @click.prevent="addBySelf">添加</button>
|
|
|
</div>
|
|
|
<div class="addByGroup">
|
|
|
<span>按小组添加</span>
|
|
|
@@ -56,7 +56,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <button>添加</button>
|
|
|
+ <button @click.prevent="addByGroup">添加</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
@@ -85,7 +85,8 @@
|
|
|
</div>
|
|
|
<div class="uploadFile">
|
|
|
<p>附件</p>
|
|
|
- <input type="file" name="fileName" id="fileInput">
|
|
|
+ <p class="fileDes">{{fileDes}}</p>
|
|
|
+ <label for="fileInput" @change="getFileInfo">导入<input type="file" name="fileName" id="fileInput"></label>
|
|
|
</div>
|
|
|
<button @click="submit" class="submitBtn">提交</button>
|
|
|
</div>
|
|
|
@@ -125,9 +126,12 @@ export default {
|
|
|
inforDes: '',
|
|
|
materialTime: '',
|
|
|
scope: '',
|
|
|
+ checkedBoxList: [], // 多选框选中的值
|
|
|
addByCustomize: '',
|
|
|
+ addGroupList: [], // 添加的小组
|
|
|
addFlag: [true, true, true, true, true, true], // 长度等于groupList.length
|
|
|
optionFlag: false, // 是否展示按小组添加的选择栏
|
|
|
+ fileDes: '', // 上传的文件名
|
|
|
// 表格配置
|
|
|
sum: 240, // 一共有多少条数据
|
|
|
pageSize: 20, // 每页展示的数据
|
|
|
@@ -176,7 +180,11 @@ export default {
|
|
|
},
|
|
|
// 点击按区域添加button
|
|
|
addByArea: function() {
|
|
|
- console.log()
|
|
|
+ console.log(this.checkedBoxList);
|
|
|
+ },
|
|
|
+ // 自定义添加
|
|
|
+ addBySelf: function() {
|
|
|
+ console.log(this.addByCustomize);
|
|
|
},
|
|
|
// 按小组添加,增加小组
|
|
|
addGroup: function(index) {
|
|
|
@@ -189,6 +197,16 @@ export default {
|
|
|
this.addFlag.splice(index, 1, true);
|
|
|
// 删除数据
|
|
|
},
|
|
|
+ // 点击按按小组添加按钮
|
|
|
+ addByGroup: function() {
|
|
|
+ this.addFlag.forEach((item, index) => {
|
|
|
+ if(!item) {
|
|
|
+ this.addGroupList.push(this.groupList[index]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(JSON.parse(JSON.stringify(this.addGroupList)));
|
|
|
+ this.optionFlag = false;
|
|
|
+ },
|
|
|
// 筛选
|
|
|
changeIcon: function(i) {
|
|
|
this.imgFlag.splice(i,1,!this.imgFlag[i]);
|
|
|
@@ -240,6 +258,7 @@ export default {
|
|
|
console.log(this.tableData);
|
|
|
const file = document.getElementById('fileInput').value;
|
|
|
console.log(file);
|
|
|
+ // console.log(document.getElementById('fileInput').files[0].name);
|
|
|
}
|
|
|
},
|
|
|
// 接口请求
|
|
|
@@ -257,13 +276,18 @@ export default {
|
|
|
// })
|
|
|
// console.log(this.inforName, this.inforDes, this.materialTime, this.scope, this.addByCustomize, File.size);
|
|
|
// console.log(FileList.);
|
|
|
+ },
|
|
|
+ // 获取文件名
|
|
|
+ getFileInfo: function() {
|
|
|
+ this.fileDes = document.getElementById('fileInput').files[0].name
|
|
|
+ console.log(this.fileDes);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
-.upload_record{
|
|
|
+.upload_infor{
|
|
|
form{
|
|
|
border: 1px solid #ccc;
|
|
|
padding: 10px;
|
|
|
@@ -417,9 +441,21 @@ export default {
|
|
|
height: 20px;
|
|
|
line-height: 20px;
|
|
|
}
|
|
|
- input{
|
|
|
+ .fileDes{
|
|
|
+ width: 100px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ label{
|
|
|
height: 30px;
|
|
|
line-height: 30px;
|
|
|
+ width: 56px;
|
|
|
+ background-color: #0056a0;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ input{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.submitBtn{
|