cognitiveTaskMgr.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <!--**lxh-查询机构下所有认知任务-->
  3. <div>
  4. <div class="headerRow">
  5. <el-input
  6. placeholder="请输入认知任务名称"
  7. v-model="wKeyword"
  8. class="input-with-select ml10"
  9. style="width: 1.5rem"
  10. size="small"
  11. @keyup.enter.native="onSubmit"
  12. >
  13. <el-button
  14. slot="append"
  15. icon="el-icon-search"
  16. @click="searchAllCognitiveTask"
  17. />
  18. </el-input>
  19. <el-button
  20. class="ml10"
  21. icon="el-icon-refresh"
  22. @click="reset"
  23. size="small"
  24. />
  25. </div>
  26. <!--记录展示start-->
  27. <el-table
  28. :header-cell-style="{ background: '#F6F7FB', color: '#606266' }"
  29. :data="tableData"
  30. border
  31. style="width: 100%; margin-top: 20px"
  32. class="table-padding"
  33. size="small"
  34. >
  35. <el-table-column
  36. prop="name"
  37. label="认知任务名称"
  38. align="center"
  39. width="480"
  40. />
  41. <el-table-column prop="description" label="简介" align="left" />
  42. <el-table-column label="操作" width="240px" align="center">
  43. <template slot-scope="scope">
  44. <el-button plain size="small" @click="editHandle(scope.row)">
  45. 编辑
  46. </el-button>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. <!--记录展示end-->
  51. <!--分页插件-->
  52. <div class="txt-center" style="margin-top: 20px">
  53. <el-pagination
  54. background
  55. size="small"
  56. @size-change="handleSizeChange"
  57. @current-change="handleCurrentChange"
  58. :current-page="pageNum"
  59. :page-sizes="[10, 20, 50, 100]"
  60. :page-size="pageSize"
  61. layout="total, sizes, prev, pager, next, jumper"
  62. :total="total"
  63. />
  64. </div>
  65. <!-- 认知任务简介设置弹窗 -->
  66. <el-dialog
  67. :title="`${formTitle} - 简介修改`"
  68. :visible.sync="descriptionVisible"
  69. append-to-body
  70. >
  71. <el-input
  72. type="textarea"
  73. v-model="description"
  74. placeholder="请输入简介"
  75. rows="8"
  76. style="margin: 16px 0"
  77. />
  78. <div slot="footer" class="dialog-footer">
  79. <el-button size="small" @click="descriptionVisible = false"
  80. >取 消</el-button
  81. >
  82. <el-button size="small" type="primary" @click="saveDescription"
  83. >保存</el-button
  84. >
  85. </div>
  86. </el-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import { mapActions } from "vuex";
  91. export default {
  92. name: "CognitiveTaskMgr",
  93. data() {
  94. return {
  95. categoryList: [], //认知任务类型列表
  96. keyword: "",
  97. currentType: "ALL",
  98. pageNum: 1,
  99. pageSize: 10,
  100. total: 0,
  101. tableData: [],
  102. institutionNo: "",
  103. type: "0",
  104. flag: "",
  105. targetId: "",
  106. description: "",
  107. descriptionVisible: false,
  108. formTitle: "",
  109. rulesSettingList: [],
  110. wKeyword: "",
  111. };
  112. },
  113. /*页面初始化*/
  114. created() {
  115. this.institutionNo = sessionStorage.getItem(
  116. "f7a42fe7211f98ac7a60a285ac3a9527"
  117. );
  118. this.getAllCognitiveTask();
  119. },
  120. methods: {
  121. ...mapActions({
  122. setSacleListName: "setSacleListName",
  123. }),
  124. // 查询全部认知任务
  125. getAllCognitiveTask() {
  126. this.$http.get(
  127. `subjectInfo/getCognizeListByName?categoryEname=CALL&scaleName=${this.wKeyword}&pageNum=${this.pageNum}&pageSize=${this.pageSize}`,
  128. {},
  129. (response) => {
  130. console.log("response: ", response);
  131. this.tableData = response.data.data;
  132. this.total = response.data.allNum;
  133. },
  134. (err) => {
  135. console.log(err);
  136. this.loading = false;
  137. }
  138. );
  139. },
  140. searchAllCognitiveTask() {
  141. this.pageNum = 1;
  142. this.getAllCognitiveTask();
  143. },
  144. // 重置预警认知任务搜索
  145. reset() {
  146. this.wKeyword = "";
  147. this.searchAllCognitiveTask();
  148. },
  149. // 全部认知任务分页
  150. handleCurrentChange(val) {
  151. this.pageNum = val;
  152. this.getAllCognitiveTask();
  153. },
  154. handleSizeChange(val) {
  155. this.pageSize = val;
  156. this.getAllCognitiveTask();
  157. },
  158. // 编辑认知任务阈值
  159. editHandle(row) {
  160. this.targetId = row.id;
  161. this.formTitle = row.name;
  162. this.description = row.description;
  163. this.descriptionVisible = true;
  164. },
  165. // 保存修改后的评分规则信息
  166. saveDescription() {
  167. this.$http.post(
  168. "cognitive/updateCognitiveTask",
  169. {
  170. id: this.targetId,
  171. description: this.description,
  172. },
  173. () => {
  174. this.getAllCognitiveTask();
  175. this.$message.success("修改成功");
  176. this.descriptionVisible = false;
  177. }
  178. );
  179. },
  180. },
  181. };
  182. </script>
  183. <style scoped>
  184. .button-pub-select {
  185. color: #ffffff !important;
  186. border-bottom-right-radius: 4px !important;
  187. border-top-right-radius: 4px !important;
  188. border-bottom-left-radius: 0px !important;
  189. border-top-left-radius: 0px !important;
  190. }
  191. .button-pub {
  192. color: #ffffff !important;
  193. border-radius: 4px !important;
  194. }
  195. ::v-deep .el-button--primary {
  196. color: #fff;
  197. border-radius: 4px !important;
  198. }
  199. ::v-deep .el-table thead {
  200. color: #f6f7fb;
  201. font-weight: 500;
  202. background-color: #5c6ca9 !important;
  203. }
  204. ::v-deep .el-pager li.active {
  205. color: #ffffff;
  206. cursor: default;
  207. background-color: #007eff;
  208. }
  209. ::v-deep .el-pagination.is-background .el-pager li {
  210. margin: 0 5px;
  211. background-color: #ffffff;
  212. color: #606266;
  213. min-width: 30px;
  214. border-radius: 2px;
  215. border: 1px solid #dfe0e4;
  216. }
  217. .pageNation {
  218. height: 60px;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. }
  223. .table-padding {
  224. height: calc(100vh - 1.4rem) !important;
  225. overflow: auto !important;
  226. overflow-x: hidden !important;
  227. }
  228. </style>