[go: up one dir, main page]

CN118972383A - A method, system, device and medium for extending an attachment upload component - Google Patents

A method, system, device and medium for extending an attachment upload component Download PDF

Info

Publication number
CN118972383A
CN118972383A CN202411170336.2A CN202411170336A CN118972383A CN 118972383 A CN118972383 A CN 118972383A CN 202411170336 A CN202411170336 A CN 202411170336A CN 118972383 A CN118972383 A CN 118972383A
Authority
CN
China
Prior art keywords
file acquisition
target
acquisition method
file
attachment upload
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411170336.2A
Other languages
Chinese (zh)
Inventor
郑伟波
邹路平
孙立新
周祥国
陈圣杰
季维涛
李亚洲
丁一凡
陈贵文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN202411170336.2A priority Critical patent/CN118972383A/en
Publication of CN118972383A publication Critical patent/CN118972383A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/08Annexed information, e.g. attachments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of software and discloses an extension method, a system, equipment and a medium of an accessory uploading component. The method comprises the following steps: in response to detecting an editing event in the accessory uploading component, identifying a target file acquisition mode corresponding to the editing event, and acquiring a target identifier corresponding to the target file acquisition mode; acquiring a file acquisition mode list of the accessory uploading component, and updating the file acquisition mode list based on the target identifier; and carrying out target function development on the accessory uploading component based on the updated file acquisition mode list to obtain the target accessory uploading component. By the scheme of the invention, the limitation of the traditional low-code platform in the aspect of function expansion is solved, and support is provided for expanding the file acquisition mode of the accessory uploading component.

Description

一种附件上传组件的扩展方法、系统、设备及介质A method, system, device and medium for extending an attachment upload component

技术领域Technical Field

本发明涉及软件技术领域,尤其涉及一种附件上传组件的扩展方法、系统、设备及介质。The present invention relates to the field of software technology, and in particular to an extension method, system, device and medium for an attachment upload component.

背景技术Background Art

低代码开发平台作为一种创新的软件开发工具,正逐步改变着软件开发的传统模式,其核心在于通过高度可视化的设计界面和一系列模块化的构建组件,极大地简化了应用程序的开发流程,使得整个开发过程更加直观和高效。并且,低代码平台能够输出完整的应用解决方案,这些方案能够覆盖从PC端网页到移动端页面,乃至微信小程序等多元化的应用场景,有效辅助了移动H5(HyperText Markup Language 5,超文本标记语言)应用的开发。低代码开发平台虽然在简化移动H5应用构建过程中表现出色,但在可扩展性方面存在明显不足,针对一些拥有专属移动端原生平台的企业来说,由于目前的低代码平台大都没有提供与外部平台集成的能力,当企业在尝试将H5应用集成到自有的专属移动端原生平台时,面临着无法直接调用原生平台能力的困境。附件上传作为移动应用中的一项基础而关键的能力,大多数低代码平台都配备了丰富的附件上传组件,但由于低代码平台在跨平台集成和功能扩展方面的局限性,使其无法支持针对特定场景或客户个性化需求对附件上传组件中的文件获取方式进行自定义扩展。As an innovative software development tool, the low-code development platform is gradually changing the traditional model of software development. Its core lies in greatly simplifying the application development process through a highly visual design interface and a series of modular building components, making the entire development process more intuitive and efficient. In addition, the low-code platform can output complete application solutions, which can cover diversified application scenarios from PC web pages to mobile pages and even WeChat applets, effectively assisting the development of mobile H5 (HyperText Markup Language 5) applications. Although the low-code development platform performs well in simplifying the construction process of mobile H5 applications, it has obvious deficiencies in scalability. For some companies with exclusive mobile native platforms, since most of the current low-code platforms do not provide the ability to integrate with external platforms, when companies try to integrate H5 applications into their own exclusive mobile native platforms, they face the dilemma of not being able to directly call the capabilities of the native platform. As attachment uploading is a basic and critical capability in mobile applications, most low-code platforms are equipped with rich attachment upload components. However, due to the limitations of low-code platforms in cross-platform integration and functional extension, it is impossible to support customized extensions of file acquisition methods in attachment upload components for specific scenarios or customer personalized needs.

因此,本发明提出了一种附件上传组件的扩展方法、系统、设备及介质来解决上述缺陷。Therefore, the present invention proposes an extension method, system, device and medium for an attachment upload component to solve the above-mentioned defects.

发明内容Summary of the invention

有鉴于此,本发明提出了一种附件上传组件的扩展方法、系统、设备及介质,解决了传统低代码平台在功能扩展方面的局限性,为附件上传组件扩展其文件获取方式提供了支持。In view of this, the present invention proposes an extension method, system, device and medium for an attachment upload component, which solves the limitations of traditional low-code platforms in functional expansion and provides support for the attachment upload component to expand its file acquisition method.

基于上述目的,本发明实施例的一方面提供了一种附件上传组件的扩展方法,具体包括如下步骤:Based on the above purpose, an embodiment of the present invention provides an extension method of an attachment upload component, which specifically includes the following steps:

响应于检测到附件上传组件中的编辑事件,识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识;In response to detecting an editing event in the attachment upload component, identifying a target file acquisition method corresponding to the editing event, and acquiring a target identifier corresponding to the target file acquisition method;

获取附件上传组件的文件获取方式列表,并基于所述目标标识,更新所述文件获取方式列表;Obtain a file acquisition method list of the attachment upload component, and update the file acquisition method list based on the target identifier;

基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件。The target function of the attachment upload component is developed based on the updated file acquisition method list to obtain a target attachment upload component.

在一些实施方式中,所述基于所述目标标识,更新所述文件获取方式列表的步骤,包括:In some implementations, the step of updating the file acquisition method list based on the target identifier includes:

获取所述目标文件获取方式对应的第一回调方法和第一字段;Obtain a first callback method and a first field corresponding to the target file acquisition method;

判断所述文件获取方式列表中是否存在与所述目标标识对应的初始文件获取方式;Determine whether there is an initial file acquisition method corresponding to the target identifier in the file acquisition method list;

响应于所述文件获取方式列表中存在与所述目标标识对应的初始文件获取方式,获取所述初始文件获取方式对应的初始回调方法和初始字段;In response to the existence of an initial file acquisition method corresponding to the target identifier in the file acquisition method list, acquiring an initial callback method and an initial field corresponding to the initial file acquisition method;

将所述初始回调方法和所述第一回调方法按照预设条件合并以得到目标回调方法;Merging the initial callback method and the first callback method according to a preset condition to obtain a target callback method;

