ap-dev 1.1.12 → 1.1.13

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.
@@ -271,7 +271,7 @@ toolbarBtn: ["add", "edit", "del", "cancel", "refresh", "save", "separator",
271
271
  default: '无',
272
272
  memo: '添加行时对象的默认值。<br>一对象:默认值。<br>二、方法:()方法返回默认值<br><span class="api-memo">注:和列的addDefaultValue效果相同,主要处理页面不需要显示的字段的默认值。</span>',
273
273
  code: '<span class="api-code">// 1、对象形式:添加行的fdDeleted默认为0 <br>addDefaultObj: {fdDeleted:0}' +
274
- '<br>// 2、方法形式:动态返回添加行的默认值 <br>addDefaultObj: () => {fdDeleted:0}</span>'
274
+ '<br>// 2、方法形式:动态返回添加行的默认值 <br>addDefaultObj: () => { return {fdDeleted:0} }</span>'
275
275
  }
276
276
  ]
277
277
  const gridAttrData_col = [
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <ap-container>
3
+ <ap-main margin="1111">
4
+ <div v-if="!showPage">
5
+ <el-input v-model="secretKey" placeholder="请输入授权秘钥!" show-password style="width: 200px"></el-input>
6
+ <el-button type="primary" @click="checkPageAuth">确定</el-button>
7
+ </div>
8
+ <ap-table v-if="showPage" ref="tDevDbSourceRef" :options.sync="tDevDbSourceOpt"></ap-table>
9
+ </ap-main>
10
+ </ap-container>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'DevDbSource',
16
+ data() {
17
+ let columns = [
18
+ {
19
+ prop: 'fdName',
20
+ label: '连接名',
21
+ type: 'input',
22
+ width: 150,
23
+ }, {
24
+ prop: 'fdDbName',
25
+ label: '数据库名称',
26
+ type: 'input',
27
+ width: 100,
28
+ }, {
29
+ prop: 'fdUrl',
30
+ label: '数据库地址',
31
+ type: 'input',
32
+ minWidth: 200,
33
+ showOverflowTooltip: true
34
+ }, {
35
+ prop: 'fdUserName',
36
+ label: '数据库用户名',
37
+ type: 'input',
38
+ width: 100,
39
+ }, {
40
+ prop: 'fdPassword',
41
+ label: '数据库密码',
42
+ type: 'input',
43
+ width: 100,
44
+ html: function (value, row) {
45
+ return "******";
46
+ }
47
+ }, {
48
+ prop: 'fdComment',
49
+ label: '备注',
50
+ type: 'input',
51
+ minWidth: 150,
52
+ }, {
53
+ prop: "fdDisabled",
54
+ label: "是否有效",
55
+ type: "select",
56
+ width: 100,
57
+ selectOptions: [{label: "失效", value: 1}, {label: "有效", value: 0}],
58
+ addDefaultValue: 0,
59
+ align: "center",
60
+ html: function (value, row) {
61
+ if (value == 1) {
62
+ return '<div class="ap-tag-danger">失效</div>'
63
+ } else if (value == 0) {
64
+ return '<div class="ap-tag-success">有效</el-tag>';
65
+ }
66
+ }
67
+ },
68
+ ];
69
+ let tableOpt = {
70
+ title: "数据源管理",
71
+ columns: columns,
72
+ editPk: "fdId", //默认fdId
73
+ deletePk: "fdId", // 默认fdId
74
+ dataUrl: "/apd/db/TDevDbSource/getTDevDbSourceGridList",
75
+ saveUrl: "/apd/db/TDevDbSource/saveTDevDbSourceGridData",
76
+ deleteUrl: "/apd/db/TDevDbSource/deleteTDevDbSourceGridData",
77
+ toolbarBtn: ["add", "edit", "del", "cancel", "refresh", "save"],
78
+ initData: true, // 默认false
79
+ params: {}
80
+ };
81
+ return {
82
+ tDevDbSourceOpt: tableOpt,
83
+ secretKey: '',
84
+ showPage: false
85
+ }
86
+ },
87
+ methods: {
88
+ checkPageAuth() {
89
+ this.$request({
90
+ url: '/apd/db/TDevDbAuth/checkPageAuth',
91
+ method: 'post',
92
+ data: {
93
+ secretKey: this.secretKey
94
+ }
95
+ }).then(response => {
96
+ if (response.data) {
97
+ this.showPage = true;
98
+ } else {
99
+ this.$message.error("授权秘钥错误!")
100
+ }
101
+ })
102
+ }
103
+ }
104
+ }
105
+ </script>
106
+
107
+ <style scoped>
108
+ </style>
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <ap-container>
3
+ <ap-container>
4
+ <template v-if="!showPage">
5
+ <ap-main margin="1111">
6
+ <div>
7
+ <el-input v-model="secretKey" placeholder="请输入授权秘钥!" show-password style="width: 200px"></el-input>
8
+ <el-button type="primary" @click="checkPageAuth">确定</el-button>
9
+ </div>
10
+ </ap-main>
11
+ </template>
12
+ <template v-if="showPage">
13
+ <ap-aside width="50%" margin="1111">
14
+ <ap-table ref="tDevDbUserRef" :options.sync="tDevDbUserOpt"></ap-table>
15
+ </ap-aside>
16
+ <ap-split-panel></ap-split-panel>
17
+ <ap-main width="50%" margin="1110">
18
+ <ap-table ref="tDevDbUserSourceRef" :options.sync="tDevDbUserSourceOpt"></ap-table>
19
+ </ap-main>
20
+ </template>
21
+ </ap-container>
22
+ </ap-container>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ name: 'TDevDbUser',
28
+ data() {
29
+ let tDevDbUserCols = [
30
+ {
31
+ prop: 'fdUserName',
32
+ label: '用户名',
33
+ type: 'input',
34
+ width: '200px'
35
+ },
36
+ ];
37
+ let tDevDbUserOpt = {
38
+ title: "数据源用户",
39
+ columns: tDevDbUserCols,
40
+ editPk: "fdId", //默认fdId
41
+ deletePk: "fdId", // 默认fdId
42
+ dataUrl: "/apd/db/TDevDbUser/getTDevDbUserGridList",
43
+ saveUrl: "/apd/db/TDevDbUser/saveTDevDbUserGridData",
44
+ deleteUrl: "/apd/db/TDevDbUser/deleteTDevDbUserGridData",
45
+ toolbarBtn: ["add", "edit", "del", "refresh", "save"],
46
+ initData: true, // 默认false
47
+ rowClickEvent: (row, column, event) => {
48
+ this.selectRowId = row.fdId;
49
+ this.selectUserName = row.fdUserName;
50
+ this.tDevDbUserSourceOpt.title = `【${row.fdUserName}】数据源列表`;
51
+ // 点击行刷新右侧表
52
+ this.$refs.tDevDbUserSourceRef.refresh();
53
+ },
54
+ params: {}
55
+ };
56
+ let tDevDbUserSourceCols = [
57
+ {
58
+ prop: 'fdSourceId',
59
+ label: '数据源',
60
+ type: 'select',
61
+ selectOptionsKey: {label: "fdName", value: "fdId"},
62
+ selectOptionsRemote: "sourceList",
63
+ width: '250px'
64
+ },
65
+ ];
66
+ let tDevDbUserSourceOpt = {
67
+ title: "数据源列表",
68
+ columns: tDevDbUserSourceCols,
69
+ editPk: "fdId", //默认fdId
70
+ deletePk: "fdId", // 默认fdId
71
+ dataUrl: "/apd/db/TDevDbUserSource/getTDevDbUserSourceGridList",
72
+ saveUrl: "/apd/db/TDevDbUserSource/saveTDevDbUserSourceGridData",
73
+ deleteUrl: "/apd/db/TDevDbUserSource/deleteTDevDbUserSourceGridData",
74
+ toolbarBtn: ["add", "edit", "del", "refresh", "save"],
75
+ initData: false, // 默认false
76
+ addDefaultObj: () => {
77
+ return {
78
+ fdDbUserId: this.selectRowId
79
+ }
80
+ },
81
+ params: () => {
82
+ return {
83
+ dbUserId: this.selectRowId
84
+ }
85
+ }
86
+ };
87
+ return {
88
+ secretKey: '',
89
+ showPage: false,
90
+ selectRowId: '', // 左侧表点击行
91
+ selectUserName: '',
92
+ tDevDbUserOpt: tDevDbUserOpt,
93
+ tDevDbUserSourceOpt: tDevDbUserSourceOpt,
94
+ }
95
+ },
96
+ methods: {
97
+ checkPageAuth() {
98
+ this.$request({
99
+ url: '/apd/db/TDevDbAuth/checkPageAuth',
100
+ method: 'post',
101
+ data: {
102
+ secretKey: this.secretKey
103
+ }
104
+ }).then(response => {
105
+ if (response.data) {
106
+ this.showPage = true;
107
+ } else {
108
+ this.$message.error("授权秘钥错误!")
109
+ }
110
+ })
111
+ }
112
+ }
113
+ }
114
+ </script>
115
+
116
+ <style scoped>
117
+ </style>
@@ -10,9 +10,9 @@
10
10
  <el-form-item label="数据库" prop="fdSourceId">
