Odoo16 实用功能之Form视图详解(表单视图)

 

目录

1、什么是Form视图

2、Form视图的结构

3、源码示例

 

 


 

 

1、什么是Form视图

        Form视图是用于查看和编辑数据库记录的界面。每个数据库模型在Odoo中都有一个Form视图,用于显示该模型的数据。Form视图提供了一个可编辑的界面,允许用户查看和修改数据库记录的字段值。

2、Form视图的结构

  • 页眉(Header): 通常包含记录的标题或按钮信息。

  • 主体(Body): 包含字段的输入框、选择框、按钮等,用于展示和编辑记录的具体数据。

  • 页脚(Footer): 包含操作按钮,例如保存、取消等。

 

示例

<record id="view_my_model_form" model="ir.ui.view">
    <field name="name">my.model.form</field>
    <field name="model">my.model</field>
    <field name="arch" type="xml">
        <form>
            <group>
                <field name="name"/>
                <field name="description"/>
                <!-- 其他字段... -->
            </group>
            <footer>
                <button string="Save" class="oe_highlight" type="object" name="save"/>
                <button string="Cancel" class="oe_link" special="cancel"/>
            </footer>
        </form>
    </field>
</record>

3、源码示例

这里以CRM中的渠道作为讲解

 

 

源码:

 <record id="crm_lead_view_form" model="ir.ui.view">
            <field name="name">crm.lead.form</field>
            <field name="model">crm.lead</field>
            <field name="arch" type="xml">
                <form class="o_lead_opportunity_form" js_class="crm_form">
                    <header>
                        <button name="action_set_won_rainbowman" string="Won"
                            type="object" class="oe_highlight" data-hotkey="w" title="Mark as won"
                            attrs="{'invisible': ['|','|', ('active','=',False), ('probability', '=', 100), ('type', '=', 'lead')]}"/>
                        <button name="%(crm.crm_lead_lost_action)d" string="Lost" data-hotkey="l" title="Mark as lost"
                            type="action" context="{'default_lead_id': active_id}" attrs="{'invisible': ['|', ('type', '=', 'lead'), '&amp;',('active', '=', False),('probability', '&lt;', 100)]}"/>
                        <button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action" help="Convert to Opportunity"
                            class="oe_highlight" attrs="{'invisible': ['|', ('type', '=', 'opportunity'), ('active', '=', False)]}" data-hotkey="v"/>
                        <button name="toggle_active" string="Restore" type="object" data-hotkey="z"
                            attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}"/>
                        <button name="action_set_lost" string="Lost" type="object" data-hotkey="l" title="Mark as lost"
                            attrs="{'invisible': ['|', ('type', '=', 'opportunity'), '&amp;', ('probability', '=', 0), ('active', '=', False)]}"/>
                        <field name="stage_id" widget="statusbar" class="o_field_statusbar"
                            options="{'clickable': '1', 'fold_field': 'fold'}"
                            domain="['|', ('team_id', '=', team_id), ('team_id', '=', False)]"
                            attrs="{'invisible': ['|', ('active', '=', False), ('type', '=', 'lead')]}"/>
                    </header>
                    <sheet>
                        <field name="active" invisible="1"/>
                        <field name="company_id" invisible="1"/>
                        <div class="oe_button_box" name="button_box">
                            <button name="action_schedule_meeting" type="object"
                                class="oe_stat_button" icon="fa-calendar"
                                context="{'partner_id': partner_id}"
                                attrs="{'invisible': [('type', '=', 'lead')]}">
                                <div class="o_stat_info">
                                    <field name="calendar_event_count" class="o_stat_value"/>
                                    <span class="o_stat_text" attrs="{'invisible': [('calendar_event_count', '&lt;', 2)]}"> Meetings</span>
                                    <span class="o_stat_text" attrs="{'invisible': [('calendar_event_count', '&gt;', 1)]}"> Meeting</span>
                                </div>
                            </button>
                            <button name="action_show_potential_duplicates" type="object"
                                class="oe_stat_button" icon="fa-star"
                                attrs="{'invisible': [('duplicate_lead_count', '&lt;', 1)]}">
                                <div class="o_stat_info">
                                    <field name="duplicate_lead_count" class="o_stat_value"/>
                                    <span class="o_stat_text" attrs="{'invisible': [('duplicate_lead_count', '&lt;', 2)]}">Similar Leads</span>
                                    <span class="o_stat_text" attrs="{'invisible': [('duplicate_lead_count', '&gt;', 1)]}">Similar Lead</span>
                                </div>
                            </button>
                        </div>
                        <widget name="web_ribbon" title="Lost" bg_color="bg-danger" attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}"/>
                        <widget name="web_ribbon" title="Won" attrs="{'invisible': [('probability', '&lt;', 100)]}" />
                        <div class="oe_title">
                            <h1><field class="text-break" name="name" placeholder="e.g. Product Pricing"/></h1>
                            <h2 class="d-flex gap-2 g-0 align-items-end pb-3">
                                <div attrs="{'invisible': [('type', '=', 'lead')]}">
                                    <label for="expected_revenue" class="oe_edit_only pb-1" />
                                    <div class="d-flex align-items-end">
                                        <field name="company_currency" invisible="1"/>
                                        <field name="expected_revenue" class="oe_inline o_input_8ch" widget='monetary' options="{'currency_field': 'company_currency'}"/>
                                        <span class="oe_grey p-2" groups="crm.group_use_recurring_revenues"> + </span>
                                        <span class="oe_grey p-2" groups="!crm.group_use_recurring_revenues"> at </span>
                                    </div>
                                </div>
                                <div attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
                                    <field name="recurring_revenue" class="oe_inline o_input_10ch" widget="monetary" options="{'currency_field': 'company_currency'}"/>
                                </div>
                                <div attrs="{'invisible': [('type', '=', 'lead')]}" groups="crm.group_use_recurring_revenues">
                                    <div class="d-flex align-items-end ps-2">
                                        <field name="recurring_plan" class="oe_inline o_input_12ch" placeholder="E.g. Monthly"
                                               attrs="{'required': [('recurring_revenue', '!=', 0)]}" options="{'no_create': True, 'no_open': True}"/>
                                        <span class="oe_grey p-2"> at </span>
                                    </div>
                                </div>
                                <div>
                                    <div class="oe_edit_only d-md-flex align-items-center">
                                        <label for="probability"/>
                                        <div class="d-flex align-items-center">
                                            <button class="ps-0 ps-md-2 btn btn-link" name="action_set_automated_probability" type="object"
                                                    attrs="{'invisible': [('is_automated_probability', '=', True)]}">
                                                <i class="fa fa-gear" role="img" title="Switch to automatic probability" aria-label="Switch to automatic probability"></i>
                                            </button>
                                            <small class="oe_grey h6 mb0 d-flex" attrs="{'invisible': [('is_automated_probability', '=', True)]}">
                                                <field class="mb0" name="automated_probability" force_save="1"/> %
                                            </small>
                                        </div>
                                    </div>
                                    <div id="probability" class="d-inline-block">
                                        <field name="is_automated_probability" invisible="1"/>
                                        <field name="probability" widget="float" class="oe_inline o_input_6ch"/>
                                        <span class="oe_grey"> %</span>
                                    </div>
                                </div>
                            </h2>
                        </div>
                        <group>
                            <group name="lead_partner" attrs="{'invisible': [('type', '=', 'opportunity')]}">
                                <!-- Preload all the partner's information -->
                                <field name="is_partner_visible" invisible='1'/>
                                <field name="partner_id" widget="res_partner_many2one"
                                    context="{
                                        'default_name': contact_name,
                                        'default_title': title,
                                        'default_street': street,
                                        'default_street2': street2,
                                        'default_city': city,
                                        'default_state_id': state_id,
                                        'default_zip': zip,
                                        'default_country_id': country_id,
                                        'default_function': function,
                                        'default_phone': phone,
                                        'default_mobile': mobile,
                                        'default_email': email_from,
                                        'default_user_id': user_id,
                                        'default_team_id': team_id,
                                        'default_website': website,
                                        'default_lang': lang_code,
                                        'show_vat': True
                                    }" attrs="{'invisible': [('is_partner_visible', '=', False)]}"/>
                                <field name="partner_name"/>
                                <label for="street" string="Address"/>
                                <div class="o_address_format">
                                    <field name="street" placeholder="Street..." class="o_address_street"/>
                                    <field name="street2" placeholder="Street 2..." class="o_address_street"/>
                                    <field name="city" placeholder="City" class="o_address_city"/>
                                    <field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
                                    <field name="zip" placeholder="ZIP" class="o_address_zip"/>
                                    <field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
                                </div>
                                <field name="website" widget="url" placeholder="e.g. https://www.odoo.com"/>
                                <field name="lang_active_count" invisible="1"/>
                                <field name="lang_code" invisible="1"/>
                                <field name="lang_id" attrs="{'invisible': [('lang_active_count', '&lt;=', 1)]}"
                                    options="{'no_quick_create': True, 'no_create_edit': True, 'no_open': True}"/>
                            </group>

                            <group name="opportunity_partner" attrs="{'invisible': [('type', '=', 'lead')]}">
                                <field name="partner_id"
                                    widget="res_partner_many2one"
                                    string="Customer"
                                    context="{'res_partner_search_mode': type == 'opportunity' and 'customer' or False,
                                        'default_name': contact_name or partner_name,
                                        'default_street': street,
                                        'default_is_company': type == 'opportunity' and contact_name == False,
                                        'default_company_name': type == 'opportunity' and partner_name,
                                        'default_street2': street2,
                                        'default_city': city,
                                        'default_title': title,
                                        'default_state_id': state_id,
                                        'default_zip': zip,
                                        'default_country_id': country_id,
                                        'default_function': function,
                                        'default_phone': phone,
                                        'default_mobile': mobile,
                                        'default_email': email_from,
                                        'default_user_id': user_id,
                                        'default_team_id': team_id,
                                        'default_website': website,
                                        'default_lang': lang_code,
                                        'show_vat': True,
                                    }"
                                />
                                <field name="is_blacklisted" invisible="1"/>
                                <field name="partner_is_blacklisted" invisible="1"/>
                                <field name="phone_blacklisted" invisible="1"/>
                                <field name="mobile_blacklisted" invisible="1"/>
                                <field name="email_state" invisible="1"/>
                                <field name="phone_state" invisible="1"/>
                                <field name="partner_email_update" invisible="1"/>
                                <field name="partner_phone_update" invisible="1"/>
                                <label for="email_from" class="oe_inline"/>
                                <div class="o_row o_row_readonly">
                                    <button name="mail_action_blacklist_remove" class="fa fa-ban text-danger"
                                        title="This email is blacklisted for mass mailings. Click to unblacklist."
                                        type="object" context="{'default_email': email_from}" groups="base.group_user"
                                        attrs="{'invisible': [('is_blacklisted', '=', False)]}"/>
                                    <field name="email_from" string="Email" widget="email"/>
                                    <span class="fa fa-exclamation-triangle text-warning oe_edit_only"
                                        title="By saving this change, the customer email will also be updated."
                                        attrs="{'invisible': [('partner_email_update', '=', False)]}"/>
                                </div>
                                <label for="phone" class="oe_inline"/>
                                <div class="o_row o_row_readonly">
                                    <button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
                                        title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
                                        type="object" context="{'default_phone': phone}" groups="base.group_user"
                                        attrs="{'invisible': [('phone_blacklisted', '=', False)]}"/>
                                    <field name="phone" widget="phone"/>
                                    <span class="fa fa-exclamation-triangle text-warning oe_edit_only"
                                        title="By saving this change, the customer phone number will also be updated."
                                        attrs="{'invisible': [('partner_phone_update', '=', False)]}"/>
                                </div>
                                <field name="lost_reason_id" attrs="{'invisible': [('active', '=', True)]}"/>
                                <field name="date_conversion" invisible="1"/>
                                <field name="user_company_ids" invisible="1"/>
                            </group>
                            <group name="lead_info" attrs="{'invisible': [('type', '=', 'opportunity')]}">
                                <label for="contact_name"/>
                                <div class="o_row">
                                    <field name="contact_name"/>
                                    <field name="title" placeholder="Title" domain="[]" options='{"no_open": True}'/>
                                </div>
                                <field name="is_blacklisted" invisible="1"/>
                                <field name="phone_blacklisted" invisible="1"/>
                                <field name="email_state" invisible="1"/>
                                <field name="phone_state" invisible="1"/>
                                <field name="partner_email_update" invisible="1"/>
                                <field name="partner_phone_update" invisible="1"/>
                                <label for="email_from_group_lead_info" class="oe_inline"/>
                                <div class="o_row o_row_readonly">
                                    <button name="mail_action_blacklist_remove" class="fa fa-ban text-danger"
                                        title="This email is blacklisted for mass mailings. Click to unblacklist."
                                        type="object" context="{'default_email': email_from}" groups="base.group_user"
                                        attrs="{'invisible': [('is_blacklisted', '=', False)]}"/>
                                    <field name="email_from" id="email_from_group_lead_info" string="Email" widget="email"/>
                                    <span class="fa fa-exclamation-triangle text-warning oe_edit_only"
                                        title="By saving this change, the customer email will also be updated."
                                        attrs="{'invisible': [('partner_email_update', '=', False)]}"/>
                                </div>
                                <field name="email_cc" groups="base.group_no_one"/>
                                <field name="function"/>
                                <label for="phone_group_lead_info" class="oe_inline"/>
                                <div class="o_row o_row_readonly">
                                    <button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
                                        title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
                                        type="object" context="{'default_phone': phone}" groups="base.group_user"
                                        attrs="{'invisible': [('phone_blacklisted', '=', False)]}"/>
                                    <field name="phone" id="phone_group_lead_info" widget="phone"/>
                                    <span class="fa fa-exclamation-triangle text-warning oe_edit_only"
                                        title="By saving this change, the customer phone number will also be updated."
                                        attrs="{'invisible': [('partner_phone_update', '=', False)]}"/>
                                </div>
                                <label for="mobile" class="oe_inline"/>
                                <div class="o_row o_row_readonly">
                                    <button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
                                        title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
                                        type="object" context="{'default_phone': mobile}" groups="base.group_user"
                                        attrs="{'invisible': [('mobile_blacklisted', '=', False)]}"/>
                                    <field name="mobile" widget="phone" string="Mobile"/>
                                </div>
                            </group>
                            <field name="type" invisible="1"/>
                            <group attrs="{'invisible': [('type', '=', 'lead')]}">
                                <field name="user_id"
                                    context="{'default_sales_team_id': team_id}" widget="many2one_avatar_user"/>
                                <label for="date_deadline">Expected Closing</label>
                                <div class="o_lead_opportunity_form_inline_fields">
                                    <field name="date_deadline" nolabel="1" class="oe_inline"/>
                                    <field name="priority" widget="priority" nolabel="1" class="oe_inline align-top"/>
                                </div>
                                <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
                            </group>
                            <group attrs="{'invisible': [('type', '=', 'opportunity')]}">
                                <field name="user_id"
                                    context="{'default_sales_team_id': team_id}" widget="many2one_avatar_user"/>
                                <field name="team_id" options="{'no_open': True, 'no_create': True}"/>
                            </group>
                            <group name="lead_priority" attrs="{'invisible': [('type', '=', 'opportunity')]}">
                                <field name="priority" widget="priority"/>
                                <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
                            </group>
                        </group>
                        <field attrs="{'invisible': [('team_id', '=', False)]}"
                            name="lead_properties" nolabel="1" columns="2" hideKanbanOption="1"/>
                        <notebook>
                            <page string="Internal Notes" name="internal_notes">
                                <field name="description" placeholder="Add a description..." options="{'collaborative': true}" />
                            </page>
                            <page name="extra" string="Extra Info" attrs="{'invisible': [('type', '=', 'opportunity')]}">
                                <group>
                                    <group string="Email" groups="base.group_no_one">
                                        <field name="message_bounce" readonly="1"/>
                                    </group>
                                    <group string="Marketing" name="categorization">
                                        <field name="company_id"
                                            groups="base.group_multi_company"
                                            options="{'no_create': True}"/>
                                        <field name="campaign_id" options="{'create_name_field': 'title', 'always_reload': True}"/>
                                        <field name="medium_id"/>
                                        <field name="source_id"/>
                                        <field name="referred"/>
                                    </group>
                                    <group string="Analysis">
                                        <field name="date_open"/>
                                        <field name="date_closed"/>
                                    </group>
                                </group>
                            </page>
                            <page name="lead" string="Extra Information" attrs="{'invisible': [('type', '=', 'lead')]}">
                                <group>
                                    <group string="Contact Information">
                                        <field name="partner_name"/>
                                        <label for="street_page_lead" string="Address"/>
                                        <div class="o_address_format">
                                            <field name="street" id="street_page_lead" placeholder="Street..." class="o_address_street"/>
                                            <field name="street2" placeholder="Street 2..." class="o_address_street"/>
                                            <field name="city" placeholder="City" class="o_address_city"/>
                                            <field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
                                            <field name="zip" placeholder="ZIP" class="o_address_zip"/>
                                            <field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
                                        </div>
                                        <field name="website" widget="url" placeholder="e.g. https://www.odoo.com"/>
                                        <field name="lang_active_count" invisible="1"/>
                                        <field name="lang_id" attrs="{'invisible': [('lang_active_count', '&lt;=', 1)]}"
                                            options="{'no_quick_create': True, 'no_create_edit': True, 'no_open': True}"/>
                                    </group>
                                    <group class="mt48">
                                        <label for="contact_name_page_lead"/>
                                        <div class="o_row">
                                            <field name="contact_name" id="contact_name_page_lead"/>
                                            <field name="title" placeholder="Title" domain="[]" options='{"no_open": True}'/>
                                        </div>
                                        <field name="function"/>
                                        <label for="mobile_page_lead" class="oe_inline"/>
                                        <div class="o_row o_row_readonly">
                                            <button name="phone_action_blacklist_remove" class="fa fa-ban text-danger"
                                                title="This phone number is blacklisted for SMS Marketing. Click to unblacklist."
                                                type="object" context="{'default_phone': mobile}" groups="base.group_user"
                                                attrs="{'invisible': [('mobile_blacklisted', '=', False)]}"/>
                                            <field name="mobile" id="mobile_page_lead" widget="phone"/>
                                        </div>
                                    </group>
                                    <group string="Marketing">
                                        <field name="campaign_id" options="{'create_name_field': 'title', 'always_reload': True}"/>
                                        <field name="medium_id" />
                                        <field name="source_id" />
                                        <field name="referred"/>
                                    </group>
                                    <group string="Tracking" name="Misc">
                                        <field name="company_id"
                                            groups="base.group_multi_company"
                                            options="{'no_create': True}"/>
                                        <field name="team_id" options="{'no_open': True, 'no_create': True}"/>
                                        <field name="day_open" />
                                        <field name="day_close"/>
                                        <field name="type" invisible="1"/>
                                    </group>
                                </group>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids"/>
                        <field name="activity_ids"/>
                        <field name="message_ids" options="{'post_refresh': 'recipients'}"/>
                    </div>
                </form>
            </field>
        </record>

