index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. <template>
  2. <div id="moduleManagementAdd">
  3. <div class="boxWidth">
  4. <el-form
  5. label-position="right"
  6. label-width="120px"
  7. :model="listData"
  8. :rules="rules"
  9. ref="listData"
  10. >
  11. <el-form-item label="适用业务层级">
  12. <el-select
  13. v-model="eduType"
  14. placeholder="请选择教育类型"
  15. @change="changeEduType"
  16. >
  17. <el-option
  18. v-for="(item, index) in eduTypeOptions"
  19. :key="index"
  20. :label="item.educationName"
  21. :value="item.id"
  22. >
  23. </el-option>
  24. </el-select>
  25. <el-select
  26. v-model="courType"
  27. placeholder="请选择业务层次"
  28. @change="changecourseType"
  29. >
  30. <el-option
  31. v-for="(item, index) in newCourTypeOptions"
  32. :key="index"
  33. :label="item.projectName + '-' + item.businessName"
  34. :value="item.id"
  35. >
  36. </el-option>
  37. </el-select>
  38. <el-popover
  39. ref="popovers"
  40. placement="bottom"
  41. trigger="click"
  42. @show="showHandle"
  43. @hide="hideHandle"
  44. :disabled="courType ? false : true"
  45. >
  46. <el-checkbox-group v-model="sujectArray" class="checkboxSty">
  47. <el-checkbox
  48. v-for="(item, index) in newSujectOption"
  49. :label="item.newId"
  50. :key="index"
  51. >{{ item.subjectName }}</el-checkbox
  52. >
  53. </el-checkbox-group>
  54. <div style="display: block; text-align: center; margin-top: 10px">
  55. <el-button size="mini" type="primary" @click="submitSujectArray"
  56. >确定</el-button
  57. >
  58. </div>
  59. <el-button
  60. slot="reference"
  61. style="margin-left: 12px"
  62. @click="getMessage"
  63. >请选择科目</el-button
  64. >
  65. </el-popover>
  66. <span style="margin-left: 10px">注:可多选</span>
  67. </el-form-item>
  68. <el-form-item label="">
  69. <div :class="changeHeight ? 'ach' : 'clh'">
  70. <div
  71. v-for="(item, index) in newSujectApis"
  72. :key="index"
  73. class="listBoxStys"
  74. >
  75. {{
  76. item.educationName +
  77. " - " +
  78. item.projectName +
  79. " - " +
  80. item.businessName +
  81. " - " +
  82. item.subjectName
  83. }}
  84. <i class="el-icon-error closeIcons" @click="closeType(index)"></i>
  85. </div>
  86. </div>
  87. <el-button
  88. size="mini"
  89. v-if="newSujectApis.length > 1"
  90. @click="changeType"
  91. >{{ changeHeight ? "展开" : "关闭" }}</el-button
  92. >
  93. </el-form-item>
  94. <el-form-item label="标题前缀" prop="prefixName">
  95. <el-input v-model="listData.prefixName"></el-input>
  96. </el-form-item>
  97. <el-form-item label="模块标题" prop="moduleName">
  98. <el-input v-model="listData.moduleName"></el-input>
  99. </el-form-item>
  100. <el-form-item label="模块封面">
  101. <div class="imgBoxins">
  102. <img :src="$methodsTools.splitImgHost(listData.coverUrl)" alt="" />
  103. <div
  104. class="posimg"
  105. v-if="
  106. listData.coverUrl === null ||
  107. listData.coverUrl === '' ||
  108. listData.coverUrl === undefined
  109. "
  110. >
  111. <label for="uplose">
  112. <i class="el-icon-circle-plus-outline iconStsz"></i
  113. ></label>
  114. <input
  115. ref="file"
  116. type="file"
  117. style="display: none"
  118. id="uplose"
  119. @change="getImgFile"
  120. />
  121. <p>
  122. 注:请上传小于300kb,尺寸为750*440的图片,支持gif、jpg、jpeg、png等类型
  123. </p>
  124. </div>
  125. </div>
  126. <el-button
  127. v-if="
  128. listData.coverUrl !== null &&
  129. listData.coverUrl !== '' &&
  130. listData.coverUrl !== undefined
  131. "
  132. type="danger"
  133. size="mini"
  134. class="margin-top: 20px;"
  135. @click="clearImgs"
  136. >删除</el-button
  137. >
  138. </el-form-item>
  139. <el-form-item label="是否发布" prop="publishStatus">
  140. <el-radio-group v-model="listData.publishStatus">
  141. <el-radio :label="1">是</el-radio>
  142. <el-radio :label="0">否</el-radio>
  143. </el-radio-group>
  144. </el-form-item>
  145. <el-form-item label="管理章">
  146. <div class="dis_plays">
  147. <div>
  148. <el-button size="small" @click="openBoxs">添加章</el-button>
  149. </div>
  150. <div style="color: #f56c6c">
  151. <span style="margin-right: 10px"
  152. >章总数:{{ tableData.length }}</span
  153. >
  154. <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
  155. </div>
  156. </div>
  157. <el-table
  158. :data="tableData"
  159. border
  160. :header-cell-style="{
  161. 'background-color': '#eee',
  162. padding: '8px',
  163. color: '#333',
  164. }"
  165. :default-sort="{ prop: 'sort', order: 'ascending' }"
  166. >
  167. <template v-for="(item, index) in tableSet">
  168. <el-table-column
  169. :width="item.width"
  170. :key="index"
  171. :label="item.label"
  172. align="center"
  173. :show-overflow-tooltip="true"
  174. header-align="center"
  175. :sortable="item.prop === 'sort'"
  176. sort-by="sort"
  177. :prop="item.prop"
  178. >
  179. <template slot-scope="scope">
  180. <span v-if="item.scope === 'types'">{{
  181. scope.row[item.prop] === 1
  182. ? "录播"
  183. : scope.row[item.prop] === 2
  184. ? "直播"
  185. : scope.row[item.prop] === 3
  186. ? "回放"
  187. : "未知"
  188. }}</span>
  189. <span v-else-if="item.scope === 'Status'">
  190. {{
  191. scope.row[item.prop] === 1
  192. ? "发布"
  193. : scope.row[item.prop] === 0
  194. ? "未发布"
  195. : "未知"
  196. }}
  197. </span>
  198. <div v-else-if="item.scope === 'inputs'">
  199. <el-input-number
  200. style="width: 50px"
  201. size="small"
  202. :controls="false"
  203. v-model="scope.row[item.prop]"
  204. controls-position="right"
  205. :min="0"
  206. ></el-input-number>
  207. </div>
  208. <span v-else>{{ scope.row[item.prop] }}</span></template
  209. >
  210. </el-table-column></template
  211. >
  212. <el-table-column
  213. label="操作"
  214. align="center"
  215. fixed="right"
  216. width="100px"
  217. >
  218. <template slot-scope="scope">
  219. <el-button type="text" @click="delList(scope.row)"
  220. >删除</el-button
  221. >
  222. </template>
  223. </el-table-column>
  224. </el-table>
  225. </el-form-item>
  226. <el-form-item>
  227. <el-button @click="backPage">取消</el-button>
  228. <el-button type="primary" @click="submit('listData')">确定</el-button>
  229. </el-form-item>
  230. </el-form>
  231. </div>
  232. <el-dialog
  233. :visible.sync="dialogVisible"
  234. width="800px"
  235. :show-close="false"
  236. :close-on-click-modal="false"
  237. >
  238. <div slot="title" class="hearders">
  239. <div class="leftTitle">添加章</div>
  240. <div class="rightBoxs">
  241. <img
  242. src="@/assets/images/Close@2x.png"
  243. alt=""
  244. @click="dialogVisible = false"
  245. />
  246. </div>
  247. </div>
  248. <search-box-new
  249. ref="searchBox"
  250. :formData="formData"
  251. :formList="formList"
  252. @search="getInfos"
  253. @init="init"
  254. />
  255. <el-table
  256. ref="multipleTable"
  257. :data="boxtableData"
  258. border
  259. @select-all="selectAll"
  260. @select="select"
  261. :row-key="getRowKeys"
  262. :header-cell-style="{
  263. 'background-color': '#eee',
  264. padding: '8px',
  265. color: '#333',
  266. }"
  267. >
  268. <el-table-column
  269. align="center"
  270. type="selection"
  271. width="55"
  272. header-align="center"
  273. :selectable="checkboxT"
  274. :reserve-selection="true"
  275. >
  276. </el-table-column>
  277. <template v-for="(item, index) in tableSet">
  278. <el-table-column
  279. v-if="item.scope !== 'inputs'"
  280. :width="item.width"
  281. :key="index"
  282. :label="item.label"
  283. align="center"
  284. :show-overflow-tooltip="true"
  285. header-align="center"
  286. >
  287. <template slot-scope="scope">
  288. <span v-if="item.scope === 'types'">{{
  289. scope.row[item.prop] === 1
  290. ? "录播"
  291. : scope.row[item.prop] === 2
  292. ? "直播"
  293. : scope.row[item.prop] === 3
  294. ? "回放"
  295. : "未知"
  296. }}</span>
  297. <span v-else-if="item.scope === 'Status'">
  298. {{
  299. scope.row[item.prop] === 1
  300. ? "发布"
  301. : scope.row[item.prop] === 0
  302. ? "未发布"
  303. : "未知"
  304. }}
  305. </span>
  306. <span v-else>{{ scope.row[item.prop] }}</span></template
  307. >
  308. </el-table-column></template
  309. >
  310. </el-table>
  311. <pagination
  312. :total="total"
  313. :pageSize="formData.pageSize"
  314. :currentPage="formData.pageNum"
  315. @handleSizeChange="handleSizeChange"
  316. @handleCurrentChange="handleCurrentChange"
  317. />
  318. <span slot="footer" class="dialog-footer">
  319. <el-button @click="dialogVisible = false">取 消</el-button>
  320. <el-button
  321. type="primary"
  322. :disabled="activeLists.length === 0"
  323. @click="submitForm"
  324. >确 定</el-button
  325. >
  326. </span>
  327. </el-dialog>
  328. </div>
  329. </template>
  330. <script>
  331. import searchBoxNew from "@/components/searchBoxNew";
  332. import pagination from "@/components/pagination";
  333. export default {
  334. components: { searchBoxNew, pagination },
  335. data() {
  336. return {
  337. // 弹窗数据
  338. changeHeight: true,
  339. bfImg: "oss/images/avatar/20211013/1634097664410_1397766697",
  340. listData: {
  341. publishStatus: 1,
  342. recordingUrl: "",
  343. liveUrl: "",
  344. coverUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
  345. },
  346. eduTypeOptions: [], //教育类型数据
  347. projectTypeOptions: [], //项目类型数据
  348. courTypeOptions: [], //业务层次数据
  349. newCourTypeOptions: [], //当前业务层次数据
  350. sujectOption: [], //科目数据
  351. newSujectOption: [], //当前科目数据数据
  352. eduType: "", //当前选中教育类型
  353. courType: "", //当前选中业务层次
  354. sujectApis: [], //当前存在的科目
  355. newSujectApis: [],
  356. sujectArray: [], //选中的科目
  357. //表单验证
  358. rules: {
  359. prefixName: [
  360. { required: true, message: "请输入标题前缀", trigger: "blur" },
  361. ],
  362. moduleName: [
  363. { required: true, message: "请输入节标题", trigger: "blur" },
  364. ],
  365. // liveDuration: [
  366. // { required: true, message: "节时长不能为空" },
  367. // { type: "number", message: "节时长必须为数字值" },
  368. // ],
  369. publishStatus: [
  370. { required: true, message: "请选择是否发布", trigger: "change" },
  371. ],
  372. },
  373. numberAll: 0, //节总数
  374. minTimeAll: 0, //总时长
  375. tableSet: [
  376. { label: "排序", prop: "sort", scope: "inputs", width: "100" },
  377. { label: "章编码", prop: "code" },
  378. { label: "标题前缀", prop: "prefixName", width: "120" },
  379. { label: "章标题", prop: "name" },
  380. {
  381. label: "发布状态",
  382. prop: "publishStatus",
  383. scope: "Status",
  384. width: "120",
  385. },
  386. ],
  387. tableData: [],
  388. dialogVisible: false,
  389. boxtableData: [],
  390. formList: [
  391. {
  392. prop: "educationTypeId",
  393. placeholder: "教育类型",
  394. scope: "educationType",
  395. },
  396. {
  397. prop: "businessId",
  398. placeholder: "业务层次",
  399. scope: "businessLevel",
  400. edu: "educationTypeId",
  401. },
  402. // {
  403. // prop: "publishStatus",
  404. // placeholder: "发布状态",
  405. // scope: "select",
  406. // options: [
  407. // {
  408. // label: "已发布",
  409. // value: 1,
  410. // },
  411. // {
  412. // label: "未发布",
  413. // value: 0,
  414. // },
  415. // ],
  416. // },
  417. {
  418. prop: "key",
  419. placeholder: "请输入章标题/章编码/标题前缀",
  420. },
  421. ],
  422. total: 0, //一共多少条
  423. formData: {
  424. status: 1,
  425. pageSize: 10,
  426. pageNum: 1,
  427. },
  428. disCheckList: [], //已选转禁用复选列表
  429. activeLists: [],
  430. };
  431. },
  432. watch: {
  433. sujectApis: {
  434. immediate: true,
  435. handler(newName, oldName) {
  436. this.changeTypes();
  437. },
  438. },
  439. },
  440. mounted() {
  441. this.getDict();
  442. // this.search();
  443. },
  444. methods: {
  445. getMessage() {
  446. if (!this.courType) {
  447. this.$message.warning("请先选择业务层级");
  448. }
  449. },
  450. openBoxs() {
  451. var self = this;
  452. this.$api
  453. .inquireCourseListchapter({
  454. status: 1,
  455. pageNum: 1,
  456. pageSize: 10,
  457. publishStatus: 1,
  458. })
  459. .then((res) => {
  460. var aList = [];
  461. this.tableData.map((item) => {
  462. aList.push(item.chapterId);
  463. });
  464. this.disCheckList = aList;
  465. this.boxtableData = res.rows;
  466. this.total = res.total;
  467. this.dialogVisible = true;
  468. this.$nextTick(function () {
  469. self.$refs.multipleTable.clearSelection();
  470. });
  471. });
  472. },
  473. getInfosList() {
  474. this.$api
  475. .inquireCourseListmodulechapter({ chapterId: this.$route.query.id })
  476. .then((result) => {
  477. // this.numberAll = result.total;
  478. // this.minTimeAll = result.timeTotal;
  479. this.tableData = result.data;
  480. });
  481. },
  482. init() {
  483. this.getInfos(2);
  484. },
  485. getInfos(int) {
  486. if (int === 1) {
  487. this.formData.pageNum = 1;
  488. }
  489. if (int === 2) {
  490. this.formData = {
  491. status: 1,
  492. pageSize: 10,
  493. pageNum: 1,
  494. publishStatus: 1,
  495. };
  496. }
  497. this.$api.inquireCourseListchapter(this.formData).then((res) => {
  498. this.boxtableData = res.rows;
  499. this.total = res.total;
  500. });
  501. },
  502. search() {
  503. this.$api.obtainCoursemodule(this.$route.query.id).then((res) => {
  504. this.bfImg = res.data.coverUrl;
  505. this.listData = res.data;
  506. this.$api
  507. .obtainCoursechapterbusiness(this.$route.query.id)
  508. .then((result) => {
  509. var arrays = [];
  510. result.data.map((item) => {
  511. arrays.push(item.businessId + "-" + item.subjectId);
  512. });
  513. this.sujectApis = arrays;
  514. this.getInfosList();
  515. });
  516. });
  517. },
  518. clearImgs() {
  519. this.listData.coverUrl = "";
  520. },
  521. changeTypes() {
  522. var self = this;
  523. var arrays = [];
  524. this.sujectApis.map((item, index) => {
  525. this.courTypeOptions.map((items) => {
  526. if (items.id === item.split("-").map(Number)[0]) {
  527. var obj = {
  528. educationTypeId: items.educationId,
  529. educationName: items.educationName,
  530. projectId: items.projectId,
  531. projectName: items.projectName,
  532. businessId: items.id,
  533. businessName: items.businessName,
  534. };
  535. self.sujectOption.map((i) => {
  536. if (
  537. i.id === item.split("-").map(Number)[1] &&
  538. i.courseArrays.indexOf(items.projectId) !== -1
  539. ) {
  540. obj.subjectName = i.subjectName;
  541. obj.subjectId = i.id;
  542. }
  543. });
  544. arrays.push(obj);
  545. }
  546. });
  547. });
  548. this.newSujectApis = arrays;
  549. },
  550. changeType() {
  551. this.changeHeight = !this.changeHeight;
  552. },
  553. submitSujectArray() {
  554. var self = this;
  555. this.sujectApis = this.sujectApis.filter((item, index) => {
  556. return item.split("-").map(Number)[0] !== Number(self.courType);
  557. });
  558. for (let i = 0; i < this.sujectArray.length; i++) {
  559. this.sujectApis.push(this.sujectArray[i]);
  560. }
  561. this.$refs.popovers.doClose();
  562. },
  563. showHandle() {
  564. var array = [];
  565. for (let i = 0; i < this.sujectApis.length; i++) {
  566. if (
  567. this.sujectApis[i].split("-").map(Number)[0] === Number(this.courType)
  568. ) {
  569. array.push(this.sujectApis[i]);
  570. }
  571. }
  572. this.sujectArray = array;
  573. this.newSujectOption.map((item) => {
  574. item.newId = this.courType + "-" + item.id;
  575. });
  576. },
  577. hideHandle() {},
  578. getDict() {
  579. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  580. this.eduTypeOptions = res.rows;
  581. });
  582. this.$api.inquireCourseProjectType({ status: 1 }).then((res) => {
  583. this.projectTypeOptions = res.rows;
  584. });
  585. this.$api.inquirebusinessList({ status: 1 }).then((res) => {
  586. this.courTypeOptions = res.rows;
  587. this.newCourTypeOptions = res.rows;
  588. });
  589. this.$api.inquireCourseSubject({ status: 1 }).then((res) => {
  590. res.rows.map((item, index) => {
  591. var array = [];
  592. item.courseProjectTypes.map((items, indexs) => {
  593. array.push(items.id);
  594. });
  595. item.courseArrays = array;
  596. });
  597. this.sujectOption = res.rows;
  598. });
  599. },
  600. changeEduType() {
  601. if (!(this.courType === undefined || this.courType === "")) {
  602. this.courType = "";
  603. }
  604. var arrays = [];
  605. this.courTypeOptions.map((item) => {
  606. if (item.educationId === this.eduType) {
  607. arrays.push(item);
  608. }
  609. });
  610. this.newCourTypeOptions = arrays;
  611. },
  612. changecourseType() {
  613. this.newCourTypeOptions.map((item, index) => {
  614. if (item.id === this.courType) {
  615. this.eduType = item.educationId;
  616. var array = [];
  617. this.sujectOption.map((items, indexs) => {
  618. if (items.courseArrays.indexOf(item.projectId) !== -1) {
  619. array.push(items);
  620. }
  621. });
  622. this.newSujectOption = array;
  623. }
  624. });
  625. var arrays = [];
  626. this.courTypeOptions.map((item) => {
  627. if (item.educationId === this.eduType) {
  628. arrays.push(item);
  629. }
  630. });
  631. this.newCourTypeOptions = arrays;
  632. this.$refs.popovers.doClose();
  633. },
  634. submit(formName) {
  635. this.$refs[formName].validate((valid) => {
  636. if (valid) {
  637. // if (
  638. // this.listData.coverUrl === "" ||
  639. // this.listData.coverUrl === null ||
  640. // this.listData.coverUrl === undefined
  641. // ) {
  642. // this.$message.error("请上传节封面");
  643. // return false;
  644. // }
  645. for (let i = 0; i < this.tableData.length; i++) {
  646. if (!this.tableData[i].sort && this.tableData[i].sort !== 0) {
  647. this.$message.warning(`管理章第${i + 1}条请输入排序`);
  648. return;
  649. }
  650. }
  651. let arr = this.tableData.map((items) => {
  652. return items.sort;
  653. });
  654. if (new Set(arr).size != arr.length) {
  655. this.$message.warning("排序不允许有重复值");
  656. return
  657. }
  658. this.rulesTableSumbit();
  659. } else {
  660. return false;
  661. }
  662. });
  663. },
  664. async rulesTableSumbit() {
  665. var chapterIdList = [];
  666. this.tableData.map((item) => {
  667. chapterIdList.push({
  668. chapterId: item.chapterId,
  669. sort: Number(item.sort),
  670. });
  671. });
  672. var dataInfos = {
  673. status: 1,
  674. businessList: this.newSujectApis,
  675. chapterIdList: chapterIdList,
  676. coverUrl: this.listData.coverUrl,
  677. moduleName: this.listData.moduleName,
  678. prefixName: this.listData.prefixName,
  679. publishStatus: this.listData.publishStatus,
  680. };
  681. this.$api.addCoursemodule(dataInfos).then((res) => {
  682. this.$message.success("新增成功");
  683. setTimeout(() => {
  684. this.$router.push({
  685. path: "moduleManagement",
  686. });
  687. }, 500);
  688. });
  689. },
  690. backPage() {
  691. this.$router.push({
  692. path: "moduleManagement",
  693. });
  694. },
  695. closeType(index) {
  696. this.sujectApis.splice(index, 1);
  697. },
  698. getImgFile() {
  699. var self = this;
  700. var file = self.$refs.file.files[0];
  701. if (file === undefined) {
  702. self.$set(self.listData, "coverUrl", "");
  703. return;
  704. }
  705. if (file.size > 0.3 * 1024 * 1024) {
  706. self.$message.error("图片不得大于300kb");
  707. return;
  708. }
  709. var type = self.$refs.file.value.toLowerCase().split(".").splice(-1);
  710. if (
  711. type[0] != "jpg" &&
  712. type[0] != "png" &&
  713. type[0] != "jpeg" &&
  714. type[0] != "gif"
  715. ) {
  716. self.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  717. self.$refs.file.value = "";
  718. return;
  719. }
  720. this.$upload.upload(file, 0).then((res) => {
  721. self.listData.coverUrl = res;
  722. });
  723. },
  724. handleSizeChange(v) {
  725. this.formData.pageSize = v;
  726. this.formData.pageNum = 1;
  727. this.getInfos();
  728. },
  729. handleCurrentChange(v) {
  730. this.formData.pageNum = v;
  731. this.getInfos();
  732. },
  733. selectAll(value) {
  734. this.activeLists = value;
  735. },
  736. select(value) {
  737. this.activeLists = value;
  738. },
  739. checkboxT(row, index) {
  740. if (this.disCheckList.indexOf(row.chapterId) !== -1) {
  741. return false;
  742. } else {
  743. return true;
  744. }
  745. },
  746. getRowKeys(row) {
  747. return row.chapterId;
  748. },
  749. submitForm() {
  750. if (this.activeLists.length === 0) {
  751. this.dialogVisible = false;
  752. return;
  753. }
  754. this.tableData = this.tableData.concat(this.activeLists);
  755. this.dialogVisible = false;
  756. this.$message.success("添加成功");
  757. this.activeLists = [];
  758. },
  759. delList(item) {
  760. this.tableData.map((items, indexs) => {
  761. if (items.chapterId === item.chapterId) {
  762. this.tableData.splice(indexs, 1);
  763. this.$message.success("删除成功");
  764. }
  765. });
  766. },
  767. },
  768. };
  769. </script>
  770. <style lang="less" scoped>
  771. .boxWidth {
  772. width: 800px;
  773. }
  774. .numInputs {
  775. width: 150px;
  776. }
  777. .checkboxSty {
  778. max-height: 210px;
  779. overflow: auto;
  780. display: flex;
  781. flex-direction: column;
  782. }
  783. .listBoxStys {
  784. flex-shrink: 0;
  785. padding: 0px 10px;
  786. border-radius: 8px;
  787. border: 1px solid #eee;
  788. margin-right: 10px;
  789. margin-bottom: 6px;
  790. }
  791. .closeIcons {
  792. color: red;
  793. cursor: pointer;
  794. margin-left: 6px;
  795. }
  796. .ach {
  797. display: flex;
  798. align-items: center;
  799. overflow: hidden;
  800. }
  801. .clh {
  802. display: flex;
  803. align-items: center;
  804. flex-wrap: wrap;
  805. }
  806. .imgBoxins {
  807. width: 375px;
  808. height: 220px;
  809. text-align: center;
  810. img {
  811. height: 100%;
  812. }
  813. }
  814. .iconStsz {
  815. font-size: 40px;
  816. color: #67c23a;
  817. cursor: pointer;
  818. }
  819. .dis_plays {
  820. display: flex;
  821. align-items: center;
  822. justify-content: space-between;
  823. margin-bottom: 10px;
  824. }
  825. .comInputsty {
  826. width: 50px;
  827. height: 24px;
  828. text-align: center;
  829. border: none;
  830. }
  831. /deep/.el-button {
  832. border-radius: 8px;
  833. }
  834. /deep/.el-dialog {
  835. border-radius: 8px;
  836. .el-dialog__header {
  837. padding: 0;
  838. .hearders {
  839. height: 40px;
  840. display: flex;
  841. align-items: center;
  842. justify-content: space-between;
  843. padding: 0px 18px 0px 20px;
  844. border-bottom: 1px solid #e2e2e2;
  845. .leftTitle {
  846. font-size: 14px;
  847. font-weight: bold;
  848. color: #2f4378;
  849. }
  850. .rightBoxs {
  851. display: flex;
  852. align-items: center;
  853. img {
  854. width: 14px;
  855. height: 14px;
  856. margin-left: 13px;
  857. cursor: pointer;
  858. }
  859. }
  860. }
  861. }
  862. .el-dialog__footer {
  863. padding: 0;
  864. .dialog-footer {
  865. padding: 0px 40px;
  866. height: 70px;
  867. border-top: 1px solid #e2e2e2;
  868. display: flex;
  869. align-items: center;
  870. justify-content: flex-end;
  871. }
  872. }
  873. }
  874. .imgBox {
  875. width: 100%;
  876. // height: 210px;
  877. border: 1px solid #e2e2e2;
  878. border-radius: 8px;
  879. padding: 8px 8px 3px;
  880. display: flex;
  881. flex-direction: column;
  882. align-items: center;
  883. .imgLabel {
  884. flex: 1;
  885. width: 100%;
  886. border: 1px dotted #e2e2e2;
  887. color: #999;
  888. font-size: 14px;
  889. cursor: pointer;
  890. border-radius: 8px;
  891. .msPhoto {
  892. display: flex;
  893. justify-content: center;
  894. align-items: center;
  895. max-width: 100%;
  896. max-height: 270px;
  897. img {
  898. max-width: 100%;
  899. max-height: 270px;
  900. }
  901. }
  902. .imgbbx {
  903. display: flex;
  904. flex-direction: column;
  905. align-items: center;
  906. justify-content: center;
  907. width: 100%;
  908. height: 100%;
  909. i {
  910. font-weight: bold;
  911. margin: 14px 0;
  912. font-size: 24px;
  913. }
  914. }
  915. }
  916. p {
  917. margin: 5px 0px;
  918. }
  919. }
  920. </style>