Skip to content

informat.system Global System Operations

Overview

Use the informat.system object for global system operations

toast

Call the system Toast notification

javascript
informat.system.toast(msg);
ParameterTypeDescription
msgStringDisplay message

confirm

Call the system confirmation dialog

javascript
informat.system.confirm(options);
ParameterTypeDescription
titleStringDialog title, optional
contentStringPrompt content, if not provided, will use the title parameter value as an alternative display
dialogTopStringDistance from top, default (15vh)
dialogHeightStringWindow height
dialogWidthStringWindow width, default (400px)
horizontalAlignStringContent horizontal alignment
left, center, right, justify, default center
verticalAlignStringContent vertical alignment
top, center, bottom, default center
showCancelboolWhether to show cancel button
cancelTextStringCancel button text, default (Cancel)
confirmTextStringConfirm button text, default (Confirm)

Return Value User operation result

javascript
// Call confirmation prompt
informat.system
  .confirm({
    title: "Are you sure you want to perform this operation?",
  })
  .then((confirm) => {
    if (!confirm) {
      console.log("Cancelled");
      return;
    }
    console.log("Confirmed");
  });

Notes

If the content attribute is not provided, the system will use title as the content to display information, while hiding the title display.

previewImage

Call the system image preview dialog to preview images

javascript
informat.system.previewImage(options);
ParameterTypeDescription
startIndexIntegerPreview image default index position, starts from 0
listArray<ImageItem>Preview image list

ImageItem structure is as follows

ts
interface ImageItem {
  // Image ID, optional parameter
  id: String;
  // Image name, optional parameter
  name: String;
  // Image URL, required parameter
  src: String;
}

Return Value User operation result

javascript
// Call system image preview dialog to preview images
informat.system.previewImage({
  startIndex: 0,
  list: [{ src: "https://url.to.image" }],
});

getSystemConfig

Get system global configuration data

javascript
informat.system.getSystemConfig();

Return Value Type is Promise<Object>

javascript
informat.system.getSystemConfig().then((data) => {
  console.log(data);
});

getCompany

Get team information of the currently logged-in user

javascript
informat.system.getCompany();

Return Value Type is Promise<Company>

javascript
informat.system.getCompany().then((data) => {
  console.log(data);
});

getAccount

Get the currently logged-in user

javascript
informat.system.getAccount();

Return Value Type is Promise<Account>

javascript
informat.system.getAccount().then((user) => {
  console.log(user);
});

getToken

Get Token data of the currently logged-in user

javascript
informat.system.getToken();

Return Value Type is Promise<String>

javascript
informat.system.getToken().then((token) => {
  console.log(token);
});

getServerUrl

Get platform service address

javascript
informat.system.getServerUrl();

Return Value Type is Promise<String>

javascript
// If server configuration is set to https://next.informat.cn
informat.system.getServerUrl().then((url) => {
  console.log(url); //https://next.informat.cn
});

getClientUrl

Get the prefix of the current platform access address

javascript
informat.system.getClientUrl();

Return Value Type is Promise<String>

javascript
// If current browser access address is https://next.informat.cn/web0/app/xxx/table/xxx?id=xxxx
informat.system.getClientUrl().then((url) => {
  console.log(url); // https://next.informat.cn/
});

showLoading

Display system loading state

javascript
informat.system.showLoading();

Return Value Type is Promise

javascript
informat.system.showLoading().then(() => {
  console.log("loading show");
});

hideLoading

Hide system loading state

javascript
informat.system.hideLoading();

Return Value Type is Promise

javascript
informat.system.hideLoading().then(() => {
  console.log("loading show");
});

setModuleBarStyle

Set application menu bar style

javascript
informat.system.setModuleBarStyle(layout);
ParameterTypeDescription
layoutStringTop-bottom layout:top
Left-right layout:left
Left-right layout (including top navigation):lefttop
Top-bottom layout (no top navigation):topmini
No navigation bar:none

Return Value Type is Promise

javascript
informat.system.setModuleBarStyle("left").then(() => {
  console.log("setModuleBarStyle success");
});

setAppColor

Set application menu bar style

javascript
informat.system.setAppColor(color);
ParameterTypeDescription
colorStringColor, supports using system default colors or custom colors

Notes

System default color list

ValueColor
c0#5b8ff9
c1#57ca8c
c2#5d7092
c3#faad14
c4#e86452
c5#56c1ec
c6#945fb9
c7#ff9845
c8#1e9493
c9#000000

Return Value Type is Promise

setVisitHistoryVisible

Set application module visit history visibility

javascript
informat.system.setVisitHistoryVisible(locale);
ParameterTypeDescription
visibleBooleanWhether visible

Return Value Type is Promise

setNavBreadcrumbVisible

Set application module path visibility

javascript
informat.system.setNavBreadcrumbVisible(locale);
ParameterTypeDescription
visibleBooleanWhether visible

Return Value Type is Promise

setModuleTitleVisible

Set application module title visibility

javascript
informat.system.setModuleTitleVisible(locale);
ParameterTypeDescription
visibleBooleanWhether visible

Return Value Type is Promise

updateAppDefine

Update application configuration object property data

javascript
informat.system.updateAppDefine(key, value);
ParameterTypeDescription
keyStringProperty name
valueObjectProperty value

Return Value Type is Promise

updateModuleDefine

Update application module configuration object property data

javascript
informat.system.updateModuleDefine(key, value);
ParameterTypeDescription
keyStringProperty name
valueObjectProperty value

Return Value Type is Promise

Data Table Default View

Data Table Other Views

setLocale

Modify current user language

javascript
informat.system.setLocale(locale);
ParameterTypeDescription
colorStringLanguage. Supports Simplified Chinese:zh_CN
English:en_US

Return Value Type is Promise