HelpCenterAssociationList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div class="tab-background float-e-margins">
  3. <div class="tab-header">
  4. <p>XX列表</p>
  5. </div>
  6. <div class="wrapper wrapper-content animated fadeInRight">
  7. <div class="row">
  8. <div class="col-sm-12">
  9. <div class="float-e-margins">
  10. <div id="center">
  11. <pagination
  12. v-if="refresh"
  13. :url="'./help/helpCenterAssociations'"
  14. :titles="titles"
  15. :paramNames="paramNames"
  16. :dicts="dicts"
  17. :otherParam="otherParam"
  18. @handleSearchResult="handleSearchResult"
  19. ref="pagination">
  20. <template slot="searchBtnBefore">
  21. <!--
  22. <span class="title title-text">部门名称:</span>
  23. <input @click="officeClick" type="text" readonly="readonly" v-model="officeName" placeholder="点击选择部门">
  24. -->
  25. </template>
  26. <template slot="opera">
  27. <button @click="create" class="layui-btn layui-btn-icon layui-btn-primary"><i class="fa fa-plus" aria-hidden="true"></i>&nbsp;&nbsp;创建</button>
  28. </template>
  29. <template slot="main">
  30. <table class="footable table table-stripped">
  31. <thead>
  32. <tr>
  33. <th width="5%" style="text-align:center;">序号</th>
  34. <th style="text-align:center;">关联id</th>
  35. <th style="text-align:center;">标题层级</th>
  36. <th style="text-align:center;">创建人</th>
  37. <th style="text-align:center;">创建时间</th>
  38. <th style="text-align:center;">修改人</th>
  39. <th style="text-align:center;">修改时间</th>
  40. <th style="text-align:center;">关系表备用选项1</th>
  41. <th style="text-align:center;">关系表备用选项2</th>
  42. <th style="text-align:center;">关系表备用选项3</th>
  43. <th style="text-align:center;">更新时间</th>
  44. <th style="text-align:center;">操作</th>
  45. </tr>
  46. </thead>
  47. <tbody id="meetingTbody" class="footable_table">
  48. <template v-for="(item, index) in page.list">
  49. <tr
  50. :class="{'footable-even': index % 2 === 0,'footable-odd': index % 2 !== 0}"
  51. style="display: table-row;"
  52. :key="item.id">
  53. <td width="5%" style="text-align:center;">{{ (page.pageNo - 1) * page.pageSize + index + 1 }}</td>
  54. <td style="text-align:center;">{{ item.selfId }}</td>
  55. <td style="text-align:center;">{{ item.levelStatus }}</td>
  56. <td style="text-align:center;">{{ item.createBy }}</td>
  57. <td style="text-align:center;">{{ item.createDate }}</td>
  58. <td style="text-align:center;">{{ item.updateBy }}</td>
  59. <td style="text-align:center;">{{ item.updateDate }}</td>
  60. <td style="text-align:center;">{{ item.assReplaceable1 }}</td>
  61. <td style="text-align:center;">{{ item.assReplaceable2 }}</td>
  62. <td style="text-align:center;">{{ item.assReplaceable3 }}</td>
  63. <td style="text-align:center;">{{ item.updateDate | moment }}</td>
  64. <td style="text-align:center;">
  65. <a @click="edit(item, true)" style="margin-right:10px"><i class="fa fa-wrench" style="font-size: 10px;color: #23b7e5;margin-right:5px;"></i>修改</a>
  66. <a @click="del(item)" class="delete_a"><i class="fa fa-cut" style="font-size: 10px;color: #23b7e5;margin-right:5px;"></i>删除</a>
  67. </td>
  68. </tr>
  69. </template>
  70. </tbody>
  71. <tfoot>
  72. </tfoot>
  73. </table>
  74. </template>
  75. </pagination>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import { getDicts } from '@/api/dict';
  85. import { del } from '@/api/help/helpCenterAssociation'
  86. import Base from "@/views/base/Base"
  87. export default {
  88. name: 'HelpCenterAssociationList',
  89. extends: Base,
  90. data () {
  91. return {
  92. titles: [],
  93. dicts: [],
  94. paramNames: [],
  95. otherParam: {
  96. },
  97. refresh: true,
  98. page: {
  99. },
  100. }
  101. },
  102. computed: {
  103. //
  104. //linkageTypeMap: function() {
  105. // return this.dicts[0].array2Obj('value', 'label');
  106. //}
  107. //
  108. },
  109. mounted () {
  110. this.initData();
  111. },
  112. methods: {
  113. initData: function() {
  114. getDicts('').then(result => {
  115. //
  116. //var linkageTypes = result.data[0];
  117. //linkageTypes.unshift({
  118. // label: "全部",
  119. // selected: 1,
  120. // value: ""
  121. //});
  122. //this.dicts.push(linkageTypes);
  123. //
  124. });
  125. },
  126. handleSearchResult: function(data){
  127. this.page = data.page || {};
  128. this.page['list'] = data.helpCenterAssociations || [];
  129. },
  130. create: function() {
  131. this.$parent.closeTabByName('HelpCenterAssociationForm');
  132. this.$parent.clickMenu({
  133. "checked": false,
  134. "icon": "fa-legal",
  135. "id": "helpCenterAssociation",
  136. "name": "HelpCenterAssociationForm",
  137. "parentId": "4",
  138. "text": "XX创建",
  139. "children": [
  140. ]
  141. }, 3);
  142. },
  143. edit: function(helpCenterAssociation) {
  144. this.$parent.closeTabByName('HelpCenterAssociationForm');
  145. this.$parent.clickMenu({
  146. "checked": false,
  147. "icon": "fa-legal",
  148. "id": "helpCenterAssociation",
  149. "name": "HelpCenterAssociationForm",
  150. "parentId": "4",
  151. "text": "XX信息更新",
  152. "children": [
  153. ]
  154. }, 3, {
  155. id: helpCenterAssociation.id,
  156. });
  157. },
  158. del: function(helpCenterAssociation) {
  159. confirm('确定删除该记录吗?', () => {
  160. del(helpCenterAssociation.id).then(result => {
  161. alert("删除成功");
  162. this.$refs.pagination.refresh();
  163. });
  164. });
  165. }
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. </style>