archivetreeconfig.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <basic-container>
  3. <el-alert
  4. title="可独立修改私有项目的归档规则,不会影响其他项目归档规则"
  5. type="warning"
  6. :closable="false">
  7. </el-alert>
  8. <avue-crud :option="option"
  9. :table-loading="loading"
  10. :data="data"
  11. :page.sync="page"
  12. :permission="permissionList"
  13. v-model="form"
  14. ref="crud"
  15. @current-change="currentChange"
  16. @size-change="sizeChange"
  17. @refresh-change="refreshChange"
  18. @on-load="onLoad">
  19. <template slot-scope="{type,size,row}" slot="menu">
  20. <el-button icon="el-icon-setting" :size="size" :type="type" @click="configurationClick(row)">配置规则</el-button>
  21. </template>
  22. </avue-crud>
  23. </basic-container>
  24. </template>
  25. <script>
  26. // import {getList, getDetail, add, update, remove} from "@/api/tentative/testcollect";
  27. import { getProjectList } from "@/api/manager/projectinfo";
  28. import {mapGetters} from "vuex";
  29. export default {
  30. data() {
  31. return {
  32. form: {},
  33. query: {},
  34. loading: true,
  35. page: {
  36. pageSize: 20,
  37. currentPage: 1,
  38. total: 0
  39. },
  40. search:{},
  41. selectionList: [],
  42. option: {
  43. addBtn:false,
  44. editBtn:false,
  45. delBtn:false,
  46. menuWidth:330,
  47. height:'auto',
  48. calcHeight: 30,
  49. tip: false,
  50. searchShow: false,
  51. searchMenuSpan: 0,
  52. border: true,
  53. index: true,
  54. selection: false,
  55. dialogClickModal: false,
  56. labelWidth:150,
  57. column: [
  58. {
  59. label: "项目名称",
  60. prop: "projectName",
  61. rules: [{
  62. required: true,
  63. message: "请输入分类名称",
  64. trigger: "blur"
  65. }]
  66. }
  67. ]
  68. },
  69. data: [],
  70. };
  71. },
  72. computed: {
  73. ...mapGetters(["permission"]),
  74. permissionList() {
  75. return {
  76. viewBtn: false,
  77. //addBtn: this.vaildData(this.permission.imageclassificationconfig_add, false),
  78. //viewBtn: this.vaildData(this.permission.imageclassificationconfig_view, false),
  79. //delBtn: this.vaildData(this.permission.imageclassificationconfig_delete, false),
  80. // editBtn: this.vaildData(this.permission.imageclassificationconfig_edit, false)
  81. };
  82. },
  83. ids() {
  84. let ids = [];
  85. this.selectionList.forEach(ele => {
  86. ids.push(ele.id);
  87. });
  88. return ids.join(",");
  89. }
  90. },
  91. methods: {
  92. currentChange(currentPage){
  93. this.page.currentPage = currentPage;
  94. },
  95. sizeChange(pageSize){
  96. this.page.pageSize = pageSize;
  97. },
  98. refreshChange() {
  99. this.onLoad(this.page, this.query);
  100. },
  101. // onLoad(page, params = {}) {
  102. // this.loading = true;
  103. // getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  104. // const data = res.data.data;
  105. // this.page.total = data.total;
  106. // // this.data = data.records;
  107. // this.data = [{name:'重庆乌江白马枢纽工程项目'}]
  108. // this.loading = false;
  109. // this.selectionClear();
  110. // });
  111. // },
  112. onLoad(page, params = {}) {
  113. this.loading = true;
  114. getProjectList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  115. const data = res.data.data;
  116. this.page.total = data.total;
  117. this.data = data.records;
  118. this.loading = false;
  119. });
  120. },
  121. configurationClick(row){
  122. //console.log(row);
  123. //return;
  124. this.$router.push({
  125. path: '/manager/projectinfo/archivetreeRule',
  126. query: {
  127. projectId:row.id,
  128. }
  129. });
  130. },
  131. }
  132. };
  133. </script>
  134. <style>
  135. </style>