Browse Source

fix: 审计页面;配方页面; 设置页面ui优化; 按钮统一

master
guoapeng 2 weeks ago
parent
commit
4bca79cd5b
  1. 8
      src/components/audit/History.vue
  2. 9
      src/components/audit/OperationRecord.vue
  3. 66
      src/components/formula/FormulaConfig.vue
  4. 20
      src/components/formula/SettingFormulaConfig.vue
  5. 41
      src/layouts/default.vue
  6. 1
      src/views/formula/index.vue
  7. 7
      src/views/setting/index.vue

8
src/components/audit/History.vue

@ -133,10 +133,10 @@ const deleteBtnVisible = computed(() => {
<el-table-column prop="detail" label="操作" width="200"> <el-table-column prop="detail" label="操作" width="200">
<template #default="scoped"> <template #default="scoped">
<div class="user-opera"> <div class="user-opera">
<el-button class="view-button" @click.stop="showDetail(scoped.row)">
<el-button type="primary" @click.stop="showDetail(scoped.row)">
查看 查看
</el-button> </el-button>
<el-button class="print-button" title="打印" @click.stop="printDetail(scoped.row)">
<el-button type="primary" @click.stop="printDetail(scoped.row)">
打印 打印
</el-button> </el-button>
</div> </div>
@ -162,7 +162,9 @@ const deleteBtnVisible = computed(() => {
padding: 10px; padding: 10px;
background: $gradient-color; background: $gradient-color;
.history-export { .history-export {
margin: 10px;
height: 50px;
display: flex;
align-items: center;
} }
.history-table { .history-table {
height: 73vh; height: 73vh;

9
src/components/audit/OperationRecord.vue

@ -83,12 +83,7 @@ const handleCurrentChange = (page: number) => {
getAuditList() getAuditList()
} }
const formatIndex = (
_row: unknown,
_column: TableColumnCtx<unknown>,
_cellValue: unknown,
index: number,
): number => {
const formatIndex = (_row: unknown, _column: TableColumnCtx<unknown>, _cellValue: unknown, index: number): number => {
return (pageNum.value - 1) * pageSize.value + index + 1 return (pageNum.value - 1) * pageSize.value + index + 1
} }
</script> </script>
@ -121,7 +116,7 @@ const formatIndex = (
background: $gradient-color; background: $gradient-color;
.audit-export { .audit-export {
height: 50px; height: 50px;
padding: 0 10px;
//padding: 0 10px;
display: flex; display: flex;
align-items: center; align-items: center;
} }

66
src/components/formula/FormulaConfig.vue

@ -1,5 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import SoftKeyboard from 'components/common/SoftKeyboard/index.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { formulaNameMap } from 'libs/constant' import { formulaNameMap } from 'libs/constant'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
@ -14,8 +13,6 @@ const homeStore = useHomeStore()
const formulaStore = useFormulaStore() const formulaStore = useFormulaStore()
const targetInputRef = ref<HTMLInputElement | null>(null)
const isFlip = ref(true) const isFlip = ref(true)
/** /**
* 当前表单数据 * 当前表单数据
@ -28,21 +25,6 @@ const formData = ref<Record<string, any>>({})
const inputValue = ref<string>('') const inputValue = ref<string>('')
/** /**
* 软键盘是否可见
*/
const keyboardVisible = ref(false)
/**
* 软键盘类型'text' 'number'
*/
const keyboardType = ref<'text' | 'number'>('number')
/**
* 软键盘组件引用
*/
const softKeyboardRef = ref()
/**
* 当前聚焦的输入字段名称 * 当前聚焦的输入字段名称
*/ */
const focusedInput = ref<string | null>(null) const focusedInput = ref<string | null>(null)
@ -178,14 +160,6 @@ const deviceState = computed(() => {
return disinfectionState.value.state === 'idle' || disinfectionState.value.state === 'finished' return disinfectionState.value.state === 'idle' || disinfectionState.value.state === 'finished'
}) })
/**
* 确认输入值
* @param {string} value - 输入值
*/
const handleConfirm = (value: string) => {
console.log('确认输入:', value)
}
const size = 'default' const size = 'default'
// //
const addFormula = async () => { const addFormula = async () => {
@ -229,7 +203,15 @@ const validateName = (rule: any, value: any, callback: any) => {
<template> <template>
<transition name="slide-right"> <transition name="slide-right">
<div v-if="isFlip" class="formula-form"> <div v-if="isFlip" class="formula-form">
<el-form ref="formRef" :model="formData" label-width="auto" label-position="right" :size="size" inline>
<el-form
ref="formRef"
:model="formData"
class="form-box"
label-width="auto"
label-position="right"
:size="size"
inline
>
<el-form-item <el-form-item
label="配方名称" label="配方名称"
style="width: 93%" style="width: 93%"
@ -289,27 +271,11 @@ const validateName = (rule: any, value: any, callback: any) => {
</template> </template>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div>
<slot name="formulaBtn">
<div class="default-btn"> <div class="default-btn">
<el-button type="primary" class="config-btn" @click="handleSubmit"> <el-button type="primary" class="config-btn" @click="handleSubmit">
确定 确定
</el-button> </el-button>
</div> </div>
</slot>
</div>
<Teleport to="body">
<SoftKeyboard
ref="softKeyboardRef"
v-model="inputValue"
:is-visible="keyboardVisible"
:keyboard-type="keyboardType"
:target-input="targetInputRef"
@confirm="handleConfirm"
@update-keyboard-visible="visible => (keyboardVisible = visible)"
@close="keyboardVisible = false"
/>
</Teleport>
</div> </div>
</transition> </transition>
</template> </template>
@ -317,16 +283,20 @@ const validateName = (rule: any, value: any, callback: any) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.formula-form { .formula-form {
font-size: 20px !important; font-size: 20px !important;
padding: 5px 5px 5px 15px;
align-items: center; align-items: center;
height: 100%;
.form-box {
height: calc(100% - 50px);
overflow: auto;
}
.default-btn { .default-btn {
margin-top: 1rem;
height: 50px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
.el-button {
width: 100px;
} }
.config-btn {
//height: 3rem;
//width: 8rem;
} }
} }

20
src/components/formula/SettingFormulaConfig.vue

@ -84,6 +84,7 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
<div class="formula-form"> <div class="formula-form">
<el-form <el-form
ref="settingFormRef" ref="settingFormRef"
class="form-box"
:disabled="!props.editable" :disabled="!props.editable"
:model="formData" :model="formData"
label-width="auto" label-width="auto"
@ -146,32 +147,31 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form
</template> </template>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div>
<slot name="formulaBtn">
<div class="default-btn"> <div class="default-btn">
<el-button v-if="editable" type="primary" @click="handleSubmit"> <el-button v-if="editable" type="primary" @click="handleSubmit">
确定 确定
</el-button> </el-button>
</div> </div>
</slot>
</div>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.formula-form { .formula-form {
font-size: 20px !important; font-size: 20px !important;
padding: 5px;
padding-left: 15px;
height: 100%;
align-items: center; align-items: center;
.form-box {
height: calc(100% - 50px);
overflow: auto;
}
.default-btn { .default-btn {
width: 100%;
height: 50px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
.el-button {
width: 100px;
} }
.config-btn {
height: 3rem;
width: 8rem;
} }
} }

41
src/layouts/default.vue

@ -227,9 +227,7 @@ const handleCloseAll = async () => {
<div class="logo"> <div class="logo">
<img src="../assets/images/logo.svg" alt=""> <img src="../assets/images/logo.svg" alt="">
</div> </div>
<div class="header-right">
<div class="header-menu"> <div class="header-menu">
<div class="aside">
<el-tag <el-tag
v-for="item in menuList.filter(item => item.meta!.isDefault)" v-for="item in menuList.filter(item => item.meta!.isDefault)"
:key="item.path" :key="item.path"
@ -255,7 +253,6 @@ const handleCloseAll = async () => {
</template> </template>
</el-tag> </el-tag>
</div> </div>
</div>
<div class="user"> <div class="user">
<span v-if="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B"> <span v-if="deviceType === deviceStore.deviceTypeMap.LargeSpaceDM_B">
<img v-if="websocketConnected" width="20" :src="WifiConnSvg" alt=""> <img v-if="websocketConnected" width="20" :src="WifiConnSvg" alt="">
@ -272,8 +269,7 @@ const handleCloseAll = async () => {
{{ language.name }} {{ language.name }}
</el-option> </el-option>
</el-select> </el-select>
<bt-button type="primary" button-text="注销" @click="onLogout" />
</div>
<bt-button style="margin-left: auto" type="primary" button-text="注销" @click="onLogout" />
</div> </div>
</el-header> </el-header>
<el-container class="container"> <el-container class="container">
@ -374,6 +370,9 @@ const handleCloseAll = async () => {
.header { .header {
color: #393f46; color: #393f46;
box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15); box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15);
display: flex;
padding: 0 10px;
justify-content: center;
.logo { .logo {
height: 22px; height: 22px;
@ -398,12 +397,14 @@ const handleCloseAll = async () => {
transition: all 0.3s; transition: all 0.3s;
} }
} }
.header-right {
.header-menu {
flex: 1;
width: 50%;
height: 100%;
display: flex; display: flex;
padding: 0 10px;
align-items: center; align-items: center;
height: 100%;
.header-menu {
width: 68vw;
justify-content: center;
} }
.wifi-icon { .wifi-icon {
width: 40px; width: 40px;
@ -417,19 +418,17 @@ const handleCloseAll = async () => {
height: 50%; height: 50%;
} }
} }
}
.user { .user {
width: 20vw;
//width: 20vw;
text-align: right; text-align: right;
right: 5px;
margin-left: auto;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 25px;
padding-left: 10px; padding-left: 10px;
.select-language { .select-language {
width: 100px;
width: 80px;
border-radius: 5px; border-radius: 5px;
margin-right: 5px;
margin: 0 10px;
} }
.user-logout { .user-logout {
margin-left: auto; margin-left: auto;
@ -466,20 +465,16 @@ const handleCloseAll = async () => {
:deep(.el-popover) { :deep(.el-popover) {
padding: 10px !important; padding: 10px !important;
} }
.aside {
overflow: hidden;
padding-left: 10px;
display: flex;
align-items: center;
.menu-tag { .menu-tag {
height: 36px; height: 36px;
border: 0; border: 0;
width: 10rem; width: 10rem;
display: flex; display: flex;
border-radius: 3px;
gap: 5px; gap: 5px;
font-size: 1.6vw; font-size: 1.6vw;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
transition: background-color 0.5s;
transition: all 0.5s;
} }
.menu-tags { .menu-tags {
display: flex; display: flex;
@ -510,7 +505,7 @@ const handleCloseAll = async () => {
background: #1989fa; background: #1989fa;
display: flex; display: flex;
justify-content: center; justify-content: center;
}
border-radius: 10px;
} }
.aside-off { .aside-off {
@ -544,7 +539,7 @@ const handleCloseAll = async () => {
} }
.content { .content {
width: 100%; width: 100%;
height: $main-container-height;
height: 100%;
padding: 10px; padding: 10px;
} }
.footer-expand { .footer-expand {

1
src/views/formula/index.vue

@ -82,6 +82,7 @@ const selectedIndexRest = () => {
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
padding: 10px;
} }
} }
</style> </style>

7
src/views/setting/index.vue

@ -38,9 +38,10 @@ const selectItem = (menuCode: string) => {
</div> </div>
</div> </div>
<div class="setting-right"> <div class="setting-right">
<div v-if="selectedMenuCode === 'defaultFormula'">
<SettingFormulaConfig :editable="systemStore.systemUser?.roleType === 'admin'" />
</div>
<SettingFormulaConfig
v-if="selectedMenuCode === 'defaultFormula'"
:editable="systemStore.systemUser?.roleType === 'admin'"
/>
<template v-if="selectedMenuCode === 'user'"> <template v-if="selectedMenuCode === 'user'">
<User /> <User />
</template> </template>

Loading…
Cancel
Save