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