多租户商城-商户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
4.1 KiB

  1. <template>
  2. <div class="interaction-diagram-select">
  3. <el-form :inline="true" :model="formData" class="demo-form-inline">
  4. <el-form-item label="">
  5. <el-input v-model="formData.keyword" maxlength="20" placeholder="互动图名称"></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-button type="primary" @click="onSubmit">{{ $t('common.query') }}</el-button>
  9. </el-form-item>
  10. </el-form>
  11. <el-table
  12. ref="multipleTable"
  13. :data="tableData"
  14. max-height="500"
  15. border
  16. row-key="interactionDiagramId"
  17. @selection-change="handleSelectionChange"
  18. style="width: 100%">
  19. <el-table-column
  20. v-if="isMultiple"
  21. width="40"
  22. type="selection"
  23. :reserve-selection="true"
  24. fixed="left"
  25. >
  26. </el-table-column>
  27. <el-table-column label="" width="40" align="center" v-else>
  28. <template slot-scope="scope">
  29. <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
  30. </template>
  31. </el-table-column>
  32. <el-table-column
  33. prop="interactionDiagramName"
  34. label="互动图名称">
  35. </el-table-column>
  36. </el-table>
  37. <el-pagination
  38. @size-change="handleSizeChange"
  39. @current-change="handleCurrentChange"
  40. :current-page="currentPage"
  41. :hide-on-single-page="true"
  42. :page-sizes="[10, 20, 50, 100]"
  43. :page-size="pageSize"
  44. layout="total, sizes, prev, pager, next, jumper"
  45. :total="total">
  46. </el-pagination>
  47. </div>
  48. </template>
  49. <script>
  50. import api from '@@/components/canvasShow/config/api'
  51. import {sendReqMixin} from '@@/components/canvasShow/config/mixin'
  52. import {checkEmptyChild} from '@@/config/common'
  53. // import {getShopId} from "@@/utils/auth.js"
  54. export default {
  55. name: 'interactiondiagram-select',
  56. mixins: [sendReqMixin],
  57. data () {
  58. return {
  59. tableRadio: '',
  60. formData: {
  61. keyword: ''
  62. },
  63. currentPage: 1,
  64. total: 0,
  65. pageSize: 10,
  66. tableData: [],
  67. multipleSelection: []
  68. }
  69. },
  70. props: {
  71. selectedRows: {
  72. type: Array,
  73. default: () => []
  74. },
  75. isMultiple: {
  76. type: Boolean,
  77. default: false
  78. }
  79. },
  80. mounted () {
  81. this.getTableData()
  82. },
  83. methods: {
  84. // 获取类别
  85. getCategory () {
  86. var _this = this
  87. let params = {
  88. url: api.getClassify,
  89. method: 'GET'
  90. }
  91. this.sendReq(params, (res) => {
  92. _this.categoryList = res.data
  93. checkEmptyChild(_this.categoryList)
  94. })
  95. },
  96. // 获取产品信息
  97. getTableData () {
  98. var _this = this
  99. var paramsUrl = `${api.getInteractionDiagrams}?page=${this.currentPage}&pageSize=${this.pageSize}`
  100. if (this.formData.keyword) {
  101. paramsUrl += `&interactionDiagramName=${this.formData.keyword}`
  102. }
  103. // let shopId = parseInt(getShopId())
  104. // if (shopId && this.typeId===3) {
  105. // paramsUrl += `&shopId=${shopId}`
  106. // }
  107. let params = {
  108. url: paramsUrl,
  109. method: 'GET'
  110. }
  111. this.sendReq(params, (res) => {
  112. _this.tableData = res.data.list
  113. _this.total = res.data.total
  114. // 表格斌值
  115. // if(_this.selectedRows.length > 0){
  116. // _this.selectedRows.forEach(row => {
  117. // this.$refs.multipleTable.toggleRowSelection(row,true);
  118. // });
  119. // }
  120. })
  121. },
  122. // 搜索
  123. onSubmit () {
  124. this.getTableData()
  125. },
  126. // 每页条数改变
  127. handleSizeChange (val) {
  128. this.pageSize = val
  129. this.getTableData()
  130. },
  131. // 当前页改变
  132. handleCurrentChange (val) {
  133. this.currentPage = val
  134. this.getTableData()
  135. },
  136. // 多选改变
  137. handleSelectionChange(val) {
  138. this.multipleSelection = val
  139. }
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .interaction-diagram-select{
  145. .el-pagination{
  146. padding: 0px;
  147. margin-top: 30px;
  148. }
  149. .el-table{
  150. .img{
  151. width: 80px;
  152. height: 80px;
  153. }
  154. }
  155. }
  156. </style>