1009 lines
47 KiB
PHP
1009 lines
47 KiB
PHP
|
<?php if (!defined("RUNTIME")) exit(); /*a:5:{s:70:"C:\lewis\phpstudy_pro\WWW\foxcms\app\admin\view\model_manage\edit.html";i:1732932220;s:59:"C:\lewis\phpstudy_pro\WWW\foxcms\app\admin\view\foxcms.html";i:1732932220;s:56:"C:\lewis\phpstudy_pro\WWW\foxcms\app\admin\view\css.html";i:1732932220;s:64:"C:\lewis\phpstudy_pro\WWW\foxcms\app\admin\view\footed-copy.html";i:1732932220;s:59:"C:\lewis\phpstudy_pro\WWW\foxcms\app\admin\view\script.html";i:1732932220;}*/ ?>
|
|||
|
<!DOCTYPE html>
|
|||
|
<html lang="cn">
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8" />
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|||
|
<title><?php echo xn_cfg('base.sys_name'); ?></title>
|
|||
|
<link rel="stylesheet" href="<?php echo htmlentities($staticPath); ?>css/foxui-1.32.min.css" />
|
|||
|
<link rel="stylesheet" href="<?php echo htmlentities($staticPath); ?>css/common.min.css" />
|
|||
|
<link rel="stylesheet" href="<?php echo htmlentities($staticPath); ?>css/admin_common.css" />
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
<div class="foxcms-container basic-set-page-container apply-page-container">
|
|||
|
<div class="foxcms-header">
|
|||
|
<div class="foxcms-logo">
|
|||
|
<img style="width: 100px;" src="/static/images/foxcms_logo.svg">
|
|||
|
</div>
|
|||
|
<div class="foxcms-modal">
|
|||
|
<?php if($clickName): ?>
|
|||
|
<p><?php echo htmlentities($clickName); ?></p>
|
|||
|
<?php else: ?>
|
|||
|
<button class="foxui-text" onclick="window.history.go(-1)">
|
|||
|
<i class="foxui-icon-fanhui-o"></i>
|
|||
|
<span>返回</span>
|
|||
|
</button>
|
|||
|
<?php endif; ?>
|
|||
|
</div>
|
|||
|
<div class="foxcms-bar">
|
|||
|
<div class="foxcms-bar-left">
|
|||
|
<ul class="foxui-breadcrumb">
|
|||
|
<?php if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$vo): ?>
|
|||
|
<li class="foxui-breadcrumb-item">
|
|||
|
<a href="<?php echo htmlentities($vo['url']); ?>"><?php echo htmlentities($vo['title']); ?></a>
|
|||
|
</li>
|
|||
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div class="foxcms-bar-right">
|
|||
|
|
|||
|
<div class="foxui-dropdown lang-select">
|
|||
|
<?php if(sizeof($otherLangs) > 0): ?>
|
|||
|
<button class="foxui-dropdown-handle foxui-dropdown-icon lang-btn" data-trigger="hover" data-lang="<?php echo htmlentities($curlang['lang']); ?>"><?php echo htmlentities($curlang['name']); ?></button>
|
|||
|
<div class="foxui-dropdown-menu">
|
|||
|
<ul class="foxui-dropdown-slide">
|
|||
|
<?php foreach($otherLangs as $key=>$vo): ?>
|
|||
|
<li class="foxui-dropdown-item" data-id="<?php echo htmlentities($vo['id']); ?>" data-lang="<?php echo htmlentities($vo['lang']); ?>" onclick="langHandover(this)"><?php echo htmlentities($vo['name']); ?></li>
|
|||
|
<?php endforeach; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<?php else: ?>
|
|||
|
<button class="foxui-dropdown-handle foxui-dropdown-icon lang-btn display-none" data-trigger="hover" data-lang="<?php echo htmlentities($curlang['lang']); ?>"><?php echo htmlentities($curlang['name']); ?></button>
|
|||
|
<?php endif; ?>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="item icon index">
|
|||
|
<i class="foxui-icon-shouye-o"></i>
|
|||
|
</div>
|
|||
|
<div class="item role">
|
|||
|
<div class="foxui-dropdown">
|
|||
|
<button class="foxui-text foxui-dropdown-handle foxui-dropdown-icon" data-trigger="hover" id="barService">
|
|||
|
<i class="foxui-icon-kefu-o"></i>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
<div class="foxui-dropdown dropdown">
|
|||
|
<button class="foxui-text foxui-dropdown-handle foxui-dropdown-icon" data-trigger="hover"><?php echo session("admin_auth.nickname"); ?></button>
|
|||
|
<div class="foxui-dropdown-menu">
|
|||
|
<ul class="foxui-dropdown-slide">
|
|||
|
<li class="foxui-dropdown-item" data-id="1">个人中心</li>
|
|||
|
<li class="foxui-dropdown-item" data-id="2">修改密码</li>
|
|||
|
<li class="foxui-dropdown-item" data-id="3">更新缓存</li>
|
|||
|
<li class="foxui-divided" data-id="4"></li>
|
|||
|
<li class="foxui-dropdown-item" data-id="5">退出系统</li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="item icon logout">
|
|||
|
<a onclick="logout()"><i class="foxui-icon-tuichu-o"></i></a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="foxcms-main">
|
|||
|
<div class="foxcms-nav">
|
|||
|
<ul>
|
|||
|
<?php if(is_array($menu) || $menu instanceof \think\Collection || $menu instanceof \think\Paginator): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
|
|||
|
<li>
|
|||
|
<a class="<?php if($pid == $vo['id']): ?>active<?php endif; ?>" href="<?php echo htmlentities($vo['name']); ?>">
|
|||
|
<i class="foxui-<?php echo htmlentities($vo['icon']); ?>"></i>
|
|||
|
<span><?php echo htmlentities($vo['title']); ?></span>
|
|||
|
</a>
|
|||
|
</li>
|
|||
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<?php if(sizeof($chileMenus) > 0): ?>
|
|||
|
<div class="foxcms-menu-nav" style="<?php echo htmlentities($fox_menu); ?>">
|
|||
|
<div class="foxcms-menu-nav-inner" id="foxMenuFrame">
|
|||
|
|
|||
|
<ul class="foxui-menu foxui-type-vertical">
|
|||
|
<?php if(is_array($chileMenus) || $chileMenus instanceof \think\Collection || $chileMenus instanceof \think\Paginator): if( count($chileMenus)==0 ) : echo "" ;else: foreach($chileMenus as $key=>$cm): if(empty($cm['_data']) != true): ?>
|
|||
|
<li class="foxui-menu-submenu">
|
|||
|
<div class="foxui-menu-handle foxui-menu-icon is-active">
|
|||
|
<span><?php echo htmlentities($cm['title']); ?></span>
|
|||
|
</div>
|
|||
|
<div class="foxui-menu-menu" style="display: block">
|
|||
|
<ul class="foxui-menu-slide">
|
|||
|
<?php if(is_array($cm['_data']) || $cm['_data'] instanceof \think\Collection || $cm['_data'] instanceof \think\Paginator): if( count($cm['_data'])==0 ) : echo "" ;else: foreach($cm['_data'] as $key=>$ccm): if(empty($ccm['_data']) != true): ?>
|
|||
|
<li class="foxui-menu-submenu">
|
|||
|
<div class="foxui-menu-handle foxui-menu-icon is-active">
|
|||
|
<span><?php echo htmlentities($ccm['title']); ?></span>
|
|||
|
</div>
|
|||
|
<div class="foxui-menu-menu" style="display: block">
|
|||
|
<ul class="foxui-menu-slide">
|
|||
|
<?php if(is_array($ccm['_data']) || $ccm['_data'] instanceof \think\Collection || $ccm['_data'] instanceof \think\Paginator): if( count($ccm['_data'])==0 ) : echo "" ;else: foreach($ccm['_data'] as $key=>$cccm): if($clickId == $cccm['id']): ?>
|
|||
|
<li class="foxui-menu-item is-active"><?php echo htmlentities($cccm['title']); ?></li>
|
|||
|
<?php else: ?>
|
|||
|
<li class="foxui-menu-item">
|
|||
|
<a href="<?php echo htmlentities($cccm['name']); ?>?columnId=<?php echo htmlentities($cccm['id']); ?>"><?php echo htmlentities($cccm['title']); ?></a>
|
|||
|
</li>
|
|||
|
<?php endif; ?>
|
|||
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
<?php else: ?>
|
|||
|
<li class="foxui-menu-item <?php if($clickId == $ccm['id']): ?>is-active<?php endif; ?>">
|
|||
|
<a href="<?php echo htmlentities($ccm['name']); ?>?columnId=<?php echo htmlentities($ccm['id']); ?>"><?php echo htmlentities($ccm['title']); ?></a>
|
|||
|
</li>
|
|||
|
<?php endif; ?>
|
|||
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
<?php else: ?>
|
|||
|
<li class="foxui-menu-item <?php if($clickId == $cm['id']): ?>is-active<?php endif; ?>">
|
|||
|
<a href="<?php echo htmlentities($cm['name']); ?>?columnId=<?php echo htmlentities($cm['id']); ?>"><?php echo htmlentities($cm['title']); ?></a>
|
|||
|
</li>
|
|||
|
<?php endif; ?>
|
|||
|
<?php endforeach; endif; else: echo "" ;endif; ?>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div class="foxcms-menu-nav-fold">
|
|||
|
<i class="foxui-icon-zuizuo"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<?php endif; ?>
|
|||
|
<div class="foxcms-article foxui-scroll-container has-content-footer">
|
|||
|
<div class="foxcms-content">
|
|||
|
|
|||
|
<input name="columnId" type="hidden" value="<?php echo htmlentities($columnId); ?>"/>
|
|||
|
<input name="modelId" type="hidden" value="<?php echo htmlentities($modelRecord['id']); ?>"/>
|
|||
|
|
|||
|
|
|||
|
<div class="foxcms-content-inner">
|
|||
|
<!-- page content -->
|
|||
|
<div class="attach-set-content">
|
|||
|
<div class="foxui-tabs foxui-type-line">
|
|||
|
<div class="foxui-tabs-header">
|
|||
|
<div class="foxui-tabs-item is-active">基本设置</div>
|
|||
|
<div class="foxui-tabs-item">内容字段</div>
|
|||
|
<div class="foxui-tabs__active-bar" style="width: 112px; transform: translateX(0px);"></div></div>
|
|||
|
<div class="foxui-tabs-content">
|
|||
|
<div class="foxui-tabs-pane" style="">
|
|||
|
<div class="section">
|
|||
|
|
|||
|
<div class="section-title">设置</div>
|
|||
|
<div class="section-main">
|
|||
|
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>模型类型:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box display-flex foxui-align-items-center">
|
|||
|
<mark><?php echo htmlentities($modelRecord['systemtext']); ?></mark>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>模型名称:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box display-flex foxui-align-items-center">
|
|||
|
<input class="foxui-size-small" disabled placeholder="请输入模型名称" value="<?php echo htmlentities($modelRecord['name']); ?>"/>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>模型标识:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box display-flex foxui-align-items-center">
|
|||
|
<span><?php echo htmlentities($modelRecord['nid']); ?></span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>附加表:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box display-flex foxui-align-items-center">
|
|||
|
<input class="foxui-size-small" disabled placeholder="请输入内容" value="<?php echo htmlentities($modelRecord['table']); ?>"/>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>标题设置:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box display-flex foxui-align-items-center">
|
|||
|
<p class="switch-label">允许标题重复</p>
|
|||
|
<div class="foxui-switch is-checked">
|
|||
|
<input type="checkbox" checked="checked" value="" class="foxui-switch-input">
|
|||
|
<span class="foxui-switch-core"></span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="foxui-tabs-pane" style="display: none;">
|
|||
|
<div class="section">
|
|||
|
<div class="foxcms-content-inner">
|
|||
|
<!-- page content -->
|
|||
|
<div class="diy-form-content">
|
|||
|
<div class="content-top-operation">
|
|||
|
<div class="left">
|
|||
|
<button class="foxui-size-small foxui-solid-primary" onclick="modifyTableItem()">
|
|||
|
<i class="foxui-icon-jiahao-o"></i>
|
|||
|
<span>添加字段</span>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
<div class="right display-flex">
|
|||
|
<div class="foxui-input-group item-input">
|
|||
|
<label>字段搜索:</label>
|
|||
|
<input class="foxui-size-small" placeholder="请输入字段标题 / 字段名称" value="" name="keyword">
|
|||
|
</div>
|
|||
|
<div class="foxui-input-group item-select">
|
|||
|
<label>状态:</label>
|
|||
|
<div class="foxui-select">
|
|||
|
<div class="foxui-select-handle foxui-select-icon">
|
|||
|
<input class="foxui-select-input foxui-size-small" readonly="readonly" placeholder="请选择状态" value="全部" name="status">
|
|||
|
<i class="foxui-icon-close-circle"></i>
|
|||
|
</div>
|
|||
|
<div class="foxui-select-menu">
|
|||
|
<ul class="foxui-select-slide">
|
|||
|
<li class="foxui-select-item" data-id="1">全部</li>
|
|||
|
<li class="foxui-select-item" data-id="2">启用</li>
|
|||
|
<li class="foxui-select-item" data-id="3">禁用</li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<button class="foxui-solid-primary foxui-size-small search-btn">搜索</button>
|
|||
|
<button class="foxui-text-primary foxui-size-small reset-btn">重置</button>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section section-panel margin-top-10">
|
|||
|
<div class="foxui-table foxui-table-border-bottom foxui-table-hover foxui-checkbox-group">
|
|||
|
|
|||
|
<ul class="foxui-table-thead foxui-checkbox-head">
|
|||
|
<li class="foxui-table-tr">
|
|||
|
<div class="foxui-table-th" style="flex: initial; width: 40px">
|
|||
|
<div class="foxui-checkbox foxui-checkbox-all">
|
|||
|
<span class="foxui-checkbox-input">
|
|||
|
<i class="foxui-checkbox-icon"></i>
|
|||
|
<input type="checkbox" value="" />
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="foxui-table-th">ID</div>
|
|||
|
<div class="foxui-table-th">标题</div>
|
|||
|
<div class="foxui-table-th">名称</div>
|
|||
|
<div class="foxui-table-th">类型</div>
|
|||
|
<div class="foxui-table-th">状态</div>
|
|||
|
<div class="foxui-table-th">所属分类</div>
|
|||
|
<div class="foxui-table-th">操作</div>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<ul class="foxui-table-tbody foxui-checkbox-list" id="loadingContainer">
|
|||
|
<!--表格内容-->
|
|||
|
</ul>
|
|||
|
|
|||
|
<div class="table-footer foxui-checkbox-head">
|
|||
|
<div class="left display-flex foxui-align-items-center">
|
|||
|
<div class="foxui-checkbox foxui-checkbox-all margin-right-24">
|
|||
|
<span class="foxui-checkbox-input">
|
|||
|
<i class="foxui-checkbox-icon"></i>
|
|||
|
<input type="checkbox" value="" />
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
<div class="display-flex">
|
|||
|
<button class="foxui-plain-info foxui-size-mini enable-btn">
|
|||
|
<i class="foxui-icon-zhengque-o"></i>
|
|||
|
<span>启用</span>
|
|||
|
</button>
|
|||
|
<button class="foxui-plain-info foxui-size-mini disabled-btn">
|
|||
|
<i class="foxui-icon-jinyong-o"></i>
|
|||
|
<span>禁用</span>
|
|||
|
</button>
|
|||
|
<button class="foxui-plain-info foxui-size-mini delete-btn">
|
|||
|
<i class="foxui-icon-shanchu-o"></i>
|
|||
|
<span>删除</span>
|
|||
|
</button>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="right total">共N条记录</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="foxcms-content-copy">
|
|||
|
<p>
|
|||
|
<span>Copyright © 2021-<?php echo isset($nowtime) ? htmlentities($nowtime) : '现在'; ?></span>
|
|||
|
<strong>FOXCMS</strong>
|
|||
|
<span>版权所有</span>
|
|||
|
</p>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</body>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/jquery-3.6.0.min.js"></script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/tinymce/tinymce.min.js"></script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/echarts.min.js"></script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/foxui-1.32.min.js"></script>
|
|||
|
<script>
|
|||
|
//全局上传文件端口
|
|||
|
var UPLOAD_FILE_URL = "<?php echo url('upload_files/upload'); ?>";
|
|||
|
//图片粘贴下载
|
|||
|
var UPIMG_URL = "<?php echo url('upload_files/upimg'); ?>";
|
|||
|
var SERVER_URL = "/";
|
|||
|
//配置的后台路径
|
|||
|
var ADMIN_PATH = "/" + "<?php echo config('adminconfig.admin_path'); ?>";
|
|||
|
//静态文件路径
|
|||
|
var STATIC_PATH ="<?php echo config('adminconfig.static_path'); ?>";
|
|||
|
//退出地址
|
|||
|
var LOGOUT_PATH = "<?php echo logout_url(); ?>";
|
|||
|
//栏目模型地址
|
|||
|
var GETCOLUMMODELS_PATH = "<?php echo getColumModels_url(); ?>";
|
|||
|
//个人中心
|
|||
|
var ADMINEDIT_PATH = "<?php echo adminEdit_url(); ?>";
|
|||
|
//更新缓存
|
|||
|
var LOGINCLEARCACHE_PATH = "<?php echo loginClearCache_url(); ?>";
|
|||
|
//修改密码
|
|||
|
var ADMINUPDATEPASSWORD_PATH = "<?php echo adminUpdatePassword_url(); ?>";
|
|||
|
//循环生成静态html
|
|||
|
var SEOALLSITE_PATH = "<?php echo seoAllSite_url(); ?>";
|
|||
|
//单独静态生成
|
|||
|
var SEOADDDATABUILDDETAIL_PATH = "<?php echo seoAddDataBuildDetail_url(); ?>";
|
|||
|
//单独静态栏目生成
|
|||
|
var SINGLEALLSITE_PATH = "<?php echo singleAllSite_url(); ?>";
|
|||
|
//删除幻灯片
|
|||
|
var SLIDEDELETE_PATH = "<?php echo slideDelete_url(); ?>";
|
|||
|
//编辑幻灯片
|
|||
|
var SLIDEEDIT_PATH = "<?php echo slideEdit_url(); ?>";
|
|||
|
//后台首页地址
|
|||
|
var HOME_PATH = "<?php echo url('Index/index'); ?>";
|
|||
|
//切换语言
|
|||
|
var HANDOVER_LANG_PATH = "<?php echo url('handoverLang'); ?>";
|
|||
|
</script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/rich_text.js"></script>
|
|||
|
<script>
|
|||
|
|
|||
|
foxui.imagesManager.init({
|
|||
|
paginationOption: {
|
|||
|
type: 'solid',
|
|||
|
size: 'small',
|
|||
|
pageSize: 10,
|
|||
|
pageNum: 7,
|
|||
|
pageSizeList: [10, 20, 30, 50],
|
|||
|
isShowJump: true,
|
|||
|
isShowTotal: true,
|
|||
|
isShowSize: true
|
|||
|
},
|
|||
|
url: "<?php echo url('PicManager/picManager'); ?>",
|
|||
|
});
|
|||
|
|
|||
|
foxui.videoManager.init({
|
|||
|
paginationOption: {
|
|||
|
type: 'solid',
|
|||
|
size: 'small',
|
|||
|
pageSize: 10,
|
|||
|
pageNum: 7,
|
|||
|
pageSizeList: [10, 20, 30, 50],
|
|||
|
isShowJump: true,
|
|||
|
isShowTotal: true,
|
|||
|
isShowSize: true,
|
|||
|
},
|
|||
|
url: "<?php echo url('VideoManager/videoManager'); ?>",
|
|||
|
});
|
|||
|
</script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/common.js"></script>
|
|||
|
<script src="<?php echo htmlentities($staticPath); ?>js/admin_common.js"></script>
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
/**
|
|||
|
* @description: 添加/编辑(item有效编辑,无效添加)
|
|||
|
* @param {*} item
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-10 10:08:32
|
|||
|
*/
|
|||
|
function modifyTableItem(id) {
|
|||
|
let fieldTitel = '',
|
|||
|
fieldName = '',
|
|||
|
fieldType = '',
|
|||
|
selects = '',
|
|||
|
oldName = '',
|
|||
|
tips = '';
|
|||
|
if (id) {
|
|||
|
// 根据 id 异步请求数据(赋值)
|
|||
|
fieldTitel = '文章模型';
|
|||
|
fieldName = 'article';
|
|||
|
fieldType = '多选项';
|
|||
|
selects = '男,女';
|
|||
|
tips = '选择性别';
|
|||
|
|
|||
|
|
|||
|
$.ajax({
|
|||
|
type: "get",
|
|||
|
url: ADMIN_PATH + '/ModelField/getModelField?id=' + id,
|
|||
|
dataType: "json",
|
|||
|
async: false,
|
|||
|
success: function (res) {
|
|||
|
if (res.code == 1) {
|
|||
|
let data = res.data;
|
|||
|
fieldTitel = data.title;
|
|||
|
fieldName = data.name;
|
|||
|
fieldType = data.dtype;
|
|||
|
selects = data.dfvalue;
|
|||
|
tips = data.remark;
|
|||
|
oldName = data.name;
|
|||
|
}
|
|||
|
}, error: function (res) {
|
|||
|
console.log("查询失败")
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
foxui.dialog({
|
|||
|
title: id ? '编辑字段' : '添加字段',
|
|||
|
content: _modifyTableItemHtml(fieldTitel, fieldName, fieldType, selects, tips),
|
|||
|
cancelText: '取消',
|
|||
|
confirmText: id ? '确定' : '添加',
|
|||
|
buttonSize: 'small',
|
|||
|
buttonAlign: 'center',
|
|||
|
width: '710px',
|
|||
|
longButton: true,
|
|||
|
border: true,
|
|||
|
confirm: function (callback) {
|
|||
|
let title = $('input[name="title"]').val();
|
|||
|
let modelId = $('input[name="modelId"]').val();
|
|||
|
let name = $('input[name="name"]').val();
|
|||
|
if(!letterBegin(name)){
|
|||
|
foxui.message({
|
|||
|
type:'warning',
|
|||
|
text: "字段名称必须以英文字母开头"
|
|||
|
})
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
let dtype = $('.dtype .foxui-radio.is-checked input').val();
|
|||
|
let dfvalue = $('textarea[name="dfvalue"]').val();
|
|||
|
let remark = $('textarea[name="remark"]').val();
|
|||
|
let datas ={"id": id, "oldName": oldName, "modelId": modelId, "name": name, "title":title, "dtype":dtype, "dfvalue":dfvalue, "remark":remark};
|
|||
|
|
|||
|
let url = id?ADMIN_PATH + '/ModelField/edit': ADMIN_PATH + '/ModelField/add';
|
|||
|
// $.ajax({
|
|||
|
// type: "post",
|
|||
|
// url: url,
|
|||
|
// dataType: "json",
|
|||
|
// data: datas,
|
|||
|
// success: function (res) {
|
|||
|
// if (res.code == 1) {
|
|||
|
// foxui.message({
|
|||
|
// text: id ? '修改成功' : '添加成功',
|
|||
|
// type: 'success',
|
|||
|
// });
|
|||
|
// //拉取模型字段
|
|||
|
// init();
|
|||
|
// } else {
|
|||
|
// foxui.message({
|
|||
|
// text: res.msg,
|
|||
|
// type: 'warning',
|
|||
|
// });
|
|||
|
// }
|
|||
|
// }, error: function (res) {
|
|||
|
// foxui.message({
|
|||
|
// text: id ? '修改失败' : '添加失败',
|
|||
|
// type: 'warning',
|
|||
|
// });
|
|||
|
// }
|
|||
|
// });
|
|||
|
ajaxR(url,'post',datas,{},function (res) {
|
|||
|
if (res.code == 1) {
|
|||
|
foxui.message({
|
|||
|
text: id ? '修改成功' : '添加成功',
|
|||
|
type: 'success',
|
|||
|
});
|
|||
|
//拉取模型字段
|
|||
|
init();
|
|||
|
} else {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
}
|
|||
|
}, function (res) {
|
|||
|
foxui.message({
|
|||
|
text: id ? '修改失败' : '添加失败',
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
})
|
|||
|
callback();
|
|||
|
},
|
|||
|
cancel: function () {},
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 修改字段类型/添加字段类型 html
|
|||
|
* @param {*} fieldTitel 字段标题
|
|||
|
* @param {*} fieldName 字段名称
|
|||
|
* @param {*} fieldType 字段类型
|
|||
|
* @param {*} selects 默认值
|
|||
|
* @param {*} tips 提示文字
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-10 13:26:40
|
|||
|
*/
|
|||
|
function _modifyTableItemHtml(fieldTitel, fieldName, fieldType, selects, tips) {
|
|||
|
|
|||
|
return `
|
|||
|
<div class="column-field-add-content">
|
|||
|
<div class="section-main">
|
|||
|
<div class="section-main-item margin-top-0">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>字段标题:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box">
|
|||
|
<div class="foxui-input-suffix">
|
|||
|
<input name="title" class="foxui-size-small" maxlength="10" placeholder="" value="${fieldTitel || ''}" />
|
|||
|
<i class="foxui-suffix-icon foxui-suffix-count">0/10</i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group">
|
|||
|
<div class="input-label">
|
|||
|
<label>字段名称:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box">
|
|||
|
<div class="foxui-input-suffix">
|
|||
|
<input name="name" class="foxui-size-small" maxlength="30" placeholder="" value="${fieldName || ''}" onkeyup="this.value=this.value.replace(/[^a-z_0-9]/g,'');"/>
|
|||
|
<i class="foxui-suffix-icon foxui-suffix-count">0/30</i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<p class="input-box-info">只能用英文字母,数字或下划线,数据表的真实字段名,必须英文字母开头</p>
|
|||
|
</div>
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group foxui-align-items-start">
|
|||
|
<div class="input-label">
|
|||
|
<label>字段类型:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box">
|
|||
|
<div class="foxui-radio-group foxui-row radio-box-gapless foxui-gutter-2 dtype">
|
|||
|
${_fieldTypeHtml(fieldType)}
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group foxui-align-items-start">
|
|||
|
<div class="input-label">
|
|||
|
<label>默认值:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box">
|
|||
|
<div class="foxui-textarea">
|
|||
|
<textarea autocomplete="off" rows="4" placeholder="" name="dfvalue">${selects || ''}</textarea>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<p class="input-box-info">如果字段类型为单择项、多选项、下拉框时,此处填写被选择的项目用英文“,”分隔。如“男孩,女孩”</p>
|
|||
|
</div>
|
|||
|
<div class="section-main-item">
|
|||
|
<div class="foxui-input-group foxui-align-items-start">
|
|||
|
<div class="input-label">
|
|||
|
<label>提示文字:</label>
|
|||
|
</div>
|
|||
|
<div class="input-box">
|
|||
|
<div class="foxui-textarea">
|
|||
|
<textarea autocomplete="off" rows="4" placeholder="" name="remark">${tips || ''}</textarea>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
`;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 字段类型列表项
|
|||
|
* @param {*} value
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-10 13:17:59
|
|||
|
*/
|
|||
|
function _fieldTypeHtml(value) {
|
|||
|
let fieldTypeList = [
|
|||
|
// { id: 1, label: '单行文本' },
|
|||
|
// { id: 2, label: '单选项' },
|
|||
|
];
|
|||
|
$.ajax({
|
|||
|
type: "get",
|
|||
|
// url: ADMIN_PATH + '/ModelField/fieldTypeList?dtype='+ value,
|
|||
|
url: "<?php echo url('ModelField/fieldTypeList'); ?>?dtype=" + value,
|
|||
|
dataType: "json",
|
|||
|
async: false,
|
|||
|
success: function (res) {
|
|||
|
if (res.code == 1) {
|
|||
|
fieldTypeList = res.data;
|
|||
|
}
|
|||
|
}, error: function (res) {
|
|||
|
console.log("操作失败");
|
|||
|
}
|
|||
|
});
|
|||
|
let htmlArr = [];
|
|||
|
value = value || fieldTypeList[0].name;
|
|||
|
fieldTypeList.forEach(item => {
|
|||
|
htmlArr.push(`
|
|||
|
<div class="foxui-radio foxui-col-xs-6 foxui-col-sm-6 ${item.name === value ? ' is-checked' : ''} ${item.isDisable? ' is-disabled' : ''}" data-id=${item.id}>
|
|||
|
<span class="foxui-radio-input">
|
|||
|
<i class="foxui-radio-icon"></i>
|
|||
|
<input type="radio" value="${item.name}"/>
|
|||
|
</span>
|
|||
|
<span class="foxui-radio-label">${item.title}</span>
|
|||
|
</div>
|
|||
|
`);
|
|||
|
});
|
|||
|
return htmlArr.join('');
|
|||
|
}
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
/**
|
|||
|
* 初始化数据
|
|||
|
*/
|
|||
|
function init(){
|
|||
|
let keyword = $('input[name="keyword"]').val();
|
|||
|
let bcid = $("input[name='bcid']").val();
|
|||
|
let status = $("input[name='status']").val();
|
|||
|
let modelId = $('input[name="modelId"]').val();
|
|||
|
let searchData = {
|
|||
|
"keyword": keyword,
|
|||
|
"bcid": bcid,
|
|||
|
"status": status,
|
|||
|
"modelId": modelId
|
|||
|
};
|
|||
|
|
|||
|
$.ajax({
|
|||
|
type: "post",
|
|||
|
// url: ADMIN_PATH + '/ModelField/index',
|
|||
|
url: "<?php echo url('ModelField/index'); ?>",
|
|||
|
dataType: "json",
|
|||
|
data: searchData,
|
|||
|
success: function (res) {
|
|||
|
if (res.code == 1 && res.data) {
|
|||
|
let data = res.data;
|
|||
|
let paginationData = {
|
|||
|
pageSize: data.per_page,
|
|||
|
total: data.total,
|
|||
|
currentPage: data.current_page
|
|||
|
};
|
|||
|
initTable(paginationData, data.data);
|
|||
|
}
|
|||
|
$('#loadingContainer').removeClass('loading-container');
|
|||
|
}, error: function (res) {
|
|||
|
$('#loadingContainer').removeClass('loading-container');
|
|||
|
}
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 初始化表格
|
|||
|
* @param {*} pageSize
|
|||
|
* @param {*} total
|
|||
|
* @param {*} currentPage
|
|||
|
* @param {*} dataList
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-12 10:55:11
|
|||
|
*/
|
|||
|
function initTable({ pageSize, total, currentPage }, dataList) {
|
|||
|
if (dataList == undefined){
|
|||
|
dataList = [];
|
|||
|
}
|
|||
|
if(total == undefined){
|
|||
|
total = 0;
|
|||
|
}
|
|||
|
// 追加表格 html
|
|||
|
_appendToTable(dataList);
|
|||
|
//总数
|
|||
|
$(".right.total").empty().html("共" + total + "条记录");
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 追加表格 html
|
|||
|
* @param {*} dataList
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-12 00:18:40
|
|||
|
*/
|
|||
|
function _appendToTable(dataList) {
|
|||
|
const html = _trsHtml(dataList);
|
|||
|
$('.foxui-table-tbody').empty().append(html);
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 表格 html
|
|||
|
* @param {*} dataList
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-12 00:18:52
|
|||
|
*/
|
|||
|
function _trsHtml(dataList) {
|
|||
|
let htmlArr = [];
|
|||
|
dataList.forEach(item => {
|
|||
|
htmlArr.push(`
|
|||
|
<li class="foxui-table-tr">
|
|||
|
<div class="foxui-table-td" style="flex: initial; width: 40px">
|
|||
|
<div class="foxui-checkbox">
|
|||
|
<span class="foxui-checkbox-input">
|
|||
|
<i class="foxui-checkbox-icon"></i>
|
|||
|
<input type="checkbox" value="" />
|
|||
|
</span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="foxui-table-td">${item.id}</div>
|
|||
|
<div class="foxui-table-td blue-color">${item.title}</div>
|
|||
|
<div class="foxui-table-td">${item.field}</div>
|
|||
|
<div class="foxui-table-td">${item.type}</div>
|
|||
|
<div class="foxui-table-td">
|
|||
|
<span class="${item.status == 1?'state-enable':'state-disabled'}">${item.statustext}</span>
|
|||
|
</div>
|
|||
|
<div class="foxui-table-td">
|
|||
|
<span class="${item.status == 1?'state-enable':'state-disabled'}">${item.category}</span>
|
|||
|
</div>
|
|||
|
<div class="foxui-table-td">
|
|||
|
<button class="foxui-text-primary foxui-size-medium edit-btn" onclick="modifyTableItem(${item.id})">编辑</button>
|
|||
|
<button class="foxui-text-primary foxui-size-medium delete-btn" id="${item.id}" title="${item.title}" onclick="deleteItem(this)">删除</button>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
`);
|
|||
|
});
|
|||
|
return htmlArr.join('');
|
|||
|
}
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
<script>
|
|||
|
|
|||
|
init();
|
|||
|
//搜索
|
|||
|
$(".search-btn").on('click', function() {
|
|||
|
$('#loadingContainer').addClass('loading-container');
|
|||
|
init();
|
|||
|
});
|
|||
|
|
|||
|
//重置
|
|||
|
$(".reset-btn").on('click', function (){
|
|||
|
$('input[name="status"]').val("全部");
|
|||
|
$('input[name="keyword"]').val("");
|
|||
|
});
|
|||
|
|
|||
|
/**
|
|||
|
* @description: 删除
|
|||
|
* @param {*} id
|
|||
|
* @return {*}
|
|||
|
* @Date: 2022-01-10 09:49:40
|
|||
|
*/
|
|||
|
function deleteItem(obj) {
|
|||
|
let title = $(obj).attr("title");
|
|||
|
let id = $(obj).attr("id");
|
|||
|
|
|||
|
foxui.dialog({
|
|||
|
title: '删除',
|
|||
|
content: '您确定要删除【' + title + '】吗',
|
|||
|
cancelText: '取消',
|
|||
|
confirmText: '删除',
|
|||
|
buttonType: 'danger',
|
|||
|
confirm: function(callback) {
|
|||
|
ajaxR(ADMIN_PATH + '/ModelField/delete','get',{id},{},function(res) {
|
|||
|
if (res.code == 1) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'success',
|
|||
|
});
|
|||
|
init();
|
|||
|
} else {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
function(res) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'info',
|
|||
|
});
|
|||
|
})
|
|||
|
callback();
|
|||
|
},
|
|||
|
cancel: function() {
|
|||
|
foxui.message({
|
|||
|
text: '取消删除',
|
|||
|
type: 'info'
|
|||
|
});
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
// 多选删除
|
|||
|
$('.table-footer .delete-btn').click(function () {
|
|||
|
let $isChecked = $('.foxui-table-td .foxui-checkbox.is-checked'),
|
|||
|
$checkedTr = $isChecked.closest('.foxui-table-tr'),
|
|||
|
len = $isChecked.length,
|
|||
|
idList = [];
|
|||
|
|
|||
|
if (len < 1) {
|
|||
|
foxui.message({
|
|||
|
text: '请先选译要删除的数据!',
|
|||
|
type: 'danger',
|
|||
|
});
|
|||
|
} else {
|
|||
|
foxui.dialog({
|
|||
|
title: '确认',
|
|||
|
content: '您确定要删除选中的所有数据吗?',
|
|||
|
confirmText: '删除',
|
|||
|
cancelText: '取消',
|
|||
|
buttonType: 'danger',
|
|||
|
buttonSize: 'small',
|
|||
|
confirm: function (callback) {
|
|||
|
// 异步删除数据
|
|||
|
$checkedTr.each(function () {
|
|||
|
let id = $(this).find('.foxui-table-td:nth-child(2)').text();
|
|||
|
idList.push(id);
|
|||
|
});
|
|||
|
ajaxR(ADMIN_PATH + '/ModelField/deletes','post',{"idList": JSON.stringify(idList)},{},function(res) {
|
|||
|
if (res.code == 1) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'success',
|
|||
|
});
|
|||
|
init();
|
|||
|
}else{
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
function(res) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
})
|
|||
|
callback();
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
//启用所有
|
|||
|
$('.table-footer .enable-btn').click(function () {
|
|||
|
let $isChecked = $('.foxui-table-td .foxui-checkbox.is-checked'),
|
|||
|
$checkedTr = $isChecked.closest('.foxui-table-tr'),
|
|||
|
len = $isChecked.length,
|
|||
|
idList = [];
|
|||
|
|
|||
|
if (len < 1) {
|
|||
|
foxui.message({
|
|||
|
text: '请先选译要启用的数据!',
|
|||
|
type: 'danger',
|
|||
|
});
|
|||
|
} else {
|
|||
|
foxui.dialog({
|
|||
|
title: '确认',
|
|||
|
content: '您确定要启用选中的所有数据吗?',
|
|||
|
confirmText: '启用',
|
|||
|
cancelText: '取消',
|
|||
|
buttonType: 'danger',
|
|||
|
buttonSize: 'small',
|
|||
|
confirm: function (callback) {
|
|||
|
// 异步删除数据
|
|||
|
$checkedTr.each(function () {
|
|||
|
let id = $(this).find('.foxui-table-td:nth-child(2)').text();
|
|||
|
idList.push(id);
|
|||
|
});
|
|||
|
ajaxR(ADMIN_PATH + '/ModelField/updateStatus','post',{"idList": JSON.stringify(idList),"status":1},{},function(res) {
|
|||
|
if (res.code == 1) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'success',
|
|||
|
});
|
|||
|
|
|||
|
init();
|
|||
|
}else{
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
function(res) {
|
|||
|
foxui.message({
|
|||
|
text: '操作失败',
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
})
|
|||
|
callback();
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
//禁用
|
|||
|
$('.table-footer .disabled-btn').click(function () {
|
|||
|
let $isChecked = $('.foxui-table-td .foxui-checkbox.is-checked'),
|
|||
|
$checkedTr = $isChecked.closest('.foxui-table-tr'),
|
|||
|
len = $isChecked.length,
|
|||
|
idList = [];
|
|||
|
|
|||
|
if (len < 1) {
|
|||
|
foxui.message({
|
|||
|
text: '请先选译要禁用的数据!',
|
|||
|
type: 'danger',
|
|||
|
});
|
|||
|
} else {
|
|||
|
foxui.dialog({
|
|||
|
title: '确认',
|
|||
|
content: '您确定要禁用选中的所有数据吗?',
|
|||
|
confirmText: '启用',
|
|||
|
cancelText: '取消',
|
|||
|
buttonType: 'danger',
|
|||
|
buttonSize: 'small',
|
|||
|
confirm: function (callback) {
|
|||
|
// 异步删除数据
|
|||
|
$checkedTr.each(function () {
|
|||
|
let id = $(this).find('.foxui-table-td:nth-child(2)').text();
|
|||
|
idList.push(id);
|
|||
|
});
|
|||
|
ajaxR(ADMIN_PATH + '/ModelField/updateStatus','post',{"idList": JSON.stringify(idList),"status":0},{},function(res) {
|
|||
|
if (res.code == 1) {
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'success',
|
|||
|
});
|
|||
|
|
|||
|
init();
|
|||
|
}else{
|
|||
|
foxui.message({
|
|||
|
text: res.msg,
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
function(res) {
|
|||
|
foxui.message({
|
|||
|
text: '操作失败',
|
|||
|
type: 'warning',
|
|||
|
});
|
|||
|
})
|
|||
|
callback();
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
|
|||
|
</html>
|