在所述文件获取方式列表中将所述初始回调方法更新为目标回调方法,将所述初始字段更新为所述第一字段。In the file acquisition method list, the initial callback method is updated to the target callback method, and the initial field is updated to the first field.

在一些实施方式中,所述的附件上传组件的扩展方法还包括:In some implementations, the method for extending the attachment upload component further includes:

响应于所述文件获取方式列表中不存在与所述目标标识对应的文件获取方式,在所述文件获取方式列表中增加所述目标标识、所述第一回调方法和所述第一字段,以更新所述文件获取方式列表。In response to the absence of a file acquisition method corresponding to the target identifier in the file acquisition method list, the target identifier, the first callback method and the first field are added to the file acquisition method list to update the file acquisition method list.

在一些实施方式中,所述识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识的步骤,包括:In some implementations, the step of identifying the target file acquisition method corresponding to the editing event and acquiring the target identifier corresponding to the target file acquisition method includes:

获取所述附件上传组件的扩展脚本;Obtaining an extension script of the attachment upload component;

比对所述文件获取方式列表和所述扩展脚本,根据比对结果判断所述扩展脚本是否存在新增文件标识;Compare the file acquisition method list with the extended script, and determine whether a new file identifier exists in the extended script according to the comparison result;

响应于所述扩展脚本存在新增文件标识,将所述新增文件标识对应的第一文件获取方式作为所述目标文件获取方式,将所述新增文件标识作为目标标识。In response to the presence of a newly added file identifier in the extended script, a first file acquisition method corresponding to the newly added file identifier is used as the target file acquisition method, and the newly added file identifier is used as the target identifier.

在一些实施方式中,所述的附件上传组件的扩展方法还包括:In some implementations, the method for extending the attachment upload component further includes:

响应于所述扩展脚本不存在新增文件标识,根据比对结果确定更新文件配置;In response to the absence of a newly added file identifier in the extended script, determining to update the file configuration according to the comparison result;

获取所述更新文件配置对应的文件标识作为目标标识,所述更新文件配置对应的第二文件获取方式作为所述目标文件获取方式。The file identifier corresponding to the update file configuration is obtained as the target identifier, and the second file acquisition method corresponding to the update file configuration is used as the target file acquisition method.

在一些实施方式中,所述的附件上传组件的扩展方法还包括:In some implementations, the method for extending the attachment upload component further includes:

响应于目标接口接收到用户输入的目标数组,将所述目标数组挂载至预设对象;In response to the target interface receiving the target array input by the user, mounting the target array to a preset object;

响应于所述附件上传组件的扩展脚本访问所述预设对象,触发所述编辑事件;In response to the extended script of the attachment upload component accessing the preset object, triggering the editing event;

其中,所述目标数组包括文件标识、文件名称、显示标识、提示文本和/或回调方法。The target array includes a file identifier, a file name, a display identifier, a prompt text and/or a callback method.

在一些实施方式中,所述基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件的步骤,包括:In some implementations, the step of developing a target function for the attachment upload component based on the updated file acquisition method list to obtain a target attachment upload component includes:

将更新后的所述文件获取方式列表通过依赖注入方式传递至所述附件上传组件;Passing the updated file acquisition method list to the attachment upload component through dependency injection;

所述附件上传组件根据更新后的所述文件获取方式列表包括的每个文件获取方式配置对应的所述目标功能,将配置了所有所述目标功能的所述附件上传组件作为所述目标附件上传组件。The attachment upload component configures the corresponding target function according to each file acquisition method included in the updated file acquisition method list, and uses the attachment upload component configured with all the target functions as the target attachment upload component.

本发明实施例的另一方面,还提供了一种附件上传组件的扩展系统,包括:Another aspect of the embodiment of the present invention further provides an extension system for an attachment upload component, including:

识别单元,配置用于响应于检测到附件上传组件中的编辑事件,识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识;an identification unit configured to, in response to detecting an editing event in the attachment upload component, identify a target file acquisition method corresponding to the editing event, and acquire a target identifier corresponding to the target file acquisition method;

更新单元,配置用于获取附件上传组件的文件获取方式列表,并基于所述目标标识,更新所述文件获取方式列表;An updating unit configured to obtain a file acquisition method list of the attachment upload component and update the file acquisition method list based on the target identifier;

扩展单元,配置用于基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件。The extension unit is configured to develop a target function for the attachment upload component based on the updated file acquisition method list to obtain a target attachment upload component.

本发明实施例的又一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机程序,所述计算机程序由所述处理器执行时实现如上方法的步骤。According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores a computer program executable on the processor, and the computer program implements the steps of the above method when executed by the processor.

本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.

本发明至少具有以下有益技术效果:本发明的附件上传组件的扩展方法,通过设置文件获取方式列表,允许用户通过对文件获取方式的自定义编辑事件,更新文件获取方式列表以对附件上传组件的功能进行管理,为低代码平台中的附件上传组件提供了更多的功能,以满足日渐复杂的用户业务需求,解决了传统低代码平台在功能扩展方面的局限性,为附件上传组件扩展其文件获取方式提供了支持。The present invention has at least the following beneficial technical effects: the extension method of the attachment upload component of the present invention, by setting a file acquisition method list, allows the user to update the file acquisition method list through customized editing events of the file acquisition method to manage the functions of the attachment upload component, thereby providing more functions for the attachment upload component in the low-code platform to meet the increasingly complex business needs of users, solving the limitations of traditional low-code platforms in functional expansion, and providing support for the attachment upload component to expand its file acquisition method.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

图1为本发明提供的附件上传组件的扩展方法的一实施例的框图;FIG1 is a block diagram of an embodiment of a method for extending an attachment upload component provided by the present invention;

图2为本发明提供的附件上传组件的扩展方法执行过程的一实施例的示意图;FIG. 2 is a schematic diagram of an embodiment of an execution process of an extension method for an attachment upload component provided by the present invention;

图3为本发明提供的附件上传组件的扩展系统的一实施例的示意图;FIG3 is a schematic diagram of an embodiment of an extension system for an attachment upload component provided by the present invention;

图4为本发明提供的计算机设备的一实施例的结构示意图;FIG4 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;

图5为本发明提供的计算机可读存储介质的一实施例的结构示意图。FIG5 is a schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

