zmiana endpointów; poprawki designu

This commit is contained in:
2023-11-29 14:22:58 +01:00
parent c5b639b068
commit 6d4d6077af
7 changed files with 62 additions and 103 deletions
+8 -11
View File
@@ -19,9 +19,7 @@
<tr v-for="(station, row) in store.sortedStationList" tabindex="0">
<td v-for="(value, propName) in headerNameList" @click="changeProperty(station, row, propName as string)">
<span v-if="propName === 'url'" :style="station.url ? 'color: gold' : 'color: gray;'">URL</span>
<span v-else-if="propName === 'projectUrl'" :style="station.projectUrl ? 'color: gold' : 'color: gray;'"
>URL</span
>
<span v-else-if="propName === 'projectUrl'" :style="station.projectUrl ? 'color: gold' : 'color: gray;'">URL</span>
<span v-else-if="propName === 'checkpoints'">{{ station[propName] ? 'POKAŻ' : 'DODAJ' }}</span>
@@ -119,9 +117,7 @@ export default defineComponent({
return;
}
const stationListRow = this.store.stationList.findIndex(
(station) => station.name == this.store.sortedStationList[row].name
);
const stationListRow = this.store.stationList.findIndex((station) => station.name == this.store.sortedStationList[row].name);
if (stationListRow == -1) return;
const oldValue = (this.store.stationList[stationListRow] as any)[propertyName];
@@ -134,16 +130,13 @@ export default defineComponent({
let newValue = prompt(`Zmień wartość dla rubryki ${this.headerNameList[propertyName]}`, oldValue || '');
if (newValue == null) return;
(this.store.stationList[stationListRow] as any)[propertyName] =
typeof oldValue === 'number' ? parseInt(newValue) : newValue;
(this.store.stationList[stationListRow] as any)[propertyName] = typeof oldValue === 'number' ? parseInt(newValue) : newValue;
// this.$set(this.stationList[stationListRow], propertyName, parseInt(newValue));
this.addChange(station, propertyName, oldValue, typeof oldValue === 'number' ? parseInt(newValue) : newValue);
},
changeCheckpoints(row: number) {
const stationListRow = this.store.stationList.findIndex(
(station) => station.name == this.store.sortedStationList[row].name
);
const stationListRow = this.store.stationList.findIndex((station) => station.name == this.store.sortedStationList[row].name);
if (stationListRow == -1) return;
const oldCheckpoints = this.store.stationList[stationListRow].checkpoints;
@@ -234,4 +227,8 @@ td img {
height: 1.45em;
vertical-align: middle;
}
button {
color: black;
}
</style>