index.vue 7.4 KB

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