💄 update ui

This commit is contained in:
LittleBoy 2025-01-12 19:25:32 +08:00
parent 19fc116f73
commit 88a9d3f7db
6 changed files with 31 additions and 16 deletions

View File

@ -102,8 +102,10 @@ function getResultValues(){
const result:{ const result:{
[key: string]: number [key: string]: number
} = {}; } = {};
const {niaosu,weight} = commonValues.value
const inputs: { [key: string]: number }= { const inputs: { [key: string]: number }= {
...commonValues.value, niaosu: niaosu ?Number(niaosu): 0,
weight: weight ?Number(weight): 0,
} }
settingList.value.forEach(it=>{ settingList.value.forEach(it=>{
inputs[it.key] = it.value ? Number(it.value) : 0 inputs[it.key] = it.value ? Number(it.value) : 0
@ -121,7 +123,7 @@ function getResultValues(){
}catch (e) { }catch (e) {
Modal.warning({ Modal.warning({
title: '提示', title: '提示',
content: `计算出错:${e.message}` content: `计算出错:${(e as Error).message}`
}) })
console.error('getResultValues',e,expression) console.error('getResultValues',e,expression)
} }

View File

@ -4,7 +4,7 @@ import { useUserStore } from "../service/user-store.ts";
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import { AppConfig } from "../app-config.ts"; import { AppConfig } from "../app-config.ts";
import { Dropdown, Menu, MenuItem, Button, Modal, Form, Input, message } from "ant-design-vue"; import { App, Dropdown, Menu, MenuItem, Button, Modal, Form, Input, message } from "ant-design-vue";
import { CaretDownOutlined } from "@ant-design/icons-vue" import { CaretDownOutlined } from "@ant-design/icons-vue"
import { MenuInfo } from "ant-design-vue/es/menu/src/interface"; import { MenuInfo } from "ant-design-vue/es/menu/src/interface";
// //
@ -12,6 +12,7 @@ const store = useUserStore()
const showLogo = ref(false) const showLogo = ref(false)
const showUpdateModal = ref(false) const showUpdateModal = ref(false)
const modifyLoading = ref(false) const modifyLoading = ref(false)
const {modal} = App.useApp();
@ -27,7 +28,15 @@ const currentMenus = computed(() => {
const handleMenuClick = ({ key }: MenuInfo) => { const handleMenuClick = ({ key }: MenuInfo) => {
console.log('click menu', key) console.log('click menu', key)
if (key == 'logout') { if (key == 'logout') {
store.logout() modal.confirm({
title: '提示',
content: '确定要清除信息并退出登录吗?',
okText: '立即退出',
cancelText: '取消',
onOk: () => {
store.logout()
}
})
} else if (key == 'modifyPassword') { } else if (key == 'modifyPassword') {
showUpdateModal.value = true showUpdateModal.value = true
} }

View File

@ -39,7 +39,7 @@ function onValuesChange() {
</script> </script>
<template> <template>
<Modal :width="640" :open="true" :footer="null" @cancel="handleCancel" :mask-closable="false" <Modal :width="640" :open="true" :footer="null" @cancel="handleCancel" :mask-closable="false"
:destroy-on-close="true"> :destroy-on-close="true" :title="editData && editData.id && editData.id > 0?'修改营养制剂数据':'新增营养制剂数据'">
<div class="pt-12"> <div class="pt-12">
<Form @finish="handleSave" @finishFailed="handleFinishError" @validate="onValuesChange" autocomplete="off" <Form @finish="handleSave" @finishFailed="handleFinishError" @validate="onValuesChange" autocomplete="off"
:model="currentData" :label-col="{ span: 7 }" :wrapper-col="{ span: 16 }"> :model="currentData" :label-col="{ span: 7 }" :wrapper-col="{ span: 16 }">
@ -47,7 +47,7 @@ function onValuesChange() {
<Form.Item label="营养制剂" name="name" :rules="[{ required: true, message: '请输入营养制剂名称' }]"> <Form.Item label="营养制剂" name="name" :rules="[{ required: true, message: '请输入营养制剂名称' }]">
<Input placeholder="请输入营养制剂名称" v-model:value="currentData.name" /> <Input placeholder="请输入营养制剂名称" v-model:value="currentData.name" />
</Form.Item> </Form.Item>
<Form.Item label="别名" name="alias" :rules="[{ required: true, message: '请输入制剂别名' }]"> <Form.Item label="制剂别名" name="alias" :rules="[{ required: true, message: '请输入制剂别名' }]">
<Input placeholder="请输入别名" v-model:value="currentData.alias" /> <Input placeholder="请输入别名" v-model:value="currentData.alias" />
</Form.Item> </Form.Item>
<Form.Item label="单位" name="unit" :rules="[{ required: true, message: '请输入制剂单位' }]"> <Form.Item label="单位" name="unit" :rules="[{ required: true, message: '请输入制剂单位' }]">

View File

@ -87,7 +87,8 @@ function handleSearch(){
<thead> <thead>
<tr> <tr>
<th>营养制剂</th> <th>营养制剂</th>
<th>Key</th> <th>制剂别名</th>
<th>类型</th>
<th v-for="th in ProductCols">{{ th.name }}</th> <th v-for="th in ProductCols">{{ th.name }}</th>
<th width="100" class="text-center">计量单位</th> <th width="100" class="text-center">计量单位</th>
<th width="150" class="text-center">操作</th> <th width="150" class="text-center">操作</th>
@ -97,6 +98,7 @@ function handleSearch(){
<tr v-for="(tr, rowIndex) in allDataList?.list" :key="rowIndex"> <tr v-for="(tr, rowIndex) in allDataList?.list" :key="rowIndex">
<td>{{ tr.name }}</td> <td>{{ tr.name }}</td>
<td>{{ tr.alias }}</td> <td>{{ tr.alias }}</td>
<td>{{ tr.category == 'gut'?'肠内制剂':'静脉制剂' }}</td>
<td v-for="th in ProductCols">{{ (tr as any)[th.alias] || 'NULL' }}</td> <td v-for="th in ProductCols">{{ (tr as any)[th.alias] || 'NULL' }}</td>
<td>{{ tr.unit }}</td> <td>{{ tr.unit }}</td>

View File

@ -56,14 +56,6 @@ import {inputProducts} from "@/pages/result/test/data-input.ts";
type InputValuesType = { type InputValuesType = {
[key: string]: number; [key: string]: number;
} }
type SettingItem = {
title: string;
value: number | string;
key: string;
placeholder: string;
type: string;
unit?: string;
}
const inputValues = defineModel('inputValues') const inputValues = defineModel('inputValues')
const commonValues = ref({ const commonValues = ref({
weight: '', weight: '',

12
src/vite-env.d.ts vendored
View File

@ -2,4 +2,14 @@
type int = number; type int = number;
type double = number; type double = number;
type bool = boolean; type bool = boolean;
type SettingItem = {
title: string;
value: number | string;
key: string;
placeholder: string;
type: string;
unit?: string;
}