app-list.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!--
  2. 应用列表
  3. @Author: linqian
  4. @Date: 2021-05-17 15:59
  5. -->
  6. <template>
  7. <dg-card header="应用列表">
  8. <!-- 搜索项 -->
  9. <el-form :inline="true" class="search-form">
  10. <el-form-item label="应用系统名称">
  11. <el-input v-model="form.name.value" clearable></el-input>
  12. </el-form-item>
  13. <el-form-item label="应用在用标识">
  14. <dg-select v-model="form.name.value" clearable></dg-select>
  15. </el-form-item>
  16. <el-form-item>
  17. <dg-button type="primary" @click="handleSearch" icon="el-icon-search">查询</dg-button>
  18. <!-- <dg-button type="primary" @click="handleReset" icon="el-icon-refresh-right">重置</dg-button> -->
  19. </el-form-item>
  20. </el-form>
  21. <!-- 操作 -->
  22. <dg-row zebra="10px">
  23. <dg-button type="primary" icon="el-icon-upload2" @click="handleImport">导入</dg-button>
  24. <dg-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd">新增</dg-button>
  25. <dg-button type="primary" icon="el-icon-refresh" @click="handleSync">同步</dg-button>
  26. </dg-row>
  27. <!-- 表格 -->
  28. <dg-table
  29. ref="table"
  30. url="/authsvr/v2/roleauthinfo/staffUserPage/_search"
  31. :condition="form"
  32. border
  33. row-key="id"
  34. >
  35. <dg-table-column type="index" width="75" label="序号" align="center"></dg-table-column>
  36. <dg-table-column prop="levelCode" label="应用系统编码" align="center"></dg-table-column>
  37. <dg-table-column prop="levelName" label="应用系统名称" align="center"></dg-table-column>
  38. <dg-table-column prop="levelName" label="应用英文名称" align="center"></dg-table-column>
  39. <dg-table-column prop="levelName" label="应用在用标识" align="center"></dg-table-column>
  40. <dg-table-column label="操作" align="center">
  41. <template slot-scope="scope">
  42. <div class="u-table__operation">
  43. <el-tooltip
  44. v-for="(item, index) in optList"
  45. :key="index"
  46. :content="item.tooltip"
  47. effect="dark"
  48. placement="top-end"
  49. >
  50. <i :class="item.icon" @click="item.on(scope.row)"></i>
  51. </el-tooltip>
  52. </div>
  53. </template>
  54. </dg-table-column>
  55. </dg-table>
  56. </dg-card>
  57. </template>
  58. <script>
  59. import importFile from "@/pages/common/import";
  60. import addAppForm from "./add-app-form";
  61. export default {
  62. components: {},
  63. data() {
  64. return {
  65. form: {
  66. name: {
  67. value: "",
  68. op: "="
  69. }
  70. },
  71. optList: [
  72. { icon: "el-icon-edit", tooltip: "修改", on: this.handleEdit },
  73. { icon: "el-icon-document", tooltip: "详情", on: this.handleViewDetail },
  74. { icon: "el-icon-delete", tooltip: "删除", on: this.handleDelete }
  75. ]
  76. };
  77. },
  78. computed: {},
  79. methods: {
  80. /**
  81. * 编辑
  82. */
  83. handleEdit(row) {
  84. this.handleOpenForm(row.id, "编辑");
  85. },
  86. /**
  87. * 查看详情
  88. */
  89. handleViewDetail(row) {
  90. this.handleOpenForm(row.id, "详情", true);
  91. },
  92. /**
  93. * 删除
  94. */
  95. handleDelete(row) {
  96. this.$dgConfirm(`是否确认删除该条应用!`, "提示", {}).then(() => {});
  97. },
  98. /**
  99. * 查询
  100. */
  101. handleSearch() {
  102. this.$refs.table.searchForm();
  103. },
  104. /**
  105. * 重置
  106. */
  107. handleReset() {
  108. for (const key in this.form) {
  109. this.form[key].value = "";
  110. }
  111. },
  112. /**
  113. * 导入
  114. */
  115. handleImport() {
  116. const vm = this;
  117. const layer = this.$dgLayer({
  118. title: "导入",
  119. content: importFile,
  120. props: {
  121. temp: "模板",
  122. action: "action"
  123. },
  124. on: {
  125. success(params) {
  126. layer.close(layer.dialogIndex);
  127. }
  128. },
  129. cancel: function (index, layero) {
  130. // 关闭对应弹窗的ID
  131. layer.close(index);
  132. return false;
  133. },
  134. area: ["550px", "500px"]
  135. });
  136. },
  137. /**
  138. * 新增
  139. */
  140. handleAdd() {
  141. this.handleOpenForm(void 0, "新增");
  142. },
  143. handleOpenForm(id, title, isDetail = false) {
  144. const layer = this.$dgLayer({
  145. title,
  146. content: addAppForm,
  147. props: {
  148. id,
  149. isDetail
  150. },
  151. btn: ["确定", "取消"],
  152. btnAlign: "r",
  153. yes: (index) => {
  154. let _layer = layer.$children[0];
  155. _layer.saveForm();
  156. layer.close(index);
  157. },
  158. area: ["900px", "600px"]
  159. });
  160. },
  161. /**
  162. * 同步
  163. */
  164. handleSync() {}
  165. },
  166. created() {},
  167. mounted() {}
  168. };
  169. </script>
  170. <style lang='scss'>
  171. </style>