ap-dev 1.2.13 → 1.2.15

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,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>
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ap-dev",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "===== ap-dev =====",
5
5
  "author": "xiexinbin",
6
6
  "email": "876818817@qq.com",