|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div id="chapterEdit">
|
|
|
- <div class="boxWidth">
|
|
|
- <el-form
|
|
|
- label-position="right"
|
|
|
- label-width="120px"
|
|
|
- :model="listData"
|
|
|
- :rules="rules"
|
|
|
- ref="listData"
|
|
|
- >
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :model="listData"
|
|
|
+ :rules="rules"
|
|
|
+ ref="listData"
|
|
|
+ >
|
|
|
+ <div class="boxWidth">
|
|
|
<el-form-item label="适用业务层级">
|
|
|
<el-select
|
|
|
v-model="eduType"
|
|
@@ -173,101 +173,104 @@
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="管理节">
|
|
|
- <div class="dis_plays">
|
|
|
- <div>
|
|
|
- <el-button size="small" @click="openBoxs">添加节</el-button>
|
|
|
- </div>
|
|
|
- <div style="color: #f56c6c">
|
|
|
- <span style="margin-right: 10px"
|
|
|
- >节总数:{{ tableData.length }}</span
|
|
|
- >
|
|
|
- <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="管理节">
|
|
|
+ <div class="dis_plays">
|
|
|
+ <div>
|
|
|
+ <el-button size="small" @click="openBoxs">调用已有数据</el-button>
|
|
|
+ <el-button size="small" type="success" @click="dialogDR = true"
|
|
|
+ >Excel批量新增</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- :header-cell-style="{
|
|
|
- 'background-color': '#eee',
|
|
|
- padding: '8px',
|
|
|
- color: '#333',
|
|
|
- }"
|
|
|
- :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- v-for="(item, index) in tableSet"
|
|
|
- :width="item.width"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- header-align="center"
|
|
|
- :sortable="item.prop === 'sort'"
|
|
|
- sort-by="sort"
|
|
|
- :prop="item.prop"
|
|
|
+ <div style="color: #f56c6c">
|
|
|
+ <span style="margin-right: 10px"
|
|
|
+ >节总数:{{ tableData.length }}</span
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="item.scope === 'types'">{{
|
|
|
+ <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ :header-cell-style="{
|
|
|
+ 'background-color': '#eee',
|
|
|
+ padding: '8px',
|
|
|
+ color: '#333',
|
|
|
+ }"
|
|
|
+ :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in tableSet"
|
|
|
+ :width="item.width"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ header-align="center"
|
|
|
+ :sortable="item.prop === 'sort'"
|
|
|
+ sort-by="sort"
|
|
|
+ :prop="item.prop"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="item.scope === 'types'">{{
|
|
|
+ scope.row[item.prop] === 1
|
|
|
+ ? "录播"
|
|
|
+ : scope.row[item.prop] === 2
|
|
|
+ ? "直播"
|
|
|
+ : scope.row[item.prop] === 3
|
|
|
+ ? "回放"
|
|
|
+ : "未知"
|
|
|
+ }}</span>
|
|
|
+ <span v-else-if="item.scope === 'Status'">
|
|
|
+ {{
|
|
|
scope.row[item.prop] === 1
|
|
|
- ? "录播"
|
|
|
- : scope.row[item.prop] === 2
|
|
|
- ? "直播"
|
|
|
- : scope.row[item.prop] === 3
|
|
|
- ? "回放"
|
|
|
+ ? "发布"
|
|
|
+ : scope.row[item.prop] === 0
|
|
|
+ ? "未发布"
|
|
|
: "未知"
|
|
|
- }}</span>
|
|
|
- <span v-else-if="item.scope === 'Status'">
|
|
|
- {{
|
|
|
- scope.row[item.prop] === 1
|
|
|
- ? "发布"
|
|
|
- : scope.row[item.prop] === 0
|
|
|
- ? "未发布"
|
|
|
- : "未知"
|
|
|
- }}
|
|
|
- </span>
|
|
|
- <div v-else-if="item.scope === 'inputs'">
|
|
|
- <el-input-number
|
|
|
- style="width: 50px"
|
|
|
- size="small"
|
|
|
- :controls="false"
|
|
|
- v-model="scope.row[item.prop]"
|
|
|
- controls-position="right"
|
|
|
- :min="0"
|
|
|
- ></el-input-number>
|
|
|
- </div>
|
|
|
- <span v-else>{{ scope.row[item.prop] }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- fixed="right"
|
|
|
- width="100px"
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ <div v-else-if="item.scope === 'inputs'">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 50px"
|
|
|
+ size="small"
|
|
|
+ :controls="false"
|
|
|
+ v-model="scope.row[item.prop]"
|
|
|
+ controls-position="right"
|
|
|
+ :min="0"
|
|
|
+ ></el-input-number>
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ scope.row[item.prop] }}</span></template
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="delList(scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="backPage">取消</el-button>
|
|
|
- <el-button
|
|
|
- :loading="disabledBtn"
|
|
|
- type="primary"
|
|
|
- @click="submit('listData')"
|
|
|
- :disabled="!noStudent"
|
|
|
- >确定</el-button
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ width="100px"
|
|
|
>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="delList(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="backPage">取消</el-button>
|
|
|
+ <el-button
|
|
|
+ :loading="disabledBtn"
|
|
|
+ type="primary"
|
|
|
+ @click="submit('listData')"
|
|
|
+ :disabled="!noStudent"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<el-dialog
|
|
|
:visible.sync="dialogVisible"
|
|
|
- width="800px"
|
|
|
+ width="1000px"
|
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
@@ -361,10 +364,94 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogDR"
|
|
|
+ width="660px"
|
|
|
+ :show-close="false"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div slot="title" class="hearders">
|
|
|
+ <div class="leftTitle">导入</div>
|
|
|
+ <div class="rightBoxs">
|
|
|
+ <img
|
|
|
+ src="@/assets/images/Close@2x.png"
|
|
|
+ alt=""
|
|
|
+ @click="dialogDR = false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="swq">
|
|
|
+ <img
|
|
|
+ style="width: 182px; height: 168px"
|
|
|
+ src="@/assets/images/dr.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div style="padding-left: 100px">
|
|
|
+ <p>第一步:下载导入模板</p>
|
|
|
+ <p style="padding-left: 50px">
|
|
|
+ <i class="el-icon-upload"></i
|
|
|
+ ><span class="dowmStys" @click="getDowm">下载模板</span>
|
|
|
+ </p>
|
|
|
+ <p>第二步:(批量新增):点击“上传Excel”完成导入</p>
|
|
|
+ <label
|
|
|
+ for="mobles"
|
|
|
+ class="el-button el-button--primary"
|
|
|
+ style="margin-left: 50px; padding: 10px 20px"
|
|
|
+ >上传Excel</label
|
|
|
+ ><input
|
|
|
+ style="display: none"
|
|
|
+ type="file"
|
|
|
+ id="mobles"
|
|
|
+ ref="input1"
|
|
|
+ @change="importMobleadd"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogDR = false">取消</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="submitChecksDR">确定</el-button> -->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="dialogERROR"
|
|
|
+ width="660px"
|
|
|
+ :show-close="false"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div slot="title" class="hearders">
|
|
|
+ <div class="leftTitle">提示</div>
|
|
|
+ <div class="rightBoxs">
|
|
|
+ <img
|
|
|
+ src="@/assets/images/Close@2x.png"
|
|
|
+ alt=""
|
|
|
+ @click="dialogERROR = false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <h4 style="margin-top: 0px; font-weight: bold; text-align: center">
|
|
|
+ 导入失败原因
|
|
|
+ </h4>
|
|
|
+ <el-input
|
|
|
+ readonly
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 6, maxRows: 24 }"
|
|
|
+ v-model="errorData"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogERROR = false">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import * as baseUrls from "@/utils/request.js";
|
|
|
import searchBoxNew from "@/components/searchBoxNew";
|
|
|
import pagination from "@/components/pagination";
|
|
|
export default {
|
|
@@ -372,6 +459,9 @@ export default {
|
|
|
name: "ChapterEdit",
|
|
|
data() {
|
|
|
return {
|
|
|
+ dialogDR: false,
|
|
|
+ errorData: "", //导入错误原因
|
|
|
+ dialogERROR: false,
|
|
|
disabledBtn: false,
|
|
|
isIndeterminate: false,
|
|
|
checkAll: false,
|
|
@@ -501,6 +591,105 @@ export default {
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 下载Excel模板
|
|
|
+ */
|
|
|
+ getDowm() {
|
|
|
+ let url =
|
|
|
+ baseUrls.BASE_IMG_URL + "/oss/images/file/20220304/1646382321115.xlsx";
|
|
|
+ let link = document.createElement("a");
|
|
|
+ let fileName = "导入模板" + ".xlsx";
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.href = url;
|
|
|
+ link.dowmload = fileName;
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Object} e
|
|
|
+ * @remards 导入逻辑
|
|
|
+ */
|
|
|
+ importMobleadd(e) {
|
|
|
+ var self = this;
|
|
|
+ var file = e.target.files[0];
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file);
|
|
|
+ this.$api
|
|
|
+ .drCourseSectionimportData(formData)
|
|
|
+ .then(async (res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (!res.data.errorLog) {
|
|
|
+ await this.awaitGetFestivalList(res.data.importNo, 1)
|
|
|
+ .then((result) => {
|
|
|
+ self.dialogDR = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ e.target.value = "";
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ await this.awaitGetFestivalList(res.data.importNo, 2)
|
|
|
+ .then((result) => {
|
|
|
+ let ary = res.data.errorLog.split("\r\n");
|
|
|
+ ary = ary
|
|
|
+ .filter((item) => {
|
|
|
+ return item.length > 0;
|
|
|
+ })
|
|
|
+ .reverse();
|
|
|
+ self.$message({
|
|
|
+ message: `${ary.length}条数据导入失败,请查看失败原因`,
|
|
|
+ customClass: "myMessageClass",
|
|
|
+ });
|
|
|
+ ary = ary.join("\r\n");
|
|
|
+ self.errorData = ary;
|
|
|
+ self.dialogERROR = true;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ e.target.value = "";
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ e.target.value = "";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Strings} ids 查询编码
|
|
|
+ * @param {Number} type 1为成功2为失败
|
|
|
+ * @remards 失败时也需查询是否有成功的数据导入数据库,如存在 则加列队列同时提示
|
|
|
+ */
|
|
|
+ awaitGetFestivalList(ids, type) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$api
|
|
|
+ .inquireCourseSection({ importNo: ids })
|
|
|
+ .then((res) => {
|
|
|
+ if (type === 2 && res.rows.length) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: `成功导入${res.rows.length}条数据,`,
|
|
|
+ customClass: "myMessageClass",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (res.rows.length) {
|
|
|
+ this.activeLists = res.rows;
|
|
|
+ if (type === 1) {
|
|
|
+ this.submitForm();
|
|
|
+ } else {
|
|
|
+ this.submitForm(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ reject();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 科目复选框发生变化时触发
|
|
|
+ */
|
|
|
handleCheckedCitiesChange() {
|
|
|
let nid = this.newSujectOption.map((item) => {
|
|
|
return item.newId;
|
|
@@ -509,6 +698,11 @@ export default {
|
|
|
this.isIndeterminate =
|
|
|
this.sujectArray.length > 0 && this.sujectArray.length < nid.length;
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Arrays} arr
|
|
|
+ * @remards 数据去重
|
|
|
+ */
|
|
|
setFunc(arr) {
|
|
|
var arrays = [];
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -518,6 +712,11 @@ export default {
|
|
|
}
|
|
|
return arrays;
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Arrays} val 复选框内容
|
|
|
+ * @remards 科目复选框全选按钮触发
|
|
|
+ */
|
|
|
handleCheckAllChange(val) {
|
|
|
if (val) {
|
|
|
let nid = this.newSujectOption.map((item) => {
|
|
@@ -540,11 +739,17 @@ export default {
|
|
|
this.isIndeterminate = false;
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 点击科目按钮 判断是否选中了业务层级
|
|
|
+ */
|
|
|
getMessage() {
|
|
|
if (!this.courType) {
|
|
|
this.$message.warning("请先选择业务层级");
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 调用已有数据触发
|
|
|
+ */
|
|
|
openBoxs() {
|
|
|
var self = this;
|
|
|
this.$api.inquireCourseSection(this.formData).then((res) => {
|
|
@@ -561,15 +766,21 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 初始化获取该章管理节数据
|
|
|
+ */
|
|
|
getInfosList() {
|
|
|
this.$api
|
|
|
.inquireCoursechaptersectionlist(this.$route.query.id)
|
|
|
.then((result) => {
|
|
|
- // this.numberAll = result.total;
|
|
|
- // this.minTimeAll = result.timeTotal;
|
|
|
this.tableData = result.data;
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Number} int
|
|
|
+ * @remards 搜索节列表
|
|
|
+ */
|
|
|
getInfos(int) {
|
|
|
this.loading = true;
|
|
|
if (int === 1) {
|
|
@@ -592,9 +803,15 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 重置节搜索
|
|
|
+ */
|
|
|
init() {
|
|
|
this.getInfos(2);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 初始调用数据
|
|
|
+ */
|
|
|
search() {
|
|
|
this.$api
|
|
|
.obtainCoursechapter(this.$route.query.id)
|
|
@@ -616,9 +833,15 @@ export default {
|
|
|
this.$modal.closeLoading();
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 删除封面
|
|
|
+ */
|
|
|
clearImgs() {
|
|
|
this.listData.coverUrl = "";
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 转换业务层级-科目选中以及展示逻辑
|
|
|
+ */
|
|
|
changeTypes() {
|
|
|
var self = this;
|
|
|
var arrays = [];
|
|
@@ -648,9 +871,15 @@ export default {
|
|
|
});
|
|
|
this.newSujectApis = arrays;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 业务层级展开or关闭
|
|
|
+ */
|
|
|
changeType() {
|
|
|
this.changeHeight = !this.changeHeight;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 科目框确定按钮触发
|
|
|
+ */
|
|
|
submitSujectArray() {
|
|
|
var self = this;
|
|
|
this.sujectApis = this.sujectApis.filter((item, index) => {
|
|
@@ -661,6 +890,9 @@ export default {
|
|
|
}
|
|
|
this.$refs.popovers.doClose();
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 科目框显示触发函数
|
|
|
+ */
|
|
|
showHandle() {
|
|
|
var array = [];
|
|
|
for (let i = 0; i < this.sujectApis.length; i++) {
|
|
@@ -681,7 +913,13 @@ export default {
|
|
|
});
|
|
|
this.handleCheckedCitiesChange();
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 科目框隐藏触发函数
|
|
|
+ */
|
|
|
hideHandle() {},
|
|
|
+ /**
|
|
|
+ * 初始获取基本select参数
|
|
|
+ */
|
|
|
getDict() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
|
|
@@ -707,6 +945,9 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 改变教育类型触发函数
|
|
|
+ */
|
|
|
changeEduType() {
|
|
|
if (!(this.courType === undefined || this.courType === "")) {
|
|
|
this.courType = "";
|
|
@@ -719,6 +960,9 @@ export default {
|
|
|
});
|
|
|
this.newCourTypeOptions = arrays;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 改变业务层级触发函数
|
|
|
+ */
|
|
|
changecourseType() {
|
|
|
this.newCourTypeOptions.map((item, index) => {
|
|
|
if (item.id === this.courType) {
|
|
@@ -741,6 +985,11 @@ export default {
|
|
|
this.newCourTypeOptions = arrays;
|
|
|
this.$refs.popovers.doClose();
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Strings} formName 表单名称
|
|
|
+ * @remards 表单验证
|
|
|
+ */
|
|
|
submit(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -771,6 +1020,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 提交表单数据
|
|
|
+ */
|
|
|
async rulesTableSumbit() {
|
|
|
this.disabledBtn = true;
|
|
|
var sectionIdList = [];
|
|
@@ -808,6 +1060,9 @@ export default {
|
|
|
this.disabledBtn = false;
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 关闭该页面
|
|
|
+ */
|
|
|
backPage() {
|
|
|
this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
|
|
|
this.$router.push({
|
|
@@ -815,9 +1070,17 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Number} index 业务层级-科目的索引
|
|
|
+ * @remards 删除该科目
|
|
|
+ */
|
|
|
closeType(index) {
|
|
|
this.sujectApis.splice(index, 1);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 上传封面
|
|
|
+ */
|
|
|
getImgFile() {
|
|
|
var self = this;
|
|
|
var file = self.$refs.file.files[0];
|
|
@@ -844,18 +1107,38 @@ export default {
|
|
|
self.listData.coverUrl = res;
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @param {Number} v 页量
|
|
|
+ * @remards
|
|
|
+ * 节列表页量触发
|
|
|
+ */
|
|
|
handleSizeChange(v) {
|
|
|
this.formData.pageSize = v;
|
|
|
this.formData.pageNum = 1;
|
|
|
this.getInfos();
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Number} v 页码
|
|
|
+ * @remards 节列表页码触发
|
|
|
+ */
|
|
|
handleCurrentChange(v) {
|
|
|
this.formData.pageNum = v;
|
|
|
this.getInfos();
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Arrays} value 节选中列表
|
|
|
+ * @remards 节全选触发
|
|
|
+ */
|
|
|
selectAll(value) {
|
|
|
this.activeLists = value;
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Arrays} value 节选中列表
|
|
|
+ * @remards 节单个选中触发
|
|
|
+ */
|
|
|
select(value) {
|
|
|
this.activeLists = value;
|
|
|
},
|
|
@@ -869,7 +1152,12 @@ export default {
|
|
|
getRowKeys(row) {
|
|
|
return row.sectionId;
|
|
|
},
|
|
|
- submitForm() {
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Number} int 导入失败标识
|
|
|
+ * @remards 合并且排列节列表数据
|
|
|
+ */
|
|
|
+ submitForm(int) {
|
|
|
if (this.activeLists.length === 0) {
|
|
|
this.dialogVisible = false;
|
|
|
return;
|
|
@@ -891,9 +1179,20 @@ export default {
|
|
|
}
|
|
|
this.tableData = this.tableData.concat(this.activeLists);
|
|
|
this.dialogVisible = false;
|
|
|
- this.$message.success("添加成功");
|
|
|
+ if (!int) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: `添加成功`,
|
|
|
+ customClass: "myMessageClass",
|
|
|
+ });
|
|
|
+ }
|
|
|
this.activeLists = [];
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Object} item 当前点击的节数据
|
|
|
+ * @remards 删除节触发
|
|
|
+ */
|
|
|
delList(item) {
|
|
|
this.tableData.map((items, indexs) => {
|
|
|
if (items.sectionId === item.sectionId) {
|
|
@@ -907,6 +1206,14 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
+.swq {
|
|
|
+ text-align: center;
|
|
|
+ border-bottom: 1px solid #eee;
|
|
|
+}
|
|
|
+.dowmStys {
|
|
|
+ color: blue;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
.boxWidth {
|
|
|
width: 800px;
|
|
|
}
|