index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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>
  9. </template></Minheader
  10. >
  11. <div class="app-containers">
  12. <DataTable
  13. :tableHeader="state.list"
  14. :tableData="tableData"
  15. :tableBtnGroup="tableBtnGroup"
  16. :tableProperty="{ rowKey: 'ID' }"
  17. @btnClick="btnClick"
  18. />
  19. </div>
  20. <Dialog
  21. :flag="flag"
  22. :type="type"
  23. :msgTitle="msgTitle"
  24. @resetForm="resetForm"
  25. @delRest="delRest"
  26. >
  27. <div class="diacont">
  28. <el-form :model="tableForm">
  29. <el-row :gutter="24">
  30. <el-col>
  31. <el-form-item label="舱位名称" size="default">
  32. <el-input v-model="tableForm.name" placeholder="请输入ID" />
  33. </el-form-item>
  34. </el-col>
  35. <el-col>
  36. <el-form-item label="舱位编码" size="default">
  37. <el-input
  38. v-model="tableForm.china"
  39. placeholder="请输入航站名称"
  40. />
  41. </el-form-item>
  42. </el-col>
  43. <el-col>
  44. <el-form-item label="舱位描述" size="default">
  45. <el-input
  46. type="textarea"
  47. v-model="tableForm.englin"
  48. placeholder="请输入机场三字码"
  49. />
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. </div>
  55. </Dialog>
  56. </div>
  57. </div>
  58. </template>
  59. <script setup lang="ts">
  60. import DataTable from "@/components/tableTemp/index.vue";
  61. import Minheader from "@/components/minheader/index.vue";
  62. import Dialog from "@/components/dialog/index.vue";
  63. const flag = ref<Boolean>(false); //弹窗开关
  64. const type = ref<String>(""); //判断是否删除
  65. const msgTitle = ref<String>("新增舱位管理"); //弹窗标题
  66. const tableColsCopys = reactive<Object>({}); //弹窗
  67. const tableForm = reactive({
  68. name: "",
  69. china: "",
  70. englin: "",
  71. }); //弹窗内容
  72. //列表
  73. const tableData = ref([
  74. {
  75. name: "测试",
  76. china: "测试",
  77. englin: "测试",
  78. },
  79. {
  80. name: "测试",
  81. china: "测试",
  82. englin: "测试",
  83. },
  84. {
  85. name: "测试",
  86. china: "测试",
  87. englin: "测试",
  88. },
  89. ]);
  90. //表头
  91. const state = reactive({
  92. list: [
  93. { label: "舱位名称", key: "name" },
  94. { label: "舱位编码", key: "china" },
  95. { label: "舱位描述", key: "englin" },
  96. ],
  97. listLoading: true,
  98. });
  99. const tableBtnGroup = ref([
  100. {
  101. name: "编辑",
  102. className: "editBtn",
  103. param: 2,
  104. },
  105. {
  106. name: "删除",
  107. className: "delBtn",
  108. param: 3,
  109. },
  110. ]);
  111. //新增
  112. const addForm = () => {
  113. msgTitle.value = "新增舱位管理";
  114. flag.value = true;
  115. type.value = "";
  116. };
  117. //取消
  118. const resetForm = () => {
  119. flag.value = false;
  120. tableForm.name = "";
  121. tableForm.china = "";
  122. tableForm.englin = "";
  123. };
  124. //编辑
  125. const editDialog = (data) => {
  126. msgTitle.value = "编辑舱位管理";
  127. flag.value = true;
  128. type.value = "";
  129. tableForm.name = data.name;
  130. tableForm.china = data.china;
  131. tableForm.englin = data.englin;
  132. };
  133. //删除
  134. const eleDialog = () => {
  135. msgTitle.value = "删除舱位管理";
  136. flag.value = true;
  137. type.value = "del";
  138. };
  139. //删除
  140. const delRest = () => {
  141. flag.value = false;
  142. };
  143. //编辑-删除
  144. const btnClick = (row, index, param) => {
  145. if (param === 2) {
  146. msgTitle.value = "编辑舱位管理";
  147. flag.value = true;
  148. type.value = "";
  149. tableForm.name = index.name;
  150. tableForm.china = index.china;
  151. tableForm.englin = index.englin;
  152. } else if (param === 3) {
  153. msgTitle.value = "删除舱位管理";
  154. flag.value = true;
  155. type.value = "del";
  156. } else if (param === 4) {
  157. }
  158. };
  159. </script>
  160. <style lang="scss" scoped>
  161. ::v-deep .el-form-item__label {
  162. width: 80px;
  163. }
  164. </style>