AppManage.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div class="app-manage">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="80px" inline>
  5. <el-form-item label="模糊查询">
  6. <el-input
  7. v-model="filter.nameStartWith"
  8. placeholder="名称前缀"
  9. ></el-input>
  10. </el-form-item>
  11. <el-form-item label="编码">
  12. <el-input v-model="filter.code" placeholder="编码"></el-input>
  13. </el-form-item>
  14. <el-form-item label-width="0px">
  15. <el-button type="primary" icon="ios-search" @click="toPage(1)"
  16. >查询</el-button
  17. >
  18. <el-button
  19. v-if="checkPrivilege('APP_INSERT')"
  20. type="success"
  21. icon="md-add"
  22. @click="toAdd"
  23. >新增</el-button
  24. >
  25. </el-form-item>
  26. </el-form>
  27. </div>
  28. <div class="part-box part-box-pad">
  29. <el-table ref="TableList" :data="dataList">
  30. <el-table-column prop="id" label="ID" width="80"></el-table-column>
  31. <el-table-column prop="name" label="名称"> </el-table-column>
  32. <el-table-column prop="code" label="编码"> </el-table-column>
  33. <el-table-column prop="masterVersionName" label="主干版本" width="120">
  34. </el-table-column>
  35. <el-table-column
  36. v-if="checkPrivilege('APP_EDIT')"
  37. label="操作"
  38. width="80"
  39. class-name="action-column"
  40. >
  41. <template slot-scope="scope">
  42. <el-button
  43. class="btn-primary"
  44. type="text"
  45. @click="toEdit(scope.row)"
  46. >编辑</el-button
  47. >
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="管理" width="360" class-name="action-column">
  51. <template slot-scope="scope">
  52. <!-- <el-button
  53. class="btn-primary"
  54. type="text"
  55. @click="toEditUser(scope.row)"
  56. >用户</el-button
  57. > -->
  58. <el-button
  59. class="btn-primary"
  60. type="text"
  61. @click="toEditDeploy(scope.row)"
  62. >部署</el-button
  63. >
  64. <el-button
  65. class="btn-primary"
  66. type="text"
  67. @click="toEditModule(scope.row)"
  68. >模块</el-button
  69. >
  70. <el-button
  71. class="btn-primary"
  72. type="text"
  73. @click="toEditVersion(scope.row)"
  74. >版本</el-button
  75. >
  76. <el-button
  77. class="btn-primary"
  78. type="text"
  79. @click="toEditEnv(scope.row)"
  80. >环境</el-button
  81. >
  82. <el-button
  83. class="btn-primary"
  84. type="text"
  85. @click="toEditConfig(scope.row)"
  86. >程序配置</el-button
  87. >
  88. <el-button
  89. class="btn-primary"
  90. type="text"
  91. @click="toEditConfigNginx(scope.row)"
  92. >nginx配置</el-button
  93. >
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <div class="part-page">
  98. <el-pagination
  99. background
  100. layout="total,prev, pager, next"
  101. :current-page="current"
  102. :total="total"
  103. :page-size="size"
  104. @current-change="toPage"
  105. >
  106. </el-pagination>
  107. </div>
  108. </div>
  109. <!-- modify-app -->
  110. <modify-app
  111. v-if="checkPrivilege('APP_INSERT') || checkPrivilege('APP_EDIT')"
  112. ref="ModifyApp"
  113. :instance="curRow"
  114. @modified="getList"
  115. >
  116. </modify-app>
  117. <!-- AppUserManage -->
  118. <app-user-manage ref="AppUserManage" :app="curRow"></app-user-manage>
  119. <!-- AppDeployManage -->
  120. <app-deploy-manage ref="AppDeployManage" :app="curRow"></app-deploy-manage>
  121. <!-- AppModuleManage -->
  122. <app-module-manage ref="AppModuleManage" :app="curRow"></app-module-manage>
  123. <!-- AppVersionManage -->
  124. <app-version-manage
  125. ref="AppVersionManage"
  126. :app="curRow"
  127. @master-change="getList"
  128. ></app-version-manage>
  129. <!-- AppEnvManage -->
  130. <app-env-manage ref="AppEnvManage" :app="curRow"></app-env-manage>
  131. <!-- AppConfigManage -->
  132. <app-config-manage ref="AppConfigManage" :app="curRow"></app-config-manage>
  133. <!-- AppNginxManage -->
  134. <app-nginx-manage ref="AppNginxManage" :app="curRow"></app-nginx-manage>
  135. </div>
  136. </template>
  137. <script>
  138. import { appQuery } from "../api";
  139. import ModifyApp from "./ModifyApp";
  140. import AppUserManage from "../app-user/AppUserManage.vue";
  141. import AppDeployManage from "../app-deploy/AppDeployManage.vue";
  142. import AppModuleManage from "../app-module/AppModuleManage.vue";
  143. import AppVersionManage from "../app-version/AppVersionManage.vue";
  144. import AppEnvManage from "../app-version/AppVersionManage.vue";
  145. import AppConfigManage from "../app-config/AppConfigManage.vue";
  146. import AppNginxManage from "../app-nginx/AppNginxManage.vue";
  147. export default {
  148. name: "app-manage",
  149. components: {
  150. ModifyApp,
  151. AppUserManage,
  152. AppDeployManage,
  153. AppModuleManage,
  154. AppVersionManage,
  155. AppEnvManage,
  156. AppConfigManage,
  157. AppNginxManage,
  158. },
  159. data() {
  160. return {
  161. filter: {
  162. nameStartWith: "",
  163. code: "",
  164. },
  165. current: 1,
  166. size: this.GLOBAL.pageSize,
  167. total: 0,
  168. dataList: [],
  169. curRow: {},
  170. loading: false,
  171. };
  172. },
  173. created() {
  174. this.initData();
  175. },
  176. methods: {
  177. initData() {
  178. this.toPage(1);
  179. },
  180. async getList() {
  181. const datas = {
  182. ...this.filter,
  183. pageNumber: this.current,
  184. pageSize: this.size,
  185. };
  186. const data = await appQuery(datas);
  187. this.dataList = data.records;
  188. this.total = data.total;
  189. },
  190. toPage(page) {
  191. this.current = page;
  192. this.getList();
  193. },
  194. toAdd() {
  195. this.curRow = {};
  196. this.$refs.ModifyApp.open();
  197. },
  198. toEdit(row) {
  199. this.curRow = row;
  200. this.$refs.ModifyApp.open();
  201. },
  202. toEditUser(row) {
  203. this.curRow = row;
  204. this.$refs.AppUserManage.open();
  205. },
  206. toEditDeploy(row) {
  207. this.curRow = row;
  208. this.$refs.AppDeployManage.open();
  209. },
  210. toEditModule(row) {
  211. this.curRow = row;
  212. this.$refs.AppModuleManage.open();
  213. },
  214. toEditVersion(row) {
  215. this.curRow = row;
  216. this.$refs.AppVersionManage.open();
  217. },
  218. toEditEnv(row) {
  219. this.curRow = row;
  220. this.$refs.AppEnvManage.open();
  221. },
  222. toEditConfig(row) {
  223. this.curRow = row;
  224. this.$refs.AppConfigManage.open();
  225. },
  226. toEditConfigNginx(row) {
  227. this.curRow = row;
  228. this.$refs.AppNginxManage.open();
  229. },
  230. },
  231. };
  232. </script>