|
@@ -108,7 +108,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="讲义文件">
|
|
|
<div class="handoutList">
|
|
|
- <label for="uplose"><span style="color: blue">添加pdf</span></label>
|
|
|
+ <label for="uplose"><span class="primary_btn">添加pdf</span></label>
|
|
|
<input
|
|
|
ref="file"
|
|
|
type="file"
|
|
@@ -118,24 +118,19 @@
|
|
|
/>
|
|
|
<span style="margin-left: 10px"
|
|
|
>注:只能上传PDF文件,且不超过100MB</span
|
|
|
- ><el-button
|
|
|
- v-if="fileList.length > 1"
|
|
|
- style="margin-left: 10px"
|
|
|
- size="mini"
|
|
|
- @click="sortList"
|
|
|
- type="success"
|
|
|
- >排序</el-button
|
|
|
>
|
|
|
<ul>
|
|
|
<li v-for="(item, index) in fileList" :key="index">
|
|
|
<el-input-number
|
|
|
- style="width: 40px; margin-right: 10px"
|
|
|
+ style="width: 60px; margin-right: 10px"
|
|
|
size="mini"
|
|
|
:precision="0"
|
|
|
v-model="item.sort"
|
|
|
:min="0"
|
|
|
+ :max="999"
|
|
|
label="排序"
|
|
|
:controls="false"
|
|
|
+ @blur="sortList"
|
|
|
></el-input-number>
|
|
|
<a
|
|
|
:href="
|
|
@@ -170,8 +165,9 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button @click="backPage">取消</el-button>
|
|
|
+ <el-button @click="backPage" size="mini">取消</el-button>
|
|
|
<el-button
|
|
|
+ size="mini"
|
|
|
type="primary"
|
|
|
@click="submit('listData')"
|
|
|
:loading="disabledBtn"
|
|
@@ -525,7 +521,7 @@ export default {
|
|
|
closeType(index) {
|
|
|
this.sujectApis.splice(index, 1);
|
|
|
},
|
|
|
- getImgFile() {
|
|
|
+ getImgFile(e) {
|
|
|
var self = this;
|
|
|
var file = self.$refs.file.files[0];
|
|
|
if (file === undefined) {
|
|
@@ -551,12 +547,19 @@ export default {
|
|
|
urlName: file.name,
|
|
|
sort: self.backNowMathMax(),
|
|
|
});
|
|
|
+ e.target.value = "";
|
|
|
},
|
|
|
|
|
|
//返回当前数组sort最大值+1,用于自动sort排序
|
|
|
backNowMathMax() {
|
|
|
if (this.fileList.length) {
|
|
|
- let list = this.fileList.map((item) => Number(item.sort));
|
|
|
+ let list = this.fileList.map((item) => {
|
|
|
+ if (item.sort >= 0) {
|
|
|
+ return Number(item.sort);
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
return Math.max(...list) + 1;
|
|
|
} else {
|
|
|
return 1;
|
|
@@ -619,11 +622,10 @@ export default {
|
|
|
& > li {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- border-bottom: 1px solid #666;
|
|
|
margin-bottom: 6px;
|
|
|
img {
|
|
|
- height: 50px;
|
|
|
- width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ width: 30px;
|
|
|
cursor: pointer;
|
|
|
transition: all 0.3s;
|
|
|
margin-right: 10px;
|
|
@@ -634,4 +636,35 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.primary_btn {
|
|
|
+ display: inline-block;
|
|
|
+ line-height: 1;
|
|
|
+ white-space: nowrap;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #ffffff;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ border-color: #dcdfe6;
|
|
|
+ color: #606266;
|
|
|
+ -webkit-appearance: none;
|
|
|
+ text-align: center;
|
|
|
+ -webkit-box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
+ outline: none;
|
|
|
+ margin: 0;
|
|
|
+ -webkit-transition: 0.1s;
|
|
|
+ transition: 0.1s;
|
|
|
+ font-weight: 400;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ padding: 12px 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 7px 15px;
|
|
|
+ font-size: 12px;
|
|
|
+ border-radius: 3px;
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #1890ff;
|
|
|
+ border-color: #1890ff;
|
|
|
+}
|
|
|
</style>
|