fix: tsconfig, types
This commit is contained in:
@@ -22,7 +22,7 @@ const pushOrRemove = (option: T) => {
|
|||||||
|
|
||||||
const setNullIds = () => {
|
const setNullIds = () => {
|
||||||
selected.value = selected.value.map(item => {
|
selected.value = selected.value.map(item => {
|
||||||
item[entityId] = 0
|
(item as any)[entityId] = 0
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const colorize = (data: PostType): string => {
|
|||||||
if (data.Name === "test") {
|
if (data.Name === "test") {
|
||||||
return "red";
|
return "red";
|
||||||
}
|
}
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ async function handleSave() {
|
|||||||
const mode = props.updateMode ? 'update' : 'create';
|
const mode = props.updateMode ? 'update' : 'create';
|
||||||
const result = await props.validate(editableItem.value as T, mode);
|
const result = await props.validate(editableItem.value as T, mode);
|
||||||
if (result.status === 'error') {
|
if (result.status === 'error') {
|
||||||
errorStore.summon(result.message);
|
errorStore.summon(result.message ?? 'Ошибка валидации');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -52,7 +52,7 @@ async function handleSave() {
|
|||||||
await emits('onSave', editableItem.value as T);
|
await emits('onSave', editableItem.value as T);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errorStore.summon(e.message)
|
errorStore.summon((e as Error).message ?? 'Ошибка сохранения');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
props.load()
|
props.load()
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ watch(() => props.items, () => {
|
|||||||
props.items.forEach(item => {
|
props.items.forEach(item => {
|
||||||
const tr = trs[item.Id];
|
const tr = trs[item.Id];
|
||||||
if (tr) {
|
if (tr) {
|
||||||
tr.style.backgroundColor = props.colorize(item);
|
tr.style.backgroundColor = props.colorize!(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { PrimitiveFieldType } from "../../types/primitive-field-type.type"
|
import type { PrimitiveFieldType } from "../../types/primitive-field-type.type"
|
||||||
import { toDate } from "./converters.util";
|
import { toDate } from "./converters.util";
|
||||||
|
|
||||||
export const viewDate = (data: unknown, type: PrimitiveFieldType) => {
|
export const viewDate = (data: unknown, type?: PrimitiveFieldType) => {
|
||||||
if (type !== 'date') return data;
|
if (type !== 'date') return data;
|
||||||
return toDate(data as number | Date).toLocaleDateString('ru-RU', {
|
return toDate(data as number | Date).toLocaleDateString('ru-RU', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
|||||||
@@ -5,11 +5,9 @@
|
|||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": false,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUnusedLocals": false,
|
"noUncheckedSideEffectImports": true,
|
||||||
"noUnusedParameters": false,
|
"strictNullChecks": true,
|
||||||
"noFallthroughCasesInSwitch": false,
|
|
||||||
"noUncheckedSideEffectImports": false,
|
|
||||||
"lib": ["ES2015", "DOM"]
|
"lib": ["ES2015", "DOM"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
|
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||||
|
|||||||
BIN
wails_windows_amd64.syso
Normal file
BIN
wails_windows_amd64.syso
Normal file
Binary file not shown.
Reference in New Issue
Block a user