stash
This commit is contained in:
parent
fda9f8e70f
commit
5c6d560680
9 changed files with 167 additions and 69 deletions
|
|
@ -104,13 +104,10 @@ export default {
|
|||
...BIcons
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["inventory_items"]),
|
||||
username() {
|
||||
return this.$route.params.username
|
||||
}
|
||||
...mapGetters(["inventory_items"])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(["fetchInventoryItems"]),
|
||||
...mapActions(["fetchInventoryItems", "deleteInventoryItem"]),
|
||||
},
|
||||
async mounted() {
|
||||
await this.fetchInventoryItems()
|
||||
|
|
|
|||
|
|
@ -53,19 +53,6 @@ import {mapActions, mapGetters} from "vuex";
|
|||
|
||||
export default {
|
||||
name: "InventoryDetail",
|
||||
data() {
|
||||
return {
|
||||
item: {
|
||||
name: "",
|
||||
description: "",
|
||||
quantity: 0,
|
||||
price: 0,
|
||||
image: "",
|
||||
tags: [],
|
||||
properties: []
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PropertyField, TagField,
|
||||
BaseLayout,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,16 @@
|
|||
<div class="card">
|
||||
<div class="card-header">Create New Item</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
placeholder="Enter item name" v-model="item.name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<textarea class="form-control" id="description" name="description"
|
||||
placeholder="Enter description" v-model="item.description"></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<ul>
|
||||
<li v-for="tag in item.tags" :key="tag">
|
||||
|
|
@ -24,16 +34,6 @@
|
|||
<label for="property" class="form-label">Property</label>
|
||||
<property-field :value="item.properties"></property-field>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
placeholder="Enter item name" v-model="item.name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<textarea class="form-control" id="description" name="description"
|
||||
placeholder="Enter description" v-model="item.description"></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="tags" class="form-label">Tags</label>
|
||||
<tag-field :value="item.tags"></tag-field>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,48 @@
|
|||
<template>
|
||||
<BaseLayout>
|
||||
<BaseLayout hide-search>
|
||||
<main class="content">
|
||||
<div class="container-fluid p-0">
|
||||
<h1 class="h3 mb-3">Blank Page</h1>
|
||||
<h1 class="h3 mb-3">Search Inventories</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<SearchBox @change="filterResults" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Empty card</h5>
|
||||
<h5 class="card-title mb-0">Results for "{{ query }}"</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="logo">
|
||||
<img src="/src/assets/icons/toolshed-48x48.png" alt="Toolshed logo">
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:40%;">Name</th>
|
||||
<th style="width:25%">Owner</th>
|
||||
<th class="d-none d-md-table-cell" style="width:25%">Amount</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in search_results" :key="item.id">
|
||||
<td>
|
||||
<router-link :to="`/inventory/${item.id}`">{{ item.name }}</router-link>
|
||||
</td>
|
||||
<td>{{ item.owner }}</td>
|
||||
<td class="d-none d-md-table-cell">{{ item.owned_quantity }}</td>
|
||||
<td class="table-action">
|
||||
<!--<router-link :to="`/inventory/${item.id}/edit`">
|
||||
<b-icon-pencil-square></b-icon-pencil-square>
|
||||
</router-link>
|
||||
<a :href="`/inventory/${item.id}/delete`"
|
||||
@click.prevent="deleteInventoryItem(item)">
|
||||
<b-icon-trash></b-icon-trash>
|
||||
</a>-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -23,16 +53,40 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters, mapMutations} from 'vuex';
|
||||
import {mapActions} from 'vuex';
|
||||
import * as BIcons from "bootstrap-icons-vue";
|
||||
import BaseLayout from "@/components/BaseLayout.vue";
|
||||
import SearchBox from "@/components/SearchBox.vue";
|
||||
|
||||
export default {
|
||||
name: 'Search',
|
||||
components: {
|
||||
SearchBox,
|
||||
...BIcons,
|
||||
BaseLayout
|
||||
},
|
||||
props: {
|
||||
query: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search_results: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['fetchSearchResults']),
|
||||
filterResults(query) {
|
||||
this.localQuery = query;
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.fetchSearchResults({query: this.query}).then((results) => {
|
||||
this.search_results = results;
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue