Fix: 调整文件结构 & 隐藏垂直滚动条 & 修正Tauri构建错误
This commit is contained in:
@ -2,12 +2,12 @@
|
|||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"productName": "jinshen-calculator",
|
"productName": "jinshen-calculator",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"identifier": "com.tauri.dev",
|
"identifier": "com.jinshen-calculator.dev",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../dist",
|
"frontendDist": "../dist",
|
||||||
"devUrl": "http://localhost:8080",
|
"devUrl": "http://localhost:8080",
|
||||||
"beforeDevCommand": "bun dev",
|
"beforeDevCommand": "bun run dev",
|
||||||
"beforeBuildCommand": "bun build"
|
"beforeBuildCommand": "bun run build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
|
|||||||
12
src/App.vue
12
src/App.vue
@ -70,12 +70,12 @@
|
|||||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import BeltSpecificationCalculate from '@/components/BeltSpecificationCalculate.vue'
|
import BeltSpecificationCalculate from '@/components/Modules/BeltSpecificationCalculate.vue'
|
||||||
import MultiLayerPaperTapeWidthAngleCalculate from '@/components/MultiLayerPaperTapeWidthAngleCalculate.vue'
|
import MultiLayerPaperTapeWidthAngleCalculate from '@/components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue'
|
||||||
import PaperRollWeightLengthCalculate from '@/components/PaperRollWeightLengthCalculate.vue'
|
import PaperRollWeightLengthCalculate from '@/components/Modules/PaperRollWeightLengthCalculate.vue'
|
||||||
import PaperTapeWidthAngleCalculate from '@/components/PaperTapeWidthAngleCalculate.vue'
|
import PaperTapeWidthAngleCalculate from '@/components/Modules/PaperTapeWidthAngleCalculate.vue'
|
||||||
import PaperTubeProductionCalculate from '@/components/PaperTubeProductionCalculate.vue'
|
import PaperTubeProductionCalculate from '@/components/Modules/PaperTubeProductionCalculate.vue'
|
||||||
import PaperTubeWeightCalculate from '@/components/PaperTubeWeightCalculate.vue'
|
import PaperTubeWeightCalculate from '@/components/Modules/PaperTubeWeightCalculate.vue'
|
||||||
|
|
||||||
const { t, locale } = useI18n()
|
const { t, locale } = useI18n()
|
||||||
|
|
||||||
|
|||||||
13
src/components.d.ts
vendored
13
src/components.d.ts
vendored
@ -9,13 +9,14 @@ export {}
|
|||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
AppFooter: typeof import('./components/AppFooter.vue')['default']
|
AppFooter: typeof import('./components/AppFooter.vue')['default']
|
||||||
BeltSpecificationCalculate: typeof import('./components/BeltSpecificationCalculate.vue')['default']
|
BeltSpecificationCalculate: typeof import('./components/Modules/BeltSpecificationCalculate.vue')['default']
|
||||||
HelloWorld: typeof import('./components/HelloWorld.vue')['default']
|
HelloWorld: typeof import('./components/HelloWorld.vue')['default']
|
||||||
MultiLayerPaperTapeWidthAngleCalculate: typeof import('./components/MultiLayerPaperTapeWidthAngleCalculate.vue')['default']
|
MultiLayerPaperTapeWidthAngleCalculate: typeof import('./components/Modules/MultiLayerPaperTapeWidthAngleCalculate.vue')['default']
|
||||||
PaperRollWeightLengthCalculate: typeof import('./components/PaperRollWeightLengthCalculate.vue')['default']
|
PaperRollWeightLengthCalculate: typeof import('./components/Modules/PaperRollWeightLengthCalculate.vue')['default']
|
||||||
PaperTapeWidthAngleCalculate: typeof import('./components/PaperTapeWidthAngleCalculate.vue')['default']
|
PaperTapeWidthAngleCalculate: typeof import('./components/Modules/PaperTapeWidthAngleCalculate.vue')['default']
|
||||||
PaperTubeProductionCalculate: typeof import('./components/PaperTubeProductionCalculate.vue')['default']
|
PaperTubeProductionCalculate: typeof import('./components/Modules/PaperTubeProductionCalculate.vue')['default']
|
||||||
PaperTubeWeightCalculate: typeof import('./components/PaperTubeWeightCalculate.vue')['default']
|
PaperTubeWeightCalculate: typeof import('./components/Modules/PaperTubeWeightCalculate.vue')['default']
|
||||||
|
ParamInputField: typeof import('./components/ParamInputField.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
}
|
}
|
||||||
|
|||||||
36
src/components/ParamInputField.vue
Normal file
36
src/components/ParamInputField.vue
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<v-text-field
|
||||||
|
density="compact"
|
||||||
|
hide-details
|
||||||
|
:label="label"
|
||||||
|
:model-value="modelValue.value.toString()"
|
||||||
|
:suffix="modelValue.unit"
|
||||||
|
type="number"
|
||||||
|
variant="outlined"
|
||||||
|
@update:model-value="handleUpdate"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type { Param } from '@/types/param'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
label: string
|
||||||
|
modelValue: Param
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'update:modelValue', value: Param): void
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<Props>()
|
||||||
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
|
function handleUpdate (value: string) {
|
||||||
|
const numValue = value === '' ? 0 : Number.parseFloat(value)
|
||||||
|
emit('update:modelValue', {
|
||||||
|
value: numValue,
|
||||||
|
unit: props.modelValue.unit,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const drawer = ref(null)
|
const drawer = ref(false)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
name: 'BaselineLayout',
|
name: 'BaselineLayout',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawer: null,
|
drawer: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,4 +14,12 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
11
src/types/param.ts
Normal file
11
src/types/param.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export interface Param {
|
||||||
|
value: number
|
||||||
|
unit: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createParam (initialValue: number, unit: string): Param {
|
||||||
|
return {
|
||||||
|
value: initialValue,
|
||||||
|
unit,
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user