queryTemplateColumn.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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. width="734px"
  22. :flag="flag"
  23. :type="type"
  24. :msgTitle="msgTitle"
  25. @resetForm="resetForm"
  26. @delRest="delRest"
  27. >
  28. <div class="diacont">
  29. <el-form :model="tableForm">
  30. <el-row :gutter="24">
  31. <el-col :span="12">
  32. <el-form-item label="名称" size="default">
  33. <el-input v-model="tableForm.name" placeholder="请输入名称" />
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="12">
  37. <el-form-item label="标签" size="default">
  38. <el-input
  39. v-model="tableForm.china"
  40. placeholder="请输入标签"
  41. />
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="12">
  45. <el-form-item label="描述" size="default">
  46. <el-select
  47. style="width: 100%"
  48. v-model="tableForm.englin"
  49. class="input-shadow"
  50. filterable
  51. default-first-option
  52. clearable
  53. placeholder="请选择"
  54. >
  55. <el-option
  56. v-for="item in tableOptionser"
  57. :key="item.v ? item.v : item.planDepartureApt"
  58. :label="item.k ? item.k : item.planDepartureApt"
  59. :value="item.v ? item.v : item.planDepartureApt"
  60. >
  61. </el-option>
  62. </el-select>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="12">
  66. <el-form-item label="排序" size="default">
  67. <el-select
  68. style="width: 100%"
  69. v-model="tableForm.two"
  70. class="input-shadow"
  71. filterable
  72. default-first-option
  73. clearable
  74. placeholder="请选择"
  75. >
  76. <el-option
  77. v-for="item in tableOptionser"
  78. :key="item.v ? item.v : item.planDepartureApt"
  79. :label="item.k ? item.k : item.planDepartureApt"
  80. :value="item.v ? item.v : item.planDepartureApt"
  81. >
  82. </el-option>
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="12">
  87. <el-form-item label="过滤" size="default">
  88. <el-select
  89. style="width: 100%"
  90. v-model="tableForm.three"
  91. class="input-shadow"
  92. filterable
  93. default-first-option
  94. clearable
  95. placeholder="请选择"
  96. >
  97. <el-option
  98. v-for="item in tableOptionser"
  99. :key="item.v ? item.v : item.planDepartureApt"
  100. :label="item.k ? item.k : item.planDepartureApt"
  101. :value="item.v ? item.v : item.planDepartureApt"
  102. >
  103. </el-option>
  104. </el-select>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="12">
  108. <el-form-item label="显示" size="default">
  109. <el-select
  110. style="width: 100%"
  111. v-model="tableForm.text"
  112. class="input-shadow"
  113. filterable
  114. default-first-option
  115. clearable
  116. placeholder="请选择"
  117. >
  118. <el-option
  119. v-for="item in tableOptionser"
  120. :key="item.v ? item.v : item.planDepartureApt"
  121. :label="item.k ? item.k : item.planDepartureApt"
  122. :value="item.v ? item.v : item.planDepartureApt"
  123. >
  124. </el-option>
  125. </el-select>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="12">
  129. <el-form-item label="数据类型" size="default">
  130. <el-select
  131. style="width: 100%"
  132. v-model="tableForm.text1"
  133. class="input-shadow"
  134. filterable
  135. default-first-option
  136. clearable
  137. placeholder="请选择"
  138. >
  139. <el-option
  140. v-for="item in tableOptionser"
  141. :key="item.v ? item.v : item.planDepartureApt"
  142. :label="item.k ? item.k : item.planDepartureApt"
  143. :value="item.v ? item.v : item.planDepartureApt"
  144. >
  145. </el-option>
  146. </el-select>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="12">
  150. <el-form-item label="分组" size="default">
  151. <el-select
  152. style="width: 100%"
  153. v-model="tableForm.text2"
  154. class="input-shadow"
  155. filterable
  156. default-first-option
  157. clearable
  158. placeholder="请选择"
  159. >
  160. <el-option
  161. v-for="item in tableOptionser"
  162. :key="item.v ? item.v : item.planDepartureApt"
  163. :label="item.k ? item.k : item.planDepartureApt"
  164. :value="item.v ? item.v : item.planDepartureApt"
  165. >
  166. </el-option>
  167. </el-select>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="12">
  171. <el-form-item label="下拉" size="default">
  172. <el-select
  173. style="width: 100%"
  174. v-model="tableForm.text3"
  175. class="input-shadow"
  176. filterable
  177. default-first-option
  178. clearable
  179. placeholder="请选择"
  180. >
  181. <el-option
  182. v-for="item in tableOptionser"
  183. :key="item.v ? item.v : item.planDepartureApt"
  184. :label="item.k ? item.k : item.planDepartureApt"
  185. :value="item.v ? item.v : item.planDepartureApt"
  186. >
  187. </el-option>
  188. </el-select>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="12">
  192. <el-form-item label="合计" size="default">
  193. <el-select
  194. style="width: 100%"
  195. v-model="tableForm.text4"
  196. class="input-shadow"
  197. filterable
  198. default-first-option
  199. clearable
  200. placeholder="请选择"
  201. >
  202. <el-option
  203. v-for="item in tableOptionser"
  204. :key="item.v ? item.v : item.planDepartureApt"
  205. :label="item.k ? item.k : item.planDepartureApt"
  206. :value="item.v ? item.v : item.planDepartureApt"
  207. >
  208. </el-option>
  209. </el-select>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="12">
  213. <el-form-item label="字段排序" size="default">
  214. <el-select
  215. style="width: 100%"
  216. v-model="tableForm.text5"
  217. class="input-shadow"
  218. filterable
  219. default-first-option
  220. clearable
  221. placeholder="请选择"
  222. >
  223. <el-option
  224. v-for="item in tableOptionser"
  225. :key="item.v ? item.v : item.planDepartureApt"
  226. :label="item.k ? item.k : item.planDepartureApt"
  227. :value="item.v ? item.v : item.planDepartureApt"
  228. >
  229. </el-option>
  230. </el-select>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. </el-form>
  235. </div>
  236. </Dialog>
  237. </div>
  238. </div>
  239. </template>
  240. <script setup lang="ts">
  241. import DataTable from "@/components/tableTemp/index.vue";
  242. import Minheader from "@/components/minheader/index.vue";
  243. import Dialog from "@/components/dialog/index.vue";
  244. const flag = ref<Boolean>(false); //弹窗开关
  245. const type = ref<String>(""); //判断是否删除
  246. const msgTitle = ref<String>("新增查询项"); //弹窗标题
  247. const tableColsCopys = reactive<Object>({}); //弹窗
  248. const tableOptionser = ref<Array>([]); //弹窗下拉
  249. const tableForm = reactive({
  250. name: "",
  251. china: "",
  252. englin: "",
  253. two: "",
  254. three: "",
  255. text: "",
  256. text1: "",
  257. text2: "",
  258. text3: "",
  259. text4: "",
  260. text5: "",
  261. }); //弹窗内容
  262. //列表
  263. const tableData = ref([
  264. {
  265. name: "测试",
  266. china: "测试",
  267. englin: "测试",
  268. two: "测试",
  269. three: "测试",
  270. text: "测试",
  271. text1: "测试",
  272. text2: "测试",
  273. text3: "测试",
  274. text4: "测试",
  275. text5: "测试",
  276. },
  277. {
  278. name: "测试",
  279. china: "测试",
  280. englin: "测试",
  281. two: "测试",
  282. three: "测试",
  283. text: "测试",
  284. text1: "测试",
  285. text2: "测试",
  286. text3: "测试",
  287. text4: "测试",
  288. text5: "测试",
  289. },
  290. {
  291. name: "测试",
  292. china: "测试",
  293. englin: "测试",
  294. two: "测试",
  295. three: "测试",
  296. text: "测试",
  297. text1: "测试",
  298. text2: "测试",
  299. text3: "测试",
  300. text4: "测试",
  301. text5: "测试",
  302. },
  303. ]);
  304. //表头
  305. const state = reactive({
  306. list: [
  307. { label: "名称", key: "name" },
  308. { label: "标签", key: "china" },
  309. { label: "描述", key: "englin" },
  310. { label: "排序", key: "two" },
  311. { label: "过滤", key: "three" },
  312. { label: "显示", key: "text" },
  313. { label: "分组", key: "text1" },
  314. { label: "下拉", key: "text2" },
  315. { label: "数据类型", key: "text3" },
  316. { label: "字段排位", key: "text4" },
  317. { label: "合计", key: "text5" },
  318. ],
  319. listLoading: true,
  320. });
  321. const tableBtnGroup = ref([
  322. {
  323. name: "编辑",
  324. className: "editBtn",
  325. param: 2,
  326. },
  327. {
  328. name: "删除",
  329. className: "delBtn",
  330. param: 3,
  331. },
  332. ]);
  333. //新增
  334. const addForm = () => {
  335. msgTitle.value = "新增查询项";
  336. flag.value = true;
  337. type.value = "";
  338. };
  339. //取消
  340. const resetForm = () => {
  341. flag.value = false;
  342. tableForm.name = "";
  343. tableForm.china = "";
  344. tableForm.englin = "";
  345. tableForm.two = "";
  346. tableForm.three = "";
  347. tableForm.text = "";
  348. tableForm.text1 = "";
  349. tableForm.text2 = "";
  350. tableForm.text3 = "";
  351. tableForm.text4 = "";
  352. tableForm.text5 = "";
  353. };
  354. //编辑
  355. // const editDialog = (data) => {
  356. // msgTitle.value = "编辑航司信息维护";
  357. // flag.value = true;
  358. // type.value = "";
  359. // tableForm.name = data.name;
  360. // tableForm.china = data.china;
  361. // tableForm.englin = data.englin;
  362. // tableForm.two = data.two;
  363. // tableForm.three = data.three;
  364. // tableForm.text = data.text;
  365. // };
  366. //编辑-删除
  367. const btnClick = (row, index, param) => {
  368. if (param === 2) {
  369. msgTitle.value = "编辑查询项";
  370. flag.value = true;
  371. type.value = "";
  372. tableForm.name = index.name;
  373. tableForm.china = index.china;
  374. tableForm.englin = index.englin;
  375. tableForm.two = index.two;
  376. tableForm.three = index.three;
  377. tableForm.text = index.text;
  378. tableForm.text1 = index.text1;
  379. tableForm.text2 = index.text2;
  380. tableForm.text3 = index.text3;
  381. tableForm.text4 = index.text4;
  382. tableForm.text5 = index.text5;
  383. } else if (param === 3) {
  384. msgTitle.value = "删除查询项";
  385. flag.value = true;
  386. type.value = "del";
  387. } else if (param === 4) {
  388. }
  389. };
  390. //删除
  391. const eleDialog = () => {
  392. msgTitle.value = "删除查询项";
  393. flag.value = true;
  394. type.value = "del";
  395. };
  396. //删除
  397. const delRest = () => {
  398. flag.value = false;
  399. };
  400. </script>
  401. <style lang="scss" scoped>
  402. ::v-deep .el-form-item__label {
  403. width: 100px;
  404. }
  405. .app-containers {
  406. height: calc(100vh - 180px);
  407. }
  408. </style>