lookAccountButton.vue 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <el-button size="mini" type="text" icon="el-icon-view" @click="lookHangdle()">
  3. <span>查看账号</span>
  4. <el-dialog :title="'查看 ' + authUserId" :visible.sync="visible" width="900px" append-to-body v-if="visible">
  5. <el-table :data="accountList" :loading="loading">
  6. <el-table-column label="账号ID" prop="accountId" align="center" fixed width="150"
  7. :show-overflow-tooltip="true" />
  8. <el-table-column label="账号名称" prop="accountName" align="center" :show-overflow-tooltip="true"
  9. width="300" />
  10. <el-table-column label="投手ID" prop="putUserId" align="center" width="120"
  11. :show-overflow-tooltip="true" />
  12. <el-table-column label="所属组" prop="groupName" align="center" width="120"
  13. :show-overflow-tooltip="true" />
  14. <el-table-column label="Enabled?" prop="enabled" align="center" width="80">
  15. <template slot-scope="scope">
  16. <span>{{ scope.row.enabled ? '可用' : '禁用' }}</span>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"
  20. width="90">
  21. <template slot-scope="scope">
  22. <!-- 指派 -->
  23. <put-user-button :accountId="scope.row.accountId" :authUserId="scope.row.authUserId"
  24. :putUserId="scope.row.putUserId" @onChange="getList()" />
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
  29. :limit.sync="queryParams.pageSize" @pagination="getList" />
  30. </el-dialog>
  31. </el-button>
  32. </template>
  33. <script>
  34. import { getAdAccountList } from "@/api/accounts/ttAdapi";
  35. import putUserButton from "./putUserButton.vue"
  36. export default {
  37. components: { putUserButton },
  38. data() {
  39. return {
  40. visible: false,
  41. loading: false,
  42. queryParams: {
  43. pageNum: 1,
  44. pageSize: 10,
  45. },
  46. accountList: [],
  47. total: 0
  48. }
  49. },
  50. props: {
  51. adAppId: {
  52. type: Number,
  53. default: null,
  54. },
  55. authUserId: {
  56. type: Number,
  57. default: null,
  58. }
  59. },
  60. methods: {
  61. lookHangdle() {
  62. this.visible = true
  63. this.queryParams.pageNum = 1
  64. this.getList()
  65. },
  66. getList() {
  67. if (this.adAppId && this.authUserId) {
  68. let params = { ...this.queryParams, adAppId: this.adAppId, authUserId: this.authUserId }
  69. this.loading = true
  70. getAdAccountList(params).then(res => {
  71. this.loading = false
  72. this.accountList = res.data.records
  73. this.total = res.data.total
  74. }).catch(() => this.loading = false)
  75. }
  76. }
  77. }
  78. }
  79. </script>