|
|
@@ -1,8 +1,9 @@
|
|
|
<template>
|
|
|
<div class="upload_record">
|
|
|
<form>
|
|
|
- <div>
|
|
|
- <span>资料名称</span><input type="text" class="inputStyle focusStyle" v-model="inforName">
|
|
|
+ <div class="dataName">
|
|
|
+ <span>资料名称</span><input type="text" class="inputStyle focusStyle" v-model="inforName" @focus="hideTip" @blur="checkName()">
|
|
|
+ <p v-show="tipFlag">资料名称不能重复,请重新输入</p>
|
|
|
</div>
|
|
|
<div class="inforDes">
|
|
|
<span>资料描述</span><textarea name="inforDes" cols="40" rows="4" class="focusStyle" v-model="inforDes"></textarea>
|
|
|
@@ -11,18 +12,18 @@
|
|
|
<p>选择类型</p>
|
|
|
<div>
|
|
|
<span>素材时间</span>
|
|
|
- <select name="materialTime" class="selectStyle" v-model="materialTime">
|
|
|
- <option>请选择</option>
|
|
|
+ <select name="materialTime" class="selectStyle" v-model="materialTime" autocomplete="off">
|
|
|
+ <option value="" selected>请选择</option>
|
|
|
<option v-for="(time, index) in materialTimeList" :key="index" :value="time">{{time}}</option>
|
|
|
</select>
|
|
|
<span>经销商范围</span>
|
|
|
- <select name="" id="" class="selectStyle" v-model="range">
|
|
|
- <option>请选择</option>
|
|
|
- <option v-for="(range, index) in rangeList" :key="index" :value="range">{{range}}</option>
|
|
|
+ <select class="selectStyle" v-model="range" autocomplete="off">
|
|
|
+ <option value="" selected>共通</option>
|
|
|
+ <option value="part">部分</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div v-show="isShow">
|
|
|
<p>权限设置</p>
|
|
|
<div class="addByArea">
|
|
|
<span>按区域添加</span>
|
|
|
@@ -33,15 +34,28 @@
|
|
|
</div>
|
|
|
<div class="addByCustomize">
|
|
|
<span>自定义添加</span>
|
|
|
- <input type="text" class="inputStyle focusStyle" v-model="addByCustomize">
|
|
|
+ <input id="drl" list="drls" class="inputStyle focusStyle" v-model="addByCustomize"/>
|
|
|
+ <datalist id="drls" value='12'>
|
|
|
+ <option value="BMW"/>
|
|
|
+ <option value="Ford"/>
|
|
|
+ <option value="Volvo"/>
|
|
|
+ </datalist>
|
|
|
<button>添加</button>
|
|
|
</div>
|
|
|
<div class="addByGroup">
|
|
|
<span>按小组添加</span>
|
|
|
- <select name="" id="">
|
|
|
- <option>请选择</option>
|
|
|
- <option v-for="(group, index) in groupList" :key="index" :value="group">{{group}}</option>
|
|
|
- </select>
|
|
|
+ <div class="selectBox">
|
|
|
+ <img src="../../img/select.png" @click="showOption">
|
|
|
+ <div class="optionBox" v-if="optionFlag">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item, index) in groupList" :key="index">
|
|
|
+ <p>{{item}}</p>
|
|
|
+ <img src="../../img/add.png" v-if="addFlag[index]" @click="addGroup(index)">
|
|
|
+ <img src="../../img/delete.png" v-else @click="deleteGroup(index)">
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<button>添加</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -55,8 +69,10 @@
|
|
|
:tableHeader='tableHeader'
|
|
|
:tableData='tableData'
|
|
|
:tableHeadStyle='tableHeadStyle'
|
|
|
- :operation='operation'
|
|
|
:discolor='discolor'
|
|
|
+ @change_icon='changeIcon'
|
|
|
+ :operationStyle='operationStyle'
|
|
|
+ :imgFlag='imgFlag'
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="page">
|
|
|
@@ -72,14 +88,15 @@
|
|
|
<input type="file" :v-model="fileValue" name="fileName" @change='changeFile()'>
|
|
|
</div>
|
|
|
<button @click="submit" class="submitBtn">提交</button>
|
|
|
+ <input id="myCar" list="cars" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import UpLoadTable from '../../components/Table';
|
|
|
+import UpLoadTable from '../../components/UploadInforTable';
|
|
|
import Count from '../../components/Count';
|
|
|
import Tablepage from '../../components/TablePage';
|
|
|
-import { AREASLIST, RANGESLIST, MATERIALTIMESLIST, TABLEHEADS,TABLEHEADSTYLES, OPERATIONS, TRSSTYLE, GROUPLISTS } from '../../tableConfig/uploadinfo';
|
|
|
+import { AREASLIST, MATERIALTIMESLIST, TABLEHEADS,TABLEHEADSTYLES, TRSSTYLE, GROUPLISTS, OPERATIONSTYLES } from '../../tableConfig/uploadinfo';
|
|
|
export default {
|
|
|
props:{
|
|
|
isManufacturer: {
|
|
|
@@ -92,14 +109,27 @@ export default {
|
|
|
Count,
|
|
|
Tablepage
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ range(val) {
|
|
|
+ if(val === 'part') {
|
|
|
+ this.isShow = true;
|
|
|
+ } else [
|
|
|
+ this.isShow = false
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ tipFlag: false, // 是否展示提示
|
|
|
+ isShow: false, // 共通时不展示权限设置
|
|
|
inforName: '',
|
|
|
inforDes: '',
|
|
|
materialTime: '',
|
|
|
range: '',
|
|
|
addByCustomize: '',
|
|
|
fileValue: '',
|
|
|
+ addFlag: [true, true, true, true, true, true], // 长度等于groupList.length
|
|
|
+ optionFlag: false, // 是否展示按小组添加的选择栏
|
|
|
// 表格配置
|
|
|
sum: 240, // 一共有多少条数据
|
|
|
pageSize: 20, // 每页展示的数据
|
|
|
@@ -108,11 +138,11 @@ export default {
|
|
|
areaList: AREASLIST, // 按区域添加
|
|
|
groupList: GROUPLISTS, // 按小组添加
|
|
|
materialTimeList: MATERIALTIMESLIST, // 素材时间
|
|
|
- rangeList: RANGESLIST, // 经销商范围
|
|
|
tableHeader: TABLEHEADS, // 表头
|
|
|
tableData: [{name: '北京博瑞',code: 'L020',area: '东区'},{name: 'a',code: 'a',area: 'N'},{name: 'a',code: 'a',area: 'N'}],
|
|
|
tableHeadStyle: TABLEHEADSTYLES, // 表头样式
|
|
|
- operation: OPERATIONS, // 操作
|
|
|
+ operationStyle: OPERATIONSTYLES,// 筛选图片样式
|
|
|
+ imgFlag: new Array(20).fill(true), // 筛选栏用添加图片还是删除图片
|
|
|
trStyle: TRSSTYLE // 表格tr样式
|
|
|
// 文件
|
|
|
}
|
|
|
@@ -127,6 +157,36 @@ export default {
|
|
|
showDetail: () => {
|
|
|
alert('展示详情');
|
|
|
},
|
|
|
+ // 检查名字是否重复
|
|
|
+ checkName: function() {
|
|
|
+ if(this.inforName==1) {
|
|
|
+ this.tipFlag = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 名字不重复,隐藏提示
|
|
|
+ hideTip: function() {
|
|
|
+ this.tipFlag = false;
|
|
|
+ },
|
|
|
+ // 显示隐藏按小组添加下拉框
|
|
|
+ showOption() {
|
|
|
+ this.optionFlag = !this.optionFlag;
|
|
|
+ },
|
|
|
+ // 按小组添加,增加小组
|
|
|
+ addGroup: function(index) {
|
|
|
+ this.addFlag.splice(index, 1, false);
|
|
|
+ console.log( this.addFlag);
|
|
|
+ // 添加数据
|
|
|
+ },
|
|
|
+ // 按小组添加,删除小组
|
|
|
+ deleteGroup: function(index) {
|
|
|
+ this.addFlag.splice(index, 1, true);
|
|
|
+ // 删除数据
|
|
|
+ },
|
|
|
+ // 筛选
|
|
|
+ changeIcon: function(i) {
|
|
|
+ this.imgFlag.splice(i,1,!this.imgFlag[i]);
|
|
|
+ console.log(i)
|
|
|
+ },
|
|
|
// 获取某一页面的数据,展示在表格
|
|
|
changePage: function(page) {
|
|
|
this.currentPage = page;
|
|
|
@@ -179,12 +239,25 @@ export default {
|
|
|
border: 1px solid #ccc;
|
|
|
padding: 10px;
|
|
|
}
|
|
|
+ .dataName{
|
|
|
+ p{
|
|
|
+ margin-left: 65px;
|
|
|
+ font-size: 10px;
|
|
|
+ color: rgb(206, 84, 84);
|
|
|
+ }
|
|
|
+ }
|
|
|
.inforDes{
|
|
|
margin: 10px 0 0 0;
|
|
|
span{
|
|
|
vertical-align: top;
|
|
|
margin-right: 17px;
|
|
|
}
|
|
|
+ textarea{
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ border-radius: 3px;
|
|
|
+ color: #555555;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
.selectType{
|
|
|
margin-top: 10px;
|
|
|
@@ -196,8 +269,12 @@ export default {
|
|
|
.selectStyle{
|
|
|
margin-left: 20px;
|
|
|
margin-right: 20px;
|
|
|
- height: 20px;
|
|
|
- width: 100px;
|
|
|
+ padding: 4px 6px;
|
|
|
+ height: 28px;
|
|
|
+ width: 144px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ color: #555555;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
.addByArea{
|
|
|
margin: 10px 0 0 65px;
|
|
|
@@ -215,6 +292,7 @@ export default {
|
|
|
height: 12px;
|
|
|
vertical-align: middle;
|
|
|
margin-top: -2px;
|
|
|
+ border:1px solid #ccc
|
|
|
}
|
|
|
span{
|
|
|
margin-left: 2px;
|
|
|
@@ -231,13 +309,62 @@ export default {
|
|
|
button{
|
|
|
height: 28px;
|
|
|
}
|
|
|
+ input{
|
|
|
+ // background: url('../../img/search.svg') no-repeat center left;
|
|
|
+ // background-size: 21px 25px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
}
|
|
|
.addByGroup{
|
|
|
margin: 10px 0 0 65px;
|
|
|
- select{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .selectBox{
|
|
|
+ position: relative;
|
|
|
margin-left: 17px;
|
|
|
- width: 172.8px;
|
|
|
- height: 28px;
|
|
|
+ img{
|
|
|
+ width: 144px;
|
|
|
+ height: 28px;
|
|
|
+ &:hover{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .optionBox{
|
|
|
+ position: absolute;
|
|
|
+ top: 28px;
|
|
|
+ left: 0;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ border-top: none;
|
|
|
+ width: 142px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 5px;
|
|
|
+ ul{
|
|
|
+ width: 144px;
|
|
|
+ padding-bottom: 6px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ li{
|
|
|
+ width: 132px;
|
|
|
+ height: 28px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #555555;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-right: 5px;
|
|
|
+ img{
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ &:hover{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
button{
|
|
|
height: 28px;
|
|
|
@@ -272,25 +399,30 @@ export default {
|
|
|
}
|
|
|
.inputStyle{
|
|
|
margin-left: 17px;
|
|
|
- height: 16px;
|
|
|
- line-height: 16px;
|
|
|
+ width: 130px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 18px;
|
|
|
padding: 4px 6px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ color: #555555;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
.focusStyle{
|
|
|
- outline-color: #ccc;
|
|
|
+ border: 1px solid #ccc;
|
|
|
line-height: 20px;
|
|
|
color: #555555;
|
|
|
+ outline: none;
|
|
|
}
|
|
|
.focusStyle:focus{
|
|
|
animation: shadowAni 200ms linear forwards;
|
|
|
}
|
|
|
@keyframes shadowAni{
|
|
|
0%{
|
|
|
- outline-color: #cccccc;
|
|
|
+ border-color: #cccccc;
|
|
|
box-shadow: inset 0px 0px 0 #ccc;
|
|
|
};
|
|
|
100%{
|
|
|
- outline-color: #75b9F0;
|
|
|
+ border-color: #75b9F0;
|
|
|
box-shadow: 0px 0px 10px #75b9F0;
|
|
|
}
|
|
|
}
|