Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3
This commit is contained in:
@@ -389,12 +389,12 @@ class api extends control
|
||||
|
||||
/* Record action for create api library. */
|
||||
$this->action->create('doclib', $libID, 'created');
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
|
||||
/* Set locate object data. */
|
||||
setCookie("objectType", $this->post->libType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setCookie("objectID", $this->post->libType == 'project' ? $this->post->project : $this->post->product, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
setCookie("objectType", $this->post->libType, $this->config->cookieLife, $this->config->webRoot);
|
||||
setCookie("objectID", $this->post->libType == 'project' ? $this->post->project : $this->post->product, $this->config->cookieLife, $this->config->webRoot);
|
||||
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
if(!helper::isAjaxRequest()) return print(js::locate($this->createLink('api', 'index', "libID=$libID"), 'parent.parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('api', 'index', "libID=$libID")));
|
||||
}
|
||||
|
||||
@@ -25,3 +25,105 @@ a.lib {margin-bottom: 0; width: unset;}
|
||||
/* sideBar */
|
||||
|
||||
.sidebar-toggle > .icon {width: 16px; height: 30px; margin-top: -10px; line-height: 30px; color: #fff; text-align: center; background: #7dcdfe; border-radius: 6px; cursor: pointer;}
|
||||
.file-tree a {height: 30px;}
|
||||
|
||||
.flex {display: flex;}
|
||||
.flex-none {flex: none;}
|
||||
.flex-auto {flex: auto;}
|
||||
.flex-full > .panel {box-shadow: none;}
|
||||
.float-r {float: right;}
|
||||
.h-full {height: 100%;}
|
||||
.w-full {width: 100%;}
|
||||
.overflow-x-auto {overflow-x: auto;}
|
||||
.overflow-auto {overflow: auto;}
|
||||
.overflow-visible {overflow: visible;}
|
||||
.overflow-hidden {overflow: hidden;}
|
||||
.img-lib {width: 14px; height: 14px; margin-bottom: 2px; flex: 0 0 14px;}
|
||||
#mainContent {padding-top: 0; padding-bottom: 0;}
|
||||
#mainContent #createDropdown {display: inline-block;}
|
||||
#mainContent #createDropdown ul {position: absolute;}
|
||||
#pageNav .dropdown-menu {max-height: inherit;}
|
||||
#mainContent > .panel {margin-bottom: 0; height: calc(100vh - 125px); overflow-y: auto;}
|
||||
#mainContent > .main-col {padding-left: 0;}
|
||||
|
||||
.no-content {width: 100px; height: 100px; margin: 0 auto;}
|
||||
.notice {text-align: center; padding-left: 15px; padding-top: 20px;}
|
||||
.no-content-button {text-align: center; padding-top: 20px;}
|
||||
.no-content-button a:nth-child(2) {margin-left: 20px;}
|
||||
|
||||
.cell .detail .detail-title {padding-left: 5px; list-style: none;}
|
||||
.menu-actions {position: absolute; top: 7px; right: 45px; padding: 7px 8px;}
|
||||
.detail ul {position: relative;}
|
||||
.tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;}
|
||||
.tail-info, .doc-title, span.item {background: #fff;}
|
||||
span.item>a {padding-left: 6px;}
|
||||
span.dotted-line+a {display: block;}
|
||||
#modules li.doc:before, .chapterNode:before, .independent:before {content: " "; width: 100%; border-bottom: 1px dashed #b5b9c5; position: absolute; top: 13px; right: 0; left: 30px;}
|
||||
.doc-title ,.item{display: inline-block !important; position: relative; padding-right: 10px; max-width:80%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
|
||||
#modules i.icon-file-text {color: #D0D2D6; font-size: 14px;}
|
||||
|
||||
.sortable-sorting .module-name > a {cursor: move;}
|
||||
.sortable-sorting li >.tree-group {opacity: .5;}
|
||||
.sortable-sorting li:before {opacity: .3;}
|
||||
.sortable-sorting .drop-here .tree-group {background-color: #fff3e0;}
|
||||
.sortable-sorting .drop-here .tree-group > * {opacity: .1;}
|
||||
.sortable-sorting .drag-shadow .tree-group {opacity: 1!important;}
|
||||
.sortable-sorting .drag-shadow .tree-actions {visibility: hidden;}
|
||||
.is-sorting > li:before {opacity: 1;}
|
||||
.is-sorting > li > .tree-group {opacity: 1; border-radius: 4px;}
|
||||
.is-sorting > li ul {display: none!important;}
|
||||
li.drag-shadow ul {display: none!important;}
|
||||
|
||||
.tree-group {position: relative;}
|
||||
.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}
|
||||
.tree li.has-list.open:before {left: 6px;}
|
||||
.main-table-content {display: flex; gap: 20px;}
|
||||
.main-table-content > .side {flex: 0 0 300px;}
|
||||
.main-table-content > .content {flex: 1;}
|
||||
|
||||
/* css for mian */
|
||||
#mainContent > #sideBar {flex: 0 0 150px; overflow-x: auto; padding-right: 5px;}
|
||||
[lang^=zh] #mainContent > #sideBar {flex: 0 0 180px;}
|
||||
|
||||
/* css for tree */
|
||||
|
||||
.tree li.has-list.open:before {content: unset;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a {height: 30px;}
|
||||
.flex-between {display: flex; align-items: center; justify-content: space-between;}
|
||||
.flex-center {display: flex; align-items: center; justify-content: center;}
|
||||
.flex-start {display: flex; align-items: center;}
|
||||
.tree li > .list-toggle {top: 4px;}
|
||||
.input-tree {width: 120px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
.img-lib {flex: 0 0 16px; height: 14px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a.show-icon > div {padding-right: 15px;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
|
||||
|
||||
/* css for sidebar */
|
||||
.sidebar-toggle {flex: 0 0 16px;}
|
||||
.sidebar-toggle > .icon {width: 12px; height: 30px; margin-top: -10px; line-height: 30px; color: #fff; text-align: center; background: #7dcdfe; border-radius: 6px; cursor: pointer;}
|
||||
|
||||
.spliter {flex: 0 0 12px;}
|
||||
.spliter-btn {height: 28px; width: 10px; background: #fff; position: absolute; top: 30%; left: -1px; border: 1px solid #D9D9D9; border-radius: 2px;}
|
||||
.spliter-btn > .spliter-inner {width: 4px; height: 12px; border-left: 1px solid #D9D9D9; border-right: 1px solid #D9D9D9;}
|
||||
|
||||
#mainContent .table-empty-tip > p, #createDocs {display: inline-block;}
|
||||
.createDropdown a.btn-primary, .createDropdown a.btn-info {border-right: 1px solid rgba(255,255,255,0.2);}
|
||||
.createDropdown button.dropdown-toggle.btn-primary, .createDropdown button.dropdown-toggle.btn-info {padding: 6px;}
|
||||
.createDropdown ul > li {text-align: left;}
|
||||
.createDropdown .btn.btn-info:hover {box-shadow: none;}
|
||||
|
||||
.table .c-name > a:first-child {display: inline-block; max-width: 90%; overflow: hidden;}
|
||||
.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: -3px;}
|
||||
table.table > thead > tr {height: 32px;}
|
||||
|
||||
#bysearchTab::before {display: none;}
|
||||
#leftBar .selectBox #currentItem {width: 150px; display: flex; align-items: center;}
|
||||
[lang^=zh] #leftBar .selectBox #currentItem {width: 180px;}
|
||||
#leftBar .selectBox #currentItem > .text {overflow: hidden; text-align: left; flex: 0 1 100%;}
|
||||
|
||||
|
||||
+10
-2
@@ -42,13 +42,21 @@ function toggleLibType(libType)
|
||||
{
|
||||
$('#projectBox').removeClass('hidden');
|
||||
$('#productBox').addClass('hidden');
|
||||
$('#acldefault').closest('.radio').show();
|
||||
$('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(productLang, projectLang));
|
||||
}
|
||||
else if(libType == 'product')
|
||||
{
|
||||
$('#projectBox').addClass('hidden');
|
||||
$('#productBox').removeClass('hidden');
|
||||
$('#acldefault').closest('.radio').show();
|
||||
$('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(projectLang, productLang));
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#projectBox').addClass('hidden');
|
||||
$('#productBox').removeClass('hidden');
|
||||
$('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(projectLang, productLang));
|
||||
$('#productBox').addClass('hidden');
|
||||
$('#acldefault').closest('.radio').hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart
|
||||
$lang->api->libTypeList = array();
|
||||
$lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library';
|
||||
$lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library';
|
||||
$lang->api->libTypeList['nolink'] = 'No Linked Api Library';
|
||||
|
||||
$lang->api->statusOptions = array(
|
||||
'done' => 'Done',
|
||||
|
||||
@@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart
|
||||
$lang->api->libTypeList = array();
|
||||
$lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library';
|
||||
$lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library';
|
||||
$lang->api->libTypeList['nolink'] = 'No Linked Api Library';
|
||||
|
||||
$lang->api->statusOptions = array(
|
||||
'done' => 'Done',
|
||||
|
||||
@@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart
|
||||
$lang->api->libTypeList = array();
|
||||
$lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library';
|
||||
$lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library';
|
||||
$lang->api->libTypeList['nolink'] = 'No Linked Api Library';
|
||||
|
||||
$lang->api->statusOptions = array(
|
||||
'done' => 'Done',
|
||||
|
||||
@@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart
|
||||
$lang->api->libTypeList = array();
|
||||
$lang->api->libTypeList['product'] = $lang->productCommon . '接口库';
|
||||
$lang->api->libTypeList['project'] = $lang->projectCommon . '接口库';
|
||||
$lang->api->libTypeList['nolink'] = '无关联接口库';
|
||||
|
||||
$lang->api->statusOptions = array(
|
||||
'done' => '开发完成',
|
||||
|
||||
@@ -321,12 +321,11 @@ class doc extends control
|
||||
* @param int|string $libID
|
||||
* @param int $moduleID
|
||||
* @param string $docType html|word|ppt|excel
|
||||
* @param bool $fromGlobal
|
||||
* @param string $from
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $fromGlobal = false, $from = 'doc')
|
||||
public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $from = 'doc')
|
||||
{
|
||||
$linkType = $objectType;
|
||||
if($objectType == 'execution' and $this->app->tab != 'execution') $linkType = 'project';
|
||||
@@ -430,7 +429,6 @@ class doc extends control
|
||||
$this->view->docType = $docType;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
|
||||
$this->view->fromGlobal = $fromGlobal;
|
||||
$this->view->from = $from;
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#main {padding: 0;}
|
||||
.container {padding: 0 !important;}
|
||||
#mainContent {padding: 0 !important;}
|
||||
#mainContent {padding: 0;}
|
||||
.doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;}
|
||||
.doc-title .form-control:focus {border: unset; box-shadow: unset;}
|
||||
.doc-title input::-webkit-input-placeholder {color: #D8DBDE;}
|
||||
@@ -33,11 +33,11 @@
|
||||
|
||||
#modalBasicInfo .modal-dialog {width:800px;}
|
||||
#modalBasicInfo .modal-content {padding:0px;}
|
||||
#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; ;overflow-x: hidden !important;}
|
||||
#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; overflow-x: hidden !important;}
|
||||
#modalBasicInfo .modal-body .close {position:absolute; right:15px; top:15px}
|
||||
#basicInfoBox{margin-bottom: 10px;}
|
||||
#basicInfoBox tfoot td {padding-bottom: 0;}
|
||||
.aclBox .radio-inline{display:block;}
|
||||
.aclBox .radio-inline{display:block; padding-bottom:5px;}
|
||||
.aclBox .radio-inline+.radio-inline {margin-left: 0px !important;}
|
||||
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
|
||||
@@ -93,9 +93,8 @@ function loadDocModule(libID)
|
||||
var link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#module').replaceWith(data);
|
||||
$('#module_chosen').remove();
|
||||
$('#module').chosen();
|
||||
$('#moduleBox').html(data);
|
||||
$('#module').picker();
|
||||
});
|
||||
|
||||
loadWhitelist(libID);
|
||||
|
||||
@@ -27,7 +27,7 @@ function redirectParentWindow(objectType, libID, docType)
|
||||
}
|
||||
|
||||
config.onlybody = 'no';
|
||||
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType + '&fromGlobal=true') + '#app=doc';
|
||||
var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType) + '#app=doc';
|
||||
window.parent.$.apps.open(link);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ $(function()
|
||||
if(option.type != 'dropDownLibrary') libClass = '.moduleDorpdown';
|
||||
if($(libClass).find('li').length == 0) return '';
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" id="' + option.type + '" style="display: unset; left:' + option.left + 'px; top:' + option.top + 'px;">';
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren).replace(/%libType%/g, option.libType);
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren);
|
||||
dropdown += '</ul>';
|
||||
return dropdown;
|
||||
}
|
||||
@@ -23,7 +23,6 @@ $(function()
|
||||
'api': 'interface'
|
||||
}
|
||||
|
||||
console.log(treeData, 'treeData');
|
||||
$('#fileTree').tree(
|
||||
{
|
||||
initialState: 'active',
|
||||
@@ -40,7 +39,7 @@ $(function()
|
||||
$item += '<span style="padding-left: 5px;">';
|
||||
$item += item.name
|
||||
$item += '</span>';
|
||||
$item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (item.type ? false : true) + '"></i>';
|
||||
$item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (libClass ? false : true) + '"></i>';
|
||||
$item += '</div>';
|
||||
$item += '</a>';
|
||||
|
||||
@@ -141,7 +140,6 @@ $(function()
|
||||
type : dropDownID,
|
||||
libID : libID,
|
||||
moduleID : moduleID,
|
||||
moduleType : moduleType,
|
||||
hasChildren : hasChildren
|
||||
};
|
||||
|
||||
@@ -237,7 +235,7 @@ $(function()
|
||||
if(item.hasChildren)
|
||||
{
|
||||
var $input = $('[data-id=liTreeModal]').html();
|
||||
var $rootDom = $('[data-id=' + item.libid + ']a + ul');
|
||||
var $rootDom = $('[data-id=' + item.moduleid+ ']a + ul');
|
||||
$rootDom.append($input);
|
||||
}
|
||||
else
|
||||
@@ -262,10 +260,12 @@ $(function()
|
||||
break;
|
||||
case 'addCataChild' :
|
||||
moduleData.parentID = item.id;
|
||||
console.log(item);
|
||||
if(item.hasChildren)
|
||||
{
|
||||
var $input = $('[data-id=liTreeModal]').html();
|
||||
var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul ');
|
||||
var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul');
|
||||
var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+8
-31
@@ -47,7 +47,7 @@ class docModel extends model
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('type')->eq('api')
|
||||
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
|
||||
->beginIF(!empty($objectType) && $objectID > 0)->andWhere($objectType)->eq($objectID)->fi()
|
||||
->beginIF(!empty($objectType) && $objectID > 0 and $objectType != 'nolink')->andWhere($objectType)->eq($objectID)->fi()
|
||||
->beginIF($objectType == 'nolink')
|
||||
->andWhere('product')->eq(0)
|
||||
->andWhere('project')->eq(0)
|
||||
@@ -234,6 +234,7 @@ class docModel extends model
|
||||
->join('users', ',')
|
||||
->setForce('product', $this->post->libType == 'product' ? $this->post->product : 0)
|
||||
->setForce('project', $this->post->libType == 'project' ? $this->post->project : 0)
|
||||
->setForce('execution', $this->post->libType == 'project' ? $this->post->execution : 0)
|
||||
->add('addedBy', $this->app->user->account)
|
||||
->add('addedDate', helper::now())
|
||||
->remove('uid,contactListMenu,libType')
|
||||
@@ -247,7 +248,8 @@ class docModel extends model
|
||||
$this->lang->doclib->project = $this->lang->api->project;
|
||||
$this->lang->doclib->product = $this->lang->api->product;
|
||||
|
||||
$this->config->api->createlib->requiredFields .= $this->post->libType == 'product' ? ',product' : ',project';
|
||||
if($this->post->libType == 'product') $this->config->api->createlib->requiredFields .= ',product';
|
||||
if($this->post->libType == 'project') $this->config->api->createlib->requiredFields .= ',project';
|
||||
|
||||
$data->type = static::DOC_TYPE_API;
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($data)->autoCheck()
|
||||
@@ -286,8 +288,8 @@ class docModel extends model
|
||||
$this->lang->doclib->project = $this->lang->api->project;
|
||||
$this->lang->doclib->product = $this->lang->api->product;
|
||||
|
||||
|
||||
$this->config->api->editlib->requiredFields .= $this->post->libType == 'product' ? ',product' : ',project';
|
||||
if($this->post->libType == 'product') $this->config->api->createlib->requiredFields .= ',product';
|
||||
if($this->post->libType == 'project') $this->config->api->createlib->requiredFields .= ',project';
|
||||
|
||||
$data->type = static::DOC_TYPE_API;
|
||||
$this->dao->update(TABLE_DOCLIB)->data($data)->autoCheck()
|
||||
@@ -2945,35 +2947,10 @@ class docModel extends model
|
||||
$attr = "data-app='{$this->app->tab}'";
|
||||
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
|
||||
$params = "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=$typeKey";
|
||||
if($typeKey == 'template') $params = "objectType=$type&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html&from=template";
|
||||
|
||||
$html .= "<li>";
|
||||
if($typeKey == 'template')
|
||||
{
|
||||
$params = "objectType=$type&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html&fromGlobal=&from=template";
|
||||
$html .= html::a('#modalTemplate', $typeName, '', "data-toggle='modal' $attr");
|
||||
$html .= "
|
||||
<div class='modal fade' id='modalTemplate' data-scroll-inside='true'>
|
||||
<div class='modal-dialog'>
|
||||
<div class='modal-content with-padding'>
|
||||
<div class='modal-header'>
|
||||
<button type='button' class='close' data-dismiss='modal'>
|
||||
<i class='icon icon-close'></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class='modal-body'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th>模板选择</th>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
$html .= html::a(helper::createLink('doc', 'create', $params, '', $class ? true : false), $typeName, '', "class='$class' $attr");
|
||||
}
|
||||
$html .= html::a(helper::createLink('doc', 'create', $params, '', $class ? true : false), $typeName, '', "class='$class' $attr");
|
||||
$html .= "</li>";
|
||||
|
||||
$printDivider = false;
|
||||
|
||||
@@ -139,7 +139,6 @@
|
||||
</div>
|
||||
<?php js::set('textType', $config->doc->textTypes);?>
|
||||
<?php js::set('docType', $docType);?>
|
||||
<?php js::set('fromGlobal', $fromGlobal);?>
|
||||
<?php js::set('holders', $lang->doc->placeholder);?>
|
||||
<?php js::set('type', 'doc');?>
|
||||
<?php js::set('requiredFields', ',' . $config->doc->create->requiredFields . ',');?>
|
||||
|
||||
Reference in New Issue
Block a user