123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:70:"/www/wwwroot/baoxian/public/../application/admin/view/product/add.html";i:1627915017;s:63:"/www/wwwroot/baoxian/application/admin/view/layout/default.html";i:1627698986;s:60:"/www/wwwroot/baoxian/application/admin/view/common/meta.html";i:1627698986;s:62:"/www/wwwroot/baoxian/application/admin/view/common/script.html";i:1627698986;}*/ ?>
- <!DOCTYPE html>
- <html lang="<?php echo $config['language']; ?>">
- <head>
- <meta charset="utf-8">
- <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
- <meta name="renderer" content="webkit">
- <meta name="referrer" content="never">
- <meta name="robots" content="noindex, nofollow">
- <link rel="shortcut icon" href="/assets/img/favicon.ico" />
- <!-- Loading Bootstrap -->
- <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
- <?php if(\think\Config::get('fastadmin.adminskin')): ?>
- <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
- <?php endif; ?>
- <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
- <!--[if lt IE 9]>
- <script src="/assets/js/html5shiv.js"></script>
- <script src="/assets/js/respond.min.js"></script>
- <![endif]-->
- <script type="text/javascript">
- var require = {
- config: <?php echo json_encode($config); ?>
- };
- </script>
- </head>
- <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
- <div id="main" role="main">
- <div class="tab-content tab-addtabs">
- <div id="content">
- <div class="row">
- <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
- <section class="content-header hide">
- <h1>
- <?php echo __('Dashboard'); ?>
- <small><?php echo __('Control panel'); ?></small>
- </h1>
- </section>
- <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
- <!-- RIBBON -->
- <div id="ribbon">
- <ol class="breadcrumb pull-left">
- <?php if($auth->check('dashboard')): ?>
- <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
- <?php endif; ?>
- </ol>
- <ol class="breadcrumb pull-right">
- <?php foreach($breadcrumb as $vo): ?>
- <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
- <?php endforeach; ?>
- </ol>
- </div>
- <!-- END RIBBON -->
- <?php endif; ?>
- <div class="content">
- <style>
- #shuxing{
- min-height: 100%;
- height: auto;
- }
- .demo_line_01{
- padding: 0 20px 0;
- margin: 20px 0;
- line-height: 1px;
- border-left: 200px solid #ddd;
- border-right: 200px solid #ddd;
- text-align: center;
- color: red;
- border-top: 80px;
- }
- </style>
- <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Name'); ?>:</label>
- <div class="col-xs-12 col-sm-8">
- <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2">所属保险分类:</label>
- <div class="col-xs-12 col-sm-8">
- <select id="c-pid" data-live-search="true" data-rule="required" class="form-control selectpicker" name="row[category_id]">
- <?php if(is_array($parentList) || $parentList instanceof \think\Collection || $parentList instanceof \think\Paginator): if( count($parentList)==0 ) : echo "" ;else: foreach($parentList as $key=>$vo): ?>
- <option data-type="<?php echo $vo['type']; ?>" value="<?php echo $key; ?>" <?php if(in_array(($key), explode(',',""))): ?>selected<?php endif; ?>><?php echo $vo['name']; ?></option>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </select>
- </div>
- </div>
- <div class="form-group" style="display: block">
- <label class="control-label col-xs-12 col-sm-2">包含属性:</label>
- <div id="shuxing" style="margin-left: 150px">
- </div>
- </div>
- <!-- <div class="form-group">-->
- <!-- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Category_id'); ?>:</label>-->
- <!-- <div class="col-xs-12 col-sm-8">-->
- <!-- <input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"product"}' class="form-control selectpage" name="row[category_id]" type="text" value="">-->
- <!-- </div>-->
- <!-- </div>-->
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Company_id'); ?>:</label>
- <div class="col-xs-12 col-sm-8">
- <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="">
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Sort'); ?>:</label>
- <div class="col-xs-12 col-sm-8">
- <input id="c-sort" class="form-control" name="row[sort]" type="number" value="0">
- </div>
- </div>
- <!-- <div class="form-group">-->
- <!-- <label class="control-label col-xs-12 col-sm-2"><?php echo __('Content'); ?>:</label>-->
- <!-- <div class="col-xs-12 col-sm-8">-->
- <!-- <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>-->
- <!-- </div>-->
- <!-- </div>-->
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2"><?php echo __('P_image'); ?>:</label>
- <div class="col-xs-12 col-sm-8">
- <div class="input-group">
- <input id="c-p_image" class="form-control" size="50" name="row[p_image]" type="text">
- <div class="input-group-addon no-border no-padding">
- <span><button type="button" id="faupload-p_image" class="btn btn-danger faupload" data-input-id="c-p_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-p_image"><i class="fa fa-upload"></i> <?php echo __('Upload'); ?></button></span>
- <span><button type="button" id="fachoose-p_image" class="btn btn-primary fachoose" data-input-id="c-p_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> <?php echo __('Choose'); ?></button></span>
- </div>
- <span class="msg-box n-right" for="c-p_image"></span>
- </div>
- <ul class="row list-inline faupload-preview" id="p-p_image"></ul>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2">是否保存草稿:</label>
- <!-- <div class="col-xs-12 col-sm-8">-->
- <!-- <input id="c-status" class="form-control" name="row[status]" type="number" value="0">-->
- <!-- </div>-->
- <div class="col-xs-12 col-sm-8">
- <select class="form-control selectpicker" name="row[status]">
- <?php if($group_id == 7): ?>
- <option value="0" >发布状态</option>
- <?php elseif($group_id == 6): ?>
- <option value="1" >草稿状态</option>
- <?php elseif($group_id == 1): ?>
- <option value="0" >发布状态</option>
- <option value="1" >草稿状态</option>
- <?php else: ?>
- <option value="0" >发布状态</option>
- <?php endif; ?>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2">状态属性:</label>
- <div class="col-xs-12 col-sm-8">
-
- <select id="c-attribute" class="form-control selectpicker" name="row[attribute]">
- <?php if(is_array($attributeList) || $attributeList instanceof \think\Collection || $attributeList instanceof \think\Paginator): if( count($attributeList)==0 ) : echo "" ;else: foreach($attributeList as $key=>$vo): ?>
- <option value="<?php echo $key; ?>" <?php if(in_array(($key), explode(',',""))): ?>selected<?php endif; ?>><?php echo $vo; ?></option>
- <?php endforeach; endif; else: echo "" ;endif; ?>
- </select>
- </div>
- </div>
- <div class="demo_line_01">
- 下方添加其他保险属性
- </div>
- <div class="form-group">
- <dl class="fieldlist" id="fieldlist" data-name="row[content]" data-template="fieldtpl" style="margin-left: 100px">
- <dd>
- <ins>名称</ins>
- <ins>内容</ins>
- </dd>
- <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>追加</a></dd>
- <textarea name="row[content]" id="sendcontent" class="form-control hide" cols="30" rows="5">
- <!-- [{"key":"特殊数据1","name":"内容1"},{"key":"特殊数据2","name":"内容2"}]-->
- </textarea>
- </dl>
- </div>
- <div class="form-group layer-footer">
- <label class="control-label col-xs-12 col-sm-2"></label>
- <div class="col-xs-12 col-sm-8">
- <button type="submit" class="btn btn-success btn-embossed disabled"><?php echo __('OK'); ?></button>
- <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
- </div>
- </div>
- </form>
- <!--以下是自定义模板的内容-->
- <script id="fieldtpl">
- <dd class="form-inline">
- <input type="text" name="<%=name%>[<%=index%>][key]" class="form-control" value="" size="10" />
- <input type="text" name="<%=name%>[<%=index%>][name]" class="form-control" value="" size="30" />
- <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
- <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
- <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
- </dd>
-
- </script>
- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
- <script>
- function myFocus(obj){
- //判断文本框中的内容是否是默认内容
- obj.value="";
- //设置文本框获取焦点时候背景颜色变换
-
- }
-
- $(document).on("focus", "#c-pid", function(){
-
- obj.value="";
- })
-
- $(document).on("change", "#c-pid", function(){
- var id = $("#c-pid").val();
- var list = {id:id};
- var addHtml = "";
- $("#shuxing").html(addHtml);
- $.ajax({
- //请求方式
- type : "POST",
- //请求的媒体类型
- contentType: "application/json;charset=UTF-8",
- //请求地址
- url : "Product/params",
- //数据,json字符串
- data:JSON.stringify(list),
- //请求成功
- success : function(result) {
- // $("#fieldlist").dataset.name = result.data;
- // var ele = document.getElementById("test");
- // ele.value = ele.value + result.data;
- // document.getElementById('shuxing').style.display = "block";
- // document.getElementById("content1").value = result.data;
- if(result.code == 1){
- var obj_json = result.data;
- var packJson = JSON.parse(obj_json);
- var addHtml = "";
- for(var i = 0; i < packJson.length; i++){
- console.log(packJson[i].key + " " + packJson[i].name);
- addHtml += "<div class=\"col-xs-6 col-sm-8\">\n" +
- " <input readonly=\"readonly\" data-rule=\"required\" style=\"width: 30%;\" name=\"row[key1][]\"" +
- " value="+packJson[i].key+ " type=\"text\">\n" +
- " <input data-rule=\"required\" style=\"width: 30%;\" name=\"row[name1][]\"" +
- " value="+packJson[i].name+ " type=\"text\">\n" +
- " </div>";
- }
- $("#shuxing").append(addHtml);
- }else{
- console.log(result.msg);
- }
- },
- //请求失败,包含具体的错误信息
- error : function(e){
- var addHtml = "";
- $("#shuxing").append(addHtml);
- console.log(e.status);
- console.log(e.responseText);
- }
- });
- });
- </script>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
- </body>
- </html>
|