MrDoc/template/app_doc/manage/manage_overview.html
2020-11-29 14:03:39 +08:00

268 lines
24 KiB
HTML

{% extends 'app_doc/user/user_base.html' %}
{% load static %}
{% block title %}仪表盘{% endblock %}
{% block custom_element %}
<link rel="stylesheet" href="{% static 'PearAdminLayui/admin/css/other/console1.css' %}" />
{% endblock %}
{% block content %}
<div>
<div class="layui-row layui-col-space10">
<div class="layui-col-xs6 layui-col-md3">
<div class="layui-card top-panel">
<div class="layui-card-header">文集总数</div>
<div class="layui-card-body">
<div class="layui-row layui-col-space5">
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="pro_cnt">
{{ pro_cnt }}
</div>
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
<svg t="1606220627766" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2169" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M884.506122 271.673469H505.208163c-13.583673 0-24.555102-9.404082-24.555102-20.897959s10.971429-20.897959 24.555102-20.897959h379.297959c13.583673 0 24.555102 9.404082 24.555102 20.897959s-10.971429 20.897959-24.555102 20.897959zM884.506122 438.857143H505.208163c-13.583673 0-24.555102-9.404082-24.555102-20.897959s10.971429-20.897959 24.555102-20.89796h379.297959c13.583673 0 24.555102 9.404082 24.555102 20.89796s-10.971429 20.897959-24.555102 20.897959zM359.444898 491.102041H183.902041C145.763265 491.102041 114.938776 460.277551 114.938776 422.138776V246.595918C114.938776 208.457143 145.763265 177.632653 183.902041 177.632653h176.065306C397.583673 177.632653 428.408163 208.457143 428.408163 246.595918v176.065306C428.408163 460.277551 397.583673 491.102041 359.444898 491.102041zM884.506122 626.938776H505.208163c-13.583673 0-24.555102-9.404082-24.555102-20.89796s10.971429-20.897959 24.555102-20.897959h379.297959c13.583673 0 24.555102 9.404082 24.555102 20.897959s-10.971429 20.897959-24.555102 20.89796zM884.506122 794.122449H505.208163c-13.583673 0-24.555102-9.404082-24.555102-20.897959s10.971429-20.897959 24.555102-20.897959h379.297959c13.583673 0 24.555102 9.404082 24.555102 20.897959s-10.971429 20.897959-24.555102 20.897959z" fill="#16C4AF" p-id="2170"></path><path d="M359.444898 846.367347H183.902041c-38.138776 0-68.963265-30.82449-68.963265-68.963265v-176.065306c0-38.138776 30.82449-68.963265 68.963265-68.963266h176.065306c38.138776 0 68.963265 30.82449 68.963265 68.963266v176.065306c-0.522449 38.138776-31.346939 68.963265-69.485714 68.963265z" fill="#16C4AF" p-id="2171"></path></svg>
</div>
</div>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-md3">
<div class="layui-card top-panel">
<div class="layui-card-header">文档数量</div>
<div class="layui-card-body">
<div class="layui-row layui-col-space5">
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="doc_cnt">
{{ doc_cnt }}
</div>
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
<svg t="1606220673973" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2315" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M736.653061 929.959184H287.346939c-45.97551 0-83.591837-37.616327-83.591837-83.591837V177.632653c0-45.97551 37.616327-83.591837 83.591837-83.591837h449.306122c45.97551 0 83.591837 37.616327 83.591837 83.591837v668.734694c0 45.97551-37.616327 83.591837-83.591837 83.591837z" fill="#F2CB51" p-id="2316"></path><path d="M694.857143 606.040816H329.142857c-11.493878 0-20.897959-9.404082-20.897959-20.897959s9.404082-20.897959 20.897959-20.897959h365.714286c11.493878 0 20.897959 9.404082 20.897959 20.897959s-9.404082 20.897959-20.897959 20.897959zM694.857143 449.306122H329.142857c-11.493878 0-20.897959-9.404082-20.897959-20.897959s9.404082-20.897959 20.897959-20.897959h365.714286c11.493878 0 20.897959 9.404082 20.897959 20.897959s-9.404082 20.897959-20.897959 20.897959zM701.126531 292.571429h-365.714286c-11.493878 0-20.897959-9.404082-20.897959-20.89796s9.404082-20.897959 20.897959-20.897959h365.714286c11.493878 0 20.897959 9.404082 20.897959 20.897959s-9.404082 20.897959-20.897959 20.89796zM590.367347 762.77551H329.142857c-11.493878 0-20.897959-9.404082-20.897959-20.897959s9.404082-20.897959 20.897959-20.897959h261.22449c11.493878 0 20.897959 9.404082 20.897959 20.897959s-9.404082 20.897959-20.897959 20.897959z" fill="#AF8015" p-id="2317"></path></svg>
</div>
</div>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-md3">
<div class="layui-card top-panel">
<div class="layui-card-header">图片数量</div>
<div class="layui-card-body">
<div class="layui-row layui-col-space5">
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="img_cnt">
{{img_cnt}}
</div>
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
<svg t="1606220413001" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M829.64898 849.502041H194.35102c-43.885714 0-79.412245-35.526531-79.412244-79.412245V253.910204c0-43.885714 35.526531-79.412245 79.412244-79.412245h635.29796c43.885714 0 79.412245 35.526531 79.412244 79.412245v516.179592c0 43.885714-35.526531 79.412245-79.412244 79.412245z" fill="#D2F4FF" p-id="2022"></path><path d="M909.061224 656.195918l-39.706122-48.065306L626.416327 365.714286c-19.330612-19.330612-50.677551-19.330612-70.008164 0L419.526531 502.073469c-2.612245 2.612245-5.22449 3.134694-6.791837 3.134694-1.567347 0-4.702041-0.522449-6.791837-3.134694L368.326531 464.979592c-19.330612-19.330612-50.677551-19.330612-70.008164 0l-143.673469 143.673469-39.706122 48.065306v113.893878c0 43.885714 35.526531 79.412245 79.412244 79.412245h635.29796c43.885714 0 79.412245-35.526531 79.412244-79.412245v-114.416327" fill="#16C4AF" p-id="2023"></path><path d="M273.763265 313.469388m-49.632653 0a49.632653 49.632653 0 1 0 99.265306 0 49.632653 49.632653 0 1 0-99.265306 0Z" fill="#E5404F" p-id="2024"></path><path d="M644.179592 768h-365.714286c-11.493878 0-20.897959-9.404082-20.897959-20.897959s9.404082-20.897959 20.897959-20.897959h365.714286c11.493878 0 20.897959 9.404082 20.897959 20.897959s-9.404082 20.897959-20.897959 20.897959zM461.322449 670.82449h-182.857143c-11.493878 0-20.897959-9.404082-20.897959-20.897959s9.404082-20.897959 20.897959-20.89796h182.857143c11.493878 0 20.897959 9.404082 20.897959 20.89796s-9.404082 20.897959-20.897959 20.897959z" fill="#0B9682" p-id="2025"></path></svg>
</div>
</div>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-md3">
<div class="layui-card top-panel">
<div class="layui-card-header">附件数量</div>
<div class="layui-card-body">
<div class="layui-row layui-col-space5">
<div class="layui-col-xs8 layui-col-md8 top-panel-number" style="color: #28333E;" id="attachment_cnt">
{{attachment_cnt}}
</div>
<div class="layui-col-xs4 layui-col-md4 top-panel-tips">
<svg t="1606220756769" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2461" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M805.093878 462.367347H219.428571V194.35102C219.428571 150.465306 254.955102 114.938776 298.840816 114.938776h426.840817c43.885714 0 79.412245 35.526531 79.412245 79.412244v268.016327z" fill="#F2CB51" p-id="2462"></path><path d="M725.681633 909.061224H298.840816c-43.885714 0-79.412245-35.526531-79.412245-79.412244v-109.191837h585.665307v109.191837c0 43.885714-36.04898 79.412245-79.412245 79.412244z" fill="#F2CB51" p-id="2463"></path><path d="M685.97551 257.044898H338.546939c-10.971429 0-19.853061-8.881633-19.853061-19.853061s8.881633-19.853061 19.853061-19.853061h347.428571c10.971429 0 19.853061 8.881633 19.853061 19.853061s-9.404082 19.853061-19.853061 19.853061z" fill="#AF8015" p-id="2464"></path><path d="M829.64898 760.163265H194.35102c-43.885714 0-79.412245-35.526531-79.412244-79.412245V502.073469c0-43.885714 35.526531-79.412245 79.412244-79.412245h635.29796c43.885714 0 79.412245 35.526531 79.412244 79.412245v178.677551c0 43.885714-35.526531 79.412245-79.412244 79.412245z" fill="#E5404F" p-id="2465"></path><path d="M685.97551 359.967347H338.546939c-10.971429 0-19.853061-8.881633-19.853061-19.853061 0-10.971429 8.881633-19.853061 19.853061-19.853062h347.428571c10.971429 0 19.853061 8.881633 19.853061 19.853062 0 10.971429-9.404082 19.853061-19.853061 19.853061z" fill="#AF8015" p-id="2466"></path><path d="M433.632653 619.62449h2.089796l10.971429-4.702041c1.044898-0.522449 2.089796-2.089796 1.567346-3.134694-4.702041-12.016327-10.44898-23.510204-16.195918-33.959184-0.522449-1.044898-2.089796-1.567347-3.657143-1.044898l-9.404081 4.702041c-1.044898 0.522449-2.089796 2.089796-1.044898 3.657143 5.22449 10.44898 9.926531 21.942857 14.628571 33.959184 0 0 0.522449 0.522449 1.044898 0.522449zM377.730612 579.918367c5.22449-14.106122 9.404082-27.689796 13.061225-39.706122v-10.971429c0-1.567347-1.044898-2.612245-2.612245-2.612245H344.816327c-1.567347 0-2.612245 1.044898-2.612245 2.612245v138.971429c0 1.567347 1.044898 2.612245 2.612245 2.612245h10.971428c1.567347 0 2.612245-1.044898 2.612245-2.612245v-24.555102h0.522449c5.746939 0.522449 10.971429 0.522449 15.15102 0 14.106122-2.612245 19.853061-14.106122 16.718368-34.481633-1.567347-8.359184-5.746939-18.285714-13.061225-29.257143z m-19.330612-37.616326h14.106122c-4.179592 14.628571-8.359184 28.212245-12.016326 39.706122-0.522449 1.044898 0 1.567347 0.522449 2.612245 7.314286 9.404082 11.493878 17.763265 13.061224 25.6 2.089796 10.971429 0.522449 17.240816-4.70204 18.285714-3.134694 0.522449-6.791837 0-10.44898-0.522449v-85.681632z" fill="#FFEEF0" p-id="2467"></path><path d="M423.706122 524.016327c-0.522449-0.522449-1.044898-1.044898-1.567346-1.044898l-11.493878-2.612245c-1.567347-0.522449-2.612245 0.522449-3.134694 2.089796-6.791837 22.987755-15.15102 42.840816-26.122449 59.036734-0.522449 1.044898-0.522449 2.089796 0 3.134694 2.089796 3.134694 4.179592 6.791837 5.746939 10.44898 0.522449 1.044898 1.044898 1.567347 2.089796 1.567347s2.089796-0.522449 2.612245-1.044898c2.089796-3.134694 4.179592-6.269388 6.269387-9.926531V668.734694c0 1.567347 1.044898 2.612245 2.612245 2.612245h11.493878c1.567347 0 2.612245-1.044898 2.612245-2.612245v-115.983674c3.134694-7.836735 6.269388-16.718367 9.404081-25.6 0-1.567347 0-2.612245-0.522449-3.134693z" fill="#FFEEF0" p-id="2468"></path><path d="M485.355102 552.228571h-16.195918v-29.257142c0-1.567347-1.044898-2.612245-2.612245-2.612245h-11.493878c-1.567347 0-2.612245 1.044898-2.612245 2.612245v29.257142h-35.004081c-1.567347 0-2.612245 1.044898-2.612245 2.612245v10.971429c0 1.567347 1.044898 2.612245 2.612245 2.612245h35.004081v74.710204c0 5.22449-2.612245 7.836735-8.359183 7.836735-4.702041 0-10.971429-0.522449-18.285715-1.567347-1.044898 0-1.567347 0-2.089796 1.044898s-1.044898 1.567347-0.522449 2.089796c1.044898 4.702041 2.089796 8.881633 2.089796 12.538775 0 1.044898 1.044898 2.089796 2.612245 2.089796 6.269388 0 12.016327 0.522449 17.763266 0.522449 15.673469 0 24.032653-7.836735 24.032653-22.465306v-77.322449H485.877551c1.567347 0 2.612245-1.044898 2.612245-2.612245v-10.971429c-0.522449-1.044898-2.089796-2.089796-3.134694-2.089796zM578.35102 525.583673c-0.522449-0.522449-1.044898-1.044898-1.567347-1.044897l-12.016326-3.657143h-2.089796c-0.522449 0.522449-1.044898 1.044898-1.044898 1.567347-8.359184 28.212245-19.330612 52.767347-32.391837 72.620408-0.522449 0.522449-0.522449 1.567347 0 2.612245 2.089796 4.179592 3.657143 8.359184 5.22449 12.538775 0.522449 1.044898 1.044898 1.567347 2.089796 1.567347s2.089796 0 2.612245-1.044898c4.179592-5.22449 7.836735-10.971429 11.493877-17.240816v74.187755c0 1.567347 1.044898 2.612245 2.612245 2.612245h11.493878c1.567347 0 2.612245-1.044898 2.612245-2.612245v-108.146939c4.179592-9.926531 8.359184-20.897959 11.493877-32.391837 0-0.522449 0-1.044898-0.522449-1.567347z" fill="#FFEEF0" p-id="2469"></path><path d="M679.706122 602.906122h-37.616326v-32.391836h32.914286c1.567347 0 2.612245-1.044898 2.612245-2.612245v-10.44898c0-1.567347-1.044898-2.612245-2.612245-2.612245h-32.914286v-31.869387c0-1.567347-1.044898-2.612245-2.612245-2.612245h-12.016327c-1.567347 0-2.612245 1.044898-2.612244 2.612245v31.869387H606.040816c1.567347-5.746939 3.657143-11.493878 5.22449-17.763265 0.522449-1.567347-0.522449-2.612245-1.567347-3.134694l-12.016326-3.657143c-0.522449 0-1.567347 0-2.089796 0.522449-0.522449 0.522449-1.044898 1.044898-1.044898 1.567347-4.179592 19.853061-11.493878 38.661224-20.37551 54.857143-0.522449 1.044898-0.522449 2.612245 1.044898 3.657143 3.657143 2.612245 6.791837 4.702041 9.404081 7.836735 0.522449 0.522449 1.567347 1.044898 2.089796 0.522449 1.044898 0 1.567347-0.522449 2.089796-1.044898 4.702041-7.836735 8.881633-17.240816 12.538776-27.167347h24.032653v32.391836h-49.110205c-1.567347 0-2.612245 1.044898-2.612244 2.612245v10.44898c0 1.567347 1.044898 2.612245 2.612244 2.612245h49.110205v49.110204c0 1.567347 1.044898 2.612245 2.612244 2.612245h12.016327c1.567347 0 2.612245-1.044898 2.612245-2.612245v-49.110204h37.616326c1.567347 0 2.612245-1.044898 2.612245-2.612245v-10.44898c-0.522449-2.089796-2.089796-3.134694-3.134694-3.134694z" fill="#FFEEF0" p-id="2470"></path></svg>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="layui-row layui-col-space10">
<div class="layui-col-md6">
<!-- <div class="layui-card">
<div class="layui-card-body">
<div class="layui-tab custom-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<div id="echarts-records" style="background-color:#ffffff;min-height:400px;padding: 10px"></div>
</div>
</div>
</div> -->
<div class="layui-card">
<div class="layui-card-header">动态</div>
<div class="layui-card-body">
<dl class="layuiadmin-card-status">
{% for doc in doc_active_list %}
<dd>
<div class="layui-status-img"><a href="javascript:;"><img style="width: 32px;height: 32px;border-radius: 50px;"
src="{% static 'PearAdminLayui/avatar.svg' %}"></a></div>
<div>
{% if doc.status == 1 %}
<p>{{doc.create_user.first_name}} 发布了文档 <a href="{% url 'doc' doc.top_doc doc.id %}" target="_blank">{{doc.name}}</a></p>
{% elif doc.status == 0 %}
<p>{{doc.create_user.first_name}} 保存了文档 <a href="{% url 'modify_doc' doc.id %}" target="_blank">{{doc.name}}</a></p>
{% else %}
<p>{{doc.create_user.first_name}} 删除了文档 <a>{{doc.name}}</a></p>
{% endif %}
<span>{{doc.modify_time}}</span>
</div>
</dd>
{% endfor %}
</dl>
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">快速草稿</div>
<div class="layui-card-body">
<div class="layui-form">
{% csrf_token %}
<input name="status" value="0" hidden>
<div class="layui-form-item">
<label class="layui-form-label">标题</label>
<div class="layui-input-block">
<input type="text" id="doc_name" name="doc_name" required lay-verify="required" placeholder="请输入文档标题" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文集</label>
<div class="layui-input-block">
<select name="project" id="project" lay-verify="required">
<option value=""></option>
{% for pro in pro_list %}
{% if pro.role == 0 %}
<option value="{{pro.id}}">[公开]{{pro.name}}</option>
{% elif pro.role == 1 %}
<option value="{{pro.id}}">[私密]{{pro.name}}</option>
{% elif pro.role == 2 %}
<option value="{{pro.id}}">[指定用户]{{pro.name}}</option>
{% elif pro.role == 3 %}
<option value="{{pro.id}}">[密码]{{pro.name}}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">文本域</label>
<div class="layui-input-block">
<textarea name="pre_content" id="pre_content" placeholder="在想些什么呢?" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" id="save_doc" onclick="manage_overview_save_doc();">保存草稿</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-header">
链接
</div>
<div class="layui-card-body">
<a target="_blank" href="http://mrdoc.zmister.com/project-7/doc-434/" class="pear-btn pear-btn-primary layui-btn-fluid" style="height: 50px;line-height: 50px;">
<i class="layui-icon layui-icon-praise"></i> 支持项目发展
</a>
<br/>
<a target="_blank" href="https://zmister.com/mrdoc/" class="pear-btn pear-btn-success layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">
<i class="layui-icon layui-icon-website"></i> 觅 道 文 档 官 网
</a>
<br/>
<a target="_blank" href="http://mrdoc.zmister.com" class="pear-btn pear-btn-primary layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">
<i class="layui-icon layui-icon-read"></i> 使 用 手 册
</a>
<br/>
<a target="_blank" href="https://gitee.com/zmister/MrDoc" class="pear-btn pear-btn-warming layui-btn-fluid" style="margin-top: 8px;height: 50px;line-height: 50px;">
<i class="layui-icon layui-icon-download-circle"></i> 源 码 下 载
</a>
</div>
</div>
</div>
</div>
</div>
<!--</div>-->
{% endblock %}
{% block custom_script %}
<script>
layui.use(['layer', 'echarts', 'element', 'count','topBar','form'], function() {
var $ = layui.jquery,
layer = layui.layer,
form = layui.form,
element = layui.element,
count = layui.count,
echarts = layui.echarts;
$.ajaxSetup({
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
});
// count.up("pro_cnt", {
// time: 4000,
// num: {{ pro_cnt }},
// bit: 0,
// regulator: 50
// });
// count.up("doc_cnt", {
// time: 4000,
// num: {{ doc_cnt }},
// bit: 0,
// regulator: 50
// });
// count.up("img_cnt", {
// time: 4000,
// num: {{ img_cnt }},
// bit: 0,
// regulator: 50
// });
// count.up("attachment_cnt", {
// time: 4000,
// bit: 0,
// num: {{ attachment_cnt }},
// regulator: 50
// });
// window.onresize = function() {
// echartsRecords.resize();
// };
// 保存文档草稿
manage_overview_save_doc = function(){
$('button.layui-btn').attr("disabled",true);
$('button.layui-btn').addClass('layui-btn-disabled');
var data = {
'project':$("#project").val(),
'doc_name':$("#doc_name").val(),
'pre_content':$("#pre_content").val(),
'status':0
}
console.log(data)
if(data.doc_name == ""){
layer.msg('请输入文档标题!');
$('button.layui-btn').attr("disabled",false);
$('button.layui-btn').removeClass('layui-btn-disabled');
}
else if(data.project == ""){
layer.msg('请选择文集!');
$('button.layui-btn').attr("disabled",false);
$('button.layui-btn').removeClass('layui-btn-disabled');
}
else{
layer.load(1);
$.post("{% url 'create_doc' %}",data,function(r){
if(r.status){
//保存成功
layer.closeAll("loading");
md_changed = false;
layer.msg('保存草稿成功',function(){
window.location.reload()
});
}else{
//创建失败
layer.closeAll("loading");
layer.msg('保存草稿失败:'+r.data);
$('button.layui-btn').attr("disabled",false);
$('button.layui-btn').removeClass('layui-btn-disabled');
}
});
}
};
});
</script>
{% endblock %}