list.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-button class-name="filter-item" type="primary" size="mini" round style="float: left">新增</el-button>
  9. <el-input v-model="listQuery.name" placeholder="模板名称" clearable style="margin-left: 20px; width: 320px;float: left;">
  10. </el-input>
  11. <el-select v-model="listQuery.reportType" placeholder="报告类型" clearable filterable
  12. style="margin-left: 20px;width: 320px;float: left;" class="filter-item">
  13. <el-option v-for="item in reportTypes" :key="item.id" :label="item.name" :value="item.id" />
  14. </el-select>
  15. <el-select v-model="listQuery.reportHeadline" placeholder="报告标题" clearable filterable
  16. style="margin-left: 20px;width: 320px;float: left;" class="filter-item">
  17. <el-option v-for="item in reportHeadlines" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList"
  20. round>搜索
  21. </el-button>
  22. <el-button class="filter-item" style="float: left;" round type="warning" @click="resetSearch()">重置
  23. </el-button>
  24. </template>
  25. <parentTable v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
  26. <el-table-column label="模板名称" align="center">
  27. <template slot-scope="{row}">
  28. <span>{{ row.name }}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="所属报告类型" align="center">
  32. <template slot-scope="{row}">
  33. <span>{{ row.reportType }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="所属报告标题" align="center">
  37. <template slot-scope="{row}">
  38. <span>{{ row.reportHeadline }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="段落内容" align="center">
  42. <template slot-scope="{row}">
  43. <span>{{ row.section }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="创建人" align="center">
  47. <template slot-scope="{row}">
  48. <span>{{ row.userName }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="创建时间" align="center">
  52. <template slot-scope="{row}">
  53. <span>{{ row.created }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="操作" align="center" width="200">
  57. <template slot-scope="{row}">
  58. <!-- <PermissionButton
  59. menu-code="_views_log_detail"
  60. class-name="filter-item"
  61. name=""
  62. type="primary"
  63. :page-jump="true"
  64. :page-query="{id: row.id,stageName:row.stageName,listQuery:listQuery}"
  65. round
  66. size="mini"
  67. />
  68. <PermissionButton
  69. menu-code="_views_log_remove"
  70. class-name="filter-item"
  71. name=""
  72. type="danger"
  73. round
  74. size="mini"
  75. @click="deleteInfo(row.id)"
  76. /> -->
  77. </template>
  78. </el-table-column>
  79. </parentTable>
  80. </y-page-list-layout>
  81. </div>
  82. </template>
  83. <script>
  84. import YPageListLayout from '@/components/YPageListLayout'
  85. import Breadcrumb from '@/components/Breadcrumb'
  86. import PermissionButton from '@/components/PermissionButton/PermissionButton'
  87. export default {
  88. name: 'ReportSection',
  89. components: {
  90. Breadcrumb,
  91. YPageListLayout,
  92. PermissionButton,
  93. },
  94. data() {
  95. return {
  96. pageData: { records: [] },
  97. total: 20,
  98. listLoading: true,
  99. listQuery: {
  100. page: 1,
  101. size: 10,
  102. // name: '',
  103. // staffNo: '',
  104. descs: 'id',
  105. },
  106. listQueryKey: 'keyword',
  107. reportHeadline: [],
  108. reportTypes: []
  109. }
  110. },
  111. created() {
  112. this.getList()
  113. },
  114. methods: {
  115. resetSearch() {
  116. this.$router.push({ query: {} });
  117. this.listQuery = {
  118. current: 1,
  119. size: 10,
  120. descs: 'id',
  121. }
  122. this.getList()
  123. },
  124. searchList() {
  125. // 重置分页
  126. this.listQuery.page = 1
  127. this.listQuery.size = 20
  128. this.getList()
  129. },
  130. getList() {
  131. const that = this
  132. this.listLoading = true
  133. const key = {}
  134. this.$api.reportSection.list(Object.assign({}, that.listQuery, key)).then((res) => {
  135. that.pageData = res.data
  136. setTimeout(() => {
  137. that.listLoading = false
  138. }, 200)
  139. })
  140. .catch(() => {
  141. that.listLoading = false
  142. })
  143. },
  144. deleteInfo(id) {
  145. const that = this
  146. that.$confirm('请确认是否删除该数据?', '提示', {
  147. confirmButtonText: '确定',
  148. cancelButtonText: '取消',
  149. type: 'warning',
  150. center: true
  151. }).then(() => {
  152. that.$api.reportSection.delete(id).then(data => {
  153. that.loading = false
  154. if (data.code === 200) {
  155. that.getList()
  156. } else {
  157. this.$message({
  158. type: 'error',
  159. message: data.msg
  160. })
  161. }
  162. })
  163. }).catch(() => {
  164. })
  165. }
  166. },
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. .right {
  171. flex: 1;
  172. .title {
  173. font-size: 16px;
  174. font-weight: 500;
  175. color: rgba(51, 51, 51, 1);
  176. line-height: 35px;
  177. margin-bottom: 8px;
  178. }
  179. .menu-2-box {
  180. display: flex;
  181. flex-wrap: wrap;
  182. width: 100%;
  183. }
  184. .menu-2-item {
  185. display: flex;
  186. align-items: center;
  187. color: #656565;
  188. font-size: 12px;
  189. width: 230px;
  190. height: 101px;
  191. background: rgb(255, 185, 129);
  192. border-radius: 3px;
  193. padding-left: 20px;
  194. margin-right: 10px;
  195. margin-bottom: 10px;
  196. cursor: pointer;
  197. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  198. .text {
  199. margin-left: 16px;
  200. }
  201. }
  202. }
  203. </style>