优化文集、文档、文档编辑器页面到个人中心文集管理、文档管理的跳转

This commit is contained in:
zmister 2022-06-05 09:54:18 +08:00
parent ca0eaf4742
commit 14e8c22b4a
5 changed files with 34 additions and 9 deletions

View File

@ -20,7 +20,7 @@
<a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
<i class="layui-icon layui-icon-add-1"></i> <span class="layui-hide-xs">{% trans "添加" %}</span>
</a>
<a class="btn pull-left" aria-label="" href="{% url 'user_center' %}">
<a class="btn pull-left" aria-label="" href="{% url 'user_center' %}?tab=manage_doc">
<i class="fa fa-cubes"></i> <span class="layui-hide-xs">{% trans "管理" %}</span>
</a>
{% elif colla_user > 0 %}

View File

@ -60,7 +60,8 @@
<a href="javascript:;"><i class="fa fa-dashboard layui-hide-md"></i><span class="layui-hide-xs">管理</span></a>
<dl class="layui-nav-child mrdoc-import-doc-child"> <!-- 二级菜单 -->
<dd><a href="{% url 'pro_list' %}" target="_blank">首页</a></dd>
<dd><a href="{% url 'user_center' %}" target="_blank">个人中心</a></dd>
<dd><a href="{% url 'user_center' %}?tab=manage_project" target="_blank">文集管理</a></dd>
<dd><a href="{% url 'user_center' %}?tab=manage_doc" target="_blank">文档管理</a></dd>
</dl>
</li>

View File

@ -71,12 +71,11 @@
{% endif %}
<li class="layui-nav-item mrdoc-import-doc-item">
<a href="javascript:;"><i class="fa fa-dashboard layui-hide-md"></i><span class="layui-hide-xs">管理</span></a>
<dl class="layui-nav-child mrdoc-import-doc-child"> <!-- 二级菜单 -->
<dd><a href="{% url 'pro_list' %}" target="_blank">首页</a></dd>
<dd><a href="{% url 'user_center' %}" target="_blank">个人中心</a></dd>
</dl>
</li>
<a href="{% url 'user_center' %}?tab=manage_doc"><span class="layui-hide-xs">文档管理</span></a>
</li>
<li class="layui-nav-item mrdoc-import-doc-item">
<a href="{% url 'pro_list' %}"><span class="layui-hide-xs">返回首页</span></a>
</li>
{% if doc.status == 0 %}
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-radius pull-right" style="margin-top:10px;" title="保存文档" id="modify_save_doc">保存</button>
<button class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius pull-right" style="margin-top:10px;" title="保存文档为发布状态" id="modify_doc_to_pub">转为发布</button>

View File

@ -18,7 +18,7 @@
</a>
{% endif %}
{% if request.user == project.create_user %}
<a class="btn pull-left" href="{% url 'user_center' %}">
<a class="btn pull-left" href="{% url 'user_center' %}?tab=manage_project">
<i class="fa fa-cubes"></i> <span class="layui-hide-xs">{% trans "管理" %}</span>
</a>
{% endif %}

View File

@ -165,6 +165,31 @@
}
admin.setConfigType("json");
admin.render(pear_admin_config);
// URL参数解析
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
};
// 选项卡跳转
function tabRedict(){
var tabKw = getQueryVariable('tab')
console.log("选项卡跳转",tabKw)
switch(tabKw){
case 'manage_project':
layui.tab.addTabOnlyByElem("content",{id:"manage_project",title:"文集管理",url:"{% url 'manage_project' %}",close:"true"})
break;
case 'manage_doc':
layui.tab.addTabOnlyByElem("content",{id:"doc_manage",title:"文档管理",url:"{% url 'manage_doc' %}",close:"true"})
break;
}
}
setTimeout(tabRedict,100)
})
</script>
<script>