在低代码开发平台的辅助下,移动端H5应用的开发过程尤为便捷。用户得以利用丰富的组件库和直观的拖拽式编辑器,无需深厚的编程知识,即可设计出既符合商业需求又具备良好用户体验的移动应用。附件上传作为移动表单中的一项基础而关键的能力,大多数低代码平台都配备了丰富的附件上传组件。在移动端,用户可以通过多种方式获取进行附件上传,包括但不限于从相册选择、拍照、访问手机本地文件以及拍摄短视频等。但是,由于H5应用页面本身不具备调用原生系统能力的权限,为了实现这些丰富的文件获取方式,移动端H5应用与原生系统之间的交互通常需要依赖于特定的“桥”技术,例如Hybrid技术。Hybrid技术是一种将原生系统和H5应用技术结合起来的开发方式,它允许用户在一个应用中同时使用原生API(Application Programming Interface,应用程序编程接口)和Web(万维网)技术,优势在于能够在保持Web技术的灵活性和跨平台能力的同时,也能利用原生API来提高应用的性能和用户体验。由于现有低代码平台往往没有提供与外部平台集成的能力,企业或用户在尝试将H5页面集成到专属移动端原生平台时,面临着无法调用原生平台能力的困境。目前的低代码平台通常只提供了固定的内置文件获取方式来进行附件上传。例如,低代码平台中的“图片上传”组件可能仅支持“从相册选择”和“拍照”这两种方式,当客户需要添加更个性化或特殊的文件获取方式,如“从扫描仪扫描”,低代码平台由于缺乏扩展性,导致无法满足这种定制化需求。并且低代码平台中固定配备的附件上传组件无法方便的适配各种移动端原生平台,这种限制对于那些拥有专属移动端原生平台的企业或机构来说,无疑造成了一定的困扰。With the assistance of low-code development platforms, the development process of mobile H5 applications is particularly convenient. Users can use rich component libraries and intuitive drag-and-drop editors to design mobile applications that meet business needs and have good user experience without deep programming knowledge. Attachment upload is a basic and key capability in mobile forms, and most low-code platforms are equipped with rich attachment upload components. On the mobile side, users can obtain and upload attachments in a variety of ways, including but not limited to selecting from the album, taking photos, accessing local files on the phone, and shooting short videos. However, since the H5 application page itself does not have the authority to call the native system capabilities, in order to realize these rich file acquisition methods, the interaction between the mobile H5 application and the native system usually needs to rely on specific "bridge" technology, such as Hybrid technology. Hybrid technology is a development method that combines native system and H5 application technology. It allows users to use native API (Application Programming Interface) and Web (World Wide Web) technology in one application at the same time. The advantage is that it can maintain the flexibility and cross-platform capabilities of Web technology while also using native API to improve application performance and user experience. Since existing low-code platforms often do not provide the ability to integrate with external platforms, enterprises or users face the dilemma of being unable to call on native platform capabilities when trying to integrate H5 pages into exclusive mobile native platforms. Current low-code platforms usually only provide fixed built-in file acquisition methods for uploading attachments. For example, the "Picture Upload" component in the low-code platform may only support the two methods of "Select from Album" and "Take a Photo". When customers need to add more personalized or special file acquisition methods, such as "Scan from Scanner", the low-code platform cannot meet such customization requirements due to its lack of scalability. In addition, the attachment upload component fixed in the low-code platform cannot be easily adapted to various mobile native platforms. This limitation has undoubtedly caused some trouble for those enterprises or institutions that have exclusive mobile native platforms.

为了解决上述缺陷,本发明实施例的第一个方面,提出了一种附件上传组件的扩展方法。如图1所示,其包括如下步骤:In order to solve the above defects, the first aspect of the embodiment of the present invention proposes an extension method of the attachment upload component. As shown in FIG1 , the method comprises the following steps:

步骤S100,响应于检测到附件上传组件中的编辑事件,识别编辑事件对应的目标文件获取方式,并获取目标文件获取方式对应的目标标识;Step S100, in response to detecting an editing event in the attachment upload component, identifying a target file acquisition method corresponding to the editing event, and acquiring a target identifier corresponding to the target file acquisition method;

步骤S200,获取附件上传组件的文件获取方式列表,并基于目标标识,更新文件获取方式列表;Step S200, obtaining a file acquisition method list of the attachment upload component, and updating the file acquisition method list based on the target identifier;

步骤S300,基于更新后的文件获取方式列表对附件上传组件进行目标功能开发,得到目标附件上传组件。Step S300: Develop the target function of the attachment upload component based on the updated file acquisition method list to obtain the target attachment upload component.

在一些实施方式中,与市面上已有的低代码开发平台所固有的附件上传组件不同,本发明在附件上传组件的属性面板中新增了一个“文件获取方式”属性,用来根据用户的需求自定义文件获取方式列表。文件获取方式列表就是当用户点击附件上传组件的上传按钮后,从页面中以弹出层的形式弹出的一个文件获取方式选择列表,列表中的条目可能包含“从相册选择”、“拍照”、“拍短视频”和/或“手机本地文件”等件获取方式选项。In some embodiments, unlike the attachment upload component inherent in the existing low-code development platform on the market, the present invention adds a "file acquisition method" property in the property panel of the attachment upload component to customize the file acquisition method list according to the user's needs. The file acquisition method list is a file acquisition method selection list that pops up from the page in the form of a pop-up layer when the user clicks the upload button of the attachment upload component. The items in the list may include "select from the album", "take a photo", "shoot a short video" and/or "mobile phone local file" and other file acquisition method options.

