Commit 744f2ec57f5459b206fe72a409b1d089611ca116

Authored by wdn127929
1 parent 5d128518

向上、向下移动、大小图、菜单名称样式

1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/models/radio_model.dart';
2 import 'package:one_key/utils/utils.dart'; 3 import 'package:one_key/utils/utils.dart';
3 4
4 ///菜单 5 ///菜单
@@ -116,6 +117,53 @@ class MenuSunModel { @@ -116,6 +117,53 @@ class MenuSunModel {
116 117
117 String nameType = '3'; //1左侧,2右侧,3顶部分开 118 String nameType = '3'; //1左侧,2右侧,3顶部分开
118 String imageType = '1'; //1大图,2小图 119 String imageType = '1'; //1大图,2小图
  120 + int sort;
  121 + int indexNew;
  122 +
  123 +//名称样式选择数组
  124 + List<RadioModel> get nameTypeList {
  125 + RadioModel radioModel1 = RadioModel();
  126 + radioModel1.title = '菜品名称(味型/烹调)及价格在顶部左侧';
  127 + radioModel1.code = '1';
  128 + radioModel1.select = nameType == radioModel1.code ? true : false;
  129 + RadioModel radioModel2 = RadioModel();
  130 + radioModel2.title = '菜品名称(味型/烹调)及价格在顶部右侧';
  131 + radioModel2.code = '2';
  132 + radioModel2.select = nameType == radioModel2.code ? true : false;
  133 + RadioModel radioModel3 = RadioModel();
  134 + radioModel3.title = '菜品名称(味型/烹调)及价格在顶部分开';
  135 + radioModel3.code = '3';
  136 + radioModel3.select = nameType == radioModel3.code ? true : false;
  137 + return [radioModel1, radioModel2, radioModel3];
  138 + }
  139 +
  140 + //图片样式选择数组
  141 + List<RadioModel> get imageTypeList {
  142 + RadioModel radioModel1 = RadioModel();
  143 + radioModel1.title = '大图展示菜品';
  144 + radioModel1.code = '1';
  145 + radioModel1.select = imageType == radioModel1.code ? true : false;
  146 + RadioModel radioModel2 = RadioModel();
  147 + radioModel2.title = '小图展示菜品';
  148 + radioModel2.code = '2';
  149 + radioModel2.select = imageType == radioModel2.code ? true : false;
  150 +
  151 + return [radioModel1, radioModel2];
  152 + }
  153 +
  154 + //图片移动数组
  155 + List<RadioModel> get moveList {
  156 + RadioModel radioModel1 = RadioModel();
  157 + radioModel1.title = '菜品向上移动一个';
  158 + radioModel1.code = '1';
  159 + radioModel1.select = false;
  160 + RadioModel radioModel2 = RadioModel();
  161 + radioModel2.title = '菜品向下移动一个';
  162 + radioModel2.code = '2';
  163 + radioModel2.select = false;
  164 +
  165 + return [radioModel1, radioModel2];
  166 + }
119 167
120 MenuSunModel( 168 MenuSunModel(
121 {this.id, 169 {this.id,
@@ -149,7 +197,8 @@ class MenuSunModel { @@ -149,7 +197,8 @@ class MenuSunModel {
149 this.cookList, 197 this.cookList,
150 this.amountC, 198 this.amountC,
151 this.nameType, 199 this.nameType,
152 - this.imageType}); 200 + this.imageType,
  201 + this.sort});
153 202
154 MenuSunModel.fromJson(Map<String, dynamic> json) { 203 MenuSunModel.fromJson(Map<String, dynamic> json) {
155 id = json['id']; 204 id = json['id'];
@@ -188,8 +237,10 @@ class MenuSunModel { @@ -188,8 +237,10 @@ class MenuSunModel {
188 } 237 }
189 // imageType = Utils.randomGet(1, 3) ?? '1'; 238 // imageType = Utils.randomGet(1, 3) ?? '1';
190 // nameType = Utils.randomGet(1, 4) ?? '3'; 239 // nameType = Utils.randomGet(1, 4) ?? '3';
191 - imageType = name == '小炒肉' || name == '水煮肉片' || name == '西湖牛肉羹'? '2' : '1'; 240 + imageType = name == '小炒肉' || name == '水煮肉片' || name == '西湖牛肉羹' ? '2' : '1';
192 nameType = '1'; 241 nameType = '1';
  242 +
  243 + sort = json['sort'];
193 } 244 }
194 245
195 MenuSunModel.fromJson3(Map<String, dynamic> json) { 246 MenuSunModel.fromJson3(Map<String, dynamic> json) {
@@ -297,6 +348,7 @@ class MenuSunModel { @@ -297,6 +348,7 @@ class MenuSunModel {
297 data['practice'] = this.practice; 348 data['practice'] = this.practice;
298 data['amount'] = this.amount; 349 data['amount'] = this.amount;
299 data['cookList'] = this.cookList; 350 data['cookList'] = this.cookList;
  351 + data['sort'] = this.sort;
300 return data; 352 return data;
301 } 353 }
302 } 354 }
  1 +class RadioModel {
  2 + String title;
  3 + bool select;
  4 + String code;
  5 +}
@@ -88,11 +88,25 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -88,11 +88,25 @@ class _MenuManagePageState extends State<MenuManagePage> {
88 88
89 await menuManageProvider.getCookbookByClass(context, params, 89 await menuManageProvider.getCookbookByClass(context, params,
90 showLoading: showLoading); 90 showLoading: showLoading);
  91 + _handleData();
  92 + }
91 93
  94 + ///处理数据
  95 + _handleData({isMove = false}) {
92 if (menuManageProvider.menuModel != null) { 96 if (menuManageProvider.menuModel != null) {
93 List<MenuModel> temp = []; 97 List<MenuModel> temp = [];
94 for (int i = 0; i < menuManageProvider.menuModel.length; i++) { 98 for (int i = 0; i < menuManageProvider.menuModel.length; i++) {
95 List<dynamic> listSub = []; 99 List<dynamic> listSub = [];
  100 + // if (menuManageProvider.menuModel[i].cookbooklist.length > 0 &&
  101 + // menuManageProvider.menuModel[i].cookbooklist[0].indexNew == null &&
  102 + // !isMove) {
  103 + // //没有设置过顺序
  104 + // for (int j = 0;
  105 + // j < menuManageProvider.menuModel[i].cookbooklist.length;
  106 + // j++) {
  107 + // menuManageProvider.menuModel[i].cookbooklist[j].indexNew = j; //初始化菜单顺序
  108 + // }
  109 + // }
96 for (int j = 0; 110 for (int j = 0;
97 j < menuManageProvider.menuModel[i].cookbooklist.length; 111 j < menuManageProvider.menuModel[i].cookbooklist.length;
98 j++) { 112 j++) {
@@ -100,6 +114,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -100,6 +114,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
100 menuManageProvider.menuModel[i].cookbooklist[j]; 114 menuManageProvider.menuModel[i].cookbooklist[j];
101 if (menuSunModel.imageType == '1') { 115 if (menuSunModel.imageType == '1') {
102 //大图 116 //大图
  117 + menuSunModel.indexNew = j;
103 listSub.add(menuSunModel); 118 listSub.add(menuSunModel);
104 } else { 119 } else {
105 //小图 120 //小图
@@ -109,18 +124,23 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -109,18 +124,23 @@ class _MenuManagePageState extends State<MenuManagePage> {
109 .menuModel[i].cookbooklist[j + 1].imageType == 124 .menuModel[i].cookbooklist[j + 1].imageType ==
110 '1') { 125 '1') {
111 //下一个是大图 126 //下一个是大图
  127 + menuSunModel.indexNew = j;
112 listSub.add(menuSunModel); 128 listSub.add(menuSunModel);
113 } else { 129 } else {
114 //下一个是小图 130 //下一个是小图
115 131
116 List<MenuSunModel> subTemp = []; 132 List<MenuSunModel> subTemp = [];
  133 + menuSunModel.indexNew = j;
117 subTemp.add(menuSunModel); 134 subTemp.add(menuSunModel);
  135 + menuManageProvider.menuModel[i].cookbooklist[j + 1].indexNew =
  136 + j + 1;
118 subTemp 137 subTemp
119 .add(menuManageProvider.menuModel[i].cookbooklist[j + 1]); 138 .add(menuManageProvider.menuModel[i].cookbooklist[j + 1]);
120 listSub.add(subTemp); 139 listSub.add(subTemp);
121 j++; 140 j++;
122 } 141 }
123 } else { 142 } else {
  143 + menuSunModel.indexNew = j;
124 listSub.add(menuSunModel); 144 listSub.add(menuSunModel);
125 } 145 }
126 } 146 }
@@ -130,6 +150,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -130,6 +150,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
130 } 150 }
131 151
132 menuManageProvider.menuModel = temp; 152 menuManageProvider.menuModel = temp;
  153 + setState(() {});
133 } 154 }
134 } 155 }
135 //左边 156 //左边
@@ -355,6 +376,50 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -355,6 +376,50 @@ class _MenuManagePageState extends State<MenuManagePage> {
355 ); 376 );
356 } 377 }
357 378
  379 + _onLongPress(MenuSunModel model, int indexOut) async {
  380 + Map object = await DialogUtil.menuMagageAlertDialog(
  381 + context, model.nameTypeList, model.imageTypeList, model.moveList);
  382 + if (object != null) {
  383 + print(object);
  384 + if (object['name_type'] != null) {
  385 + //有一个选中
  386 +
  387 + model.nameType = object['name_type'];
  388 + } else {
  389 + //全部不选择
  390 + model.nameType = null;
  391 + }
  392 + if (object['image_type'] != null) {
  393 + model.imageType = object['image_type'];
  394 + } else {
  395 + model.imageType = null;
  396 + }
  397 + if (object['move'] != null) {
  398 + if (object['move'] == '1') {
  399 + //向上移动
  400 +
  401 + var child = menuManageProvider.menuModel[indexOut].cookbooklist
  402 + .removeAt(model.indexNew);
  403 +
  404 + menuManageProvider.menuModel[indexOut].cookbooklist
  405 + .insert(model.indexNew - 1, child);
  406 +
  407 + _handleData(isMove: true);
  408 + } else if (object['move'] == '2') {
  409 + //向下移动
  410 + var child = menuManageProvider.menuModel[indexOut].cookbooklist
  411 + .removeAt(model.indexNew);
  412 +
  413 + menuManageProvider.menuModel[indexOut].cookbooklist
  414 + .insert(model.indexNew + 1, child);
  415 +
  416 + _handleData(isMove: true);
  417 + }
  418 + }
  419 + }
  420 + ;
  421 + }
  422 +
