index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  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:analyzeCourseLog: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:analyzeCourseLog: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-item label="数据是否删除" prop="isDelete">
  105. <el-input v-model="form.isDelete" placeholder="请输入数据是否删除" />
  106. </el-form-item>
  107. </el-form>
  108. <div slot="footer" class="dialog-footer">
  109. <el-button type="primary" @click="submitForm">确 定</el-button>
  110. <el-button @click="cancel">取 消</el-button>
  111. </div>
  112. </el-dialog>
  113. </div>
  114. </template>
  115. <script>
  116. import { listAnalyzeCourseLog, getAnalyzeCourseLog, delAnalyzeCourseLog, addAnalyzeCourseLog, updateAnalyzeCourseLog } from "@/api/manage/analyzeCourseLog";
  117. export default {
  118. name: "AnalyzeCourseLog",
  119. data() {
  120. return {
  121. // 遮罩层
  122. loading: true,
  123. // 选中数组
  124. ids: [],
  125. // 非单个禁用
  126. single: true,
  127. // 非多个禁用
  128. multiple: true,
  129. // 显示搜索条件
  130. showSearch: true,
  131. // 总条数
  132. total: 0,
  133. // 分析过程日志表格数据
  134. analyzeCourseLogList: [],
  135. // 弹出层标题
  136. title: "",
  137. // 是否显示弹出层
  138. open: false,
  139. // 查询参数
  140. queryParams: {
  141. pageNum: 1,
  142. pageSize: 10,
  143. moduleName: null,
  144. moduleType: null,
  145. courseContent: null,
  146. status: null,
  147. },
  148. // 表单参数
  149. form: {},
  150. // 表单校验
  151. rules: {
  152. isDelete: [
  153. { required: true, message: "数据是否删除不能为空", trigger: "blur" }
  154. ],
  155. }
  156. };
  157. },
  158. created() {
  159. this.getList();
  160. },
  161. methods: {
  162. /** 查询分析过程日志列表 */
  163. getList() {
  164. this.loading = true;
  165. listAnalyzeCourseLog(this.queryParams).then(response => {
  166. this.analyzeCourseLogList = response.rows;
  167. this.total = response.total;
  168. this.loading = false;
  169. });
  170. },
  171. // 取消按钮
  172. cancel() {
  173. this.open = false;
  174. this.reset();
  175. },
  176. // 表单重置
  177. reset() {
  178. this.form = {
  179. id: null,
  180. moduleName: null,
  181. moduleType: null,
  182. courseContent: null,
  183. status: null,
  184. isDelete: null,
  185. createBy: null,
  186. createTime: null,
  187. updateBy: null,
  188. updateTime: null
  189. };
  190. this.resetForm("form");
  191. },
  192. /** 搜索按钮操作 */
  193. handleQuery() {
  194. this.queryParams.pageNum = 1;
  195. this.getList();
  196. },
  197. /** 重置按钮操作 */
  198. resetQuery() {
  199. this.resetForm("queryForm");
  200. this.handleQuery();
  201. },
  202. // 多选框选中数据
  203. handleSelectionChange(selection) {
  204. this.ids = selection.map(item => item.id)
  205. this.single = selection.length!==1
  206. this.multiple = !selection.length
  207. },
  208. /** 新增按钮操作 */
  209. handleAdd() {
  210. this.reset();
  211. this.open = true;
  212. this.title = "添加分析过程日志";
  213. },
  214. /** 修改按钮操作 */
  215. handleUpdate(row) {
  216. this.reset();
  217. const id = row.id || this.ids
  218. getAnalyzeCourseLog(id).then(response => {
  219. this.form = response.data;
  220. this.open = true;
  221. this.title = "修改分析过程日志";
  222. });
  223. },
  224. /** 提交按钮 */
  225. submitForm() {
  226. this.$refs["form"].validate(valid => {
  227. if (valid) {
  228. if (this.form.id != null) {
  229. updateAnalyzeCourseLog(this.form).then(response => {
  230. this.$modal.msgSuccess("修改成功");
  231. this.open = false;
  232. this.getList();
  233. });
  234. } else {
  235. addAnalyzeCourseLog(this.form).then(response => {
  236. this.$modal.msgSuccess("新增成功");
  237. this.open = false;
  238. this.getList();
  239. });
  240. }
  241. }
  242. });
  243. },
  244. /** 删除按钮操作 */
  245. handleDelete(row) {
  246. const ids = row.id || this.ids;
  247. this.$modal.confirm('是否确认删除分析过程日志编号为"' + ids + '"的数据项?').then(function() {
  248. return delAnalyzeCourseLog(ids);
  249. }).then(() => {
  250. this.getList();
  251. this.$modal.msgSuccess("删除成功");
  252. }).catch(() => {});
  253. },
  254. /** 导出按钮操作 */
  255. handleExport() {
  256. this.download('manage/analyzeCourseLog/export', {
  257. ...this.queryParams
  258. }, `analyzeCourseLog_${new Date().getTime()}.xlsx`)
  259. }
  260. }
  261. };
  262. </script>