Тут розглянуто створення та редагування моделі.
Для створення чи редагування в розділ "Створити/оновити" і заповнити параметри моделі
Параметри схеми:
{
"modal_entity": {
"activity_name": {
"type": "ASSOCIATION", //for Association
"label": "Активність",
"label_from_column_name": "gps", //get label name from column json
"editable": true || false // when editable show SELECT
"icon": "mdi-phone", //mdi icons
"icon_color": "red", //can be HEX code
},
"minimal": { //key for value
"type": "STRING", //STRING, TEXT, INTEGER, BIGINT, BOOLEAN
"label": "Custom Name",
"label_from_column_name": "gps", //get label name from column json
"icon": "mdi-phone", //mdi icons
"icon_color": "red", //can be HEX code
"editable": true || false
},
"cd_map": {
"type": "MAP",
"label": "Coordinates",
"editable": true || false,
"latitude_key": "latitude", //key from row for value
"longitude_key": "longitude" //key from row for value
},
"cd_image_slider": {
"type": "SLIDER",
"label": "Images",
"img_fields": [
"outlet_image" //key from row for value
]
},
"custom_value_chart": {
"type": "CHART",
"label": "Coordinates",
"editable": true || false
},
"expansion-panels": [ //expansion Panel
{
"label": "Адреса",
"header_color": "#d9edf7",
"icon": "mdi-map-marker-outline",
"icon_color": "black",
"items": {
"petra_id": {
"label": "Custom Label",
"label_from_column_name": "gps", //get label name from column json
"type": "BIGINT",
"editable": true, //if true show toggle
"edit_toggle": false, //need for toggle
"icon": "mdi-account-hard-hat",
"icon_color": "primary"
},
"region": {
"type": "STRING"
}
}
}
],
"create_association_row": { //need for add new row in assoc table
"type": "CREATE_ASSOCIATION_ROW",
"label": "Призначити штраф", //label for button
"from": "consultant_penalty", //association model_name
"to": "penalty_id", //field in model which need update in model
"show_if_result": "penalty_hours", //hide button if result exist (penalty_id)
"label_if_result": "Штраф призначено", //label for alert if result exist (penalty_id)
"icon": "mdi-currency-usd-off", //icon before button
"icon_color": "error", //icon and button color
"save_by_permission": "error", //check permission canAdd in model by 'from'
}
},
"table_stylization": {
"total_row": true, //show total row in table
"colorize": { //background Color element in table
"what": "cell", // "row" || "cell"
"field": "ap_work_status_label", // required if need bgColor CELL
"param_name": "bgColor", //HEX code color value in field row
"opacity": 0.3 //opacity Number with Float 1 - no opacity
}
},
"macros": {
"bot_id": 1,
"single": true, //button in row of table
"multiple": false, //button in Global for multiple
}
}
<aside> ⚠️ При зміні схеми при додаванні стовпців дані зберігаються. Виняток тільки при видаленні колонок - дані видаляться і при зміні типу стовпця, якщо приведення типу неможливе, наприклад рядок до числа
</aside>