在一些实施方式中,在低代码开发平台的“文件获取方式”属性面板的预设位置上会通过一个只读的文本框显示当前附件上传组件所配置的文件获取方式名称,如果存在多个文件获取方式,则名称之间以逗号相互分隔。属性面板上设置有文本框对应的编辑按钮,通过点击该编辑按钮,低代码开发平台会弹出一个标题为“文件获取方式编辑器”的弹框,弹框中可以通过一个列表显示目前已经启用的文件获取方式,该弹框列表上方提供了“新增”、“删除”、“上移”、“下移”、“扩展”按钮。用户在上述弹框列表中选中一个已经存在的文件获取方式条目,然后点击“上移”或“下移”按钮,可以改变文件获取方式选项的显示位置。用户在弹框列表中选中一个已经存在的文件获取方式条目,然后点击“删除”按钮,可以将该文件获取方式从移除弹框列表中移除。用户通过编辑“文件获取方式”属性,即可对附件上传组件中的文件获取方式选项进行自定义。图2为本发明提供的附件上传组件的扩展方法执行过程的一实施例的示意图。如果用户认为当前弹框列表中的文件获取方式不足以应付实际的业务场景,可以通过点击“新增”按钮自定义文件获取方式。点击“新增”按钮之后,低代码开发平台将弹出一个下拉框,在该下拉框中展示了当前低代码平台所有内置的文件获取方式,以及用户通过编写js(JavaScript,即时编译型的编程语言)插件代码所新增的自定义文件获取方式,用户点击任意文件获取方式条目,即可将该文件获取方式添加到弹框列表中。如果用户希望新增一种自定义的文件获取方式,或者希望对于某个内置的文件获取方式进行多平台适配,则点击“扩展”按钮,低代码平台会将当前的弹框中显示的列表切换为一个代码编辑器,用于编写js扩展插件,以下称为js扩展脚本。编辑事件指的是对文件获取方式列表中文件获取方式进行变更的事件。将编辑事件中所变更的文件获取方式作为目标文件获取方式,并将变更的内容同步更新至文件获取方式列表。In some embodiments, a read-only text box will be used to display the name of the file acquisition method configured by the current attachment upload component at a preset position of the "File Acquisition Method" property panel of the low-code development platform. If there are multiple file acquisition methods, the names are separated by commas. An edit button corresponding to the text box is set on the property panel. By clicking the edit button, the low-code development platform will pop up a pop-up box titled "File Acquisition Method Editor". The pop-up box can display the currently enabled file acquisition methods through a list. The pop-up box list provides "Add", "Delete", "Move Up", "Move Down", and "Extend" buttons above. The user selects an existing file acquisition method entry in the above pop-up box list, and then clicks the "Move Up" or "Move Down" button to change the display position of the file acquisition method option. The user selects an existing file acquisition method entry in the pop-up box list, and then clicks the "Delete" button to remove the file acquisition method from the removal pop-up box list. The user can customize the file acquisition method option in the attachment upload component by editing the "File Acquisition Method" property. Figure 2 is a schematic diagram of an embodiment of the execution process of the extension method of the attachment upload component provided by the present invention. If the user thinks that the file acquisition method in the current pop-up list is not enough to cope with the actual business scenario, the user can customize the file acquisition method by clicking the "Add" button. After clicking the "Add" button, the low-code development platform will pop up a drop-down box, which displays all the built-in file acquisition methods of the current low-code platform, as well as the custom file acquisition methods added by the user by writing js (JavaScript, a just-in-time compiled programming language) plug-in code. The user clicks on any file acquisition method entry to add the file acquisition method to the pop-up list. If the user wants to add a custom file acquisition method, or wants to adapt a built-in file acquisition method to multiple platforms, click the "Extend" button, and the low-code platform will switch the list displayed in the current pop-up box to a code editor for writing js extension plug-ins, hereinafter referred to as js extension scripts. Editing events refer to events that change the file acquisition method in the file acquisition method list. The file acquisition method changed in the editing event is used as the target file acquisition method, and the changed content is synchronously updated to the file acquisition method list.

在一些实施方式中,每当用户编写并保存该js扩展脚本或者初次打开“文件获取方式编辑器”时,低代码平台都需要重新读取并解析js扩展脚本的内容,识别出用户额外添加的自定义文件获取方式并同步更新至文件获取方式列表。用户完成对移动表单的编辑后,保存并生成整个应用,低代码平台将根据元数据生成移动端H5应用的代码,在入口文件index.html中,将会把js扩展脚本以script标签的方式引用,或者将加载js扩展脚本的任务交给移动端框架脚本来执行,从而实现按需引入文件获取方式,生成最终附件上传组件。In some implementations, every time a user writes and saves the js extension script or opens the "File Acquisition Method Editor" for the first time, the low-code platform needs to re-read and parse the content of the js extension script, identify the custom file acquisition method added by the user, and synchronously update it to the file acquisition method list. After the user completes editing the mobile form, saves and generates the entire application, the low-code platform will generate the code for the mobile H5 application based on the metadata. In the entry file index.html, the js extension script will be referenced as a script tag, or the task of loading the js extension script will be handed over to the mobile framework script to execute, thereby realizing the on-demand introduction of file acquisition methods and generating the final attachment upload component.

本发明的附件上传组件的扩展方法,通过设置文件获取方式列表,允许用户通过对文件获取方式的自定义编辑事件,更新文件获取方式列表以对附件上传组件的功能进行管理,为低代码平台中的附件上传组件提供了更多的功能,以满足日渐复杂的用户业务需求,解决了传统低代码平台在功能扩展方面的局限性,为附件上传组件扩展其文件获取方式提供了支持。The extension method of the attachment upload component of the present invention, by setting a file acquisition method list, allows the user to update the file acquisition method list through customized editing events of the file acquisition method to manage the functions of the attachment upload component, thereby providing more functions for the attachment upload component in the low-code platform to meet the increasingly complex business needs of users, solving the limitations of traditional low-code platforms in functional expansion, and providing support for the attachment upload component to expand its file acquisition method.

在一些实施方式中,本发明的附件上传组件的扩展方法还包括:响应于目标接口接收到用户输入的目标数组,将目标数组挂载至预设对象;响应于附件上传组件的扩展脚本访问预设对象,触发编辑事件;其中,目标数组包括文件标识、文件名称、显示标识、提示文本和/或回调方法。In some embodiments, the extension method of the attachment upload component of the present invention also includes: in response to the target interface receiving a target array input by the user, mounting the target array to a preset object; in response to the extension script of the attachment upload component accessing the preset object, triggering an editing event; wherein the target array includes a file identifier, a file name, a display identifier, a prompt text and/or a callback method.

