mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
877d5bc55d
@ -88,9 +88,10 @@ class SystemCrud extends AuthController
|
||||
*/
|
||||
public function getFilePath()
|
||||
{
|
||||
[$menuName, $tableName, $fromField, $columnField] = $this->request->postMore([
|
||||
[$menuName, $tableName, $isTable, $fromField, $columnField] = $this->request->postMore([
|
||||
['menuName', ''],
|
||||
['tableName', ''],
|
||||
['isTable', 0],
|
||||
['fromField', []],
|
||||
['columnField', []],
|
||||
], true);
|
||||
@ -108,7 +109,15 @@ class SystemCrud extends AuthController
|
||||
$makePath[$key] = $item['path'];
|
||||
}
|
||||
|
||||
return app('json')->success($makePath);
|
||||
$tableField = [];
|
||||
if (!$isTable) {
|
||||
$field = $this->services->getColumnNamesList($tableName);
|
||||
foreach ($field as $item) {
|
||||
$tableField[] = ['value' => $item['name'], 'comment' => $item['comment'], 'label' => $item['name']];
|
||||
}
|
||||
}
|
||||
|
||||
return app('json')->success(compact('makePath', 'tableField'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -256,13 +256,12 @@ class SystemMenus extends AuthController
|
||||
public function ruleList()
|
||||
{
|
||||
//获取所有的路由
|
||||
$ruleList = app()->make(SystemRouteServices::class)->selectList(['app_name' => 'adminapi'], 'name,path,method,type,id');
|
||||
$ruleList = app()->make(SystemRouteServices::class)->selectList(['app_name' => 'adminapi'], 'name,path,method,type,id')->toArray();
|
||||
$menuApiList = $this->services->getColumn(['auth_type' => 2, 'is_del' => 0], "concat(`api_url`,'_',lower(`methods`)) as rule");
|
||||
if ($menuApiList) $menuApiList = array_column($menuApiList, 'rule');
|
||||
$list = [];
|
||||
foreach ($ruleList as $item) {
|
||||
$item['path'] = str_replace('adminapi/', '', $item['path']);
|
||||
if (!in_array($item['path'] . '_' . $item['method'], $menuApiList)) {
|
||||
if (!in_array($item['path'] . '_' . strtolower($item['method']), $menuApiList)) {
|
||||
$item['real_name'] = $item['name'] ?? '';
|
||||
$item['method'] = strtoupper($item['method']);
|
||||
$list[] = $item;
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
namespace app\adminapi\controller\v1\system;
|
||||
|
||||
use think\facade\App;
|
||||
use think\facade\Db;
|
||||
use think\facade\Session;
|
||||
use app\adminapi\controller\AuthController;
|
||||
use app\services\system\SystemDatabackupServices;
|
||||
@ -53,6 +54,30 @@ class SystemDatabackup extends AuthController
|
||||
return app('json')->success($this->services->getRead($tablename));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据表或者表字段备注
|
||||
* @return \think\Response
|
||||
* @author 吴汐
|
||||
* @email 442384644@qq.com
|
||||
* @date 2023/04/11
|
||||
*/
|
||||
public function updateMark()
|
||||
{
|
||||
[$table, $field, $type, $mark] = $this->request->postMore([
|
||||
['table', ''],
|
||||
['field', ''],
|
||||
['type', ''],
|
||||
['mark', ''],
|
||||
], true);
|
||||
if ($field == '') {
|
||||
$sql = "ALTER TABLE $table COMMENT '$mark'";
|
||||
} else {
|
||||
$sql = "ALTER TABLE $table MODIFY COLUMN $field $type COMMENT '$mark'";
|
||||
}
|
||||
Db::execute($sql);
|
||||
return app('json')->success(100024);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优化表
|
||||
*/
|
||||
|
||||
@ -49,6 +49,8 @@ Route::group('system', function () {
|
||||
Route::get('backup', 'v1.system.SystemDatabackup/index')->option(['real_name' => '数据库所有表']);
|
||||
//数据备份详情
|
||||
Route::get('backup/read', 'v1.system.SystemDatabackup/read')->option(['real_name' => '数据备份详情']);
|
||||
//更新数据表或者表字段备注
|
||||
Route::post('database/update_mark', 'v1.system.SystemDatabackup/updateMark')->option(['real_name' => '更新数据表或者表字段备注']);
|
||||
//数据备份 优化表
|
||||
Route::put('backup/optimize', 'v1.system.SystemDatabackup/optimize')->option(['real_name' => '数据备份优化表']);
|
||||
//数据备份 修复表
|
||||
|
||||
@ -65,11 +65,39 @@ class SystemCrudServices extends BaseServices
|
||||
return compact('list', 'count');
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库字段类型
|
||||
* @return \string[][]
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/11
|
||||
*/
|
||||
public function getTabelRule()
|
||||
{
|
||||
$adapter = app()->make(MysqlAdapter::class);
|
||||
return [
|
||||
'types' => $adapter->getColumnTypes(),
|
||||
'types' => [
|
||||
'string',
|
||||
'char',
|
||||
'text',
|
||||
'integer',
|
||||
'biginteger',
|
||||
'float',
|
||||
'decimal',
|
||||
'datetime',
|
||||
'timestamp',
|
||||
'time',
|
||||
'date',
|
||||
'blob',
|
||||
'binary',
|
||||
'varbinary',
|
||||
'boolean',
|
||||
'uuid',
|
||||
// Geospatial data types
|
||||
'geometry',
|
||||
'point',
|
||||
'linestring',
|
||||
'polygon',
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -93,6 +93,18 @@ class SystemRouteServices extends BaseServices
|
||||
}
|
||||
])
|
||||
->toArray();
|
||||
|
||||
foreach ($list as $key => $item) {
|
||||
if (!empty($item['children'])) {
|
||||
foreach ($item['children'] as $k => $v) {
|
||||
if (isset($v['cate_id']) && isset($v['method']) && $v['method'] === 'DELETE') {
|
||||
$v['method'] = 'DEL';
|
||||
$list[$key]['children'][$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return get_tree_children($list);
|
||||
}
|
||||
|
||||
|
||||
@ -109,7 +109,7 @@ class Controller extends Make
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/3/13
|
||||
*/
|
||||
protected function getStub(string $type = '')
|
||||
protected function getStub(string $type = 'controller')
|
||||
{
|
||||
$controllerPath = __DIR__ . DS . 'stubs' . DS . 'controller' . DS;
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ class Route extends Make
|
||||
|
||||
$contentStr = str_replace($this->var, $this->value, $content);
|
||||
|
||||
$filePath = $this->getFilePathName($path, $this->value['nameCamel']);
|
||||
$filePath = $this->getFilePathName($path, strtolower($name));
|
||||
|
||||
return [$this->makeFile($filePath, $contentStr), $filePath];
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>加载中</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.b0707a6a.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.6d549041.js></script><script src=/static/js/index.8f27223f.js></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.b0707a6a.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.6d549041.js></script><script src=/static/js/index.468ab3a7.js></script></body></html>
|
||||
26
crmeb/public/mobile.html
Normal file
26
crmeb/public/mobile.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?=$siteName?></title>
|
||||
<style>
|
||||
#page {
|
||||
width: 375px;
|
||||
height: 60vh;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%,0);
|
||||
-moz-transform: translate(-50%,0);
|
||||
transform: translate(-50%,0);
|
||||
}
|
||||
body {
|
||||
margin-top: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="page" src="<?=$siteUrl?>" frameborder="0"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,55 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang=zh-CN>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
|
||||
<title>crmeb-PC端</title>
|
||||
<meta name="Copyright" content="helang">
|
||||
<link rel="shortcut icon" type="image/png" href="">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<style type="text/css">
|
||||
body{
|
||||
margin: 0;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
iframe{
|
||||
width: 375px;
|
||||
height: 667px;
|
||||
background-color: #fff;
|
||||
box-sizing: content-box;
|
||||
border: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 450px) {
|
||||
iframe {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
border: rgba(0,0,0,0.1) solid 1px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
window.isPC = true;
|
||||
|
||||
window.onload = function(){
|
||||
/* 监听电脑浏览器窗口尺寸改变 */
|
||||
window.onresize = function(){
|
||||
/* 窗口宽度 小于或等于420px 时,跳转回H5页面 */
|
||||
if(window.innerWidth <= 420){
|
||||
window.location.pathname = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="/"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
1
crmeb/public/static/js/index.468ab3a7.js
Normal file
1
crmeb/public/static/js/index.468ab3a7.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-annex-web_view-index"],{"70c4":function(t,n,e){"use strict";e.r(n);var i=e("9c60"),r=e.n(i);for(var u in i)"default"!==u&&function(t){e.d(n,t,(function(){return i[t]}))}(u);n["default"]=r.a},"9c60":function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var e={data:function(){return{windowH:0,windowW:0,webviewStyles:{progress:{color:"transparent"}},url:""}},onLoad:function(t){this.url=t.url;try{var n=uni.getSystemInfoSync();this.windowW=n.windowWidth,this.windowH=n.windowHeight}catch(e){}}};n.default=e}).call(this,e("5a52")["default"])},c4bc:function(t,n,e){"use strict";var i;e.d(n,"b",(function(){return r})),e.d(n,"c",(function(){return u})),e.d(n,"a",(function(){return i}));var r=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("v-uni-web-view",{staticClass:"web-view",style:{width:t.windowW+"px",height:t.windowH+"px"},attrs:{"webview-styles":t.webviewStyles,src:t.url}})},u=[]},c5e8:function(t,n,e){"use strict";e.r(n);var i=e("c4bc"),r=e("70c4");for(var u in r)"default"!==u&&function(t){e.d(n,t,(function(){return r[t]}))}(u);var c,a=e("f0c5"),o=Object(a["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],c);n["default"]=o.exports}}]);
|
||||
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-annex-web_view-index"],{"70c4":function(n,t,e){"use strict";e.r(t);var i=e("9c60"),r=e.n(i);for(var u in i)"default"!==u&&function(n){e.d(t,n,(function(){return i[n]}))}(u);t["default"]=r.a},9693:function(n,t,e){"use strict";var i;e.d(t,"b",(function(){return r})),e.d(t,"c",(function(){return u})),e.d(t,"a",(function(){return i}));var r=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("v-uni-web-view",{staticClass:"web-view",style:{width:n.windowW+"px",height:n.windowH+"px"},attrs:{"webview-styles":n.webviewStyles,src:n.url}})},u=[]},"9c60":function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={data:function(){return{windowH:0,windowW:0,webviewStyles:{progress:{color:"transparent"}},url:""}},onLoad:function(n){this.url=n.url;try{var t=uni.getSystemInfoSync();this.windowW=t.windowWidth,this.windowH=t.windowHeight}catch(e){}}};t.default=i},c5e8:function(n,t,e){"use strict";e.r(t);var i=e("9693"),r=e("70c4");for(var u in r)"default"!==u&&function(n){e.d(t,n,(function(){return r[n]}))}(u);var c,o=e("f0c5"),a=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],c);t["default"]=a.exports}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -24,8 +24,16 @@ Route::miss(function () {
|
||||
case 'pages':
|
||||
return view(app()->getRootPath() . 'public' . DS . 'index.html');
|
||||
default:
|
||||
if (!request()->isMobile() && is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html');
|
||||
if (!request()->isMobile()) {
|
||||
if (is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html');
|
||||
} else {
|
||||
if (request()->get('type')) {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'index.html');
|
||||
} else {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'mobile.html', ['siteName' => sys_config('site_name'), 'siteUrl' => sys_config('site_url') . '/pages/index/index']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'index.html');
|
||||
}
|
||||
|
||||
@ -114,8 +114,8 @@
|
||||
<Button @click="init">重置</Button>
|
||||
</div>
|
||||
<Tabs v-model="routeType" @on-click="changTab">
|
||||
<TabPane label="基础接口" name="1"></TabPane>
|
||||
<TabPane label="公共接口" name="0"></TabPane>
|
||||
<TabPane label="公共接口" name="1"></TabPane>
|
||||
<TabPane label="基础接口" name="0"></TabPane>
|
||||
</Tabs>
|
||||
<div class="rule">
|
||||
<div
|
||||
@ -128,7 +128,7 @@
|
||||
>
|
||||
<div>接口名称:{{ item.real_name }}</div>
|
||||
<div>请求方式:{{ item.method }}</div>
|
||||
<div>接口地址:{{ item.rule }}</div>
|
||||
<div>接口地址:{{ item.path }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
@ -250,6 +250,10 @@ export default {
|
||||
// 获取权限列表
|
||||
getRuleList() {
|
||||
getRuleList().then((res) => {
|
||||
this.foundationList = [];
|
||||
this.openList = [];
|
||||
this.seletRouteIds = [];
|
||||
this.seletRoute = [];
|
||||
res.data.map((e) => {
|
||||
if (e.type) {
|
||||
this.foundationList.push(e);
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
size="small"
|
||||
no-filtered-data-text="暂无筛选结果"
|
||||
>
|
||||
<template slot-scope="{ row, index }" slot="action">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<a @click="Info(row)">详情</a>
|
||||
</template>
|
||||
</Table>
|
||||
|
||||
@ -246,14 +246,6 @@
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
uni.getSystemInfo({
|
||||
success(e) {
|
||||
/* 窗口宽度大于420px且不在PC页面且不在移动设备时跳转至 PC.html 页面 */
|
||||
if (e.windowWidth > 420 && !window.top.isPC && !/iOS|Android/i.test(e.system)) {
|
||||
window.location.pathname = '/static/html/pc.html';
|
||||
}
|
||||
}
|
||||
});
|
||||
if (option.query.hasOwnProperty('type') && option.query.type == "iframeWindow") {
|
||||
this.globalData.isIframe = true;
|
||||
} else {
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang=zh-CN>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
|
||||
<title>crmeb-PC端</title>
|
||||
<meta name="Copyright" content="helang">
|
||||
<link rel="shortcut icon" type="image/png" href="">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<style type="text/css">
|
||||
body{
|
||||
margin: 0;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
iframe{
|
||||
width: 375px;
|
||||
height: 667px;
|
||||
background-color: #fff;
|
||||
box-sizing: content-box;
|
||||
border: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 450px) {
|
||||
iframe {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
border: rgba(0,0,0,0.1) solid 1px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
window.isPC = true;
|
||||
|
||||
window.onload = function(){
|
||||
/* 监听电脑浏览器窗口尺寸改变 */
|
||||
window.onresize = function(){
|
||||
/* 窗口宽度 小于或等于420px 时,跳转回H5页面 */
|
||||
if(window.innerWidth <= 420){
|
||||
window.location.pathname = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="/"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user