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.
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div style="height: 100%">
3
+ <el-table :data="data" border class="api-table-class" :span-method="spanMethod" height="100%">
4
+ <template v-for="col in columns">
5
+ <el-table-column :prop="col.prop" :label="col.label" :width="col.width" :min-width="col.minWidth" class-name="api-table-cell">
6
+ <template slot-scope="scope">
7
+ <div v-html="scope.row[scope.column.property]" />
8
+ </template>
9
+ </el-table-column>
10
+ </template>
11
+ </el-table>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ name: 'ApiTable',
18
+ props: ['data', 'columns', 'spanMethod'],
19
+ methods: {
20
+ formatCol(row, column, cellValue, index) {
21
+ return cellValue
22
+ }
23
+ }
24
+ }
25
+ </script>
26
+
27
+ <style scoped>
28
+ .api-table-class {
29
+ width: 100%
30
+ }
31
+
32
+ .api-table-class /deep/ th, .api-table-class /deep/ td {
33
+ padding: 2px;
34
+ }
35
+
36
+ /*模式式样覆盖:垂直居上*/
37
+ .el-table /deep/ .api-table-cell {
38
+ vertical-align: top
39
+ }
40
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div>
3
+ <h2>
4
+ <slot />
5
+ </h2>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ name: 'ApiTittle1'
12
+ }
13
+ </script>
14
+
15
+ <style scoped>
16
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div>
3
+ <h3>
4
+ <slot />
5
+ </h3>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ name: 'ApiTittle2'
12
+ }
13
+ </script>
14
+
15
+ <style scoped>
16
+ </style>
@@ -0,0 +1,5 @@
1
+ export { default as ApiCode } from './ApiCode'
2
+ export { default as ApiTittle1 } from './ApiTittle1'
3
+ export { default as ApiTittle2 } from './ApiTittle2'
4
+ export { default as ApiContent } from './ApiContent'
5
+ export { default as ApiTable } from './ApiTable'
@@ -0,0 +1,265 @@
1
+ <template>
2
+ <ap-container>
3
+ <ap-aside margin="1111" style="width: 235px">
4
+ <ap-aside-tree :options.sync="treeOptions">
5
+ <span slot="tree" slot-scope="scope">
6
+ <span style="font-size: 12px;">{{ scope.data.fdName }}</span>
7
+ </span>
8
+ </ap-aside-tree>
9
+ </ap-aside>
10
+ <ap-split-panel/>
11
+ <ap-main margin="1110" v-loading="loading">
12
+ <div v-if="showCustom">
13
+ <component :is="customComponent" />
14
+ </div>
15
+ <ap-doc v-if="showDoc" v-model="doc"></ap-doc>
16
+ <el-tabs v-if="showTabs" v-model="tabActiveName" tabPosition="left" class="api-tabs sap-dev-api" @tab-click="clickTabEvent">
17
+ <template v-for="(item,index) in tabs">
18
+ <el-tab-pane :label="item.fdName" :name="getTabName(item)" :id="item.fdId" class="api-tab">
19
+ <el-tabs v-if="showTopTabs" v-model="toptabActiveName" type="card" @tab-click="clickTopTabEvent">
20
+ <template v-for="(item2,index2) in topTabs">
21
+ <el-tab-pane :label="item2.fdName" :name="getTabName(item2)">
22
+ <ap-doc v-if="!showTopTabsCustom" v-model="doc"></ap-doc>
23
+ <component v-else :is="customComponent" />
24
+ </el-tab-pane>
25
+ </template>
26
+ </el-tabs>
27
+
28
+ <div v-else>
29
+ <ap-doc v-if="!showTabsCustom" v-model="doc"></ap-doc>
30
+ <component v-else :is="customComponent" />
31
+ </div>
32
+ </el-tab-pane>
33
+ </template>
34
+ </el-tabs>
35
+ </ap-main>
36
+ </ap-container>
37
+ </template>
38
+
39
+ <script>
40
+ // 批量导入modules下的组件
41
+ const allComponents = require.context('./modules', false, /\.vue$/)
42
+ const apiComponents = {}
43
+ allComponents.keys().forEach(fileName => {
44
+ const comp = allComponents(fileName)
45
+ apiComponents[fileName.replace(/^\.\/(.*)\.\w+$/, '$1')] = comp.default
46
+ })
47
+
48
+ export default {
49
+ name: 'ApiPanel',
50
+ components: apiComponents,
51
+ data() {
52
+ return {
53
+ // ----- 左侧树 -----
54
+ treeOptions: this.getTreeOption(),
55
+ selectedDocTypeId: "",
56
+ // ----- 右侧 -----
57
+ loading: false,
58
+ customComponent: "",
59
+ showCustom: false,
60
+ showDoc: false,
61
+ showTabs: false,
62
+ showTabsCustom: false,
63
+ showTopTabs: false,
64
+ showTopTabsCustom: false,
65
+ tabActiveName: "",
66
+ tabs: [],
67
+ doc: "",
68
+ currentComponent: 'ApiLog',
69
+ // ----- 右上侧 -----
70
+ toptabActiveName: null,
71
+ topTabs: [], // 左侧顶部
72
+ }
73
+ },
74
+ methods: {
75
+ // 左侧树:配置
76
+ getTreeOption() {
77
+ let treeOptions = {
78
+ showTitle: false,
79
+ onClick: (data, node, comp) => {
80
+ this.scrollTop();
81
+ this.selectedDocTypeId = data.fdId;
82
+ this.hideContentFn();
83
+ // 自定义组件
84
+ let customComponent = data.fdCustom;
85
+ if(customComponent != null && customComponent != ""){
86
+ this.customComponent = customComponent;
87
+ this.showCustomFn();
88
+
89
+ return;
90
+ }
91
+ // 单页
92
+ if (data.fdType == 2 || data.fdLayout == "one") {
93
+ this.showDocFn();
94
+ this.getDocText();
95
+ return;
96
+ }
97
+ // 左侧
98
+ this.getDocGroup();
99
+ },
100
+ loadOptions: {
101
+ url: "/apd/ops/OpsDoc/getOpsDocApiList",
102
+ treeKey: {
103
+ idKey: "fdId",
104
+ parentKey: "fdParentId",
105
+ childrenKey: "children",
106
+ label: "fdName"
107
+ },
108
+ success: (response) => {
109
+ },
110
+ },
111
+ afterOpenAddDialog: (node) => {
112
+ },
113
+ };
114
+ return treeOptions;
115
+ },
116
+ getDocGroup() {
117
+ this.loading = true;
118
+ this.showTabsFn();
119
+ this.$request({
120
+ url: '/apd/ops/OpsDoc/getDocGroup',
121
+ method: 'post',
122
+ data: {
123
+ id: this.selectedDocTypeId
124
+ }
125
+ }).then(response => {
126
+ this.tabs = response.data
127
+ }).finally(() => {
128
+ this.loading = false;
129
+ })
130
+ },
131
+ getDocText() {
132
+ this.loading = true;
133
+ this.$request({
134
+ url: '/apd/ops/OpsDoc/getDocText',
135
+ method: 'post',
136
+ data: {
137
+ id: this.selectedDocTypeId
138
+ }
139
+ }).then(response => {
140
+ this.doc = response.data
141
+ }).finally(() => {
142
+ this.loading = false;
143
+ })
144
+ },
145
+ getTabName(obj){
146
+ // 分组
147
+ if (obj.fdType == 1) {
148
+ return '%%' + obj.fdId;
149
+ }
150
+ // 自定义组件
151
+ if( obj.fdCustom != null && obj.fdCustom != '' && obj.fdCustom != undefined ) {
152
+ return '##' + obj.fdCustom;
153
+ } else {
154
+ // 文档Id
155
+ return obj.fdId;
156
+ }
157
+ },
158
+ clickTabEvent(tab) {
159
+ this.scrollTop();
160
+ let name = tab._props.name;
161
+ // 左上菜单
162
+ if (name.startsWith('%%')) {
163
+ this.$request({
164
+ url: '/apd/ops/OpsDoc/getDocGroup',
165
+ method: 'post',
166
+ data: {
167
+ id: name.substring(2, name.length)
168
+ }
169
+ }).then(response => {
170
+ this.topTabs = response.data
171
+ })
172
+ this.showTopTabsFn();
173
+ return;
174
+ }
175
+ // 自定义组件
176
+ if (name.startsWith('##')) {
177
+ this.showTabsCustom = true;
178
+ this.showTopTabs = false;
179
+ this.customComponent = name.substring(2, name.length);
180
+ return;
181
+ }
182
+
183
+ // 文档
184
+ this.showTabsCustom = false;
185
+ this.showTopTabs = false;
186
+ this.selectedDocTypeId = name;
187
+ this.getDocText();
188
+
189
+ },
190
+ clickTopTabEvent(tab) {
191
+ this.scrollTop();
192
+ let name = tab._props.name;
193
+ // 自定义组件
194
+ if (name.startsWith('##')) {
195
+ this.showTopTabsCustom = true;
196
+ this.customComponent = name.substring(2, name.length);
197
+ return;
198
+ }
199
+ // 文档
200
+ this.showTopTabsCustom = false;
201
+ this.selectedDocTypeId = name;
202
+ this.getDocText();
203
+ },
204
+ hideContentFn() {
205
+ this.showDoc = false;
206
+ this.showTabs = false;
207
+ this.showTopTabs = false;
208
+ this.doc = "";
209
+ this.tabActiveName = "";
210
+ },
211
+ showCustomFn() {
212
+ this.showCustom = true;
213
+ this.showDoc = false;
214
+ this.showTabs = false;
215
+ this.showTopTabs = false;
216
+ },
217
+ showDocFn() {
218
+ this.showCustom = false;
219
+ this.showDoc = true;
220
+ this.showTabs = false;
221
+ this.showTopTabs = false;
222
+ },
223
+ showTabsFn() {
224
+ this.showCustom = false;
225
+ this.showDoc = false;
226
+ this.showTabs = true;
227
+ this.showTopTabs = false;
228
+ },
229
+ showTopTabsFn() {
230
+ this.showCustom = false;
231
+ this.showDoc = false;
232
+ this.showTabs = true;
233
+ this.showTopTabs = true;
234
+ },
235
+ scrollTop(){
236
+ // 回到顶部
237
+ let ctn = document.getElementsByClassName('el-tabs__content')
238
+ if (ctn != null && ctn.length <1) {
239
+ return;
240
+ }
241
+ ctn[0].scrollTop = 0;
242
+ }
243
+ }
244
+ }
245
+ </script>
246
+
247
+ <style scoped>
248
+ .api-tabs {
249
+ display: flex;
250
+ height: 100%;
251
+ }
252
+
253
+ .api-tabs /deep/ .el-tabs__content {
254
+ flex: 1;
255
+ overflow: scroll;
256
+ }
257
+
258
+ .api-tabs /deep/ .el-tabs__item{
259
+ padding: 0 15px 0 15px;
260
+ }
261
+
262
+ .api-tabs /deep/ .el-tabs__item {
263
+ text-align: left;
264
+ }
265
+ </style>
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div>
3
+ <h3>ABAP · 开发文档</h3>
4
+
5
+ 请选择需要查看的API!
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ name: 'ApiDefault'
12
+ }
13
+ </script>
14
+
15
+ <style scoped>
16
+
17
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div>
3
+ <api-tittle1><i class="el-icon-guide"/> 2022-11-22 <span class="log-version">1.0.0</span></api-tittle1>
4
+ <h4>SAP ABAP开发平台1.0</h4>
5
+ 1、ABAP开发平台1.0正式发布<br>
6
+ <div class="ap-split-line"/>
7
+
8
+ <api-tittle1><i class="el-icon-guide"/> 2022-11-01 <span class="log-version">0.0.1</span></api-tittle1>
9
+ <h4>SAP ABAP开发平台</h4>
10
+ 1、开发平台初始化构建<br>
11
+ <div class="ap-split-line"/>
12
+
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import {ApiCode, ApiContent, ApiTable, ApiTittle1, ApiTittle2} from './../components'
18
+
19
+ export default {
20
+ name: 'ApiLog',
21
+ components: {
22
+ ApiTable, ApiCode, ApiTittle1, ApiContent, ApiTittle2
23
+ }
24
+ }
25
+ </script>
26
+
27
+ <style scoped>
28
+ .log-version {
29
+ margin-left: 30px;
30
+ }
31
+ </style>
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <ap-container>
3
+ <ap-header margin="1111">
4
+ <el-form ref="searchForm" :model="searchForm" :rules="searchFormRules"
5
+ :inline="true" class="layout-header-form">
6
+ <el-form-item label="搜索:" class="layout-header-form-item" prop="likeStr">
7
+ <el-input v-model="searchForm.likeStr" placeholder="名称"></el-input>
8
+ </el-form-item>
9
+ </el-form>
10
+ <el-button type="primary" @click="searchEvent">查询</el-button>
11
+ </ap-header>
12
+ <ap-main margin="0111">
13
+ <ap-table ref="tDocHistoryRef" :options.sync="docHistoryOpt">
14
+ <template #operate="slotProps">
15
+ <div class="ap-tag" @click="showDetail(slotProps.rowData.fdId)">文档预览</div>
16
+ </template>
17
+ </ap-table>
18
+ </ap-main>
19
+ <el-dialog
20
+ title="文档预览"
21
+ :visible.sync="showDialog" style="height: 100%">
22
+ <ap-doc v-model="docText" style="height: 400px;overflow: scroll;">
23
+
24
+ </ap-doc>
25
+ </el-dialog>
26
+ </ap-container>
27
+ </template>
28
+
29
+ <script>
30
+ export default {
31
+ name: 'OpsDocHistory',
32
+ data() {
33
+ let columns = [
34
+ {
35
+ prop: 'fdTypeId',
36
+ label: '文档类型Id',
37
+ type: 'input',
38
+ width: '250px'
39
+ } , {
40
+ prop: 'fdName',
41
+ label: '文档名称',
42
+ type: 'input'
43
+ }, {
44
+ prop: 'fdDate',
45
+ label: '文档更新时间',
46
+ type: 'datePicker',
47
+ align:"center",
48
+ datePickerFormat: 'yyyy-MM-dd HH:mm',
49
+ width: '130px'
50
+ }, {
51
+ prop: 'fdBackupDate',
52
+ label: '备份时间',
53
+ type: 'datePicker',
54
+ datePickerFormat: 'yyyy-MM-dd HH:mm',
55
+ align:"center",
56
+ width: '130px'
57
+ } , {
58
+ prop: 'fdName',
59
+ label: '检查信息',
60
+ type: 'input',
61
+ html: (value, row) => {
62
+ if (row.currentName == null) {
63
+ return `<div class="ap-color-red">当前文档已删除</div>`;
64
+ }
65
+ if (row.currentName != row.fdName) {
66
+ return `<div class="ap-color-red">最新文档名称:${row.currentName}</div>`;
67
+ }
68
+ return `<div class="ap-color-green">正常</div>`;
69
+ }
70
+ }, {
71
+ prop: 'operate',
72
+ label: '操作',
73
+ type: 'slot',
74
+ slot: "operate",
75
+ align:"center",
76
+ width: '120px',
77
+ }
78
+ ];
79
+ let tableOpt = {
80
+ title: "文档历史表",
81
+ columns: columns,
82
+ dataUrl: "/apd/ops/TOpsDocHistory/getTOpsDocHistoryGridList",
83
+ toolbarBtn: [{btnType: "primary", text: "备份文档", icon: "el-icon-transfer", onClick: this.backupDoc}, "refresh"],
84
+ initData: true, // 默认false
85
+ showSelection: false,
86
+ params: () => {
87
+ return {
88
+ likeStr: this.searchForm.likeStr
89
+ }
90
+ }
91
+ };
92
+ return {
93
+ docHistoryOpt: tableOpt,
94
+ searchForm: {
95
+ likeStr: ""
96
+ },
97
+ searchFormRules: {
98
+ likeStr: [{min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur'}]
99
+ },
100
+ showDialog: false,
101
+ docText: ""
102
+ }
103
+ },
104
+ methods: {
105
+ // 查询
106
+ searchEvent() {
107
+ // 表单rules认证
108
+ this.$refs.searchForm.validate((valid) => {
109
+ if (!valid) {
110
+ this.$message.error('搜索条件格式不正确!');
111
+ return false;
112
+ }
113
+ this.$refs.tDocHistoryRef.refresh();
114
+ });
115
+ },
116
+ backupDoc() {
117
+ this.$message.warning("开始备份...");
118
+ this.$request({
119
+ url: "/apd/ops/TOpsDocHistory/backupOpsDoc",
120
+ method: 'post',
121
+ data: {}
122
+ }).then(response => {
123
+ this.$message.success(response.data);
124
+ this.$refs.tDocHistoryRef.refresh();
125
+ })
126
+ },
127
+ showDetail(id) {
128
+ this.showDialog = true;
129
+ this.docText = "...";
130
+ this.$request({
131
+ url: "/apd/ops/TOpsDocHistory/getTOpsDocHistoryByFdId",
132
+ method: 'post',
133
+ data: {
134
+ fdId: id
135
+ }
136
+ }).then(response => {
137
+ this.docText = response.data.fdText;
138
+ })
139
+ }
140
+ }
141
+ }
142
+ </script>
143
+
144
+ <style scoped>
145
+ </style>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <el-tabs v-model="activeTab" @tab-click="handleClick" tab-position="left" class="config-tab" style="height: 100%;">
3
+ <el-tab-pane label="文档历史表" name="status1" style="height: 100%;">
4
+ <ops-doc-history v-if="status1"/>
5
+ </el-tab-pane>
6
+ </el-tabs>
7
+ </template>
8
+
9
+ <script>
10
+ import OpsDocHistory from './OpsDocHistory'
11
+
12
+ export default {
13
+ name: 'ConfigPanel',
14
+ components: {
15
+ OpsDocHistory,
16
+ },
17
+ data() {
18
+ return {
19
+ activeTab: 'status1',
20
+ status1: true,
21
+ status2: false,
22
+ }
23
+ },
24
+ methods: {
25
+ handleClick(tab, event) {
26
+ this[tab.name] = true;
27
+ console.log(tab.name);
28
+ },
29
+ }
30
+ }
31
+ </script>
32
+
33
+ <style scoped>
34
+ .config-tab /deep/ .el-tabs__header.is-left {
35
+ margin-right: 0px !important;
36
+ }
37
+
38
+ .config-tab /deep/ .el-tabs__content {
39
+ height: 100% !important;
40
+ }
41
+ </style>
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <div class="flex flex-pack-justify flex-1 ap-dev-operate-panel">
3
+ <div class="flex">
4
+ <div class="ap-dev-tool-item dev-header-logo" @click="currentDesignPanel('api-panel', $event)">
5
+ OPS | 运维平台
6
+ </div>
7
+ <div class="ap-dev-tool-item flex flex-center" @click="currentDesignPanel('ops-doc', $event)">
8
+ <div class="ap-dev-tool-item-icon1">
9
+ <i class="el-icon-education" />
10
+ </div>
11
+ <div class="ap-dev-tool-item-text1">文档</div>
12
+ </div>
13
+ </div>
14
+ <div class="flex">
15
+ <div class="ap-dev-tool-item flex flex-center" @click="currentDesignPanel('config-panel', $event)">
16
+ <div class="ap-dev-tool-item-icon">
17
+ <i class="el-icon-setting"/>
18
+ </div>
19
+ <div class="ap-dev-tool-item-text">配置</div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ import {addClass, removeClass} from 'ap-util/util/StyleUtil'
27
+ import {setCurrentCompanyId} from "ap-util/util/LoginUserUtil";
28
+
29
+ export default {
30
+ name: 'OperatePanel',
31
+ data() {
32
+ return {
33
+ }
34
+ },
35
+ computed: {
36
+ currentModel() {
37
+ return this.$store.state.tempData.currentModel
38
+ }
39
+ },
40
+ methods: {
41
+ currentDesignPanel(type, event) {
42
+ console.log(event);
43
+ let items = document.getElementsByClassName("ap-dev-tool-item-active");
44
+ for (let i = 0; i < items.length; i++) {
45
+ removeClass(items[i],"ap-dev-tool-item-active")
46
+ }
47
+ addClass( event.currentTarget,"ap-dev-tool-item-active");
48
+ this.$store.commit('updateCurrentDesignPanel', type);
49
+ },
50
+ clickEvent(item) {
51
+ this.currentModel = item.name;
52
+ this.$store.commit('updateCurrentModel', item.name);
53
+ },
54
+ showMenu(type){
55
+ return this.currentModel == type;
56
+ }
57
+ }
58
+ }
59
+ </script>
60
+
61
+ <style scoped>
62
+ .dev-header-logo {
63
+ width: 315px;
64
+ height: 100%;
65
+ text-align: center;
66
+ background-color: #497fd5;
67
+ line-height: 40px;
68
+ font-size: 18px !important;
69
+ }
70
+
71
+ .ap-dev-operate-panel {
72
+ height: 100%;
73
+ padding: 0 10px 0 0;
74
+ }
75
+
76
+ .ap-dev-tool-item {
77
+ padding: 2px 14px;
78
+ font-size: 13px;
79
+ text-align: center;
80
+ }
81
+
82
+ .ap-dev-tool-item:hover {
83
+ background-color: #80A9EA;
84
+ cursor: pointer
85
+ }
86
+
87
+ .ap-dev-tool-item-active {
88
+ background-color: #6699ea;
89
+ }
90
+
91
+ .ap-dev-tool-item-text {
92
+ font-size: 10px;
93
+ margin-left: 3px;
94
+ }
95
+
96
+ .ap-dev-tool-item-icon {
97
+ font-size: 16px;
98
+ }
99
+
100
+ .ap-dev-tool-item-icon1 {
101
+ font-size: 18px;
102
+ }
103
+
104
+ .ap-dev-tool-item-text1 {
105
+ font-size: 15px;
106
+ margin-left: 3px;
107
+ color: white;
108
+ }
109
+ </style>