dialog.select.file.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <el-dialog
  3. title="选择学习附件"
  4. :visible.sync="isShow"
  5. class="g-dialog-select-safe-check"
  6. :close-on-click-modal="false"
  7. width="55%"
  8. top="10vh"
  9. append-to-body
  10. >
  11. <div class="el-dialog-div">
  12. <g-search-table
  13. ref="st"
  14. url="/core/materials/fileList"
  15. method="post"
  16. :search-data="search"
  17. :manual="true"
  18. :pageable="true"
  19. :select="true"
  20. :select-default="selectList"
  21. :drag="false"
  22. @select="onSelect"
  23. >
  24. <!-- 搜索 -->
  25. <template slot="searchs">
  26. <el-form-item prop="title" label="资料标题">
  27. <el-input v-model="search.title"></el-input>
  28. </el-form-item>
  29. <el-form-item prop="fileName" label="附件名称">
  30. <el-input v-model="search.fileName"></el-input>
  31. </el-form-item>
  32. </template>
  33. <!-- 表格 -->
  34. <template slot="columns">
  35. <el-table-column
  36. prop="orgName"
  37. label="资料上传机构"
  38. min-width="40%"
  39. ></el-table-column>
  40. <el-table-column label="资料标题" prop="title" min-width="40%"> </el-table-column>
  41. <el-table-column
  42. label="资料附件"
  43. min-width="20%"
  44. >
  45. <template slot-scope="scope">
  46. <template v-if="scope.row.fileList">
  47. <el-tag size="mini" type="success" v-for="(item, index) in scope.row.fileList"
  48. :key="index">
  49. {{ JSON.parse(item).name }}
  50. </el-tag>
  51. </template>
  52. </template>
  53. </el-table-column>
  54. <!-- <el-table-column prop="nfcName"
  55. label="采集点"
  56. width="120"></el-table-column>-->
  57. </template>
  58. </g-search-table>
  59. </div>
  60. <div slot="footer" class="dialog-footer">
  61. <el-button @click="onHide">关闭</el-button>
  62. <el-button type="primary" @click="onSubmit">确定</el-button>
  63. </div>
  64. </el-dialog>
  65. </template>
  66. <script>
  67. import GSearchTable from "@/components/table/gx.search.table.vue";
  68. // import { ruleListForOrg } from "@/api/resumption/rule.js";
  69. export default {
  70. components: { GSearchTable },
  71. data() {
  72. return {
  73. isShow: false,
  74. selectList: [],
  75. // ruleList: [],
  76. search: this.emptySearch(),
  77. };
  78. },
  79. computed: {},
  80. watch: {
  81. orgId(newval) {
  82. console.log("orgId",newval);
  83. this.search.orgId=newval;
  84. },
  85. },
  86. props: {
  87. defaultSelect:{
  88. type:Array
  89. },
  90. orgId:{
  91. },
  92. },
  93. methods: {
  94. show() {
  95. this.search= this.emptySearch();
  96. console.log("this.search",this.search)
  97. this.isShow = true;
  98. this.selectList =this.defaultSelect;
  99. // TODO: 处理第一次进入弹窗时,表格数据不加载
  100. },
  101. onHide() {
  102. this.isShow = false;
  103. this.search=this.emptySearch();
  104. },
  105. onSelect(item) {
  106. this.selectList = item;
  107. },
  108. onSubmit() {
  109. let s=this.selectList
  110. this.$emit("select", this.selectList);
  111. this.onHide();
  112. },
  113. emptySearch() {
  114. return {
  115. title: null,
  116. fileName: null,
  117. orgId:this.$store.getters.orgId,
  118. t:new Date(),
  119. };
  120. },
  121. },
  122. mounted() {
  123. },
  124. };
  125. </script>
  126. <style lang="scss" scoped>
  127. .el-dialog-div {
  128. overflow: auto;
  129. }
  130. </style>