11
11
  <el-select v-model="configForm.fdSourceId" placeholder="请选择数据库" filterable>
12
12
  <el-option v-for="item in dbSourceList"
13
- :key="item.fdSourceId"
13
+ :key="item.fdId"
14
14
  :label="item.fdName"
15
- :value="item.fdSourceId"/>
15
+ :value="item.fdId"/>
16
16
  </el-select>
17
17
  </el-form-item>
18
18
 
@@ -3,21 +3,26 @@
3
3
  <el-tab-pane label="我的配置" style="height: 100%;">
4
4
  <dev-my-config/>
5
5
  </el-tab-pane>
6
+ <el-tab-pane label="数据源管理" style="height: 100%;">
7
+ <dev-db-source/>
8
+ </el-tab-pane>
6
9
  <el-tab-pane label="数据源授权" style="height: 100%;">
7
- <dev-db-auth/>
10
+ <dev-db-user-source/>
8
11
  </el-tab-pane>
9
12
  </el-tabs>
10
13
  </template>
11
14
 
12
15
  <script>
13
- import DevDbAuth from './DevDbAuth'
14
16
  import DevMyConfig from './DevMyConfig'
17
+ import DevDbSource from './DevDbSource'
18
+ import DevDbUserSource from './DevDbUserSource'
15
19
 
