1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
| <template>
| <el-dialog
| :title="'查看用户U盾地址'"
| :close-on-click-modal="false"
| :visible.sync="visible"
| width="1200px"
| @close="handClose"
| >
| <div class="mod-subscribe-general">
| <avue-crud
| ref="crud"
| :data="dataList"
| :option="tableOption_1"
| @search-change="searchChange"
| @selection-change="selectionChange"
| >
| </avue-crud>
| </div>
| <span slot="footer" class="dialog-footer">
| <el-button @click="visible = false">关闭</el-button>
| </span>
| </el-dialog>
| </template>
|
| <script>
| import { tableOption } from "@/crud/user/ud-address-parameters";
| export default {
| data() {
| return {
| visible: false,
| tableOption_1: tableOption,
| dataList: [],
| dataListLoading: false,
| userId: null,
| };
| },
| methods: {
| init(row) {
| this.userId = row.userId;
| this.visible = true;
| this.getDataList();
| },
| handClose() {
| this.dataList = [];
| this.userId = null;
| },
| // 条件查询
| searchChange(params, done) {
| this.getDataList(params, done);
| },
| // 多选变化
| selectionChange(val) {
| this.dataListSelections = val;
| },
| // 获取数据列表
| getDataList(params, done) {
| if (!this.userId) {
| if (done) done();
| return;
| }
| this.dataListLoading = true;
| this.$http({
| url: this.$http.adornUrl("/address/getUDList"),
| method: "get",
| params: this.$http.adornParams(
| Object.assign(
| {
| partyId: this.userId,
| },
| params
| ),
| false
| ),
| })
| .then(({ data }) => {
| if (data.code == 0) {
| // 如果返回的是分页数据
| if (data.data && data.data.records) {
| this.dataList = data.data.records;
| } else if (Array.isArray(data.data)) {
| // 如果返回的是数组
| this.dataList = data.data;
| } else {
| this.dataList = [];
| }
| } else {
| this.$message({
| message: data.msg || "获取数据失败",
| type: "error",
| duration: 1000,
| });
| this.dataList = [];
| }
| this.dataListLoading = false;
| if (done) {
| done();
| }
| })
| .catch((error) => {
| console.error("获取U盾地址列表失败:", error);
| this.$message({
| message: "获取数据失败",
| type: "error",
| duration: 1000,
| });
| this.dataList = [];
| this.dataListLoading = false;
| if (done) {
| done();
| }
| });
| },
| },
| };
| </script>
|
| <style lang="scss" scoped>
| ::v-deep .el-dialog__body {
| padding: 0px 20px;
| }
|
| ::v-deep .avue-crud__menu {
| height: auto;
| min-height: 0px;
| }
| </style>
|
|