index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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. <!-- <el-table :data="tableData" style="width: 100%">
  13. <el-table-column
  14. prop="name"
  15. label="名称"
  16. class="infinite-list-item"
  17. />
  18. <el-table-column label="有效日期">
  19. <el-table-column prop="china" label="开始日期" />
  20. <el-table-column prop="englin" label="结束日期" />
  21. </el-table-column>
  22. <el-table-column label="有效时间">
  23. <el-table-column prop="china" label="开始时间" />
  24. <el-table-column prop="englin" label="结束时间" />
  25. </el-table-column>
  26. <el-table-column prop="name" label="黑名单" />
  27. <el-table-column prop="name" label="白名单" />
  28. <el-table-column prop="name" label="描述" />
  29. </el-table> -->
  30. <DataTable
  31. :tableHeader="state.list"
  32. :tableData="tableData"
  33. :tableBtnGroup="tableBtnGroup"
  34. :tableProperty="{ rowKey: 'ID' }"
  35. @btnClick="btnClick"
  36. />
  37. </div>
  38. <Dialog
  39. :flag="flag"
  40. :type="type"
  41. :msgTitle="msgTitle"
  42. @resetForm="resetForm"
  43. @delRest="delRest"
  44. >
  45. <div class="diacont">
  46. <el-form :model="tableForm">
  47. <el-row :gutter="24">
  48. <el-col>
  49. <el-form-item label="航司名称" size="default">
  50. <el-input
  51. v-model="tableForm.name"
  52. placeholder="请输入航司名称"
  53. />
  54. </el-form-item>
  55. </el-col>
  56. <el-col>
  57. <el-form-item label="中文简称" size="default">
  58. <el-input
  59. v-model="tableForm.china"
  60. placeholder="请输入中文简称"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col>
  65. <el-form-item label="英文简称" size="default">
  66. <el-input
  67. v-model="tableForm.englin"
  68. placeholder="请输入英文简称"
  69. />
  70. </el-form-item>
  71. </el-col>
  72. <el-col>
  73. <el-form-item label="航司二字码" size="default">
  74. <el-input
  75. v-model="tableForm.two"
  76. placeholder="请输入航司二字码"
  77. />
  78. </el-form-item>
  79. </el-col>
  80. <el-col>
  81. <el-form-item label="航司三字码" size="default">
  82. <el-input
  83. v-model="tableForm.three"
  84. placeholder="请输入航司三字码"
  85. />
  86. </el-form-item>
  87. </el-col>
  88. <el-col>
  89. <el-form-item label="备注" size="default">
  90. <el-input
  91. type="textarea"
  92. v-model="tableForm.text"
  93. placeholder="请输入备注"
  94. />
  95. </el-form-item>
  96. </el-col>
  97. </el-row>
  98. </el-form>
  99. </div>
  100. </Dialog>
  101. </div>
  102. </div>
  103. </template>
  104. <script setup lang="ts">
  105. import DataTable from "@/components/tableTemp/index.vue";
  106. import Minheader from "@/components/minheader/index.vue";
  107. import Dialog from "@/components/dialog/index.vue";
  108. const flag = ref<Boolean>(false); //弹窗开关
  109. const type = ref<String>(""); //判断是否删除
  110. const msgTitle = ref<String>("新增登录策略"); //弹窗标题
  111. const tableColsCopys = reactive<Object>({}); //弹窗
  112. const tableForm = reactive({
  113. name: "",
  114. china: "",
  115. englin: "",
  116. two: "",
  117. three: "",
  118. text: "",
  119. }); //弹窗内容
  120. //列表
  121. const tableData = ref([
  122. {
  123. name: "中国国际航空",
  124. china: "国航",
  125. englin: "AIRCHINA",
  126. two: "CA",
  127. three: "CCA",
  128. text: "CA国航",
  129. },
  130. {
  131. name: "中国国际航空",
  132. china: "国航",
  133. englin: "AIRCHINA",
  134. two: "CA",
  135. three: "CCA",
  136. text: "CA国航",
  137. },
  138. {
  139. name: "中国国际航空",
  140. china: "国航",
  141. englin: "AIRCHINA",
  142. two: "CA",
  143. three: "CCA",
  144. text: "CA国航",
  145. },
  146. ]);
  147. //表头
  148. const state = reactive({
  149. list: [
  150. { label: "名称", key: "name" },
  151. { label: "有效日期", key: "china" },
  152. { label: "有效时间", key: "englin" },
  153. { label: "黑名单", key: "two" },
  154. { label: "白名单", key: "three" },
  155. { label: "描述", key: "text" },
  156. ],
  157. listLoading: true,
  158. });
  159. const tableBtnGroup = ref([
  160. {
  161. name: "编辑",
  162. className: "editBtn",
  163. param: 2,
  164. },
  165. {
  166. name: "删除",
  167. className: "delBtn",
  168. param: 3,
  169. },
  170. ]);
  171. //新增
  172. const addForm = () => {
  173. msgTitle.value = "新增登录策略";
  174. flag.value = true;
  175. type.value = "";
  176. };
  177. //取消
  178. const resetForm = () => {
  179. flag.value = false;
  180. tableForm.name = "";
  181. tableForm.china = "";
  182. tableForm.englin = "";
  183. tableForm.two = "";
  184. tableForm.three = "";
  185. tableForm.text = "";
  186. };
  187. //编辑
  188. // const editDialog = (data) => {
  189. // msgTitle.value = "编辑航司信息维护";
  190. // flag.value = true;
  191. // type.value = "";
  192. // tableForm.name = data.name;
  193. // tableForm.china = data.china;
  194. // tableForm.englin = data.englin;
  195. // tableForm.two = data.two;
  196. // tableForm.three = data.three;
  197. // tableForm.text = data.text;
  198. // };
  199. //编辑-删除
  200. const btnClick = (row, index, param) => {
  201. if (param === 2) {
  202. msgTitle.value = "编辑登录策略";
  203. flag.value = true;
  204. type.value = "";
  205. tableForm.name = index.name;
  206. tableForm.china = index.china;
  207. tableForm.englin = index.englin;
  208. tableForm.two = index.two;
  209. tableForm.three = index.three;
  210. tableForm.text = index.text;
  211. } else if (param === 3) {
  212. msgTitle.value = "删除航司信息维护";
  213. flag.value = true;
  214. type.value = "del";
  215. } else if (param === 4) {
  216. }
  217. };
  218. //删除
  219. const eleDialog = () => {
  220. msgTitle.value = "删除登录策略";
  221. flag.value = true;
  222. type.value = "del";
  223. };
  224. //删除
  225. const delRest = () => {
  226. flag.value = false;
  227. };
  228. </script>
  229. <style lang="scss" scoped>
  230. ::v-deep .el-form-item__label {
  231. width: 100px;
  232. }
  233. .app-containers {
  234. height: calc(100vh - 180px);
  235. }
  236. .infinite-list {
  237. height: 300px;
  238. padding: 0;
  239. margin: 0;
  240. list-style: none;
  241. }
  242. .infinite-list .infinite-list-item {
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. height: 50px;
  247. background: var(--el-color-primary-light-9);
  248. margin: 10px;
  249. color: var(--el-color-primary);
  250. }
  251. .infinite-list .infinite-list-item + .list-item {
  252. margin-top: 10px;
  253. }
  254. ::v-deep.el-table .rowClass {
  255. height: 40px;
  256. font-size: 14px;
  257. color: #101116;
  258. }
  259. ::v-deep.el-table .headerRowClass {
  260. height: 40px;
  261. background: #ffffff;
  262. font-size: 14px;
  263. font-weight: bold;
  264. color: #101116;
  265. }
  266. ::v-deep.el-table .editBtn {
  267. background: #ffffff;
  268. border: 1px solid #f79ec6;
  269. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  270. border-radius: 4px;
  271. font-size: 12px;
  272. font-weight: 400;
  273. color: #ac014d;
  274. }
  275. ::v-deep.el-table .delBtn {
  276. background: #eb2f3b;
  277. box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  278. border-radius: 4px;
  279. font-size: 12px;
  280. font-weight: 400;
  281. color: #ffffff;
  282. border: none;
  283. }
  284. ::v-deep.el-table--striped
  285. .el-table__body
  286. tr.el-table__row--striped
  287. td.el-table__cell {
  288. background-color: #f0f3f7;
  289. }
  290. </style>