{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form form-validation view-save" action="{{:MyUrl('admin/goodsparamstemplate/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/goodsparamstemplate/index', $params)}}" enctype="multipart/form-data">
			<legend>
				<span class="am-text-default">商品参数{{if empty($data['id'])}}添加{{else /}}编辑{{/if}}</span>
				<a href="{{:MyUrl('admin/goodsparamstemplate/index', $params)}}" class="am-fr am-text-sm am-margin-top-xs am-icon-mail-reply"> 返回</a>
			</legend>
			<div class="am-form-group">
				<label>名称</label>
				<input type="text" name="name" placeholder="名称" minlength="2" maxlength="30" data-validation-message="名称格式 2~30 个字符" class="am-radius" {{if !empty($data['name'])}} value="{{$data.name}}"{{/if}} required />
			</div>

			<div class="am-margin-top-lg">
				<label class="block">参数配置</label>
				{{include file="public/goodsparamstemplate/tips" /}}
				<!-- 通过配置生成商品参数 -->
				<div class="am-dropdown" id="parameters-quick-container" data-am-dropdown>
					<span class="business-operations-submit am-dropdown-toggle parameters-quick-add">
						<span>快捷操作</span>
						<i class="am-icon-caret-down"></i>
					</span>
					<div class="am-dropdown-content parameters-quick-config">
						<textarea rows="5" placeholder="粘贴商品参数配置信息"></textarea>
						<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block am-margin-top-sm">确认</button>
					</div>
				</div>
				<!-- 复制操作 -->
				<span class="business-operations-submit am-margin-left-sm parameters-quick-copy">
					<i class="am-icon-copy"></i>
					<span>复制配置</span>
				</span>
			    <!-- 清空操作 -->
			    <span class="business-operations-submit am-margin-left-sm parameters-quick-remove">
					<i class="am-icon-times"></i>
					<span>清空参数</span>
				</span>
				{{include file="public/goodsparamstemplate/table" /}}
			</div>

			<div class="am-form-group">
			    <label class="block">是否启用</label>
			    <input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if (isset($data['is_enable']) and $data['is_enable'] eq 1) or !isset($data['is_enable'])}}checked="true"{{/if}} />
			</div>

			<!-- 插件扩展数据 start -->
			{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_admin_goods_params_template_save</span>
                </div>
            {{/if}}
			{{if !empty($plugins_view_admin_goods_params_template_save_data) and is_array($plugins_view_admin_goods_params_template_save_data)}}
				<div class="am-alert am-alert-secondary">
					<label class="am-text-sm am-text-warning">该区域为插件扩展数据，请按照插件文档填写相应的值</label>
					<div>
						{{foreach $plugins_view_admin_brand_save_data as $hook}}
		                    {{if is_string($hook) or is_int($hook)}}
		                        {{$hook|raw}}
		                    {{/if}}
		                {{/foreach}}
					</div>
				</div>
			{{/if}}
			<!-- 插件扩展数据 end -->

			<div class="am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0">
				<input type="hidden" name="id" {{if !empty($data['id'])}} value="{{$data.id}}"{{/if}} />
				<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
			</div>
		</form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->