serviceMonitor.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="airportInfo scroll-y">
  3. <div class="wrap">
  4. <Minheader :is-auth="true" :is-statuser="true" @addForm="addForm">
  5. <template #header>
  6. <div class="status flex-wrap">
  7. <div class="manageTitle">服务管理</div>
  8. <div class="status0"><span class="icon"></span>启动</div>
  9. <div class="status2"><span class="icon"></span>异常</div>
  10. <div class="status1"><span class="icon"></span>停止</div>
  11. </div>
  12. </template></Minheader
  13. >
  14. <div class="app-containers">
  15. <DataTable
  16. BtnGroupWidth="300px"
  17. :is-Status="true"
  18. :tableHeader="state.list"
  19. :tableData="tableData"
  20. :tableBtnGroup="tableBtnGroup"
  21. :tableProperty="{ rowKey: 'ID' }"
  22. @btnClick="btnClick"
  23. />
  24. </div>
  25. <Dialog
  26. width="600px"
  27. :flag="flag"
  28. :type="type"
  29. :msgTitle="msgTitle"
  30. @delRest="delRest"
  31. >
  32. </Dialog>
  33. </div>
  34. </div>
  35. </template>
  36. <script setup lang="ts">
  37. import DataTable from "@/components/tableTemp/index.vue";
  38. import Minheader from "@/components/minheader/index.vue";
  39. import Dialog from "@/components/dialog/index.vue";
  40. const router = useRouter();
  41. const flag = ref<Boolean>(false); //弹窗开关
  42. const type = ref<String>(""); //判断是否删除
  43. const msgTitle = ref<String>("新增服务管理"); //弹窗标题
  44. const tableColsCopys = reactive<Object>({}); //弹窗
  45. const tableForm = reactive({
  46. name: "",
  47. china: "",
  48. englin: "",
  49. two: "",
  50. three: "",
  51. text: "",
  52. }); //弹窗内容
  53. //列表
  54. const tableData = ref([
  55. {
  56. nodeState: "运行",
  57. name: "测试",
  58. china: "测试",
  59. englin: "测试",
  60. two: "测试",
  61. three: "测试",
  62. text: "测试",
  63. text1: "测试",
  64. },
  65. {
  66. nodeState: "运行",
  67. name: "测试",
  68. china: "测试",
  69. englin: "测试",
  70. two: "测试",
  71. three: "测试",
  72. text: "测试",
  73. text1: "测试",
  74. },
  75. {
  76. nodeState: "运行",
  77. name: "测试",
  78. china: "测试",
  79. englin: "测试",
  80. two: "测试",
  81. three: "测试",
  82. text: "测试",
  83. text1: "测试",
  84. },
  85. ]);
  86. //表头
  87. const state = reactive({
  88. list: [
  89. { label: "服务编号", key: "name" },
  90. { label: "名称", key: "china" },
  91. { label: "类型", key: "englin" },
  92. { label: "是否同步", key: "two" },
  93. { label: "数据类型", key: "three" },
  94. { label: "取值规则", key: "text" },
  95. { label: "检测规则", key: "text1" },
  96. ],
  97. listLoading: true,
  98. });
  99. const tableBtnGroup = ref([
  100. {
  101. name: "查看",
  102. className: "editBtn",
  103. param: 4,
  104. },
  105. {
  106. name: "编辑",
  107. className: "editBtn",
  108. param: 2,
  109. },
  110. {
  111. name: "停止",
  112. className: "editBtn",
  113. param: 5,
  114. },
  115. {
  116. name: "删除",
  117. className: "delBtn",
  118. param: 3,
  119. },
  120. ]);
  121. //新增
  122. const addForm = () => {};
  123. //取消
  124. const resetForm = () => {
  125. flag.value = false;
  126. tableForm.name = "";
  127. tableForm.china = "";
  128. tableForm.englin = "";
  129. tableForm.two = "";
  130. tableForm.three = "";
  131. tableForm.text = "";
  132. };
  133. //编辑
  134. // const editDialog = (data) => {
  135. // msgTitle.value = "编辑航司信息维护";
  136. // flag.value = true;
  137. // type.value = "";
  138. // tableForm.name = data.name;
  139. // tableForm.china = data.china;
  140. // tableForm.englin = data.englin;
  141. // tableForm.two = data.two;
  142. // tableForm.three = data.three;
  143. // tableForm.text = data.text;
  144. // };
  145. //编辑-删除
  146. const btnClick = (row, index, param) => {
  147. if (param === 2) {
  148. router.push({ path: "/systemSettings/serviceMonitorEdit" });
  149. } else if (param === 3) {
  150. msgTitle.value = "删除服务管理";
  151. flag.value = true;
  152. type.value = "del";
  153. } else if (param === 4) {
  154. router.push({ path: "/systemSettings/serviceManagement" });
  155. }
  156. };
  157. //删除
  158. const eleDialog = () => {
  159. msgTitle.value = "删除服务管理";
  160. flag.value = true;
  161. type.value = "del";
  162. };
  163. //删除
  164. const delRest = () => {
  165. flag.value = false;
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. ::v-deep .el-form-item__label {
  170. width: 100px;
  171. }
  172. .app-containers {
  173. height: calc(100vh - 180px);
  174. }
  175. .icon {
  176. width: 14px;
  177. height: 14px;
  178. background: #2d67e3;
  179. border-radius: 2px;
  180. display: inline-block;
  181. vertical-align: middle;
  182. margin-right: 10px;
  183. position: relative;
  184. top: -2px;
  185. }
  186. .status0,
  187. .status2 {
  188. margin-right: 28px;
  189. position: relative;
  190. top: 5px;
  191. }
  192. .status1 {
  193. position: relative;
  194. top: 5px;
  195. .icon {
  196. background-color: #afb4bf;
  197. }
  198. }
  199. .status2 {
  200. .icon {
  201. background-color: #eb2f3b;
  202. }
  203. }
  204. </style>