mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化代码
This commit is contained in:
parent
55547d1089
commit
f3dedb3b4e
6
public/js/marked.min.js
vendored
Normal file
6
public/js/marked.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
25
public/markdown.html
Normal file
25
public/markdown.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>文档</title>
|
||||
<script src="/js/bootstrap/jquery-3.3.1.min.js"></script>
|
||||
<script src="/vcCore/vc-lang.js"></script>
|
||||
<script src="/js/marked.min.js"></script>
|
||||
<script src="/js/vue/vue.min.js"></script>
|
||||
<script src="/js/vue/vue-resource.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="component">
|
||||
<vc:create path="/pages/frame/markdown"></vc:create>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="/vcCore/vcFramework.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
3
public/pages/frame/markdown/markdown.html
Executable file
3
public/pages/frame/markdown/markdown.html
Executable file
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<div v-html="markdownInfo.page"></div>
|
||||
</div>
|
||||
47
public/pages/frame/markdown/markdown.js
Executable file
47
public/pages/frame/markdown/markdown.js
Executable file
@ -0,0 +1,47 @@
|
||||
(function (vc) {
|
||||
vc.extends({
|
||||
data: {
|
||||
markdownInfo: {
|
||||
url: '',
|
||||
page:'',
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
$that.markdownInfo.url = vc.getParam('url');
|
||||
$that._loadMarkdown();
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
_loadMarkdown: function () {
|
||||
let xmlhttp;
|
||||
if (window.XMLHttpRequest) {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
xmlhttp = new ActiveXObject('Microsoft.XMLHttp');
|
||||
}
|
||||
xmlhttp.onreadystatechange = function () {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
let _content = xmlhttp.responseText;
|
||||
$that._dealImgPath(_content);
|
||||
|
||||
}
|
||||
}
|
||||
// 向服务器发送请求
|
||||
xmlhttp.open('GET', $that.markdownInfo.url, true);
|
||||
xmlhttp.send();
|
||||
},
|
||||
_dealImgPath:function(_content){
|
||||
|
||||
let _currentPath = $that.markdownInfo.url.replace('/docs/readme.md','');
|
||||
|
||||
_content = _content.replaceAll("(img/","("+_currentPath+"/docs/img/");
|
||||
|
||||
$that.markdownInfo.page = marked.parse(_content);
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
BIN
public/pages/property/repairSettingManage/.DS_Store
vendored
Normal file
BIN
public/pages/property/repairSettingManage/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
public/pages/property/repairSettingManage/docs/.DS_Store
vendored
Normal file
BIN
public/pages/property/repairSettingManage/docs/.DS_Store
vendored
Normal file
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
9
public/pages/property/repairSettingManage/docs/readme.md
Normal file
9
public/pages/property/repairSettingManage/docs/readme.md
Normal file
@ -0,0 +1,9 @@
|
||||
## 报修操作文档
|
||||
|
||||
### 1.0 流程
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
@ -56,6 +56,9 @@
|
||||
<span><vc:i18n name="报修设置" namespace="repairSettingManage"></vc:i18n></span>
|
||||
</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
<button type="button" class="btn btn-white btn-sm" v-on:click="vc.showMarkdown('/pages/property/repairSettingManage')">
|
||||
<span><vc:i18n name="文档" namespace="repairSettingManage"></vc:i18n></span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddRepairSettingModal()">
|
||||
<i class="fa fa-plus"></i>
|
||||
<span><vc:i18n name="添加" namespace="repairSettingManage"></vc:i18n></span>
|
||||
|
||||
@ -2990,3 +2990,14 @@
|
||||
}
|
||||
}
|
||||
})(window.vcFramework);
|
||||
|
||||
|
||||
/**
|
||||
* 文档
|
||||
*/
|
||||
(function(vcFramework) {
|
||||
vcFramework.showMarkdown = function(_url) {
|
||||
let _docUrl = _url+ "/docs/readme.md";
|
||||
window.open('/markdown.html?url='+_docUrl);
|
||||
}
|
||||
})(window.vcFramework);
|
||||
Loading…
Reference in New Issue
Block a user