dialog.select.file.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <DialogCom
  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. width="250"
  39. ></el-table-column>
  40. <el-table-column label="资料标题" prop="title" width="300"> </el-table-column>
  41. <el-table-column
  42. label="资料附件"
  43. >
  44. <template slot-scope="scope">
  45. <template v-if="scope.row.fileList">
  46. <el-tag size="mini" type="success" v-for="(item, index) in scope.row.fileList"
  47. :key="index">
  48. {{ JSON.parse(item).name }}
  49. </el-tag>
  50. </template>
  51. </template>
  52. </el-table-column>
  53. <!-- <el-table-column prop="nfcName"
  54. label="采集点"
  55. width="120"></el-table-column>-->
  56. </template>
  57. </g-search-table>
  58. </div>
  59. <div slot="footer" class="dialog-footer">
  60. <el-button @click="onHide">关闭</el-button>
  61. <el-button type="primary" @click="onSubmit">确定</el-button>
  62. </div>
  63. </DialogCom>
  64. </template>
  65. <script>
  66. import GSearchTable from "@/components/table/gx.search.table.vue";
  67. // import { ruleListForOrg } from "@/api/resumption/rule.js";
  68. export default {
  69. components: { GSearchTable },
  70. data() {
  71. return {
  72. isShow: false,
  73. selectList: [],
  74. // ruleList: [],
  75. search: this.emptySearch(),
  76. };
  77. },
  78. computed: {},
  79. watch: {
  80. orgId(newval) {
  81. console.log("orgId",newval);
  82. this.search.orgId=newval;
  83. },
  84. },
  85. props: {
  86. defaultSelect:{
  87. type:Array
  88. },
  89. orgId:{
  90. },
  91. },
  92. methods: {
  93. show() {
  94. this.search= this.emptySearch();
  95. console.log("this.search",this.search)
  96. this.isShow = true;
  97. this.selectList =this.defaultSelect;
  98. // TODO: 处理第一次进入弹窗时,表格数据不加载
  99. },
  100. onHide() {
  101. this.isShow = false;
  102. this.search=this.emptySearch();
  103. },
  104. onSelect(item) {
  105. this.selectList = item;
  106. },
  107. onSubmit() {
  108. let s=this.selectList
  109. this.$emit("select", this.selectList);
  110. this.onHide();
  111. },
  112. emptySearch() {
  113. return {
  114. title: null,
  115. fileName: null,
  116. orgId:this.$store.getters.orgId,
  117. t:new Date(),
  118. };
  119. },
  120. },
  121. mounted() {
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .el-dialog-div {
  127. overflow: auto;
  128. }
  129. </style>