index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <div id="chapterVolumeManagement">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. :tableSets="tableSet"
  12. :tableData="tableData"
  13. :navText="navText"
  14. @addClick="addClick"
  15. :loading="loading"
  16. @editInfo="editInfo"
  17. >
  18. <template slot="btn" slot-scope="props">
  19. <el-button type="text" @click="addClick(props.scope.row, 0)"
  20. >修改</el-button
  21. >
  22. <el-button type="text" @click="del(props.scope.row)">删除</el-button>
  23. </template>
  24. </table-list>
  25. <pagination
  26. :total="total"
  27. :pageSize="formData.pageSize"
  28. :currentPage="formData.pageNum"
  29. @handleSizeChange="handleSizeChange"
  30. @handleCurrentChange="handleCurrentChange"
  31. />
  32. </div>
  33. </template>
  34. <script>
  35. import searchBoxNew from "@/components/searchBoxNew";
  36. import tableList from "@/components/tableList";
  37. import pagination from "@/components/pagination";
  38. export default {
  39. components: { searchBoxNew, tableList, pagination },
  40. name: "ChapterVolumeManagement",
  41. data() {
  42. return {
  43. loading: false, //当前表单加载是否加载动画
  44. navText: {
  45. title: "章卷管理",
  46. index: 0,
  47. ch: "条",
  48. num: false,
  49. border: true,
  50. choice: true,
  51. addHide: false,
  52. backFatherBtn: {
  53. status: false,
  54. title: "未定义",
  55. },
  56. },
  57. //搜索
  58. formList: [
  59. {
  60. prop: "educationId",
  61. placeholder: "教育类型",
  62. scope: "educationType",
  63. },
  64. {
  65. prop: "businessId",
  66. placeholder: "业务层次",
  67. scope: "businessLevel",
  68. edu: "educationId",
  69. },
  70. {
  71. prop: "subjectId",
  72. placeholder: "科目",
  73. scope: "sujectType",
  74. edu: "educationId",
  75. },
  76. {
  77. prop: "publishStatus",
  78. placeholder: "发布状态",
  79. scope: "select",
  80. options: [
  81. {
  82. label: "发布",
  83. value: 1,
  84. },
  85. {
  86. label: "未发布",
  87. value: 0,
  88. },
  89. ],
  90. },
  91. {
  92. prop: "prefixName",
  93. placeholder: "请输入标题前缀",
  94. },
  95. {
  96. prop: "name",
  97. placeholder: "请输入章卷标题",
  98. },
  99. ],
  100. formData: {
  101. status: "0,1",
  102. pageSize: 10,
  103. pageNum: 1,
  104. },
  105. // 表单
  106. tableSet: [
  107. {
  108. label: "章卷编码",
  109. prop: "code",
  110. hidden: true,
  111. },
  112. {
  113. label: "标题前缀",
  114. prop: "prefixName",
  115. hidden: true,
  116. },
  117. {
  118. label: "章卷标题",
  119. prop: "name",
  120. hidden: true,
  121. scope: "editInfo",
  122. },
  123. {
  124. label: "适用业务层级",
  125. prop1: "educationName",
  126. prop2: "projectName",
  127. prop3: "businessName",
  128. prop4: "subjectName",
  129. hidden: true,
  130. scope: "eduTypes",
  131. },
  132. {
  133. label: "关联商品",
  134. prop: "goodsList",
  135. prop1: "goodsName",
  136. hidden: true,
  137. scope: "aboutChapter",
  138. int: 7,
  139. },
  140. {
  141. label: "试卷总数",
  142. prop: "examNum",
  143. hidden: true,
  144. },
  145. {
  146. label: "最后编辑时间",
  147. prop: "updateTime",
  148. scope: "aTimeList",
  149. hidden: true,
  150. },
  151. {
  152. label: "创建时间",
  153. prop: "createTime",
  154. scope: "aTimeList",
  155. hidden: true,
  156. },
  157. {
  158. label: "发布状态",
  159. prop: "publishStatus",
  160. hidden: true,
  161. scope: "fabStatus",
  162. },
  163. ],
  164. tableData: [], //表单数据
  165. total: 0, //一共多少条
  166. };
  167. },
  168. mounted() {
  169. this.search();
  170. },
  171. activated() {
  172. this.search();
  173. },
  174. methods: {
  175. editInfo(v) {
  176. this.addClick(v, 0);
  177. },
  178. search(int) {
  179. this.loading = true;
  180. if (int === 1) {
  181. this.formData.pageNum = 1;
  182. }
  183. if (int === 2) {
  184. this.formData = {
  185. status: "0,1",
  186. pageSize: 10,
  187. pageNum: 1,
  188. };
  189. }
  190. this.$api
  191. .inquirebankchapterList(this.formData)
  192. .then((res) => {
  193. this.tableData = res.rows;
  194. this.total = res.total;
  195. this.navText.index = res.total;
  196. })
  197. .finally(() => {
  198. this.loading = false;
  199. });
  200. },
  201. init() {
  202. this.search(2);
  203. },
  204. del(v) {
  205. this.$alert(
  206. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  207. "提示",
  208. {
  209. dangerouslyUseHTMLString: true,
  210. }
  211. )
  212. .then(() => {
  213. var data = {
  214. chapterExamId: v.chapterExamId,
  215. status: -1,
  216. };
  217. this.$api.editbankchapter(data).then((res) => {
  218. this.$message.success("删除成功");
  219. this.search();
  220. });
  221. })
  222. .catch(() => {
  223. this.$message({
  224. type: "info",
  225. message: "已取消删除",
  226. });
  227. });
  228. },
  229. addClick(v, int) {
  230. if (v === undefined) {
  231. this.$router.push({
  232. path: "chapterVolumeManagementAdd",
  233. });
  234. } else {
  235. const jump = () => {
  236. this.$router.push({
  237. path: "chapterVolumeManagementEdit",
  238. query: {
  239. id: v.chapterExamId,
  240. },
  241. });
  242. };
  243. const statusPage = this.$store.state.tagsView.visitedViews.some(
  244. (item) => {
  245. return item.name == "ChapterVolumeManagementEdit";
  246. }
  247. );
  248. if (statusPage) {
  249. this.$store
  250. .dispatch("tagsView/delCachedView", {
  251. name: "ChapterVolumeManagementEdit",
  252. })
  253. .then((res) => {
  254. jump();
  255. });
  256. } else {
  257. jump();
  258. }
  259. }
  260. },
  261. handleSizeChange(v) {
  262. this.formData.pageSize = v;
  263. this.formData.pageNum = 1;
  264. this.search();
  265. },
  266. handleCurrentChange(v) {
  267. this.formData.pageNum = v;
  268. this.search();
  269. },
  270. },
  271. };
  272. </script>
  273. <style lang="less" scoped>
  274. /deep/.el-button {
  275. border-radius: 8px;
  276. }
  277. /deep/.el-dialog {
  278. border-radius: 8px;
  279. .el-dialog__header {
  280. padding: 0;
  281. .hearders {
  282. height: 40px;
  283. display: flex;
  284. align-items: center;
  285. justify-content: space-between;
  286. padding: 0px 18px 0px 20px;
  287. border-bottom: 1px solid #e2e2e2;
  288. .leftTitle {
  289. font-size: 14px;
  290. font-weight: bold;
  291. color: #2f4378;
  292. }
  293. .rightBoxs {
  294. display: flex;
  295. align-items: center;
  296. img {
  297. width: 14px;
  298. height: 14px;
  299. margin-left: 13px;
  300. cursor: pointer;
  301. }
  302. }
  303. }
  304. }
  305. .el-dialog__footer {
  306. padding: 0;
  307. .dialog-footer {
  308. padding: 0px 40px;
  309. height: 70px;
  310. border-top: 1px solid #e2e2e2;
  311. display: flex;
  312. align-items: center;
  313. justify-content: flex-end;
  314. }
  315. }
  316. }
  317. .imgBox {
  318. width: 100%;
  319. // height: 210px;
  320. border: 1px solid #e2e2e2;
  321. border-radius: 8px;
  322. padding: 8px 8px 3px;
  323. display: flex;
  324. flex-direction: column;
  325. align-items: center;
  326. .imgLabel {
  327. flex: 1;
  328. width: 100%;
  329. border: 1px dotted #e2e2e2;
  330. color: #999;
  331. font-size: 14px;
  332. cursor: pointer;
  333. border-radius: 8px;
  334. .msPhoto {
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. max-width: 100%;
  339. max-height: 270px;
  340. img {
  341. max-width: 100%;
  342. max-height: 270px;
  343. }
  344. }
  345. .imgbbx {
  346. display: flex;
  347. flex-direction: column;
  348. align-items: center;
  349. justify-content: center;
  350. width: 100%;
  351. height: 100%;
  352. i {
  353. font-weight: bold;
  354. margin: 14px 0;
  355. font-size: 24px;
  356. }
  357. }
  358. }
  359. p {
  360. margin: 5px 0px;
  361. }
  362. }
  363. </style>