358 @override 423 @override
359 Widget build(BuildContext context) { 424 Widget build(BuildContext context) {
360 menuManageProvider = Provider.of<MenuManageProvider>(context, listen: true); 425 menuManageProvider = Provider.of<MenuManageProvider>(context, listen: true);
@@ -544,15 +609,8 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -544,15 +609,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
544 return GestureDetector( 609 return GestureDetector(
545 onLongPress: () async { 610 onLongPress: () async {
546 print('onLongPress 长按事件'); 611 print('onLongPress 长按事件');
547 - Map object = await DialogUtil  
548 - .menuMagageAlertDialog(  
549 - context);  
550 - if (object != null) {  
551 - print(object);  
552 - // 'name_type':'1',  
553 - // 'image_type':'1',  
554 - // 'move':'1'  
555 - } 612 +
  613 + _onLongPress(model, indexOut);
556 }, 614 },
557 child: Stack( 615 child: Stack(
558 children: [ 616 children: [
@@ -580,6 +638,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -580,6 +638,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
580 return GestureDetector( 638 return GestureDetector(
581 onLongPress: () { 639 onLongPress: () {
582 print('onLongPress 长按事件'); 640 print('onLongPress 长按事件');
  641 + _onLongPress(model, indexOut);
583 }, 642 },
584 child: Stack(children: [ 643 child: Stack(children: [
585 Container( 644 Container(
@@ -704,6 +763,8 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -704,6 +763,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
704 onLongPress: () { 763 onLongPress: () {
705 print( 764 print(
706 'onLongPress 长按事件'); 765 'onLongPress 长按事件');
  766 + _onLongPress(temp[0],
  767 + indexOut);
707 }, 768 },
708 child: Stack( 769 child: Stack(
709 children: [ 770 children: [
@@ -736,6 +797,9 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -736,6 +797,9 @@ class _MenuManagePageState extends State<MenuManagePage> {
736 onLongPress: () { 797 onLongPress: () {
737 print( 798 print(
738 'onLongPress 长按事件'); 799 'onLongPress 长按事件');
  800 +
  801 + _onLongPress(temp[1],
  802 + indexOut);
739 }, 803 },
740 child: Stack( 804 child: Stack(
741 children: [ 805 children: [
@@ -36,6 +36,7 @@ import 'package:table_calendar/table_calendar.dart'; @@ -36,6 +36,7 @@ import 'package:table_calendar/table_calendar.dart';
36 import 'package:one_key/models/table.dart' as t; 36 import 'package:one_key/models/table.dart' as t;
37 import 'package:url_launcher/url_launcher.dart'; 37 import 'package:url_launcher/url_launcher.dart';
38 38
  39 +import '../models/radio_model.dart';
39 import '../models/theme_color_model.dart'; 40 import '../models/theme_color_model.dart';
40 41
41 typedef CustomCallBack = void Function(Object object); 42 typedef CustomCallBack = void Function(Object object);
@@ -53,14 +54,19 @@ typedef ClickCallback = void Function(String value); @@ -53,14 +54,19 @@ typedef ClickCallback = void Function(String value);
53 // }; 54 // };
54 55
55 class DialogUtil { 56 class DialogUtil {
56 - static Future menuMagageAlertDialog(BuildContext context,  
57 - {GestureTapCallback onTap, double fontSize = 32}) async { 57 + static Future menuMagageAlertDialog(
  58 + BuildContext context,
  59 + List<RadioModel> nameTypeList,
  60 + List<RadioModel> imageTypeList,
  61 + List<RadioModel> moveList,
  62 + {GestureTapCallback onTap,
  63 + double fontSize = 32}) async {
58 final action = await showDialog( 64 final action = await showDialog(
59 context: context, 65 context: context,
60 barrierDismissible: true, 66 barrierDismissible: true,
61 builder: (BuildContext context) { 67 builder: (BuildContext context) {
62 - return Center(  
63 - child: Container( 68 + return Center(child: StatefulBuilder(builder: (context, state) {
  69 + return Container(
64 padding: 70 padding:
65 EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)), 71 EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
66 decoration: BoxDecoration( 72 decoration: BoxDecoration(
@@ -71,68 +77,138 @@ class DialogUtil { @@ -71,68 +77,138 @@ class DialogUtil {
71 Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角 77 Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角
72 child: Column(mainAxisSize: MainAxisSize.min, children: [ 78 child: Column(mainAxisSize: MainAxisSize.min, children: [
73 VEmptyView(92), 79 VEmptyView(92),
74 - Container(  
75 - height: ScreenUtil().setWidth(96),  
76 - alignment: Alignment.center,  
77 - child: Text('菜品名称(味型/烹调)及价格在顶部左侧',  
78 - style: TextStyle(  
79 - fontSize: ScreenUtil().setSp(fontSize),  
80 - color: MyColours.color_515151)),  
81 - ),  
82 - Container(  
83 - height: ScreenUtil().setWidth(96),  
84 - alignment: Alignment.center,  
85 - child: Text('菜品名称(味型/烹调)及价格在顶部右侧',  
86 - style: TextStyle(  
87 - fontSize: ScreenUtil().setSp(fontSize),  
88 - color: MyColours.color_515151)),  
89 - ),  
90 - Container(  
91 - height: ScreenUtil().setWidth(96),  
92 - alignment: Alignment.center,  
93 - child: Text('菜品名称(味型/烹调)及价格在顶部分开',  
94 - style: TextStyle(  
95 - fontSize: ScreenUtil().setSp(fontSize),  
96 - color: MyColours.color_515151)),  
97 - ), 80 + ListView.builder(
  81 + itemCount: nameTypeList.length,
  82 + shrinkWrap: true,
  83 + itemBuilder: (context, index) {
  84 + return InkWell(
  85 + onTap: () {
  86 + if (imageTypeList.length > 1 &&
  87 + imageTypeList[1].select) {
  88 + return;
  89 + } else {
  90 + nameTypeList.forEach((element) {
  91 + element.select = false;
  92 + });
  93 + nameTypeList[index].select = true;
  94 + state(() {});
  95 + }
  96 + },
  97 + child: Container(
  98 + height: ScreenUtil().setWidth(96),
  99 + alignment: Alignment.center,
  100 + child: Text(nameTypeList[index].title,
  101 + style: TextStyle(
  102 + fontSize: ScreenUtil().setSp(fontSize),
  103 + color: imageTypeList.length > 1 &&
  104 + imageTypeList[1].select
  105 + ? MyColours.color_999999
  106 + : nameTypeList[index].select
  107 + ? MyColours.color_438E93
  108 + : MyColours.color_515151)),
  109 + ));
  110 + }),
  111 +
  112 + // Container(
  113 + // height: ScreenUtil().setWidth(96),
  114 + // alignment: Alignment.center,
  115 + // child: Text('菜品名称(味型/烹调)及价格在顶部右侧',
  116 + // style: TextStyle(
  117 + // fontSize: ScreenUtil().setSp(fontSize),
  118 + // color: MyColours.color_515151)),
  119 + // ),
  120 + // Container(
  121 + // height: ScreenUtil().setWidth(96),
  122 + // alignment: Alignment.center,
  123 + // child: Text('菜品名称(味型/烹调)及价格在顶部分开',
  124 + // style: TextStyle(
  125 + // fontSize: ScreenUtil().setSp(fontSize),
  126 + // color: MyColours.color_515151)),
  127 + // ),
98 MyDivider( 128 MyDivider(
99 ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2), 129 ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2),
100 color: MyColours.color_efefef), 130 color: MyColours.color_efefef),
101 - Container(  
102 - height: ScreenUtil().setWidth(96),  
103 - alignment: Alignment.center,  
104 - child: Text('大图展示菜品',  
105 - style: TextStyle(  
106 - fontSize: ScreenUtil().setSp(fontSize),  
107 - color: MyColours.color_515151)),  
108 - ),  
109 - Container(  
110 - height: ScreenUtil().setWidth(96),  
111 - alignment: Alignment.center,  
112 - child: Text('小图展示菜品',  
113 - style: TextStyle(  
114 - fontSize: ScreenUtil().setSp(fontSize),  
115 - color: MyColours.color_515151)),  
116 - ), 131 + ListView.builder(
  132 + itemCount: imageTypeList.length,
  133 + shrinkWrap: true,
  134 + itemBuilder: (context, index) {
  135 + return InkWell(
  136 + onTap: () {
  137 + imageTypeList.forEach((element) {
  138 + element.select = false;
  139 + });
  140 + imageTypeList[index].select = true;
  141 + state(() {});
  142 + },
  143 + child: Container(
  144 + height: ScreenUtil().setWidth(96),
  145 + alignment: Alignment.center,
  146 + child: Text(imageTypeList[index].title,
  147 + style: TextStyle(
  148 + fontSize: ScreenUtil().setSp(fontSize),
  149 + color: imageTypeList[index].select
  150 + ? MyColours.color_438E93
  151 + : MyColours.color_515151)),
  152 + ));
  153 + }),
  154 + // Container(
  155 + // height: ScreenUtil().setWidth(96),
  156 + // alignment: Alignment.center,
  157 + // child: Text('大图展示菜品',
  158 + // style: TextStyle(
  159 + // fontSize: ScreenUtil().setSp(fontSize),
  160 + // color: MyColours.color_515151)),
  161 + // ),
  162 + // Container(
  163 + // height: ScreenUtil().setWidth(96),
  164 + // alignment: Alignment.center,
  165 + // child: Text('小图展示菜品',
  166 + // style: TextStyle(
  167 + // fontSize: ScreenUtil().setSp(fontSize),
  168 + // color: MyColours.color_515151)),
  169 + // ),
117 MyDivider( 170 MyDivider(
118 ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2), 171 ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2),
119 color: MyColours.color_efefef), 172 color: MyColours.color_efefef),
120 - Container(  
121 - height: ScreenUtil().setWidth(96),  
122 - alignment: Alignment.center,  
123 - child: Text('菜品向上移动一个',  
124 - style: TextStyle(  
125 - fontSize: ScreenUtil().setSp(fontSize),  
126 - color: MyColours.color_515151)),  
127 - ),  
128 - Container(  
129 - height: ScreenUtil().setWidth(96),  
130 - alignment: Alignment.center,  
131 - child: Text('菜品向下移动一个',  
132 - style: TextStyle(  
133 - fontSize: ScreenUtil().setSp(fontSize),  
134 - color: MyColours.color_515151)),  
135 - ), 173 + ListView.builder(
  174 + itemCount: moveList.length,
  175 + shrinkWrap: true,
  176 + itemBuilder: (context, index) {
  177 + return InkWell(
  178 + onTap: () {
  179 + moveList.forEach((element) {
  180 + element.select = false;
  181 + });
  182 + moveList[index].select = true;
  183 + state(() {});
  184 + },
  185 + child: Container(
  186 + height: ScreenUtil().setWidth(96),
  187 + alignment: Alignment.center,
  188 + child: Text(moveList[index].title,
  189 + style: TextStyle(
  190 + fontSize: ScreenUtil().setSp(fontSize),
  191 + color: moveList[index].select
  192 + ? MyColours.color_438E93
  193 + : MyColours.color_515151)),
  194 + ));
  195 + }),
  196 + // Container(
  197 + // height: ScreenUtil().setWidth(96),
  198 + // alignment: Alignment.center,
  199 + // child: Text('菜品向上移动一个',
  200 + // style: TextStyle(
  201 + // fontSize: ScreenUtil().setSp(fontSize),
  202 + // color: MyColours.color_515151)),
  203 + // ),
  204 + // Container(
  205 + // height: ScreenUtil().setWidth(96),
  206 + // alignment: Alignment.center,
  207 + // child: Text('菜品向下移动一个',
  208 + // style: TextStyle(
  209 + // fontSize: ScreenUtil().setSp(fontSize),
  210 + // color: MyColours.color_515151)),
  211 + // ),
136 VEmptyView(60), 212 VEmptyView(60),
137 MyDivider(double.infinity, ScreenUtil().setWidth(2), 213 MyDivider(double.infinity, ScreenUtil().setWidth(2),
138 color: MyColours.color_f3f3f3), 214 color: MyColours.color_f3f3f3),
@@ -175,18 +251,37 @@ class DialogUtil { @@ -175,18 +251,37 @@ class DialogUtil {
175 // return; 251 // return;
176 // } 252 // }
177 // onTap(controller.text); 253 // onTap(controller.text);
  254 +
  255 + List<RadioModel> nameSelect = nameTypeList
  256 + .where((element) => element.select)
  257 + .toList();
  258 + List<RadioModel> imageSelect = imageTypeList
  259 + .where((element) => element.select)
  260 + .toList();
  261 + List<RadioModel> moveSelect = moveList
  262 + .where((element) => element.select)
  263 + .toList();
178 Navigator.pop(context, { 264 Navigator.pop(context, {
179 - 'name_type': '1',  
180 - 'image_type': '1',  
181 - 'move': '1' 265 + 'name_type':
  266 + nameSelect != null && nameSelect.length > 0
  267 + ? nameSelect[0].code
  268 + : null,
  269 + 'image_type':
  270 + imageSelect != null && imageSelect.length > 0
  271 + ? imageSelect[0].code
  272 + : null,
  273 + 'move':
  274 + moveSelect != null && moveSelect.length > 0
  275 + ? moveSelect[0].code
  276 + : null,
182 }); 277 });
183 // } 278 // }
184 }), 279 }),
185 ], 280 ],
186 ), 281 ),
187 ])), 282 ])),
188 - ),  
189 - ); 283 + );
  284 + }));
190 }, 285 },
191 ); 286 );
192 return action; 287 return action;