1
0
mirror of https://github.com/huxuxuya/1cPredefinedValuesSubsystem.git synced 2026-04-24 20:33:46 +02:00

Начало добавления массива

This commit is contained in:
Fedor Timokhov
2025-09-27 22:49:43 +03:00
parent edc3c95100
commit 80bcd3d644
4 changed files with 254 additions and 11 deletions
@@ -267,7 +267,9 @@
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<width>6</width>
<autoMaxWidth>true</autoMaxWidth>
<height>3</height>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:PictureDecorationExtInfo">
<picture xsi:type="core:PictureRef">
@@ -317,8 +319,10 @@
<maxWidth>32</maxWidth>
<autoMaxHeight>true</autoMaxHeight>
<horizontalStretch>false</horizontalStretch>
<groupVerticalAlign>Center</groupVerticalAlign>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
<verticalAlign>Center</verticalAlign>
</extInfo>
</items>
<items xsi:type="form:FormField">
@@ -447,7 +451,10 @@
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<width>6</width>
<autoMaxWidth>true</autoMaxWidth>
<maxWidth>3</maxWidth>
<height>3</height>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:PictureDecorationExtInfo">
<picture xsi:type="core:PictureRef">
@@ -497,8 +504,10 @@
<maxWidth>32</maxWidth>
<autoMaxHeight>true</autoMaxHeight>
<horizontalStretch>false</horizontalStretch>
<groupVerticalAlign>Center</groupVerticalAlign>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
<verticalAlign>Center</verticalAlign>
</extInfo>
</items>
<visible>true</visible>
@@ -2185,6 +2194,23 @@
<common>true</common>
</edit>
</attributes>
<attributes>
<name>СозданПрограммно</name>
<title>
<key>ru</key>
<value>Создан программно</value>
</title>
<id>9</id>
<valueType>
<types>Boolean</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<commandInterface>
<navigationPanel/>
<commandBar/>
@@ -378,6 +378,7 @@
Возврат;
Иначе
ИсходноеЗначение = СтрокаТекущейНастройки.Значение;
СозданПрограммно = Истина;
КонецЕсли;
КонецПроцедуры
@@ -385,9 +386,15 @@
&НаСервере
Процедура УстановитьВидимостьЭлементовФормы()
ЗначенияРазличаются = (Объект.Значение <> ИсходноеЗначение);
Элементы.ГруппаИнформация.Видимость = ЗначенияРазличаются;
Если СозданПрограммно Тогда
Элементы.ГруппаПредупреждение.Видимость = Ложь;
ЗначенияРазличаются = (Объект.Значение <> ИсходноеЗначение);
Элементы.ГруппаИнформация.Видимость = ЗначенияРазличаются;
Иначе
Элементы.ГруппаПредупреждение.Видимость = Истина;
Элементы.ГруппаИнформация.Видимость = Ложь;
КонецЕсли;
КонецПроцедуры
#КонецОбласти
@@ -702,6 +702,154 @@
<currentRowUse>Auto</currentRowUse>
</extInfo>
</items>
<items xsi:type="form:FormGroup">
<name>ГруппаМассив</name>
<id>15</id>
<items xsi:type="form:Button">
<name>СозданиеПредопределеннойНастройкМассив</name>
<id>17</id>
<title>
<key>ru</key>
<value>Создать настройку</value>
</title>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<extendedTooltip>
<name>СозданиеПредопределеннойНастройкМассивРасширеннаяПодсказка</name>
<id>18</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<type>UsualButton</type>
<commandName>Form.Command.СозданиеПредопределеннойНастройкМассив</commandName>
<representation>PictureAndText</representation>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<placementArea>UserCmds</placementArea>
<picture xsi:type="core:PictureRef">
<picture>StdPicture.CreateListItem</picture>
</picture>
<representationInContextMenu>Auto</representationInContextMenu>
</items>
<items xsi:type="form:Button">
<name>УстановитьЗначениеПредопределеннойНастройкиМассив</name>
<id>19</id>
<title>
<key>ru</key>
<value>Установить значение</value>
</title>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<extendedTooltip>
<name>УстановитьЗначениеПредопределеннойНастройкиМассивРасширеннаяПодсказка</name>
<id>20</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<type>UsualButton</type>
<commandName>Form.Command.УстановитьЗначениеПредопределеннойНастройкиМассив</commandName>
<representation>PictureAndText</representation>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<placementArea>UserCmds</placementArea>
<picture xsi:type="core:PictureRef">
<picture>StdPicture.DataCompositionStandardSettings</picture>
</picture>
<representationInContextMenu>Auto</representationInContextMenu>
</items>
<items xsi:type="form:Button">
<name>УдалениеПредопределеннойНастройкиМассив</name>
<id>21</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<extendedTooltip>
<name>УдалениеПредопределеннойНастройкиМассивРасширеннаяПодсказка</name>
<id>22</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<type>UsualButton</type>
<commandName>Form.Command.УдалениеПредопределеннойНастройкиМассив</commandName>
<representation>PictureAndText</representation>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<placementArea>UserCmds</placementArea>
<picture xsi:type="core:PictureRef">
<picture>StdPicture.Delete</picture>
</picture>
<representationInContextMenu>Auto</representationInContextMenu>
</items>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<title>
<key>ru</key>
<value>Массив</value>
</title>
<extendedTooltip>
<name>ГруппаМассивРасширеннаяПодсказка</name>
<id>16</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<type>UsualGroup</type>
<extInfo xsi:type="form:UsualGroupExtInfo">
<group>AlwaysHorizontal</group>
<behavior>Auto</behavior>
<showLeftMargin>true</showLeftMargin>
<united>true</united>
<showTitle>true</showTitle>
<throughAlign>Auto</throughAlign>
<currentRowUse>Auto</currentRowUse>
</extInfo>
</items>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
@@ -728,7 +876,7 @@
</extendedTooltip>
<type>UsualGroup</type>
<extInfo xsi:type="form:UsualGroupExtInfo">
<group>HorizontalIfPossible</group>
<group>Vertical</group>
<behavior>Auto</behavior>
<showLeftMargin>true</showLeftMargin>
<united>true</united>
@@ -753,6 +901,7 @@
<dataPath xsi:type="form:DataPath">
<segments>ПредопределеннаяНастройка</segments>
</dataPath>
<titleLocation>Top</titleLocation>
<extendedTooltip>
<name>ПредопределеннаяНастройкаРасширеннаяПодсказка</name>
<id>25</id>
@@ -1211,6 +1360,47 @@
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<formCommands>
<name>СозданиеПредопределеннойНастройкМассив</name>
<title>
<key>ru</key>
<value>Создать настройку</value>
</title>
<id>3</id>
<use>
<common>true</common>
</use>
<action xsi:type="form:FormCommandHandlerContainer">
<handler>
<name>СозданиеПредопределеннойНастройкМассив</name>
</handler>
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<formCommands>
<name>УстановитьЗначениеПредопределеннойНастройкиМассив</name>
<title>
<key>ru</key>
<value>Установить значение</value>
</title>
<id>4</id>
<use>
<common>true</common>
</use>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<formCommands>
<name>УдалениеПредопределеннойНастройкиМассив</name>
<title>
<key>ru</key>
<value>Удалить настройку</value>
</title>
<id>5</id>
<use>
<common>true</common>
</use>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<commandInterface>
<navigationPanel/>
<commandBar/>
@@ -76,6 +76,11 @@
Процедура УдалениеПредопределеннойНастройкиСсылка(Команда)
УдалениеПредопределеннойНастройкиСсылкаНаСервере();
КонецПроцедуры
&НаКлиенте
Процедура СозданиеПредопределеннойНастройкМассив(Команда)
СозданиеПредопределеннойНастройкМассивНаСервере();
КонецПроцедуры
#КонецОбласти
#Область СлужебныеПроцедурыИФункции
@@ -86,7 +91,7 @@
ОбновитьПовторноИспользуемыеЗначения();
ТаблицаНастроек = ТаблицаПредопределенныхТестовыхНастроек();
ПредопределенныеНастройки.ЗаполнениеПредопределенныхЭлементов(ТаблицаНастроек);
ПредопределенныеНастройки.ОбновитьНастройкиВБазе(ТаблицаНастроек);
ПроверитьСозданныеНастройки();
КонецПроцедуры
@@ -225,13 +230,11 @@
НоваяНастройка = ТаблицаНастроек.Добавить();
НоваяНастройка.Идентификатор = Новый УникальныйИдентификатор("6f205348-2c73-46a8-98a6-851a40a12bbe");
НоваяНастройка.ИмяНастройки = "ТестМассив";
НоваяНастройка.Хранилище = Перечисления.ValueStorage.Массив;
НоваяНастройка.ИмяНастройки = ИмяНастройкиТестовыйМассив();
НоваяНастройка.Хранилище = Новый ХранилищеЗначения(МассивПример);
НоваяНастройка.Значение = МассивПример;
НоваяНастройка.Наименование = "Массив тестовых настроек";
НоваяНастройка.ТипЗначения = Справочники.ПредопределенныеНастройки.НайтиПоРеквизиту("ИмяНастройки",
"ПримерТипаМассив");
НоваяНастройка.ТипЗначения = ПредопределенноеЗначение("Перечисление.ТипыЗначенияПредопределенныхЗначений.Массив");
КонецПроцедуры
// Процедура проверяет, были ли созданы предопределенные настройки.
@@ -362,6 +365,11 @@
Возврат "ТестСсылки";
КонецФункции
&НаСервере
Функция ИмяНастройкиТестовыйМассив()
Возврат "ТестМассива";
КонецФункции
&НаСервере
Процедура СозданиеПредопределеннойНастройкиБулевоНаСервере()
@@ -408,7 +416,7 @@
ПредопределеннаяНастройка = ПредопределенныеНастройки.НастройкаПоИмени(ИмяНастройкиТестовойСсылки());
ЗначениеПредопределеннойНастройки = ПредопределенныеНастройки.Значение(ИмяНастройкиТестовойСсылки(), Истина);
КонецПроцедуры
&НаСервере
@@ -436,4 +444,16 @@
КонецПроцедуры
&НаСервере
Процедура СозданиеПредопределеннойНастройкМассивНаСервере()
ТаблицаНастроек = ПредопределенныеНастройки.НоваяТаблицаПредопределенныхНастроек();
ДобавитьТестовыйМассив(ТаблицаНастроек);
ПредопределенныеНастройки.ОбновитьНастройкиВБазе(ТаблицаНастроек);
ПредопределеннаяНастройка = ПредопределенныеНастройки.НастройкаПоИмени(ИмяНастройкиТестовыйМассив());
ЗначениеПредопределеннойНастройки = ПредопределенныеНастройки.Значение(ИмяНастройкиТестовыйМассив(), Истина);
КонецПроцедуры
#КонецОбласти