参数解释:

  1. <record> 元素:

    • id="crm_lead_view_form":视图的唯一标识符,用于在其他地方引用该视图。
    • model="ir.ui.view":指定模型为 ir.ui.view,这是Odoo中用于存储用户界面视图定义的模型。
  2. <field> 元素:

    • name="name":视图的名称,用于在Odoo界面中标识该视图。
    • model="crm.lead":指定模型为 crm.lead,表示该视图关联到 crm.lead 模型。
  3. <form> 元素:

    • class="o_lead_opportunity_form":为视图添加CSS类名,可以用于自定义视图的样式。
    • js_class="crm_form":为视图添加JavaScript类名,可用于自定义视图的行为。
  4. <header> 元素:

    • 包含了在 Form 视图的顶部显示的按钮和字段,如 "Won"、"Lost"、"Convert to Opportunity" 等。
  5. <button> 元素:

    • name:按钮的方法名称,点击按钮时会触发该方法。
    • string:按钮上显示的文本。
    • type:按钮的类型,可以是 "object" 或 "action"。
    • class:CSS类,用于自定义按钮的样式。
    • data-hotkey:定义热键,用户可以通过键盘快捷键触发按钮。
    • context:上下文,传递给按钮触发的方法。
  6. <field> 元素:

    • name="stage_id":展示了一个阶段的字段,使用了 widget="statusbar",显示为状态栏。
    • domain:定义了字段的域(过滤条件)。
  7. <sheet> 元素:

    • 包含了 Form 视图主体的内容,包括字段、按钮、页签等。
  8. <widget> 元素:

    • name="web_ribbon":自定义小部件,用于在记录上显示标签,如 "Lost" 或 "Won"。
    • title:小部件的标题。
    • bg_color:背景颜色,用于区分不同的标签。
  9. <div> 元素:

    • class="oe_button_box":包含按钮的容器,用于自定义按钮的布局。
  10. <notebook> 元素:

    • 包含了多个页签,每个页签使用 <page> 元素定义。这里有 "Internal Notes"、"Extra Info" 和 "Extra Information" 三个页签。
  11. <group> 元素:

    • 包含了一组相关的字段,可以通过 attrs 属性控制字段组的可见性。
  12. <field> 元素:

    • widget="many2one_avatar_user":使用了 many2one_avatar_user 小部件,用于选择用户,并显示用户的头像。
  13. <button> 元素:

    • name="action_schedule_meeting":触发一个方法来安排会议。
    • context:定义了在触发方法时传递给方法的上下文。
  14. <widget> 元素:

    • name="web_ribbon":自定义小部件,用于显示记录的标签。
  15. <notebook> 中的 <page> 元素:

    • 包含了不同的信息页,例如 "Internal Notes"、"Extra Info" 和 "Extra Information"。
  16. <div> 元素:

    • class="oe_chatter":包含了关于记录的讨论和活动信息。
  17. <field> 元素:

    • name="message_follower_ids"name="activity_ids"name="message_ids":用于显示关注者、活动和消息的信息。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/268351.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

