ap-dev 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/ConfigPanel/CptTemplate.vue +92 -0
- package/dev/ConfigPanel/DevCpt.vue +355 -63
- package/ops/ApiPanel/components/ApiCode.vue +13 -0
- package/ops/ApiPanel/components/ApiContent.vue +17 -0
- package/ops/ApiPanel/components/ApiTable.vue +40 -0
- package/ops/ApiPanel/components/ApiTittle1.vue +16 -0
- package/ops/ApiPanel/components/ApiTittle2.vue +16 -0
- package/ops/ApiPanel/components/index.js +5 -0
- package/ops/ApiPanel/index.vue +265 -0
- package/ops/ApiPanel/modules/ApiDefault.vue +17 -0
- package/ops/ApiPanel/modules/ApiLog.vue +31 -0
- package/ops/ConfigPanel/OpsDocHistory.vue +145 -0
- package/ops/ConfigPanel/index.vue +41 -0
- package/ops/OperatePanel/index.vue +109 -0
- package/ops/OpsDoc/index.vue +246 -0
- package/ops/ops/index.vue +61 -0
- package/ops/ops/opsStore.js +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ap-container>
|
|
3
|
+
<ap-aside margin="1111">
|
|
4
|
+
<ap-aside-tree ref="docTypeTree" :options.sync="treeOptions">
|
|
5
|
+
<el-form slot="form" ref="tOpsDocType" :inline="true" label-width="100px"
|
|
6
|
+
:model="tOpsDocTypeForm" :rules="tOpsDocTypeRules">
|
|
7
|
+
<el-form-item label="父类别">
|
|
8
|
+
<el-select v-model="tOpsDocTypeForm.fdParentId" filterable placeholder="请选择父节点">
|
|
9
|
+
<el-option label="无" value=""/>
|
|
10
|
+
<el-option
|
|
11
|
+
v-for="item in typeList"
|
|
12
|
+
:key="item.fdId"
|
|
13
|
+
:label="item.fdName"
|
|
14
|
+
:value="item.fdId"
|
|
15
|
+
/>
|
|
16
|
+
</el-select>
|
|
17
|
+
</el-form-item>
|
|
18
|
+
<el-form-item label='名称' prop='fdName'>
|
|
19
|
+
<el-input v-model='tOpsDocTypeForm.fdName'></el-input>
|
|
20
|
+
</el-form-item>
|
|
21
|
+
<el-form-item label='类型' prop='fdType'>
|
|
22
|
+
<el-select v-model="tOpsDocTypeForm.fdType" filterable placeholder="请选择类型">
|
|
23
|
+
<el-option key="1" label="分组" :value=1></el-option>
|
|
24
|
+
<el-option key="2" label="文档" :value=2></el-option>
|
|
25
|
+
</el-select>
|
|
26
|
+
</el-form-item>
|
|
27
|
+
<el-form-item label='布局' prop='fdLayout'>
|
|
28
|
+
<el-select v-model="tOpsDocTypeForm.fdLayout" filterable placeholder="请选择布局">
|
|
29
|
+
<el-option key="one" label="单页" value="one"></el-option>
|
|
30
|
+
<el-option key="left" label="左侧(二级)" value="left"></el-option>
|
|
31
|
+
<el-option key="lefttop" label="左上(三级)" value="lefttop"></el-option>
|
|
32
|
+
</el-select>
|
|
33
|
+
</el-form-item>
|
|
34
|
+
<el-form-item label='自定义组件' prop='fdCustom' placeholder="请输入自定义组件名">
|
|
35
|
+
<el-input v-model='tOpsDocTypeForm.fdCustom'></el-input>
|
|
36
|
+
</el-form-item>
|
|
37
|
+
<el-form-item label='排序' prop='fdSort'>
|
|
38
|
+
<el-input v-model='tOpsDocTypeForm.fdSort'></el-input>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
</el-form>
|
|
41
|
+
<span slot="tree" slot-scope="scope">
|
|
42
|
+
<span v-if="scope.data.fdType == 1" style="color: #1890ff;font-size: 13px;">{{ scope.data.fdName }}</span>
|
|
43
|
+
<span v-else style="font-size: 12px;">{{ scope.data.fdName }}</span>
|
|
44
|
+
</span>
|
|
45
|
+
</ap-aside-tree>
|
|
46
|
+
</ap-aside>
|
|
47
|
+
<ap-split-panel></ap-split-panel>
|
|
48
|
+
<ap-container>
|
|
49
|
+
<ap-main margin="1110">
|
|
50
|
+
<ap-rich-editor ref="richEditorRef" :options.sync="richEditorOptions" v-loading="loading"/>
|
|
51
|
+
</ap-main>
|
|
52
|
+
</ap-container>
|
|
53
|
+
</ap-container>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script>
|
|
57
|
+
|
|
58
|
+
import ApRichEditor from 'ap-plugin/ApRichEditor'
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
name: 'OpsDoc',
|
|
63
|
+
components: {
|
|
64
|
+
ApRichEditor
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
// ----- 左侧树 -----
|
|
69
|
+
treeOptions: this.getTreeOption(),
|
|
70
|
+
typeList: [],
|
|
71
|
+
tOpsDocTypeForm: {},
|
|
72
|
+
tOpsDocTypeRules: {},
|
|
73
|
+
selectedDocTypeId: "",
|
|
74
|
+
// ----- 右侧 -----
|
|
75
|
+
loading: false,
|
|
76
|
+
isFirstClick: true, // 第一次点击不校验是否修改
|
|
77
|
+
oldEditorValue: "",
|
|
78
|
+
richEditorOptions: {
|
|
79
|
+
toolbar: `undo redo formatpainter removeformat
|
|
80
|
+
| forecolor backcolor permanentpen bold italic underline strikethrough
|
|
81
|
+
| fontfamily fontsize blocks
|
|
82
|
+
| alignleft aligncenter alignright alignjustify lineheight
|
|
83
|
+
| outdent indent
|
|
84
|
+
| numlist bullist checklist
|
|
85
|
+
| table image apvideo pageembed link
|
|
86
|
+
| codesample apcode
|
|
87
|
+
| searchreplace code preview fullscreen save`,
|
|
88
|
+
save: (value)=> {
|
|
89
|
+
this.saveDocText(value)
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
activated() {
|
|
95
|
+
this.getDocText();
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
// 左侧树:配置
|
|
99
|
+
getTreeOption() {
|
|
100
|
+
let treeOptions = {
|
|
101
|
+
title: "运维文档",
|
|
102
|
+
toolbarBtn: [{
|
|
103
|
+
icon: "el-icon-copy",
|
|
104
|
+
onClick: () => {
|
|
105
|
+
this.copyNode();
|
|
106
|
+
}
|
|
107
|
+
}, "add", "edit", "del", "sort", ],
|
|
108
|
+
dialogTitle: "运维文档",
|
|
109
|
+
sortByTree: true,
|
|
110
|
+
sortByDrag: true,
|
|
111
|
+
onClick: (data, node, comp) => {
|
|
112
|
+
// 检查未保存
|
|
113
|
+
if (!this.isFirstClick && this.oldEditorValue != this.$refs.richEditorRef.getContent()) {
|
|
114
|
+
this.$confirm('当前操作会丢失未保存内容,确认要切换文档?', '提示', {
|
|
115
|
+
confirmButtonText: '切换',
|
|
116
|
+
cancelButtonText: '取消',
|
|
117
|
+
type: 'warning'
|
|
118
|
+
}).then(() => {
|
|
119
|
+
this.selectedDocTypeId = data.fdId;
|
|
120
|
+
this.getDocText();
|
|
121
|
+
})
|
|
122
|
+
} else {
|
|
123
|
+
this.selectedDocTypeId = data.fdId;
|
|
124
|
+
this.getDocText();
|
|
125
|
+
this.isFirstClick = false;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
loadOptions: {
|
|
129
|
+
url: "/apd/ops/OpsDoc/getTOpsDocTypeList",
|
|
130
|
+
treeKey: {
|
|
131
|
+
idKey: "fdId",
|
|
132
|
+
parentKey: "fdParentId",
|
|
133
|
+
childrenKey: "children",
|
|
134
|
+
label: "fdName"
|
|
135
|
+
},
|
|
136
|
+
success: (response) => {
|
|
137
|
+
this.getDocType();
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
editOptions: {
|
|
141
|
+
url: "/apd/ops/OpsDoc/getTOpsDocTypeByFdId",
|
|
142
|
+
data: (node) => {
|
|
143
|
+
return {
|
|
144
|
+
fdId: node.fdId
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
success: (response) => {
|
|
148
|
+
this.tOpsDocTypeForm= response.data;
|
|
149
|
+
},
|
|
150
|
+
error() {},
|
|
151
|
+
},
|
|
152
|
+
insertUrl: "/apd/ops/OpsDoc/insertTOpsDocType",
|
|
153
|
+
insertData: () => {
|
|
154
|
+
return this.tOpsDocTypeForm
|
|
155
|
+
},
|
|
156
|
+
updateUrl: "/apd/ops/OpsDoc/updateTOpsDocType",
|
|
157
|
+
updateData: () => {
|
|
158
|
+
return this.tOpsDocTypeForm
|
|
159
|
+
},
|
|
160
|
+
deleteUrl: "/apd/ops/OpsDoc/deleteTOpsDocTypeByFdId",
|
|
161
|
+
deleteData: (node) => {
|
|
162
|
+
return {
|
|
163
|
+
fdId: node.fdId
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
updateSortUrl: '/apd/ops/OpsDoc/updateTOpsDocTypeSort',
|
|
167
|
+
updateSortListUrl: '/apd/ops/OpsDoc/updateTOpsDocTypeSortList',
|
|
168
|
+
resetForm: () => {
|
|
169
|
+
this.tOpsDocTypeForm = {
|
|
170
|
+
fdId: '',
|
|
171
|
+
fdParentId: '',
|
|
172
|
+
fdName: '',
|
|
173
|
+
fdType: '',
|
|
174
|
+
fdLayout: '',
|
|
175
|
+
fdSort: '',
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
afterOpenAddDialog: (node) => {
|
|
179
|
+
this.tOpsDocTypeForm.fdParentId = this.selectedDocTypeId;
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
return treeOptions;
|
|
184
|
+
},
|
|
185
|
+
copyNode(){
|
|
186
|
+
if (this.selectedDocTypeId == null || this.selectedDocTypeId == '') {
|
|
187
|
+
this.$message.error("请选择需要复制的节点");
|
|
188
|
+
return
|
|
189
|
+
}
|
|
190
|
+
this.$request({
|
|
191
|
+
url: '/apd/ops/OpsDoc/copyDoc',
|
|
192
|
+
method: 'post',
|
|
193
|
+
data: {
|
|
194
|
+
id: this.selectedDocTypeId
|
|
195
|
+
}
|
|
196
|
+
}).then(response => {
|
|
197
|
+
this.$message.success("复制成功");
|
|
198
|
+
this.$refs.docTypeTree.reLoadTreeData();
|
|
199
|
+
})
|
|
200
|
+
},
|
|
201
|
+
getDocType() {
|
|
202
|
+
this.$request({
|
|
203
|
+
url: '/apd/ops/OpsDoc/getDocTypeList',
|
|
204
|
+
method: 'post',
|
|
205
|
+
data: {}
|
|
206
|
+
}).then(response => {
|
|
207
|
+
this.typeList = response.data
|
|
208
|
+
})
|
|
209
|
+
},
|
|
210
|
+
getDocText() {
|
|
211
|
+
this.loading = true;
|
|
212
|
+
this.$request({
|
|
213
|
+
url: '/apd/ops/OpsDoc/getDocText',
|
|
214
|
+
method: 'post',
|
|
215
|
+
data: {
|
|
216
|
+
id: this.selectedDocTypeId
|
|
217
|
+
}
|
|
218
|
+
}).then(response => {
|
|
219
|
+
this.$refs.richEditorRef.setContent(response.data);
|
|
220
|
+
this.oldEditorValue = response.data
|
|
221
|
+
}).finally(() => {
|
|
222
|
+
this.loading = false;
|
|
223
|
+
})
|
|
224
|
+
},
|
|
225
|
+
saveDocText(value) {
|
|
226
|
+
this.loading = true;
|
|
227
|
+
this.$request({
|
|
228
|
+
url: '/apd/ops/OpsDoc/saveDocText',
|
|
229
|
+
method: 'post',
|
|
230
|
+
data: {
|
|
231
|
+
typeId: this.selectedDocTypeId,
|
|
232
|
+
text: value
|
|
233
|
+
}
|
|
234
|
+
}).then(response => {
|
|
235
|
+
this.$message.success("保存成功");
|
|
236
|
+
this.oldEditorValue = this.$refs.richEditorRef.getContent();
|
|
237
|
+
}).finally(() => {
|
|
238
|
+
this.loading = false;
|
|
239
|
+
})
|
|
240
|
+
},
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
</script>
|
|
244
|
+
|
|
245
|
+
<style scoped>
|
|
246
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-pack-center flex-direction-column"
|
|
3
|
+
style="height: 100%;background-color: #E9ECF1;">
|
|
4
|
+
<div class="dev-header flex flex-pack-justify flex-align-center">
|
|
5
|
+
<operate-panel/>
|
|
6
|
+
</div>
|
|
7
|
+
<keep-alive>
|
|
8
|
+
<component :is="currentDesignPanel" class="flex-1 dev-main"/>
|
|
9
|
+
</keep-alive>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import OperatePanel from './../OperatePanel'
|
|
15
|
+
import ApiPanel from './../ApiPanel'
|
|
16
|
+
import ConfigPanel from './../ConfigPanel'
|
|
17
|
+
import OpsDoc from './../OpsDoc'
|
|
18
|
+
import opsStore from './opsStore'
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'Ops',
|
|
22
|
+
components: {
|
|
23
|
+
OperatePanel,
|
|
24
|
+
ApiPanel,
|
|
25
|
+
ConfigPanel,
|
|
26
|
+
OpsDoc,
|
|
27
|
+
},
|
|
28
|
+
store: opsStore,
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
ctnLoading: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
created() {
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
// store数据修改,itemObj对应修改
|
|
38
|
+
currentComps() {
|
|
39
|
+
return this.$store.state.currentComps
|
|
40
|
+
},
|
|
41
|
+
currentDesignPanel() {
|
|
42
|
+
return this.$store.state.tempData.currentDesignPanel
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
<style scoped>
|
|
52
|
+
.dev-header {
|
|
53
|
+
height: 40px;
|
|
54
|
+
background-color: #3D76D3;
|
|
55
|
+
color: white;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dev-main {
|
|
59
|
+
overflow: auto;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Vuex from 'vuex'
|
|
2
|
+
|
|
3
|
+
const apDevStore = new Vuex.Store({
|
|
4
|
+
state: {
|
|
5
|
+
tempData: {
|
|
6
|
+
copyItem: {},
|
|
7
|
+
currentDesignPanel: 'api-panel'
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
strict: true,
|
|
11
|
+
getters: {
|
|
12
|
+
},
|
|
13
|
+
mutations: {
|
|
14
|
+
// 更新当前设计的页面
|
|
15
|
+
updateCurrentDesignPanel(state, param) {
|
|
16
|
+
state.tempData.currentDesignPanel = param
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export default apDevStore
|