在一些实施方式中,js扩展脚本对应移动端运行框架中的一个js文件,其是全局唯一的。在实际运行移动端H5应用时将会首先加载js扩展脚本,所以用户在js扩展脚本中编写的代码将会在所有移动端H5应用中的所有附件上传组件中生效。另外,需要注意的是,由于js扩展脚本全局唯一,所以要避免两个用户同时编辑该js扩展脚本所可能引起的相互覆盖的问题,因此可以通过加锁的方式保证同一时间只能有一个用户对js扩展脚本进行编辑。用户编写js扩展脚本时,需要根据指定的格式返回自定义文件获取方式的全部信息或者内置文件获取方式的编号值以及扩展方法。无论是将文件获取方式进行多平台适配还是要增加自定义文件获取方式,目标数组的数据结构都是相同的。区别在于,编写自定义文件获取方式时需给出所有必需的配置,而将文件获取方式进行多平台适配时只需要提供一个指向内置文件获取方式的文件标识以及一个用来扩展的回调方法即可,其它配置,比如文件名称之类的配置可以默认复用内置文件获取方式的文件名称,而无需变化。文件获取方式所需的所有配置包含如下表1所示。In some embodiments, the js extension script corresponds to a js file in the mobile terminal running framework, which is globally unique. When the mobile terminal H5 application is actually running, the js extension script will be loaded first, so the code written by the user in the js extension script will take effect in all attachment upload components in all mobile terminal H5 applications. In addition, it should be noted that since the js extension script is globally unique, it is necessary to avoid the problem of mutual coverage caused by two users editing the js extension script at the same time, so it can be ensured that only one user can edit the js extension script at the same time by locking. When the user writes the js extension script, it is necessary to return all the information of the custom file acquisition method or the number value and extension method of the built-in file acquisition method according to the specified format. Whether the file acquisition method is adapted to multiple platforms or a custom file acquisition method is added, the data structure of the target array is the same. The difference is that when writing a custom file acquisition method, all necessary configurations need to be given, and when adapting the file acquisition method to multiple platforms, only a file identifier pointing to the built-in file acquisition method and a callback method for extension are needed. Other configurations, such as configurations such as file names, can reuse the file name of the built-in file acquisition method by default without change. All configurations required for the file acquisition method are shown in Table 1 below.

表1Table 1

本发明的附件上传组件的扩展方法,通过目标数组可以灵活地支持在文件获取方式列表中扩展内置或自定义的文件获取方式,可以简化组件的多平台扩展工作,提高了低代码平台的可扩展性。The extension method of the attachment upload component of the present invention can flexibly support the extension of built-in or customized file acquisition methods in the file acquisition method list through the target array, which can simplify the multi-platform expansion work of the component and improve the scalability of the low-code platform.

在一些实施方式中,基于目标标识,更新文件获取方式列表的步骤,包括:获取目标文件获取方式对应的第一回调方法和第一字段;判断文件获取方式列表中是否存在与目标标识对应的初始文件获取方式;响应于文件获取方式列表中存在与目标标识对应的初始文件获取方式,获取初始文件获取方式对应的初始回调方法和初始字段;将初始回调方法和第一回调方法按照预设条件合并以得到目标回调方法;在文件获取方式列表中将初始回调方法更新为目标回调方法,将初始字段更新为第一字段。In some embodiments, based on the target identifier, the step of updating the file acquisition method list includes: obtaining a first callback method and a first field corresponding to the target file acquisition method; determining whether there is an initial file acquisition method corresponding to the target identifier in the file acquisition method list; in response to the existence of an initial file acquisition method corresponding to the target identifier in the file acquisition method list, obtaining an initial callback method and an initial field corresponding to the initial file acquisition method; merging the initial callback method and the first callback method according to preset conditions to obtain a target callback method; updating the initial callback method to the target callback method in the file acquisition method list, and updating the initial field to the first field.

在一些实施方式中,本发明的附件上传组件的扩展方法还包括:响应于文件获取方式列表中不存在与目标标识对应的文件获取方式,在文件获取方式列表中增加目标标识、第一回调方法和第一字段,以更新文件获取方式列表。In some embodiments, the extension method of the attachment upload component of the present invention also includes: in response to the absence of a file acquisition method corresponding to the target identifier in the file acquisition method list, adding the target identifier, the first callback method and the first field to the file acquisition method list to update the file acquisition method list.

在一些实施方式中,js扩展脚本只需要得到用户编辑的FilePickerOption数组(即目标数组)即可将用户自定义的文件获取方式在附件上传组件中进行扩展,FilePickerOption数组为js扩展脚本接受文件获取方式配置信息的一种接口定义,能够向js扩展脚本返回指定的格式的文件获取方式的全部信息。js扩展脚本具体获取FilePickerOption数组的方式不限,例如可以要求用户将该FilePickerOption数组挂载到window对象的某个属性中,由于window对象全局可访问,所以只需要保证js扩展脚本被移动表单运行时加载,移动端框架脚本即可读取window对象并根据FilePickerOption数组获取用户配置的自定义文件获取方式的配置信息。并且,js扩展脚本的加载方式也不限,可以在生成代码时直接在H5应用页面的入口文件index.html中生成一个script标签,直接在H5应用页面加载时加载js扩展脚本,也可以在移动表单运行时动态加载该js扩展脚本。在移动端框架脚本中,当需要在文件获取方式列表中新增一个内置文件获取方式实现时,也同样通过FilePickerOption数组向js扩展脚本返回指定的格式的文件获取方式的全部信息。In some implementations, the js extension script only needs to obtain the FilePickerOption array (i.e., the target array) edited by the user to extend the user-defined file acquisition method in the attachment upload component. The FilePickerOption array is an interface definition for the js extension script to accept the configuration information of the file acquisition method, and can return all the information of the file acquisition method in the specified format to the js extension script. There is no limit to the specific way in which the js extension script obtains the FilePickerOption array. For example, the user can be required to mount the FilePickerOption array to a certain attribute of the window object. Since the window object is globally accessible, it is only necessary to ensure that the js extension script is loaded when the mobile form is running. The mobile terminal framework script can read the window object and obtain the configuration information of the user-configured custom file acquisition method according to the FilePickerOption array. In addition, the loading method of the js extension script is also not limited. When generating the code, a script tag can be directly generated in the entry file index.html of the H5 application page, and the js extension script can be directly loaded when the H5 application page is loaded. The js extension script can also be dynamically loaded when the mobile form is running. In the mobile framework script, when a built-in file acquisition method needs to be added to the file acquisition method list, all information about the file acquisition method in the specified format is also returned to the js extension script through the FilePickerOption array.

