index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <script lang="ts">
  2. // 声明额外的选项
  3. export default {
  4. name: "PriRecursionStartReturnField"
  5. };
  6. </script>
  7. <script setup lang="ts">
  8. import { provide } from "vue";
  9. import { usePriRecursionStartReturnField } from "./hook";
  10. import { http } from "@/utils/http";
  11. import { useRenderIcon, hasAuth, PureTableBar } from "@/utils/importUsed";
  12. import Add from "./components/add/index.vue";
  13. import EditUpdatePriRecursionStartReturnField from "./components/updatePriRecursionStartReturnField/index.vue";
  14. import Search from "@iconify-icons/ep/search";
  15. import Addicon from "@iconify-icons/ep/document-add";
  16. import Delete from "@iconify-icons/ep/delete";
  17. import EditPen from "@iconify-icons/ep/edit-pen";
  18. import More from "@iconify-icons/ep/more-filled";
  19. const {
  20. form,
  21. loading,
  22. columns,
  23. dataList,
  24. pagination,
  25. onSearch,
  26. handleSizeChange,
  27. handleCurrentChange,
  28. handleSelectionChange,
  29. ruleFormRef,
  30. objectTableIdOptionList,
  31. handleAdd,
  32. addVisible,
  33. handleUpdatePriRecursionStartReturnField,
  34. editUpdatePriRecursionStartReturnFieldVisible,
  35. editUpdatePriRecursionStartReturnFieldFormData,
  36. handleDelete,
  37. } = usePriRecursionStartReturnField();
  38. // 关闭添加
  39. const closeAddVisible = () => {
  40. onSearch(ruleFormRef.value);
  41. addVisible.value = false;
  42. }
  43. provide('closeAddVisible', closeAddVisible)
  44. // 关闭修改
  45. const closeEditUpdatePriRecursionStartReturnFieldVisible = () => {
  46. onSearch(ruleFormRef.value);
  47. editUpdatePriRecursionStartReturnFieldVisible.value = false
  48. }
  49. provide('closeEditUpdatePriRecursionStartReturnFieldVisible', closeEditUpdatePriRecursionStartReturnFieldVisible)
  50. </script>
  51. <template lang="pug">
  52. .main
  53. div
  54. //- 搜索表格组件条件
  55. el-form.bg-bg_color.pl-8.pt-4.pr-8(
  56. label-position="left"
  57. label-width="100px"
  58. :inline="true",
  59. :model="form",
  60. class="w-[99/100]"
  61. ref="ruleFormRef"
  62. )
  63. el-form-item(label='字段名称' prop="fieldName")
  64. el-input(v-model='form.fieldName' autocomplete='off'
  65. placeholder="请输入字段名称")
  66. el-form-item(label='字段名' prop="fieldEnName")
  67. el-input(v-model='form.fieldEnName' autocomplete='off'
  68. placeholder="请输入字段名")
  69. el-form-item(label="对象表", prop="objectTableId")
  70. el-select(
  71. v-model="form.objectTableId",
  72. placeholder="请选择对象表",
  73. clearable,
  74. )
  75. el-option(:label="item.tableEnName", :value="item.id" v-for="(item,index) in objectTableIdOptionList")
  76. el-form-item
  77. el-button(
  78. type="primary",
  79. :icon="useRenderIcon(Search)",
  80. :loading="loading",
  81. @click="onSearch(ruleFormRef)"
  82. ) 查询
  83. //- 表格组件
  84. PureTableBar(title="递归开始条件返回字段", @refresh="onSearch(ruleFormRef)" )
  85. template(#buttons)
  86. el-button(type="primary" :icon="useRenderIcon(Addicon)" @click="handleAdd()" v-if="hasAuth(['add'])") 新增
  87. template(v-slot="{ size, checkList }")
  88. pure-table(
  89. row-key="id"
  90. ref="tableRef"
  91. adaptive
  92. align-whole="center"
  93. table-layout="auto"
  94. :loading="loading"
  95. :size="size",
  96. :data="dataList",
  97. :columns="columns",
  98. :checkList="checkList",
  99. :pagination="pagination",
  100. :paginationSmall="size === 'default' ? true : false",
  101. :header-cell-style="{ background: 'var(--el-table-row-hover-bg-color)', color: 'var(--el-text-color-primary)' }",
  102. @selection-change="handleSelectionChange",
  103. @size-change="handleSizeChange",
  104. @current-change="handleCurrentChange"
  105. )
  106. template(#operation="{ row }")
  107. el-button.reset-margin(
  108. link
  109. type="primary"
  110. size="small"
  111. @click="handleUpdatePriRecursionStartReturnField(row)"
  112. :icon="useRenderIcon(EditPen)"
  113. v-if="hasAuth(['updatePriRecursionStartReturnField'])"
  114. ) 编辑
  115. el-button.reset-margin(
  116. link
  117. type="primary"
  118. size="small"
  119. @click="handleDelete(row)"
  120. :icon="useRenderIcon(Delete)"
  121. v-if="hasAuth(['delete'])"
  122. ) 删除
  123. Add(:addVisible="addVisible" :objectTableId="form.objectTableId")
  124. EditUpdatePriRecursionStartReturnField(:editVisible="editUpdatePriRecursionStartReturnFieldVisible" :formData="editUpdatePriRecursionStartReturnFieldFormData")
  125. </template>
  126. <style scoped lang="scss">
  127. :deep(.el-dropdown-menu__item i) {
  128. margin: 0;
  129. }
  130. :deep(.el-form-item__label) {
  131. font-weight: 700;
  132. }
  133. :deep(.el-pagination) {
  134. flex-flow: wrap;
  135. }
  136. :deep(.is-draggable) {
  137. max-height: 80vh;
  138. overflow: auto;
  139. }
  140. :deep(.el-dialog__header) {
  141. position: sticky;
  142. top: 0;
  143. z-index: 2;
  144. background: #fff;
  145. }
  146. :deep(.el-descriptions__header) {
  147. margin: 16px 0 !important;
  148. }
  149. </style>