|
@@ -4,16 +4,43 @@
|
4
|
4
|
<Input
|
5
|
5
|
v-model="searchForm.name"
|
6
|
6
|
placeholder="请输入区域名称"
|
|
7
|
+ search
|
|
8
|
+ @on-search="searchList()"
|
7
|
9
|
style="width: 150px"
|
8
|
10
|
/>
|
9
|
11
|
<Button type="primary" class="primary_btn">新建</Button>
|
10
|
12
|
</div>
|
11
|
|
- <Table :columns="columns" :data="searchForm.list">
|
12
|
|
- <template slot-scope="{ row }" slot="updatetimeSlot">
|
13
|
|
- <div>{{ date_format(row.updatetime) }}</div>
|
14
|
|
- </template>
|
15
|
|
- </Table>
|
16
|
|
- <Page :total="100" show-sizer />
|
|
13
|
+ <div class="table_wrap">
|
|
14
|
+ <Table :columns="columns" :data="searchForm.list">
|
|
15
|
+ <template slot-scope="{ row }" slot="createtimeSlot">
|
|
16
|
+ <div>{{ date_format(row.createtime) }}</div>
|
|
17
|
+ </template>
|
|
18
|
+ <template slot-scope="{ row }" slot="updatetimeSlot">
|
|
19
|
+ <div>{{ date_format(row.updatetime) }}</div>
|
|
20
|
+ </template>
|
|
21
|
+ <template slot-scope="{ row }" slot="actionSlot">
|
|
22
|
+ <div class="action_list">
|
|
23
|
+ <div @click="toEnter(row)">进入</div>
|
|
24
|
+ <div @click="toView(row)">查看</div>
|
|
25
|
+ <div @click="toEdit(row)">编辑</div>
|
|
26
|
+ <div class="action_del" @click="toDel(row)">删除</div>
|
|
27
|
+ </div>
|
|
28
|
+ </template>
|
|
29
|
+ </Table>
|
|
30
|
+ </div>
|
|
31
|
+ <div class="page_wrap">
|
|
32
|
+ <Page
|
|
33
|
+ :transfer="true"
|
|
34
|
+ :total="searchForm.total"
|
|
35
|
+ :current="searchForm.page"
|
|
36
|
+ :page-size="searchForm.size"
|
|
37
|
+ :page-size-opts="[10, 20, 40, 60]"
|
|
38
|
+ @on-change="pageChange"
|
|
39
|
+ @on-page-size-change="pageSizeChange"
|
|
40
|
+ show-total
|
|
41
|
+ show-sizer
|
|
42
|
+ ></Page>
|
|
43
|
+ </div>
|
17
|
44
|
</div>
|
18
|
45
|
</template>
|
19
|
46
|
|
|
@@ -46,7 +73,7 @@ export default {
|
46
|
73
|
},
|
47
|
74
|
{
|
48
|
75
|
title: "区域名称",
|
49
|
|
- key: "dbname",
|
|
76
|
+ key: "areaname",
|
50
|
77
|
align: "center"
|
51
|
78
|
},
|
52
|
79
|
{
|
|
@@ -75,14 +102,64 @@ export default {
|
75
|
102
|
},
|
76
|
103
|
{
|
77
|
104
|
title: "操作",
|
78
|
|
- slot: "action",
|
79
|
|
- width: 80,
|
|
105
|
+ slot: "actionSlot",
|
|
106
|
+ width: 220,
|
80
|
107
|
align: "center"
|
81
|
108
|
}
|
82
|
109
|
]
|
83
|
110
|
};
|
84
|
111
|
},
|
85
|
|
- methods: {}
|
|
112
|
+ created() {
|
|
113
|
+ this.searchList();
|
|
114
|
+ },
|
|
115
|
+ methods: {
|
|
116
|
+ searchList() {
|
|
117
|
+ this.searchForm.page = 1;
|
|
118
|
+ this.getList();
|
|
119
|
+ },
|
|
120
|
+ pageChange(page) {
|
|
121
|
+ this.searchForm.page = page;
|
|
122
|
+ this.getList();
|
|
123
|
+ },
|
|
124
|
+ pageSizeChange(size) {
|
|
125
|
+ this.searchForm.size = size;
|
|
126
|
+ this.searchForm.page = 1;
|
|
127
|
+ this.getList();
|
|
128
|
+ },
|
|
129
|
+ getList() {
|
|
130
|
+ this.searchForm.list = [
|
|
131
|
+ {
|
|
132
|
+ id: 1,
|
|
133
|
+ areaname: "区域一",
|
|
134
|
+ createname: "区域一",
|
|
135
|
+ createtime: 1710838418,
|
|
136
|
+ updatename: "区域一",
|
|
137
|
+ updatetime: 1710838430
|
|
138
|
+ },
|
|
139
|
+ {
|
|
140
|
+ id: 2,
|
|
141
|
+ areaname: "区域二",
|
|
142
|
+ createname: "区域一",
|
|
143
|
+ createtime: 1710838418,
|
|
144
|
+ updatename: "区域一",
|
|
145
|
+ updatetime: 1710838430
|
|
146
|
+ },
|
|
147
|
+ {
|
|
148
|
+ id: 3,
|
|
149
|
+ areaname: "区域三",
|
|
150
|
+ createname: "区域一",
|
|
151
|
+ createtime: 1710838418,
|
|
152
|
+ updatename: "区域一",
|
|
153
|
+ updatetime: 1710838430
|
|
154
|
+ }
|
|
155
|
+ ];
|
|
156
|
+ this.searchForm.total = 3;
|
|
157
|
+ },
|
|
158
|
+ toEnter() {},
|
|
159
|
+ toView() {},
|
|
160
|
+ toEdit() {},
|
|
161
|
+ toDel() {}
|
|
162
|
+ }
|
86
|
163
|
};
|
87
|
164
|
</script>
|
88
|
165
|
|