This commit is contained in:
saeid
2019-04-29 19:24:18 +04:30
parent 9c28dc5538
commit a8a6780c17
49 changed files with 76186 additions and 1157 deletions
+28 -7
View File
@@ -59,9 +59,15 @@
<v-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
<span>Archive</span>
</v-btn>
<v-btn color="cyan" class="mr-2">
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
<span>Edit</span>
<router-link :to="{name: 'EditTestResult', params: {testResult: item.id}}">
<v-btn color="cyan" class="mr-2">
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
<span>Edit</span>
</v-btn>
</router-link>
<v-btn color="pink" class="mr-2" @click="remove(item.id)" >
<v-icon class="white--text mr-1 caption">fas fa-times</v-icon>
<span>Remove</span>
</v-btn>
</td>
</template>
@@ -141,9 +147,24 @@ export default {
this.lastPage = result.data.data.last_page;
}
},
async load() {
const result = await ApiService.get(urls.listTestResult);
if (result && result.status == 200) {
this.items = result.data.data.data;
this.currentPage = result.data.data.current_page;
this.lastPage = result.data.data.last_page;
}
},
async remove(testResultId) {
const result = await ApiService.get(urls.removeTestResult(testResultId));
if (result && result.status == 200) {
for (const key in this.items) {
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
this.items.splice(key, 1);
}
}
}
},
}
}
</script>
<style lang="css" scoped>
</style>
</script>