设计模式--迭代器模式

实验18&#xff1a;迭代器模式 本次实验属于模仿型实验&#xff0c;通过本次实验学生将掌握以下内容&#xff1a; 1、理解迭代器模式的动机&#xff0c;掌握该模式的结构&#xff1b; 2、能够利用迭代器模式解决实际问题。 [实验任务]&#xff1a;JAVA和C常见数据结构迭代…

PyTorch随机数生成:torch.rand,torch.randn,torch.randind,torch.rand_like

在用PyTorch做深度学习开发过程中&#xff0c;时常用到随机数生成功能&#xff0c;但经常记不住几个随机数生成函数的用法&#xff0c;现在正好有点时间&#xff0c;整理一下。 1. torch.rand() torch.rand(*size, *, generatorNone, outNone, dtypeNone, layouttorch.stride…

我们是如何测试人工智能的(一)基础效果篇(内含大模型的测试内容)

来源&#xff5c;TesterHome社区 作者&#xff5c;孙高飞 前言 这个系列算是科普文吧&#xff0c;尤其这第一篇可能会比较长&#xff0c;因为我这8年里一直在 AI 领域里做测试&#xff0c;涉及到的场景有些多&#xff0c;我希望能尽量把我经历过的东西都介绍一下&#xff0c;…

