Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a707465e
authored
May 13, 2020
by
肖康
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/sunlong_v5/note-library
parents
25cd1d80
1e853cf6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
12 deletions
app/Http/Controllers/AjaxController.php
app/Http/Controllers/PermController.php
app/Http/Controllers/WebController.php
app/Services/LabelService.php
config/website.php
resources/views/web/labelList.blade.php
resources/views/web/showTemplate.blade.php
app/Http/Controllers/AjaxController.php
View file @
a707465e
...
...
@@ -95,10 +95,6 @@ Class AjaxController extends Controller
$tmpl
->
save
();
//此处推送到erp
$this
->
pushTemplateErp
();
// dump($this->erp);
// $a = $this->erp->createIssueLabel(1,"测试模板0001","田超",1);
// dump($a);
return
$this
->
ajaxReturn
(
0
,
"修改成功"
);
}
else
{
...
...
@@ -144,18 +140,19 @@ Class AjaxController extends Controller
try
{
//登录
$soap
=
new
\SoapClient
(
env
(
"ERP_DOMAIN"
)
.
'/ormrpc/services/EASLogin?wsdl'
);
$res
=
$soap
->
login
(
'PT'
,
'123456
'
,
'eas'
,
env
(
'ERP_DB_NAME'
),
'L2'
,
1
,
'BaseDB'
);
$res
=
$soap
->
login
(
'TC'
,
'unicom
'
,
'eas'
,
env
(
'ERP_DB_NAME'
),
'L2'
,
1
,
'BaseDB'
);
//接口
$this
->
erp
=
new
\SoapClient
(
ENV
(
"ERP_DOMAIN"
)
.
'/ormrpc/services/WSIchuntjKFacade?wsdl'
);
// dump($this->erp);
$this
->
erp
->
createIssueLabel
(
json_encode
([
$tmp
=
$this
->
erp
->
createIssueLabel
(
json_encode
([
"templateId"
=>
1
,
"templateNmae"
=>
"aaaa"
,
"createUser"
=>
"bbbb"
,
"status"
=>
1
,
]));
dump
(
$tmp
);
return
true
;
}
catch
(
\Exception
$e
){
dump
(
$e
);
return
false
;
// dump($e->getMessage());
}
...
...
app/Http/Controllers/PermController.php
View file @
a707465e
...
...
@@ -180,7 +180,7 @@
}
// 查看菜单权限
$permId
=
'cron_'
.
$permId
.
'_check'
;
$permId
=
$permId
.
'_check'
;
if
(
!
in_array
(
$permId
,
$perms
))
{
unset
(
$menus
[
$k
]);
...
...
app/Http/Controllers/WebController.php
View file @
a707465e
...
...
@@ -84,21 +84,49 @@ class WebController extends Controller
return
view
(
'web'
,
$info
);
}
/*
* 设计
*/
public
function
design
(
$request
,
$info
){
$info
[
'title'
]
=
'标签设计'
;
return
view
(
'web'
,
$info
);
}
/*
* 标签预览
*/
public
function
showPage
(
$request
,
$info
){
$info
[
'title'
]
=
'预览'
;
$id
=
$request
->
input
(
"tmpl_relation_id"
,
0
);
$html
=
(
new
\App\Services\LabelService
)
->
getLabelHtml
(
5
);
$html
=
(
new
\App\Services\LabelService
)
->
getLabelHtml
(
$id
);
$info
[
"html"
]
=
$html
;
return
view
(
'web'
,
$info
);
}
/*
* 标签预览
*/
public
function
showTemplate
(
$request
,
$info
){
$info
[
'title'
]
=
'预览'
;
$id
=
$request
->
input
(
"t_id"
,
0
);
$count
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
where
(
"create_userid"
,
$request
->
user
->
userId
)
->
count
(
"id"
);
if
(
$count
<=
0
){
return
back
()
->
with
(
'showTemplateerror'
,
'没找到属于您的模板信息'
);
}
$templateInfo
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
select
(
"id"
,
"template_name"
,
"status"
)
->
first
();
if
(
$templateInfo
->
status
<=
0
){
return
back
()
->
with
(
'showTemplateerror'
,
'该模板已经被主人禁用了'
);
}
// dump($templateInfo->template_extend);
$html
=
$templateInfo
->
template_extend
;
$info
[
"html"
]
=
$html
->
html
;
return
view
(
'web'
,
$info
);
}
/*
* 打印标签
*/
public
function
prints
(
$request
,
$info
){
$tmpl_relationids
=
$request
->
input
(
"tmpl_relationids"
,
''
);
$tmpl_relationid_arr
=
explode
(
","
,
$tmpl_relationids
);
...
...
@@ -121,6 +149,9 @@ class WebController extends Controller
$templateRelation
=
TmplRelationsModel
::
where
(
"create_userid"
,
$request
->
user
->
userId
)
->
whereIn
(
"id"
,
$tmpl_relationid_arr
)
->
get
();
if
(
!
$templateRelation
){
die
(
"没有要打印的数据"
);
}
$html
=
[];
foreach
(
$templateRelation
as
$item
){
$createHtml
=
(
new
\App\Services\LabelService
)
->
getLabelHtml
(
$item
->
id
);
...
...
app/Services/LabelService.php
View file @
a707465e
...
...
@@ -10,6 +10,8 @@ use App\Http\Controllers\Controller;
use
App\Model\TemplateListModel
;
use
App\Model\NodesModel
;
use
App\Model\TmplRelationsModel
;
use
DNS1D
;
use
DNS2D
;
class
LabelService
{
public
function
getLabelHtml
(
$id
){
...
...
config/website.php
View file @
a707465e
...
...
@@ -12,7 +12,7 @@ return [
'domain'
=>
'liexin.net'
,
'risk_url'
=>
'http://
risk
.liexin.net'
,
'risk_url'
=>
'http://
label
.liexin.net'
,
// API项目
'api_domain'
=>
'http://api.liexin.com/'
,
// 获取用户权限接口
...
...
resources/views/web/labelList.blade.php
View file @
a707465e
@
if
(
session
(
'showTemplateerror'
))
<
div
class
="
alert
alert
-
success
">
{{ session('showTemplateerror') }}
</div>
@endif
<form class="
layui
-
form
layui
-
box
" method="
post
">
<div class="
layui
-
form
-
item
">
<div class="
layui
-
inline
">
...
...
@@ -49,7 +54,7 @@
<script type="
text
/
html
" id="
action
">
<!-- <a class="
btn
btn
-
xs
btn
-
outline
btn
-
info
" lay-event="
offline
">离线使用</a> -->
<
a
class
=
"btn btn-xs btn-outline btn-success"
lay
-
event
=
"show"
>
预览
<
/a>
<a class="
btn
btn
-
xs
btn
-
outline
btn
-
success
"
href="
/
web
/
showTemplate
?
t_id
=@
{{
d
.
id
}}
" target="
_blank
"
lay-event="
show
">预览</a>
<a class="
btn
btn
-
xs
btn
-
outline
btn
-
success
" href="
/
web
/
design
?
t_id
=@
{{
d
.
id
}}
" target="
_blank
">编辑</a>
@{{# if (d.status == -1) { }}
<a class="
btn
btn
-
xs
btn
-
outline
layui
-
btn
-
primary
" lay-event="
enable
">启用</a>
...
...
resources/views/web/showTemplate.blade.php
0 → 100644
View file @
a707465e
{
!!
$html
!!
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment