index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="ghzc ResourceShare sharedLocation">
  3. <div class="innerContainer" v-drag>
  4. <custom-form ref="formRef" :model="model" :config="formConfig">
  5. <template #type>
  6. <el-select v-model="model.type" placeholder="申请状态">
  7. <el-option
  8. v-for="item in servicetype"
  9. :key="item.dictValue"
  10. :label="item.dictLabel"
  11. :value="item.dictValue"
  12. >
  13. </el-option>
  14. </el-select>
  15. </template>
  16. <template #action>
  17. <!-- v-hasPermi="['monitor:job:add']" -->
  18. <el-button size="mini" @click="getTableData">查询</el-button>
  19. <el-button size="mini" @click="reset()">重置</el-button>
  20. </template>
  21. </custom-form>
  22. <!-- :total="table.total"
  23. :tableArrDate="table.data" -->
  24. <customForm></customForm>
  25. <tablePage
  26. class="tablePage"
  27. :cloumn="cloumn"
  28. :table="table"
  29. :indexed="false"
  30. :showTotal="false"
  31. ref="tableDialogRef"
  32. @currentChange="searchFun"
  33. :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
  34. >
  35. <template #type="{ row }">
  36. {{ sertypeMap[row.type] || "-" }}
  37. </template>
  38. <template #shared="{ row }">
  39. <el-checkbox
  40. v-if="row.url"
  41. v-model="row.checked"
  42. @change="changeShare(row)"
  43. >
  44. 共享
  45. </el-checkbox>
  46. </template>
  47. <template #action="{ row }">
  48. <span class="usable" v-if="row.url" @click="fieldset(row)"
  49. >共享字段设置</span
  50. >
  51. </template>
  52. </tablePage>
  53. </div>
  54. <fieldSet ref="fieldSetModal" @close="closeMdel"></fieldSet>
  55. </div>
  56. </template>
  57. <script>
  58. // import Clipboard from "clipboard";
  59. import tablePage from "@/components/mapView/tablePage.vue";
  60. import customForm from "@/components/mapView/custom-form.vue";
  61. import fieldSet from "./components/fieldSetModal.vue";
  62. import { FormConfig, TableHeader } from "./config";
  63. import { listZyml, shareZyml } from "@/api/shared.js";
  64. import { handleTree } from "@/utils/ruoyi.js";
  65. import { Getservicetype } from "../myApplication/config";
  66. export default {
  67. components: {
  68. tablePage,
  69. customForm,
  70. fieldSet,
  71. },
  72. props: {},
  73. data() {
  74. return {
  75. model: {
  76. startTime: "",
  77. endTime: "",
  78. sj: ["", ""],
  79. type: "",
  80. state: null,
  81. year: null,
  82. },
  83. formConfig: FormConfig,
  84. cloumn: TableHeader,
  85. servicetype: [],
  86. sertypeMap: {},
  87. table: { data: [], total: 0 },
  88. };
  89. },
  90. methods: {
  91. searchFun(page) {
  92. this.getTableData(page);
  93. },
  94. /** 查询数据资源目录列表 */
  95. async getTableData(page = { pageIndex: 1, size: 10 }) {
  96. // this.model.pageNum = page.pageIndex;
  97. // this.model.pageSize = page.size;
  98. this.model.startTime = this.model.sj[0];
  99. this.model.endTime = this.model.sj[1];
  100. let res = await listZyml(this.model);
  101. this.table = {
  102. data: handleTree(res.data, "bsm", "pbsm"),
  103. total: 0,
  104. };
  105. },
  106. reset() {
  107. this.model = {
  108. startTime: "",
  109. endTime: "",
  110. sj: ["", ""],
  111. type: "",
  112. state: null,
  113. year: null,
  114. // pageNum: 1,
  115. // pageSize: 10,
  116. };
  117. this.searchFun();
  118. },
  119. // 详情
  120. fieldset(row) {
  121. this.$refs.fieldSetModal.Init(row);
  122. },
  123. changeShare(row) {
  124. shareZyml({ id: row.bsm }).then((res) => {
  125. this.$message.success("共享状态切换成功!");
  126. this.searchFun();
  127. });
  128. },
  129. closeMdel() {
  130. this.searchFun();
  131. },
  132. },
  133. computed: {},
  134. watch: {},
  135. async mounted() {
  136. this.servicetype = await Getservicetype();
  137. this.servicetype.forEach((ty) => {
  138. this.sertypeMap[ty.dictValue] = ty.dictLabel;
  139. });
  140. console.log("--s-s--s", this.sertypeMap);
  141. this.searchFun();
  142. },
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. @import "../resource.scss";
  147. .el-checkbox {
  148. color: #fff;
  149. }
  150. </style>
  151. <style lang="scss">
  152. @import "../../cockpit/datePicker.scss";
  153. .sharedLocation {
  154. .el-table {
  155. overflow-y: auto;
  156. overflow-x: hidden;
  157. }
  158. }
  159. </style>