<JavaEE> 协议格式 -- 传输层协议 UDP

目录 一、UDP协议格式长啥样&#xff1f; 二、端口号和IP地址 1&#xff09;UDP协议中包含哪两个端口号&#xff1f; 2&#xff09;有没有包含IP地址&#xff1f; 三、UDP报文长度 1&#xff09;UDP报文长度最长多长&#xff1f; 2&#xff09;UDP报文的组成&#xff1f…

Socket地址

socket地址其实是一个结构体&#xff0c;封装端口号和IP等信息 。后面的 socket 相关的 api 中需要使用到这个socket地址。 客户端 -> 服务器需要知道服务器的&#xff08; IP, Port &#xff09; 一、通用 socket 地址 socket 网络编程接口中表示 socket 地址的是结构体…

linux cpu调度分析

一、cpu调度调试方法 echo 0 > /sys/kernel/debug/tracing/tracing_on echo > /sys/kernel/debug/tracing/trace echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb echo nop > /sys/kernel/debug/tracing/current_tracer echo sched_switch sched_wakeup s…

MYSQL函数\约束\多表查询\事务

函数 字符串函数 数值函数 mod就是取余 日期函数 流程函数 约束 外键约束 删除更新\外键 多表查询 多表关系 一对多 多对多 一对一 多表查询 内连接 select e.name d.name from emp e join dept d on e.id d.id; 外连接 select emp.*, d.name from emp left join tm…

