!8094 开门,关门功能

Merge pull request !8094 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-01-18 15:18:35 +00:00
committed by Gitee
@@ -9,14 +9,14 @@
<t t-inherit="web.FormView" t-inherit-mode="extension">
<xpath expr="//Layout//t[@t-set-slot='control-panel-create-button']" position="before">
<t t-portal="'.th_custom_control_panel_buttons'" t-if="env.isSmall">
<div class="d-flex gap-1" t-if="!model.root.isInEdition and ! model.root.isNew ">
<div class="d-flex gap-1" t-if="!model.root.isInEdition and buttonState.showEditButton">
<t if="canCreate">
<button type="button" class="btn btn-outline-primary o_form_button_create" data-hotkey="c" t-on-click.stop="create">新建</button>
</t>
<button type="button" class="btn btn-outline-primary o_form_button_edit" t-on-click="edit" data-hotkey="a">编辑</button>
</div>
<t t-if="model.root.isInEdition or model.root.isNew ">
<t t-if="model.root.isInEdition and buttonState.formRendered">
<div class="o_form_buttons_edit">
<button id="editButton" type="button" class="btn btn-secondary o_form_button_save" t-on-click="saveButtonClicked" data-hotkey="s">
<i class="fa fa-cloud-upload fa-fw" />
@@ -59,7 +59,28 @@
<xpath expr="////div[@class='o_control_panel d-flex flex-column gap-3 gap-lg-1 px-3 pt-2 pb-3']" position="after">
<div class="o_control_panel th_custom_control_panel d-flex gap-1" t-if="env.isSmall">
<div class="th_custom_control_panel_buttons">
<!-- 用于放置按钮-->
<!-- 用于放置按钮-->
<div class="d-flex gap-1" t-if="!model.root.isInEdition and buttonState.showEditButton">
<t if="canCreate">
<button type="button" class="btn btn-outline-primary o_form_button_create" data-hotkey="c" t-on-click.stop="create">新建</button>
</t>
<button type="button" class="btn btn-outline-primary o_form_button_edit" t-on-click="edit" data-hotkey="a">编辑</button>
</div>
<t t-if="model.root.isInEdition and buttonState.formRendered">
<div class="o_form_buttons_edit">
<button id="editButton" type="button" class="btn btn-secondary o_form_button_save" t-on-click="saveButtonClicked" data-hotkey="s">
<i class="fa fa-cloud-upload fa-fw" />
保存
</button>
<button type="button" id="formDiscard" class="btn btn-secondary" t-on-click="discard" data-hotkey="j">
<i class="fa fa-undo fa-fw" />
丢弃
</button>
</div>
</t>
</div>
<!-- 返回箭头-->