index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!--
  2. * @Author: Liugh
  3. * @Date: 2021-05-25 13:49:40
  4. * @LastEditTime: 2021-05-25 14:36:52
  5. * @LastEditors: Do not edit
  6. * @FilePath: \auth-web\src\pages\log-manage\err-auth-earlywarning-manage\auth-earlywarning-plan.vue
  7. * @Description: 鉴权风险检测
  8. -->
  9. <template>
  10. <main>
  11. <el-form ref="ruleForm" inline :rules="rules" :model="form">
  12. <!-- <el-form-item label="鉴权风险检测名称">
  13. <el-input v-model="form.name.value" placeholder="请输入鉴权风险检测名称" clearable></el-input>
  14. </el-form-item> -->
  15. <el-form-item label="方案状态" prop="state.value">
  16. <dg-select
  17. v-model="form.state.value"
  18. placeholder="请选择方案状态"
  19. code="DM_APPLY_STATUS"
  20. style="width: 13rem"
  21. clearable
  22. >
  23. </dg-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <dg-button type="primary" @click="handleSearch" icon="el-icon-search">查询</dg-button>
  27. <dg-button type="primary" @click="handleReset" icon="el-icon-refresh-right">重置</dg-button>
  28. </el-form-item>
  29. </el-form>
  30. <Table ref="myTable" :url="tableUrl" :headerData="RiskDetectionPlan" :condition="form">
  31. <dg-table-column fixed="right" label="操作" width="120" align="center">
  32. <template slot-scope="scope">
  33. <div class="u-table__operation">
  34. <el-tooltip
  35. v-for="(item, i) in optList"
  36. :key="i"
  37. :content="item.tooltip"
  38. effect="dark"
  39. placement="top-end"
  40. >
  41. <i :class="item.icon" @click="item.on(scope.row)" />
  42. </el-tooltip>
  43. </div>
  44. </template>
  45. </dg-table-column>
  46. </Table>
  47. </main>
  48. </template>
  49. <script>
  50. import Table from "@/pages/common/table";
  51. import { RiskDetectionPlan } from "../DataConfig";
  52. import { authRiskDetectionUrl, getAuthRiskDetail } from "@/api/log-manage";
  53. import Detail from "@/pages/log-manage/auth-risk-detection/detail";
  54. import Editor from "@/pages/log-manage/auth-risk-detection/edit";
  55. export default {
  56. name: "auth-risk-detection",
  57. props: {},
  58. data() {
  59. const that = this;
  60. return {
  61. RiskDetectionPlan,
  62. form: {
  63. // name: {
  64. // value: "",
  65. // op: "like"
  66. // },
  67. state: {
  68. value: "",
  69. op: "="
  70. }
  71. },
  72. rules: {},
  73. tableUrl: authRiskDetectionUrl,
  74. optList: [
  75. { icon: "el-icon-edit", tooltip: "修改", on: that.handleEditor },
  76. { icon: "el-icon-document", tooltip: "详情", on: that.handleDetail }
  77. ]
  78. };
  79. },
  80. components: { Table, Detail, Editor }, // 注册局部组件
  81. methods: {
  82. reloadTable() {
  83. const that = this;
  84. that.$refs.myTable.$refs.grid.reload();
  85. },
  86. handleEditor({ id }) {
  87. const that = this;
  88. getAuthRiskDetail(id)
  89. .then(res => {
  90. const formData = res;
  91. const layer = that.$dgLayer({
  92. title: "修改风险检测方案",
  93. shade: [0.4, "#FFF"],
  94. area: ["830px", "660px"],
  95. content: Editor,
  96. props: {
  97. formData
  98. },
  99. on: {
  100. success(bool = false) {
  101. layer.close(layer.dialogIndex);
  102. if (bool) {
  103. that.reloadTable();
  104. }
  105. }
  106. }
  107. });
  108. })
  109. .catch(error => {
  110. that.$message.error("详情获取失败");
  111. });
  112. },
  113. handleDetail({ id }) {
  114. const that = this;
  115. getAuthRiskDetail(id)
  116. .then(res => {
  117. const layer = that.$dgLayer({
  118. title: "风险检测方案详情",
  119. shade: [0.4, "#FFF"],
  120. content: Detail,
  121. area: ["830px", "660px"],
  122. props: { sizeForm: res },
  123. on: {
  124. success() {
  125. layer.close(layer.dialogIndex);
  126. }
  127. }
  128. });
  129. })
  130. .catch(error => {
  131. that.$message.error("详情获取失败");
  132. });
  133. },
  134. /**
  135. * @description:表单查询
  136. */
  137. handleSearch() {
  138. this.$refs.myTable.handleSearchClick();
  139. },
  140. /**
  141. * @description:表单重置
  142. */
  143. handleReset() {
  144. this.$refs.ruleForm.resetFields();
  145. }
  146. }
  147. };
  148. </script>
  149. <style lang="scss" scoped></style>