计算机网络(4):网络层

网络层提供的两种服务 虚电路服务&#xff08;Virtual Circuit Service&#xff09;和数据报服务&#xff08;Datagram Service&#xff09;是在网络层&#xff08;第三层&#xff09;提供的两种不同的通信服务。它们主要区别在于建立连接的方式和数据传输的方式。 虚电路服务…

初识QT(上篇):What Qt

初识QT&#xff08;上篇&#xff09;&#xff1a;What Qt 前言 & 说明前言说明 初识QT1.1 QT的what1. 介绍2. 发展历程3. QT架构的主要内容4.QT的常用模块 1.2 QT的 why1. QT的核心机制 下篇笔记链接 前言 & 说明 前言 前言&#xff1a; 之前说要share的qt相关知识&am…

看图学源码之FutureTask

RunnableFuture 源码学习&#xff1a; 成员变量 任务的运行状态的转化 package java.util.concurrent; import java.util.concurrent.locks.LockSupport;/**可取消的异步计算。该类提供了Future的基本实现&#xff0c;包括启动和取消计算的方法&#xff0c;查询计算是否完成以…

基于flask和echarts的新冠疫情实时监控系统源码+数据库,后端基于python的flask框架,前端主要是echarts

介绍 基于flask和echarts的新冠疫情实时监控系统 软件架构 后端基于python的flask框架&#xff0c;前端主要是echarts 安装教程 下载到本地&#xff0c;在python相应环境下运行app.py,flask项目部署请自行完成 使用说明 flaskProject文件夹中 app.py是flask项目主运行文…

