3
0

AppManage.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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_add')"
  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="320" class-name="action-column">
  51. <template slot-scope="scope">
  52. <el-button
  53. v-if="checkPrivilege('app_user')"
  54. class="btn-primary"
  55. type="text"
  56. @click="toEditUser(scope.row)"
  57. >用户</el-button
  58. >
  59. <el-button
  60. v-if="checkPrivilege('app_module')"
  61. class="btn-primary"
  62. type="text"
  63. @click="toEditModule(scope.row)"
  64. >模块</el-button
  65. >
  66. <el-button
  67. v-if="checkPrivilege('app_version')"
  68. class="btn-primary"
  69. type="text"
  70. @click="toEditVersion(scope.row)"
  71. >版本</el-button
  72. >
  73. <el-button
  74. v-if="checkPrivilege('app_env')"
  75. class="btn-primary"
  76. type="text"
  77. @click="toEditEnv(scope.row)"
  78. >环境</el-button
  79. >
  80. <el-button
  81. v-if="checkPrivilege('app_config')"
  82. class="btn-primary"
  83. type="text"
  84. @click="toEditConfig(scope.row)"
  85. >程序配置</el-button
  86. >
  87. <el-button
  88. v-if="checkPrivilege('app_config_nginx')"
  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_add') || checkPrivilege('app_edit')"
  112. ref="ModifyApp"
  113. :instance="curRow"
  114. @modified="getList"
  115. >
  116. </modify-app>
  117. <!-- AppUserManage -->
  118. <app-user-manage
  119. v-if="checkPrivilege('app_user')"
  120. ref="AppUserManage"
  121. :app="curRow"
  122. ></app-user-manage>
  123. <!-- AppModuleManage -->
  124. <app-module-manage
  125. v-if="checkPrivilege('app_module')"
  126. ref="AppModuleManage"
  127. :app="curRow"
  128. ></app-module-manage>
  129. <!-- AppVersionManage -->
  130. <app-version-manage
  131. v-if="checkPrivilege('app_version')"
  132. ref="AppVersionManage"
  133. :app="curRow"
  134. @master-change="getList"
  135. ></app-version-manage>
  136. <!-- AppEnvManage -->
  137. <app-env-manage
  138. v-if="checkPrivilege('app_env')"
  139. ref="AppEnvManage"
  140. :app="curRow"
  141. ></app-env-manage>
  142. <!-- AppConfigManage -->
  143. <app-config-manage
  144. v-if="checkPrivilege('app_config')"
  145. ref="AppConfigManage"
  146. :app="curRow"
  147. ></app-config-manage>
  148. <!-- AppNginxManage -->
  149. <app-nginx-manage
  150. v-if="checkPrivilege('app_config_nginx')"
  151. ref="AppNginxManage"
  152. :app="curRow"
  153. ></app-nginx-manage>
  154. </div>
  155. </template>
  156. <script>
  157. import { appQuery } from "../api";
  158. import ModifyApp from "../components/ModifyApp";
  159. import AppUserManage from "../components/AppUserManage.vue";
  160. import AppModuleManage from "../components/AppModuleManage.vue";
  161. import AppVersionManage from "../components/AppVersionManage.vue";
  162. import AppEnvManage from "../components/AppEnvManage.vue";
  163. import AppConfigManage from "../components/AppConfigManage.vue";
  164. import AppNginxManage from "../components/AppNginxManage.vue";
  165. export default {
  166. name: "app-manage",
  167. components: {
  168. ModifyApp,
  169. AppUserManage,
  170. AppModuleManage,
  171. AppVersionManage,
  172. AppEnvManage,
  173. AppConfigManage,
  174. AppNginxManage
  175. },
  176. data() {
  177. return {
  178. filter: {
  179. nameStartWith: "",
  180. code: ""
  181. },
  182. current: 1,
  183. size: this.GLOBAL.pageSize,
  184. total: 0,
  185. dataList: [],
  186. curRow: {},
  187. loading: false
  188. };
  189. },
  190. created() {
  191. this.initData();
  192. },
  193. methods: {
  194. initData() {
  195. this.toPage(1);
  196. },
  197. async getList() {
  198. const datas = {
  199. ...this.filter,
  200. pageNumber: this.current,
  201. pageSize: this.size
  202. };
  203. const data = await appQuery(datas);
  204. this.dataList = data.records;
  205. this.total = data.total;
  206. },
  207. toPage(page) {
  208. this.current = page;
  209. this.getList();
  210. },
  211. toAdd() {
  212. this.curRow = {};
  213. this.$refs.ModifyApp.open();
  214. },
  215. toEdit(row) {
  216. this.curRow = row;
  217. this.$refs.ModifyApp.open();
  218. },
  219. toEditUser(row) {
  220. this.curRow = row;
  221. this.$refs.AppUserManage.open();
  222. },
  223. toEditModule(row) {
  224. this.curRow = row;
  225. this.$refs.AppModuleManage.open();
  226. },
  227. toEditVersion(row) {
  228. this.curRow = row;
  229. this.$refs.AppVersionManage.open();
  230. },
  231. toEditEnv(row) {
  232. this.curRow = row;
  233. this.$refs.AppEnvManage.open();
  234. },
  235. toEditConfig(row) {
  236. this.curRow = row;
  237. this.$refs.AppConfigManage.open();
  238. },
  239. toEditConfigNginx(row) {
  240. this.curRow = row;
  241. this.$refs.AppNginxManage.open();
  242. }
  243. }
  244. };
  245. </script>