在一些实施方式中,当文件获取方式列表已经存在与自定义文件获取方式(即目标文件获取方式)的文件标识(即目标标识)对应的内置文件获取方式(即初始文件获取方式),而移动表单运行时附件上传组件不应该关心文件获取方式列表的合并,因此在移动表单运行时,由移动端框架对相同文件标识的文件获取方式进行合并。即,移动端框架脚本将会在js扩展脚本加载完成后,读取开发者自定义的文件获取方式的配置信息,根据文件标识的对应关系,将相同文件标识的自定义文件获取方式和内置文件获取方式合并。上述合并指的是将自定义文件获取方式的回调方法(第一回调方法)和内置文件获取方式的回调方法(初始回调方法)进行包装合并,其它的字段都是用自定义的配置信息覆盖内置的配置信息,即用第一字段覆盖初始字段。当文件获取方式列表未存在与自定义文件获取方式的文件标识对应的内置文件获取方式,直接在文件获取方式列表中新增自定义的文件获取方式实现。内置文件获取方式为在移动端框架中默认实现的文件获取方式。第一字段和初始字段包括表1中的文件名称、提示文本、选项可见标识和/或文件名称的国际化配置。由于回调方法是函数,并且可能包含复杂的逻辑,因此不能直接通过简单的值覆盖来合并它们,需要创建一个新的回调(即目标回调方法)对第一回调方法和初始回调方法进行包装合并,该目标回调在内部以某种方式(如顺序调用)来调用第一回调方法和初始回调方法。当文件获取请求发生时,会首先调用第一回调方法,如果第一回调方法的返回值为空,再调用初始回调方法。In some embodiments, when the file acquisition method list already has a built-in file acquisition method (i.e., the initial file acquisition method) corresponding to the file identifier (i.e., the target identifier) of the custom file acquisition method (i.e., the target file acquisition method), and the attachment upload component should not care about the merging of the file acquisition method list when the mobile form is running, the mobile terminal framework merges the file acquisition methods with the same file identifier when the mobile form is running. That is, after the js extension script is loaded, the mobile terminal framework script will read the configuration information of the file acquisition method customized by the developer, and merge the custom file acquisition method and the built-in file acquisition method with the same file identifier according to the corresponding relationship of the file identifier. The above-mentioned merger refers to packaging and merging the callback method (first callback method) of the custom file acquisition method and the callback method (initial callback method) of the built-in file acquisition method, and the other fields are all overwritten with the built-in configuration information with the custom configuration information, that is, the initial field is overwritten with the first field. When the file acquisition method list does not have a built-in file acquisition method corresponding to the file identifier of the custom file acquisition method, the custom file acquisition method is directly added to the file acquisition method list. The built-in file acquisition method is the file acquisition method implemented by default in the mobile terminal framework. The first field and the initial field include the file name, prompt text, option visibility flag and/or international configuration of the file name in Table 1. Since the callback method is a function and may contain complex logic, they cannot be directly merged by simple value overwriting. It is necessary to create a new callback (i.e., the target callback method) to wrap and merge the first callback method and the initial callback method. The target callback calls the first callback method and the initial callback method in some way (such as sequential call) internally. When a file acquisition request occurs, the first callback method is called first. If the return value of the first callback method is empty, the initial callback method is called.

本发明的附件上传组件的扩展方法,提供了一种灵活的方式来调整内置和自定义功能之间的优先级和行为,实现一个强大且灵活的附件上传组件,该附件上传组件不仅支持多平台和多终端适配,还允许用户根据需求扩展文件获取方式。The extension method of the attachment upload component of the present invention provides a flexible way to adjust the priority and behavior between built-in and custom functions, and realizes a powerful and flexible attachment upload component. The attachment upload component not only supports multi-platform and multi-terminal adaptation, but also allows users to expand the file acquisition method according to needs.

在一些实施方式中,识别编辑事件对应的目标文件获取方式,并获取目标文件获取方式对应的目标标识的步骤,包括:获取附件上传组件的扩展脚本;比对文件获取方式列表和扩展脚本,根据比对结果判断扩展脚本是否存在新增文件标识;响应于扩展脚本存在新增文件标识,将新增文件标识对应的第一文件获取方式作为目标文件获取方式,将新增文件标识作为目标标识。In some embodiments, the steps of identifying a target file acquisition method corresponding to an editing event and acquiring a target identifier corresponding to the target file acquisition method include: acquiring an extended script of an attachment upload component; comparing a file acquisition method list and an extended script, and determining whether the extended script has a new file identifier based on the comparison result; in response to the existence of a new file identifier in the extended script, using a first file acquisition method corresponding to the new file identifier as a target file acquisition method, and using the new file identifier as a target identifier.

在一些实施方式中,本发明的附件上传组件的扩展方法还包括:响应于扩展脚本不存在新增文件标识,根据比对结果确定更新文件配置;获取更新文件配置对应的文件标识作为目标标识,更新文件配置对应的第二文件获取方式作为目标文件获取方式。In some embodiments, the extension method of the attachment upload component of the present invention also includes: in response to the absence of a new file identifier in the extension script, determining an updated file configuration based on a comparison result; obtaining a file identifier corresponding to the updated file configuration as a target identifier, and using a second file acquisition method corresponding to the updated file configuration as a target file acquisition method.

本发明的附件上传组件的扩展方法,既能够在附件上传组件中扩展自定义文件获取方式,又能够对低代码平台内置的文件获取方式按照需求进行修改后扩展至附件上传组件中,为移动端H5应用的开发带来了前所未有的便捷性和效率,提高了开发速度和灵活性,使得更多企业和个人能够轻松将H5页面集成到专属移动端原生平台中。The extension method of the attachment upload component of the present invention can not only expand the custom file acquisition method in the attachment upload component, but also modify the built-in file acquisition method of the low-code platform as needed and expand it to the attachment upload component, bringing unprecedented convenience and efficiency to the development of mobile H5 applications, improving development speed and flexibility, and enabling more companies and individuals to easily integrate H5 pages into their exclusive mobile native platforms.

在一些实施方式中,基于更新后的文件获取方式列表对附件上传组件进行目标功能开发,得到目标附件上传组件的步骤,包括:将更新后的文件获取方式列表通过依赖注入方式传递至附件上传组件;附件上传组件根据更新后的文件获取方式列表包括的每个文件获取方式配置对应的目标功能,将配置了所有目标功能的附件上传组件作为目标附件上传组件。其中,目标附件上传组件能够具备所有目标功能,但每个目标功能能够根据其对应的文件获取方式的选项可见标识来确定其在当前应用平台下是否可用,若不可用则不显示该目标功能。该选项可见标识根据用户需求进行设置。In some embodiments, the target function of the attachment upload component is developed based on the updated file acquisition method list to obtain the step of the target attachment upload component, including: passing the updated file acquisition method list to the attachment upload component through dependency injection; the attachment upload component configures the corresponding target function according to each file acquisition method included in the updated file acquisition method list, and uses the attachment upload component configured with all target functions as the target attachment upload component. Among them, the target attachment upload component can have all target functions, but each target function can determine whether it is available in the current application platform according to the option visible mark of the corresponding file acquisition method. If it is not available, the target function will not be displayed. The option visible mark is set according to user needs.