Unity2017升级到Unity2018在Window7上输出空异常错误问题

Unity2017升级到Unity2018在Window7上输出空异常错误问题 一、环境Window7二、现象Unity报空异常&#xff08;.NET 4.x Equivalent&#xff09;三、日志四、解决方案第一种解决方案第二种解决方案 一、环境Window7 二、现象Unity报空异常&#xff08;.NET 4.x Equivalent&…

免费WPML v4.6.6已注册学习版+17插件包

免费WPML v4.6.6已注册学习版17插件包 关于一个名为WPML的WordPress插件的描述。这个插件被用于创建和管理多语言网站&#xff0c;使得网站的内容可以轻松地翻译成多种语言。 以下是这段文本的详细分析&#xff1a; WPML v4.6.6 已注册&#xff1a;这是插件的名称和版本号。表…

HarmonyOS的功能及场景应用

一、基本介绍 鸿蒙HarmonyOS主要应用的设备包括智慧屏、平板、手表、智能音箱、IoT设备等。具体来说&#xff0c;鸿蒙系统是一款面向全场景(移动办公、运动健康、社交通信、媒体娱乐等)的分布式操作系统&#xff0c;能够支持手机、平板、智能穿戴、智慧屏、车机等多种终端设备…

黑格尔哲学,从入门到入坟

