Skip to content

Commit 79ebc0b

Browse files
authored
Update table.vue
1 parent c8a31b4 commit 79ebc0b

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

client/table.vue

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
<template>
22
<div class="container">
3-
<table class="table" style="display:none">
3+
<table class="table" style="">
44
<caption><strong>app详情</strong></caption>
55
<thead>
66
<tr>
77
<th>id</th>
88
<th>app名字</th>
99
<th>创建时间</th>
1010
<th>更新时间</th>
11-
1211
<th>操作</th>
1312
</tr>
1413
</thead>
1514
<tbody>
1615
<tr class="success">
1716
<td><input v-model="editing.id" placeholder="必须填写,且为不重复数字"/></td>
1817
<td><input v-model="editing.name" placeholder="必须填写"/></td>
19-
<td><input v-model="editing.createTime" placeholder="必须为时间date格式"/></td>
20-
<td><input v-model="editing.updateTime" placeholder="必须为时间date格式"/></td>
21-
18+
<td><input v-model="editing.createTime" placeholder="必须为时间date格式" type="datetime-local"/></td>
19+
<td><input v-model="editing.updateTime" placeholder="必须为时间date格式" type="datetime-local"/></td>
2220
<td>
23-
<button class="btn btn-info" @click="addApp" style="display:none;">添加</button>
21+
<button class="btn btn-info" @click="addApp" >添加</button>
2422
</td>
2523
</tr>
2624

@@ -42,14 +40,15 @@
4240
</table>
4341
<!--<button class="btn btn-info" @click="addApp" style="display:none; float:right;">添加app</button>-->
4442
</div>
43+
<version></version>
4544
</template>
4645

4746
<script>
4847
var apps;
4948
5049
module.exports = {
5150
http: {
52-
root: '/api',
51+
root: '/api/v1',
5352
// headers:{ Authorization: 1231
5453
//
5554
// }
@@ -82,12 +81,15 @@
8281
var id = self.editing.id;
8382
var name = self.editing.name;
8483
var createTime = self.editing.createTime;
85-
8684
var updateTime = self.editing.updateTime;
87-
88-
85+
console.log('id: ' + id + 'name: ' + name + ' ,createTime: ' + createTime + ' , updateTime: ' + updateTime);
8986
if (id && name) {
90-
apps.save({}, {id: id, name: name,createTime:createTime,updateTime:updateTime}, function (data, status, request) {
87+
apps.save({}, {
88+
id: id,
89+
name: name,
90+
createTime: createTime,
91+
updateTime: updateTime
92+
}, function (data, status, request) {
9193
self.editing = data;
9294
self.fetchApps();
9395
});
@@ -117,13 +119,15 @@
117119
}
118120
},
119121
ready: function () {
120-
apps = this.$resource('apps/:id');
122+
var access_token = localStorage.getItem('access_token');
123+
124+
apps = this.$resource('apps/:id?access_token=' + access_token);
121125
this.fetchApps();
122126
},
123-
// components: {
124-
// version: require("./version.vue")
125-
// }
127+
components: {
128+
version: require("./version.vue")
129+
}
126130
127131
128132
}
129-
</script>
133+
</script>

0 commit comments

Comments
 (0)