本发明的附件上传组件的扩展方法,通过设置文件获取方式列表,允许用户通过对文件获取方式的自定义编辑事件,更新文件获取方式列表以对附件上传组件的功能进行管理,为低代码平台中的附件上传组件提供了更多的功能,以满足日渐复杂的用户业务需求,解决了传统低代码平台在功能扩展方面的局限性,为附件上传组件扩展其文件获取方式提供了支持。The extension method of the attachment upload component of the present invention, by setting a file acquisition method list, allows the user to update the file acquisition method list through customized editing events of the file acquisition method to manage the functions of the attachment upload component, thereby providing more functions for the attachment upload component in the low-code platform to meet the increasingly complex business needs of users, solving the limitations of traditional low-code platforms in functional expansion, and providing support for the attachment upload component to expand its file acquisition method.

基于同一发明构思,根据本发明的另一个方面,如图3所示,本发明的实施例还提供了一种附件上传组件的扩展系统,包括:Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 3 , an embodiment of the present invention further provides an extension system for an attachment upload component, including:

识别单元110,配置用于响应于检测到附件上传组件中的编辑事件,识别编辑事件对应的目标文件获取方式,并获取目标文件获取方式对应的目标标识;The identification unit 110 is configured to, in response to detecting an editing event in the attachment upload component, identify a target file acquisition method corresponding to the editing event, and obtain a target identifier corresponding to the target file acquisition method;

更新单元120,配置用于获取附件上传组件的文件获取方式列表,并基于目标标识,更新文件获取方式列表;The updating unit 120 is configured to obtain a file acquisition method list of the attachment upload component and update the file acquisition method list based on the target identifier;

扩展单元130,配置用于基于更新后的文件获取方式列表对附件上传组件进行目标功能开发,得到目标附件上传组件。The extension unit 130 is configured to develop a target function for the attachment upload component based on the updated file acquisition method list to obtain a target attachment upload component.

本发明的附件上传组件的扩展系统,通过设置文件获取方式列表,允许用户通过对文件获取方式的自定义编辑事件,更新文件获取方式列表以对附件上传组件的功能进行管理,为低代码平台中的附件上传组件提供了更多的功能,以满足日渐复杂的用户业务需求,解决了传统低代码平台在功能扩展方面的局限性,为附件上传组件扩展其文件获取方式提供了支持。The extension system of the attachment upload component of the present invention, by setting a file acquisition method list, allows the user to update the file acquisition method list through customized editing events of the file acquisition method to manage the functions of the attachment upload component, thereby providing more functions for the attachment upload component in the low-code platform to meet the increasingly complex business needs of users, solving the limitations of traditional low-code platforms in functional expansion, and providing support for the attachment upload component to expand its file acquisition method.

基于同一发明构思,根据本发明的另一个方面,如图4所示,本发明的实施例还提供了一种计算机设备30,在该计算机设备30中包括处理器310以及存储器320,存储器320存储有可在处理器上运行的计算机程序321,处理器310执行程序时执行如上的方法的步骤。Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 4 , an embodiment of the present invention further provides a computer device 30, which includes a processor 310 and a memory 320, wherein the memory 320 stores a computer program 321 that can be run on the processor, and the processor 310 executes the steps of the above method when executing the program.

基于同一发明构思,根据本发明的另一个方面,如图5所示,本发明的实施例还提供了一种计算机可读存储介质40,计算机可读存储介质40存储有被处理器执行时执行如上方法的计算机程序410。Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 5 , an embodiment of the present invention further provides a computer-readable storage medium 40 , which stores a computer program 410 that performs the above method when executed by a processor.

最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned any method embodiments.

本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.

以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the present invention as defined in the claims. The functions, steps and/or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and/or" refers to any and all possible combinations including one or more of the associated listed items.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims (10)