身体需要锻炼&#xff0c;心灵也需要锻炼。哲学家思考的大致步骤&#xff1a;确立自己哲学的基本原则&#xff0c;在此原则基础上建构哲学体系。 黑格尔建立了哲学史上最庞大最全面的哲学体系。 黑格尔的对手是康德。 黑格尔哲学包括逻辑学、自然哲学、精神哲学。逻辑学&…

Vscode中plot不显示

需要在File->preference->settings中的搜索框中搜索plots&#xff0c;然后将勾选框勾选 然后重启vscode&#xff0c;解决!

操作系统 内存管理篇

一.程序的装入和链接 装入方式&#xff1a; 链接方式&#xff1a; 二.进程的内存映像 三.内存的分配 1.连续分配 分配方式&#xff1a; 2.不连续分配 分页&#xff1a;页面大小一致 引入快表&#xff08;和 cache 处理思路一致&#xff09; 升级到二级页表 分段&#xff1a;…

python pip安装依赖的常用软件源

目录 引言 一、什么是镜像源&#xff1f;​​​​​​​ 二、清华源 三、阿里源 四、中科大源 五、豆瓣源 六、更多资源 引言 在软件开发和使用过程中&#xff0c;我们经常需要下载和更新各种软件包和库文件。然而&#xff0c;由于网络环境的限制或者服务器的负载&#…

树与图的深度优先遍历、宽度优先遍历算法总结

知识概览 树是特殊的图&#xff0c;是无环连通图图分为有向图和无向图。因为无向图可以转化为有向图&#xff0c;树可以转化为图。因此本文讨论有向图。 树和图的存储&#xff1a; 邻接矩阵&#xff1a;空间复杂度&#xff0c;适合存储稠密图。邻接表&#xff1a;存储每个点可以…

04-JVM字节码文件结构深度剖析

一、源代码 package com.tuling.jvm;public class TulingByteCode {private String userName;public String getUserName() {return userName;}public void setUserName(String userName) {this.userName userName;} }二、通过javap -verbose TulingByteCode .class反编译 //…
最新文章