Files
zyplayer-doc/zyplayer-doc-wiki/src/main/resources/doc-wiki.html

165 lines
105 KiB
HTML
Raw Normal View History

2019-02-17 20:20:39 +08:00
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>wiki文档管理系统</title>
<link rel="shortcut icon" href="webjars/doc-wiki/img/wiki.ico"/>
<link rel="stylesheet" href="webjars/doc-wiki/css/element-ui.css">
<link rel="stylesheet" href="webjars/doc-wiki/css/doc-wiki.css" />
</head>
<body>
<div id="app">
<el-container style="height: 100%;">
<el-aside width="auto" style="height: 100%;">
<div class="logo" @click="aboutDialogVisible = true">zyplayer-doc-wiki</div>
<div style="padding: 10px;">
<div align="center"><el-button type="primary" v-on:click="createWiki" icon="el-icon-plus" style="width: 100%;">创建文档</el-button></div>
<!--<el-row><el-switch v-model="isCollapse"></el-switch></el-row>-->
<el-input v-model="searchKeywords" placeholder="搜索文档" style="margin: 10px 0;">
<el-button slot="append" icon="el-icon-search" v-on:click="searchByKeywords"></el-button>
</el-input>
<el-tree :data="pathIndex" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</el-aside>
<el-main class="doc-body-box">
<el-row type="border-card">
<div class="wiki-title">
2019-02-23 22:19:13 +08:00
狗屎一样的代码如何重构wiki模块正在开发中这只是一个预览页面
2019-02-17 20:20:39 +08:00
<div style="float: right;">
<el-button type="text" icon="el-icon-edit">编辑</el-button>
<el-button type="text" icon="el-icon-setting">访问权限</el-button>
</div>
</div>
<div class="wiki-author">
创建时间暮光城中城 2019-2-17 18:44:17  最后修改暮光城中城 2019-2-17 18:44:23
</div>
<div class="wiki-files">
<div style="float: right; margin-bottom: 5px;">
<el-button icon="el-icon-upload">上传附件</el-button>
</div>
<el-table :data="docFileList" border style="width: 100%; margin-bottom: 5px;">
<el-table-column label="文件名">
<template slot-scope="scope">
<a target="_blank" :href="scope.row.name">{{scope.row.name}}</a>
</template>
</el-table-column>
<el-table-column prop="creator" label="创建人"></el-table-column>
<el-table-column prop="create" label="创建时间"></el-table-column>
</el-table>
</div>
<div class="wiki-content">
<div class="rich_media_content " id="js_content"><p style="margin-bottom: 15px;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);text-align: center;" data-mpa-powered-by="yiban.io"></p><p style="white-space: normal;font-size: 14px;letter-spacing: 1.4px;text-align: left;line-height: 2em;">狗屎一样的代码如何重构?</p><p style="white-space: normal;font-size: 14px;letter-spacing: 1.4px;text-align: left;line-height: 2em;">重构不止是代码整理,它提供了一种高效且受控的代码整理技术。</p><h4 style="margin-top: 20px;margin-bottom: 10px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;color: rgb(0, 150, 136) !important;">(一)重构原则</h4><h6 style="margin-top: 20px;margin-bottom: 10px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;color: rgb(0, 150, 136) !important;">1、何谓重构</h6><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">对软件内部结构的一种调整,目的是在不改变软件可观察行为的前提下,提高其可理解性,降低其修改成本。</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">另一种解释是:使用一系列重构手法,在不改变软件可观察行为的前提下,调整其结构。</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;"><span style="color: rgb(0, 150, 136);font-size: 16px;letter-spacing: 1.4px;text-align: left;">2、为何重构</span><br /></p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">改进软件设计:如果没有重构,程序的设计会逐渐变质,重构很像是在整理代码,你所做的就是让所有的东西回到应处的位置上。<br />帮助找到bug对代码进行重构可以深入理解代码的作为在搞清楚程序结构的同时想不把bug揪出来都难。<br />提高编程速度:良好的设计是快速开发的根本,改善设计、提高可读性,减少错误,这些都是提高质量。</p><h6 style="margin-top: 20px;margin-bottom: 10px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;color: rgb(0, 150, 136) !important;">3、何时重构</h6><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">任何情况下我都反对专门拨出时间进行重构。重构本来就不是一件应该特别拨出时间做的事情,重构应该随时随地的进行。</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;"><strong style="color: rgb(191, 54, 12);">三次法则</strong></p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">第一次做某件事情是只管去做;第二次做类似的事情会产生反感;第三次再做类似的事,你就应该重构</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">最常见的重构时机是想给软件添加新特性的时候;</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">重构的另个一原动力是:代码的设计无法帮助我轻松的添加所需要的特性</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">修改错误的时候review代码的时重构</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">间接层和重构</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">计算机科学是这样一门科学:它相信所有的问题都可以通过增加一个间接层来解决。</p><p style="font-size: 14px;letter-spacing: 1.4px;white-space: normal;text-align: left;line-height: 2em;">大多数重构都为程序引入
</div>
</el-row>
</el-main>
</el-container>
<el-dialog title="关于zyplayer-doc-wiki" :visible.sync="aboutDialogVisible" width="600px">
<el-form>
<el-form-item label="项目地址:">
<a target="_blank" href="https://gitee.com/zyplayer/zyplayer-doc">zyplayer-doc</a>
</el-form-item>
<el-form-item label="开发人员:">
<a target="_blank" href="http://zyplayer.com">暮光:城中城</a>
</el-form-item>
<el-form-item label="">
欢迎加群讨论QQ群号466363173欢迎提交需求欢迎使用和加入开发
</el-form-item>
</el-form>
</el-dialog>
</div>
</body>
<script type="text/javascript" src="webjars/doc-wiki/vue/vue.js"></script>
<script type="text/javascript" src="webjars/doc-wiki/js/element-ui.js"></script>
<!-- ajax 用到了jquery -->
<script type="text/javascript" src="webjars/doc-wiki/js/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="webjars/doc-wiki/js/common.js"></script>
<script type="text/javascript" src="webjars/doc-wiki/js/toast.js"></script>
<script type="text/javascript" src="webjars/doc-wiki/js/formatjson.js"></script>
<script type="text/javascript" src="webjars/doc-wiki/js/doc-wiki-tree.js"></script>
<script>
var app = new Vue({
el: '#app',
data() {
return {
isCollapse: false,
aboutDialogVisible: false,
onlineDebugLoading: false,
docFileList: [
{name:'开发规范.doc', create: '2019-2-17 19:00:02', creator: '暮光:城中城'}
],
pathIndex: [
{
label: '研发中心',
children: [
{
label: '狗屎一样的代码如何重构?'
},{
label: '开发规范',
},{
label: '关于研发中心',
},
]
},
],
defaultProps: {
children: 'children',
label: 'label'
},
// 依据目录树存储的map全局对象
treePathDataMap: new Map(),
// 搜索的输入内容
searchKeywords: "",
}
},
watch: {
},
mounted: function () {
//this.doGetServiceList();
},
methods: {
createWiki(){
},
handleNodeClick(data) {
if (data.children == null) {
var path = data.interface;
}
},
searchByKeywords() {
app.pathIndex = createTreeViewByTreeWithMerge(app.dubboDocList, app.searchKeywords);
}
}
});
</script>
<style>
html,body,#app {
margin: 0;
padding: 0;
height: 100%;
}
pre{margin: 0;}
.el-menu {
box-sizing: border-box;
border-right: 0;
margin-right: 3px;
}
.doc-body-box{
overflow-x: hidden;height: calc(100vh);overflow-y: auto;width: 100%;
padding: 20px;border-left: 1px solid #f1f1f1; box-sizing: border-box;
}
.el-tree{margin-right: 3px;}
.logo{
background: #409EFF; cursor: pointer;
width: 100%; height:60px;line-height:60px;font-size: 25px;color: #fff;text-align: center;
}
.wiki-title{font-size: 20px;}
.wiki-author{font-size: 14px;padding: 10px 0;}
.wiki-content{font-size: 14px;}
</style>
</html>