0.18.2
This commit is contained in:
29
app.R
29
app.R
@@ -150,8 +150,8 @@ server <- function(input, output, session) {
|
||||
tagList(
|
||||
strong("Импорт и экспорт данных для выбранной схемы:"),
|
||||
verticalLayout(
|
||||
downloadButton("downloadData", "Экспорт в .xlsx", style = "width: 250px; margin-top: 5px"),
|
||||
actionButton("button_upload_data_from_xlsx", "импорт!", icon("file-import", lib = "font-awesome"), style = "width: 250px; margin-top: 10px"),
|
||||
downloadButton("downloadData", "Экспорт базы в .xlsx", style = "width: 250px; margin-top: 5px"),
|
||||
actionButton("button_upload_data_from_xlsx", "Импорт базы из .xlsx", icon("file-import", lib = "font-awesome"), style = "width: 250px; margin-top: 10px"),
|
||||
fluid = FALSE
|
||||
),
|
||||
strong("Дополнительные опции:"),
|
||||
@@ -1262,15 +1262,24 @@ server <- function(input, output, session) {
|
||||
} else {
|
||||
|
||||
# удаление данных в базе данных по ключам
|
||||
purrr::walk(
|
||||
.x = unique(df[[main_key_id]]),
|
||||
.f = \(main_key) {
|
||||
# purrr::walk(
|
||||
# .x = unique(df[[main_key_id]]),
|
||||
# .f = \(main_key) {
|
||||
|
||||
if (main_key %in% unique(df_original[[main_key_id]])) {
|
||||
DBI::dbExecute(con, glue::glue("DELETE FROM {table_name} WHERE {main_key_id} = '{main_key}'"))
|
||||
}
|
||||
}
|
||||
)
|
||||
# if (main_key %in% unique(df_original[[main_key_id]])) {
|
||||
# DBI::dbExecute(con, glue::glue("DELETE FROM {table_name} WHERE {main_key_id} = '{main_key}'"))
|
||||
# }
|
||||
# }
|
||||
# )
|
||||
|
||||
# TODO
|
||||
all_existed_keys <- unique(df_original[[main_key_id]])
|
||||
all_new_keys <- unique(df[[main_key_id]])
|
||||
|
||||
keys_to_delete <- all_existed_keys[all_existed_keys %in% all_new_keys]
|
||||
keys_to_delete <- paste0("'", keys_to_delete, "'", collapse = ", ")
|
||||
|
||||
DBI::dbExecute(connection(), glue::glue("DELETE FROM {table_name} WHERE \"{main_key_id}\" IN ({keys_to_delete})"))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
default:
|
||||
form_app_version: 0.18.1
|
||||
form_app_version: 0.18.2
|
||||
form_id: formy
|
||||
form_name: FORMY
|
||||
Reference in New Issue
Block a user