1.一种附件上传组件的扩展方法,其特征在于,包括:1. A method for extending an attachment upload component, comprising: 响应于检测到附件上传组件中的编辑事件,识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识;In response to detecting an editing event in the attachment upload component, identifying a target file acquisition method corresponding to the editing event, and acquiring a target identifier corresponding to the target file acquisition method; 获取附件上传组件的文件获取方式列表,并基于所述目标标识,更新所述文件获取方式列表;Obtain a file acquisition method list of the attachment upload component, and update the file acquisition method list based on the target identifier; 基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件。The target function of the attachment upload component is developed based on the updated file acquisition method list to obtain a target attachment upload component. 2.根据权利要求1所述的附件上传组件的扩展方法,其特征在于,所述基于所述目标标识,更新所述文件获取方式列表的步骤,包括:2. The method for extending the attachment upload component according to claim 1, wherein the step of updating the file acquisition method list based on the target identifier comprises: 获取所述目标文件获取方式对应的第一回调方法和第一字段;Obtain a first callback method and a first field corresponding to the target file acquisition method; 判断所述文件获取方式列表中是否存在与所述目标标识对应的初始文件获取方式;Determine whether there is an initial file acquisition method corresponding to the target identifier in the file acquisition method list; 响应于所述文件获取方式列表中存在与所述目标标识对应的初始文件获取方式,获取所述初始文件获取方式对应的初始回调方法和初始字段;In response to the existence of an initial file acquisition method corresponding to the target identifier in the file acquisition method list, acquiring an initial callback method and an initial field corresponding to the initial file acquisition method; 将所述初始回调方法和所述第一回调方法按照预设条件合并以得到目标回调方法;Merging the initial callback method and the first callback method according to a preset condition to obtain a target callback method; 在所述文件获取方式列表中将所述初始回调方法更新为目标回调方法,将所述初始字段更新为所述第一字段。In the file acquisition method list, the initial callback method is updated to the target callback method, and the initial field is updated to the first field. 3.根据权利要求2所述的附件上传组件的扩展方法,其特征在于,还包括:3. The method for extending the attachment upload component according to claim 2, further comprising: 响应于所述文件获取方式列表中不存在与所述目标标识对应的文件获取方式,在所述文件获取方式列表中增加所述目标标识、所述第一回调方法和所述第一字段,以更新所述文件获取方式列表。In response to the absence of a file acquisition method corresponding to the target identifier in the file acquisition method list, the target identifier, the first callback method and the first field are added to the file acquisition method list to update the file acquisition method list. 4.根据权利要求1所述的附件上传组件的扩展方法,其特征在于,所述识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识的步骤,包括:4. The method for extending the attachment upload component according to claim 1, wherein the step of identifying the target file acquisition method corresponding to the editing event and acquiring the target identifier corresponding to the target file acquisition method comprises: 获取所述附件上传组件的扩展脚本;Obtaining an extension script of the attachment upload component; 比对所述文件获取方式列表和所述扩展脚本,根据比对结果判断所述扩展脚本是否存在新增文件标识;Compare the file acquisition method list with the extended script, and determine whether a new file identifier exists in the extended script according to the comparison result; 响应于所述扩展脚本存在新增文件标识,将所述新增文件标识对应的第一文件获取方式作为所述目标文件获取方式,将所述新增文件标识作为所述目标标识。In response to the presence of a new file identifier in the extended script, a first file acquisition method corresponding to the new file identifier is used as the target file acquisition method, and the new file identifier is used as the target identifier. 5.根据权利要求4所述的附件上传组件的扩展方法,其特征在于,还包括:5. The method for extending the attachment upload component according to claim 4, further comprising: 响应于所述扩展脚本不存在新增文件标识,根据所述比对结果确定更新文件配置;In response to the absence of a newly added file identifier in the extended script, determining to update the file configuration according to the comparison result; 获取所述更新文件配置对应的文件标识作为所述目标标识,所述更新文件配置对应的第二文件获取方式作为所述目标文件获取方式。The file identifier corresponding to the update file configuration is obtained as the target identifier, and the second file acquisition method corresponding to the update file configuration is obtained as the target file acquisition method. 6.根据权利要求1所述的附件上传组件的扩展方法,其特征在于,还包括:6. The method for extending the attachment upload component according to claim 1, further comprising: 响应于目标接口接收到用户输入的目标数组,将所述目标数组挂载至预设对象;In response to the target interface receiving the target array input by the user, mounting the target array to a preset object; 响应于所述附件上传组件的扩展脚本访问所述预设对象,触发所述编辑事件;In response to the extended script of the attachment upload component accessing the preset object, triggering the editing event; 其中,所述目标数组包括文件标识、文件名称、显示标识、提示文本和/或回调方法。The target array includes a file identifier, a file name, a display identifier, a prompt text and/or a callback method. 7.根据权利要求1所述的附件上传组件的扩展方法,其特征在于,所述基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件的步骤,包括:7. The method for extending the attachment upload component according to claim 1, wherein the step of developing a target function of the attachment upload component based on the updated file acquisition method list to obtain a target attachment upload component comprises: 将更新后的所述文件获取方式列表通过依赖注入方式传递至所述附件上传组件;Passing the updated file acquisition method list to the attachment upload component through dependency injection; 所述附件上传组件根据更新后的所述文件获取方式列表包括的每个文件获取方式配置对应的所述目标功能,将配置了所有所述目标功能的所述附件上传组件作为所述目标附件上传组件。The attachment upload component configures the corresponding target function according to each file acquisition method included in the updated file acquisition method list, and uses the attachment upload component configured with all the target functions as the target attachment upload component. 8.一种附件上传组件的扩展系统,其特征在于,包括:8. An extension system for an attachment upload component, comprising: 识别单元,配置用于响应于检测到附件上传组件中的编辑事件,识别所述编辑事件对应的目标文件获取方式,并获取所述目标文件获取方式对应的目标标识;an identification unit configured to, in response to detecting an editing event in the attachment upload component, identify a target file acquisition method corresponding to the editing event, and acquire a target identifier corresponding to the target file acquisition method; 更新单元,配置用于获取附件上传组件的文件获取方式列表,并基于所述目标标识,更新所述文件获取方式列表;An updating unit configured to obtain a file acquisition method list of the attachment upload component and update the file acquisition method list based on the target identifier; 扩展单元,配置用于基于更新后的所述文件获取方式列表对所述附件上传组件进行目标功能开发,得到目标附件上传组件。The extension unit is configured to develop a target function for the attachment upload component based on the updated file acquisition method list to obtain a target attachment upload component. 9.一种计算机设备,包括:9. A computer device comprising: 至少一个处理器;以及at least one processor; and 存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如权利要求1至7任意一项所述的方法的步骤。A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 7 when executing the program. 10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行如权利要求1至7任意一项所述的方法的步骤。10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the method according to any one of claims 1 to 7.
CN202411170336.2A 2024-08-23 2024-08-23 A method, system, device and medium for extending an attachment upload component Pending CN118972383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411170336.2A CN118972383A (en) 2024-08-23 2024-08-23 A method, system, device and medium for extending an attachment upload component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411170336.2A CN118972383A (en) 2024-08-23 2024-08-23 A method, system, device and medium for extending an attachment upload component

Publications (1)

Publication Number Publication Date
CN118972383A true CN118972383A (en) 2024-11-15

Family

ID=93394462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411170336.2A Pending CN118972383A (en) 2024-08-23 2024-08-23 A method, system, device and medium for extending an attachment upload component

Country Status (1)

Country Link
CN (1) CN118972383A (en)

Similar Documents

Publication Publication Date Title
TWI808393B (en) Page processing method, device, apparatus and storage medium
US7603624B2 (en) System and method for styling content in a graphical user interface control
CN108549568B (en) Application entry processing method, device, storage medium and electronic device
WO2020052337A1 (en) Information processing method and apparatus, storage medium, and electronic device
CN104636139A (en) Visualized cross-platform mobile application development and generation system
CN115033235A (en) System and method for flexibly multiplexing web page based on low-code development platform
US20110029949A1 (en) Widget combos: a widget programming model
CN111638907A (en) Method, device, terminal and storage medium for replacing third-party code segment
CN112764802A (en) Business logic customization method and device, electronic equipment and storage medium
CN113900725B (en) Interface configuration method, device, computer equipment and storage medium
US20110126171A1 (en) Dynamic native editor code view facade
JP2015222571A (en) Method and apparatus for managing system specification
CN116304442A (en) Page code generation method and device, electronic equipment and storage medium
WO2025044582A1 (en) Page management method and apparatus for virtual game, electronic device, and storage medium
CN116595284B (en) Webpage system operation method, device, equipment, storage medium and program
CN114116077B (en) Image editing method, device, electronic device and medium
Delessio et al. Sams teach yourself Android application development in 24 hours
CN118972383A (en) A method, system, device and medium for extending an attachment upload component
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN116820453A (en) Universal form component design method based on elementUI
US9372669B2 (en) Multiple architecture viewpoints in single unified modeling language (UML) model
CN111880698A (en) Information processing method and device of intelligent terminal, electronic equipment and storage medium
CN112905922B (en) Page loading method, device, electronic device, storage medium and program product
CN117311799B (en) Configuration method of software project page
CN101847147A (en) System and method for integrating independently edited script and style into webpage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination