Skip to content

Commit 4ba9f4a

Browse files
author
hikki
committed
beta 点线面
1 parent 6107869 commit 4ba9f4a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ComponentViewer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace App\Admin\Controllers;
3+
namespace App\Admin\Extensions;
44

55
use Encore\Admin\Actions\RowAction;
66
use Encore\Admin\Admin;
@@ -22,7 +22,7 @@ public static function makeAddFormAction(Grid $grid){
2222
$url = Request::capture()->getPathInfo();
2323
Admin::script(<<<EOF
2424
$('.CAForm').click(function(){
25-
componentForm('{$url}/create');
25+
componentPlane('{$url}/create');
2626
});
2727
EOF
2828
);
@@ -55,7 +55,7 @@ public static function makeEditFormAction(Grid $grid)
5555
Admin::script(<<<EOF
5656
$('.CEForm').click(function(){
5757
let url = '{$url}' + '/'+this.getAttribute('data-id') + '/edit';
58-
componentForm(url,'PUT');
58+
componentPlane(url,'PUT');
5959
});
6060
EOF
6161
);
@@ -85,7 +85,7 @@ public static function _makeEditFormAction(Grid &$grid)
8585
Admin::script(<<<EOF
8686
$('.CEForm').click(function(){
8787
let url = '{$url}' + '/'+this.getAttribute('data-id') + '/edit';
88-
componentForm(url,'PUT');
88+
componentPlane(url,'PUT');
8989
});
9090
EOF
9191
);
@@ -105,7 +105,7 @@ public static function makeForm(Content $content)
105105
$items = [
106106
'_content_' => str_replace('pjax-container', '', $content->build())
107107
];
108-
return view('admin.content', $items)->render();
108+
return view('component.content', $items)->render();
109109
}
110110

111111
public static function result($success=true,$message='OK',$data=[])

component.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let _componentCommonBlock = {
4848
}
4949
};
5050

51-
function componentAlert(message,time=1,callback=function () {}) {
51+
function _componentAlert(message,time=1,callback=function () {}) {
5252
var div = document.createElement('div');
5353
div.innerHTML = message;
5454
let w = window.innerWidth/2 - 140;
@@ -64,7 +64,7 @@ function componentAlert(message,time=1,callback=function () {}) {
6464
},time*1000);
6565
}
6666

67-
function componentSelect(name,selected,options) {
67+
function componentDot(name,selected,options) {
6868
function tagSelect() {
6969
var cdom = this.cloneNode(true);
7070
cdom.addEventListener('click',tagCancel);
@@ -135,7 +135,7 @@ function componentSelect(name,selected,options) {
135135
});
136136
}
137137

138-
function componentJsonTable(name,columns,data) {
138+
function componentLine(name,columns,data) {
139139
function selectTd(td,type,value,column) {
140140
switch (type) {
141141
case 'text':
@@ -295,7 +295,7 @@ function componentJsonTable(name,columns,data) {
295295
dom.getElementsByClassName('JsonTableInsert')[0].appendChild(i);
296296
}
297297

298-
function componentForm(url,method='POST'){
298+
function componentPlane(url,method='POST'){
299299
let Form = {
300300
make:function (url) {
301301
this._clear();
@@ -340,7 +340,7 @@ function componentForm(url,method='POST'){
340340
if(response.code == 1) {
341341
window.location.reload();
342342
}else{
343-
componentAlert(response.message,3,function () {
343+
_componentAlert(response.message,3,function () {
344344
obj.removeAttribute('disabled');
345345
obj.innerText = '提交';
346346
});

0 commit comments

Comments
 (0)