16
20
  export default {
17
21
  name: 'ConfigPanel',
18
22
  components: {
19
- DevDbAuth,
20
- DevMyConfig
23
+ DevMyConfig,
24
+ DevDbSource,
25
+ DevDbUserSource
21
26
  }
22
27
  }
23
28
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ap-dev",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "===== ap-dev =====",
5
5
  "author": "xiexinbin",
6
6
  "email": "876818817@qq.com",
@@ -1,71 +0,0 @@
1
- <template>
2
- <ap-container>
3
- <ap-main margin="1111">
4
- <div v-if="!showPage">
5
- <el-input v-model="secretKey" placeholder="请输入授权秘钥!" show-password style="width: 200px"></el-input>
6
- <el-button type="primary" @click="checkPageAuth">确定</el-button>
7
- </div>
8
- <ap-table v-if="showPage" ref="tDevDbAuthRef" :options.sync="tDevDbAuthOpt"></ap-table>
9
- </ap-main>
10
- </ap-container>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: 'DevDbAuth',
16
- data() {
17
- let columns = [
18
- {
19
- prop: 'fdUserName',
20
- label: '用户登录名',
21
- type: 'input'
22
- }, {
23
- prop: 'fdSourceId',
24
- label: '数据源',
25
- type: 'select',
26
- selectOptionsKey: {label: "fdName", value: "fdSourceId"},
27
- selectOptionsRemote: 'dbList'
28
- }
29
- ];
30
- let tableOpt = {
31
- title: "数据源授权",
32
- columns: columns,
33
- editPk: "fdId", //默认fdId
34
- deletePk: "fdId", // 默认fdId
35
- dataUrl: "/apd/db/TDevDbAuth/getTDevDbAuthGridList",
36
- saveUrl: "/apd/db/TDevDbAuth/saveTDevDbAuthGridData",
37
- deleteUrl: "/apd/db/TDevDbAuth/deleteTDevDbAuthGridData",
38
- toolbarBtn: ["add", "edit", "del", "cancel", "refresh", "save"],
39
- initData: true, // 默认false
40
- params: () => {
41
- return {secretKey: this.secretKey}
42
- }
43
- };
44
- return {
45
- tDevDbAuthOpt: tableOpt,
46
- secretKey: '',
47
- showPage: false
48
- }
49
- },
50
- methods: {
51
- checkPageAuth() {
52
- this.$request({
53
- url: '/apd/db/TDevDbAuth/checkPageAuth',
54
- method: 'post',
55
- data: {
56
- secretKey: this.secretKey
57
- }
58
- }).then(response => {
59
- if (response.data) {
60
- this.showPage = true;
61
- } else {
62
- this.$message.error("授权秘钥错误!")
63
- }
64
- })
65
- }
66
- }
67
- }
68
- </script>
69
-
70
- <style scoped>
71
- </style>