index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
  4. <el-form-item label="模块功能名称" prop="moduleName">
  5. <el-input
  6. v-model="queryParams.moduleName"
  7. placeholder="请输入模块功能名称"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-row :gutter="10" class="mb8">
  18. <el-col :span="1.5">
  19. <el-button
  20. type="primary"
  21. plain
  22. icon="el-icon-plus"
  23. size="mini"
  24. @click="handleAdd"
  25. v-hasPermi="['manage:analyzeCourseLog:add']"
  26. >新增</el-button>
  27. </el-col>
  28. <el-col :span="1.5">
  29. <el-button
  30. type="success"
  31. plain
  32. icon="el-icon-edit"
  33. size="mini"
  34. :disabled="single"
  35. @click="handleUpdate"
  36. v-hasPermi="['manage:analyzeCourseLog:edit']"
  37. >修改</el-button>
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-button
  41. type="danger"
  42. plain
  43. icon="el-icon-delete"
  44. size="mini"
  45. :disabled="multiple"
  46. @click="handleDelete"
  47. v-hasPermi="['manage:analyzeCourseLog:remove']"
  48. >删除</el-button>
  49. </el-col>
  50. <el-col :span="1.5">
  51. <el-button
  52. type="warning"
  53. plain
  54. icon="el-icon-download"
  55. size="mini"
  56. @click="handleExport"
  57. v-hasPermi="['manage:analyzeCourseLog:export']"
  58. >导出</el-button>
  59. </el-col>
  60. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  61. </el-row>
  62. <el-table v-loading="loading" :data="analyzeCourseLogList" @selection-change="handleSelectionChange">
  63. <el-table-column type="selection" width="55" align="center" />
  64. <el-table-column label="唯一ID" align="center" prop="id" />
  65. <el-table-column label="模块功能名称" align="center" prop="moduleName" />
  66. <el-table-column label="模块功能类型" align="center" prop="moduleType" />
  67. <el-table-column label="过程日志" align="center" prop="courseContent" />
  68. <el-table-column label="分析结果状态" align="center" prop="status" />
  69. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  70. <template slot-scope="scope">
  71. <el-button
  72. size="mini"
  73. type="text"
  74. icon="el-icon-edit"
  75. @click="handleUpdate(scope.row)"
  76. v-hasPermi="['manage:afterAnalysisResult:edit']"
  77. >修改</el-button>
  78. <el-button
  79. size="mini"
  80. type="text"
  81. icon="el-icon-delete"
  82. @click="handleDelete(scope.row)"
  83. v-hasPermi="['manage:afterAnalysisResult:remove']"
  84. >删除</el-button>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <pagination
  89. v-show="total>0"
  90. :total="total"
  91. :page.sync="queryParams.pageNum"
  92. :limit.sync="queryParams.pageSize"
  93. @pagination="getList"
  94. />
  95. <!-- 添加或修改分析过程日志对话框 -->
  96. <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
  97. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  98. <el-form-item label="模块功能名称" prop="moduleName">
  99. <el-input v-model="form.moduleName" placeholder="请输入模块功能名称" />
  100. </el-form-item>
  101. <el-form-item label="过程日志">
  102. <editor v-model="form.courseContent" :min-height="192"/>
  103. </el-form-item>
  104. </el-form>
  105. <div slot="footer" class="dialog-footer">
  106. <el-button type="primary" @click="submitForm">确 定</el-button>
  107. <el-button @click="cancel">取 消</el-button>
  108. </div>
  109. </el-dialog>
  110. </div>
  111. </template>
  112. <script>
  113. import { listAnalyzeCourseLog, getAnalyzeCourseLog, delAnalyzeCourseLog, addAnalyzeCourseLog, updateAnalyzeCourseLog } from "@/api/manage/analyzeCourseLog";
  114. export default {
  115. name: "AnalyzeCourseLog",
  116. data() {
  117. return {
  118. // 遮罩层
  119. loading: true,
  120. // 选中数组
  121. ids: [],
  122. // 非单个禁用
  123. single: true,
  124. // 非多个禁用
  125. multiple: true,
  126. // 显示搜索条件
  127. showSearch: true,
  128. // 总条数
  129. total: 0,
  130. // 分析过程日志表格数据
  131. analyzeCourseLogList: [],
  132. // 弹出层标题
  133. title: "",
  134. // 是否显示弹出层
  135. open: false,
  136. // 查询参数
  137. queryParams: {
  138. pageNum: 1,
  139. pageSize: 10,
  140. moduleName: null,
  141. moduleType: null,
  142. courseContent: null,
  143. status: null,
  144. },
  145. // 表单参数
  146. form: {},
  147. // 表单校验
  148. rules: {
  149. isDelete: [
  150. { required: true, message: "数据是否删除不能为空", trigger: "blur" }
  151. ],
  152. }
  153. };
  154. },
  155. created() {
  156. this.getList();
  157. },
  158. methods: {
  159. /** 查询分析过程日志列表 */
  160. getList() {
  161. this.loading = true;
  162. listAnalyzeCourseLog(this.queryParams).then(response => {
  163. this.analyzeCourseLogList = response.rows;
  164. this.total = response.total;
  165. this.loading = false;
  166. });
  167. },
  168. // 取消按钮
  169. cancel() {
  170. this.open = false;
  171. this.reset();
  172. },
  173. // 表单重置
  174. reset() {
  175. this.form = {
  176. id: null,
  177. moduleName: null,
  178. moduleType: null,
  179. courseContent: null,
  180. status: null,
  181. };
  182. this.resetForm("form");
  183. },
  184. /** 搜索按钮操作 */
  185. handleQuery() {
  186. this.queryParams.pageNum = 1;
  187. this.getList();
  188. },
  189. /** 重置按钮操作 */
  190. resetQuery() {
  191. this.resetForm("queryForm");
  192. this.handleQuery();
  193. },
  194. // 多选框选中数据
  195. handleSelectionChange(selection) {
  196. this.ids = selection.map(item => item.id)
  197. this.single = selection.length!==1
  198. this.multiple = !selection.length
  199. },
  200. /** 新增按钮操作 */
  201. handleAdd() {
  202. this.reset();
  203. this.open = true;
  204. this.title = "添加分析过程日志";
  205. },
  206. /** 修改按钮操作 */
  207. handleUpdate(row) {
  208. this.reset();
  209. const id = row.id || this.ids
  210. getAnalyzeCourseLog(id).then(response => {
  211. this.form = response.data;
  212. this.open = true;
  213. this.title = "修改分析过程日志";
  214. });
  215. },
  216. /** 提交按钮 */
  217. submitForm() {
  218. this.$refs["form"].validate(valid => {
  219. if (valid) {
  220. if (this.form.id != null) {
  221. updateAnalyzeCourseLog(this.form).then(response => {
  222. this.$modal.msgSuccess("修改成功");
  223. this.open = false;
  224. this.getList();
  225. });
  226. } else {
  227. addAnalyzeCourseLog(this.form).then(response => {
  228. this.$modal.msgSuccess("新增成功");
  229. this.open = false;
  230. this.getList();
  231. });
  232. }
  233. }
  234. });
  235. },
  236. /** 删除按钮操作 */
  237. handleDelete(row) {
  238. const ids = row.id || this.ids;
  239. this.$modal.confirm('是否确认删除分析过程日志编号为"' + ids + '"的数据项?').then(function() {
  240. return delAnalyzeCourseLog(ids);
  241. }).then(() => {
  242. this.getList();
  243. this.$modal.msgSuccess("删除成功");
  244. }).catch(() => {});
  245. },
  246. /** 导出按钮操作 */
  247. handleExport() {
  248. this.download('manage/analyzeCourseLog/export', {
  249. ...this.queryParams
  250. }, `analyzeCourseLog_${new Date().getTime()}.xlsx`)
  251. }
  252. }
  253. };
  254. </script>