vue2-client 1.5.25 → 1.6.0

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.
@@ -1,231 +1,229 @@
1
- <template>
2
- <a-drawer
3
- title="字典详情"
4
- placement="right"
5
- :width="isMobile ? screenWidth : screenWidth * 0.85"
6
- :visible="visible"
7
- @close="onClose"
8
- >
9
- <a-spin :spinning="loadDetails">
10
- <a-page-header
11
- :title="'字典名称:' + details.f_name"
12
- >
13
- <div class="row">
14
- <div class="content">
15
- <a-descriptions size="small" :column="isMobile ? 1 : 2">
16
- <a-descriptions-item label="字典编号">{{ details.id }}</a-descriptions-item>
17
- <a-descriptions-item label="字典键">{{ details.f_key }}</a-descriptions-item>
18
- <a-descriptions-item label="备注">{{ details.f_remark }}</a-descriptions-item>
19
- <a-descriptions-item label="创建时间">{{ format(details.f_input_date) }}</a-descriptions-item>
20
- </a-descriptions>
21
- </div>
22
- <div class="extra">
23
- <a-row class="status-list">
24
- <a-col :xs="12" :sm="24">
25
- </a-col>
26
- </a-row>
27
- </div>
28
- </div>
29
- <!-- actions -->
30
- <template v-slot:extra>
31
- <a-button-group style="margin-right: 4px;">
32
- <a-button type="dashed" @click="initView" :loading="loadDetails">刷新</a-button>
33
- </a-button-group>
34
- </template>
35
- <template slot="footer">
36
- <a-tabs :default-active-key="tabActiveKey" :activeKey="tabActiveKey" @change="handleTabChange" style="margin-bottom: 23px;">
37
- <template v-for="value in tabList">
38
- <a-tab-pane :key="value.key" :tab="value.tab"/>
39
- </template>
40
- </a-tabs>
41
- <div v-if="!loadDetails">
42
- <template v-if="tabActiveKey === '1'">
43
- <x-form-table
44
- title="字典数据配置"
45
- :fixed-add-form="fixedAddForm"
46
- :fixed-query-form="fixedQueryForm"
47
- queryParamsName="dictionaryValueQueryParams"
48
- @afterSubmit="afterSubmit"
49
- >
50
- </x-form-table>
51
- </template>
52
- </div>
53
- </template>
54
- </a-page-header>
55
- </a-spin>
56
- </a-drawer>
57
- </template>
58
-
59
- <script>
60
- import { DictionaryDetailsViewApi, post } from '@vue2-client/services/api'
61
- import { mapState } from 'vuex'
62
- import { formatDate } from '@vue2-client/utils/util'
63
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
64
-
65
- export default {
66
- name: 'DictionaryDetailsView',
67
- components: {
68
- XFormTable
69
- },
70
- data () {
71
- return {
72
- // 页面宽度
73
- screenWidth: document.documentElement.clientWidth,
74
- // Tab页签
75
- tabActiveKey: '1',
76
- // 字典详情
77
- details: {
78
- id: 0,
79
- f_name: '',
80
- f_key: '',
81
- f_remark: '',
82
- f_input_date: '',
83
- f_state: 0
84
- },
85
- tabList: [
86
- { key: '1', tab: '字典数据' }
87
- ],
88
- // 固定新增数据
89
- fixedAddForm: {},
90
- // 固定查询数据
91
- fixedQueryForm: {},
92
- // 详情加载
93
- loadDetails: true
94
- }
95
- },
96
- mounted () {
97
- this.initView()
98
- },
99
- computed: {
100
- ...mapState('account', { currUser: 'user' }),
101
- ...mapState('setting', ['isMobile'])
102
- },
103
- props: {
104
- id: {
105
- type: String,
106
- required: true
107
- },
108
- visible: {
109
- type: Boolean,
110
- default: false
111
- }
112
- },
113
- methods: {
114
- // 初始化组件
115
- initView () {
116
- this.tabActiveKey = '1'
117
- this.fixedQueryForm['v_f_dictionary_id'] = this.id
118
- this.fixedAddForm['v_f_dictionary_id'] = this.id
119
- this.getDetails(this.id)
120
- },
121
- onClose () {
122
- this.$emit('update:visible', false)
123
- },
124
- // 获取详情信息
125
- getDetails (userId) {
126
- this.loadDetails = true
127
- return post(DictionaryDetailsViewApi.getDictionaryDetails, {
128
- id: userId
129
- })
130
- .then(res => {
131
- this.details = res
132
- this.loadDetails = false
133
- }, err => {
134
- this.loadDetails = false
135
- console.error(err)
136
- })
137
- },
138
- // Tab切换
139
- handleTabChange (key) {
140
- this.tabActiveKey = key
141
- },
142
- // 日期格式化
143
- format (date, format) {
144
- return formatDate(date, format)
145
- },
146
- afterSubmit () {
147
- this.$appdata.load()
148
- }
149
- },
150
- watch: {
151
- 'visible' (val) {
152
- if (val) {
153
- this.initView()
154
- }
155
- }
156
- }
157
- }
158
- </script>
159
-
160
- <style lang="less" scoped>
161
- .business {
162
- color: #ffffff;
163
- }
164
- .business:enabled:hover {
165
- background-color: #85CE61 !important;
166
- border-color: #85CE61 !important;
167
- }
168
- .business:enabled {
169
- background-color: #67c23a;
170
- border-color: #67c23a;
171
- }
172
- .business:disabled {
173
- color: rgba(0, 0, 0, 0.25);
174
- }
175
- .detail-layout {
176
- margin-left: 44px;
177
- }
178
- .text {
179
- color: rgba(0, 0, 0, .45);
180
- }
181
-
182
- .heading {
183
- color: rgba(0, 0, 0, .85);
184
- font-size: 20px;
185
- }
186
-
187
- .no-data {
188
- color: rgba(0, 0, 0, .25);
189
- text-align: center;
190
- line-height: 64px;
191
- font-size: 16px;
192
-
193
- i {
194
- font-size: 24px;
195
- margin-right: 16px;
196
- position: relative;
197
- top: 3px;
198
- }
199
- }
200
-
201
- .mobile {
202
- .detail-layout {
203
- margin-left: unset;
204
- }
205
- .text {
206
-
207
- }
208
- .status-list {
209
- text-align: left;
210
- }
211
- }
212
-
213
- .row {
214
- display: flex;
215
-
216
- .content {
217
- -webkit-box-flex: 1;
218
- flex: auto;
219
- -ms-flex: auto;
220
- }
221
-
222
- .extra {
223
- flex: 0 1 auto;
224
- -webkit-box-flex: 0;
225
- -ms-flex: 0 1 auto;
226
- min-width: 242px;
227
- margin-left: 88px;
228
- text-align: right;
229
- }
230
- }
231
- </style>
1
+ <template>
2
+ <a-drawer
3
+ title="字典详情"
4
+ placement="right"
5
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
6
+ :visible="visible"
7
+ @close="onClose"
8
+ >
9
+ <a-spin :spinning="loadDetails">
10
+ <a-page-header
11
+ :title="'字典名称:' + details.f_name"
12
+ >
13
+ <div class="row">
14
+ <div class="content">
15
+ <a-descriptions size="small" :column="isMobile ? 1 : 2">
16
+ <a-descriptions-item label="字典编号">{{ details.id }}</a-descriptions-item>
17
+ <a-descriptions-item label="字典键">{{ details.f_key }}</a-descriptions-item>
18
+ <a-descriptions-item label="备注">{{ details.f_remark }}</a-descriptions-item>
19
+ <a-descriptions-item label="创建时间">{{ format(details.f_input_date) }}</a-descriptions-item>
20
+ </a-descriptions>
21
+ </div>
22
+ <div class="extra">
23
+ <a-row class="status-list">
24
+ <a-col :xs="12" :sm="24">
25
+ </a-col>
26
+ </a-row>
27
+ </div>
28
+ </div>
29
+ <!-- actions -->
30
+ <template v-slot:extra>
31
+ <a-button-group style="margin-right: 4px;">
32
+ <a-button type="dashed" @click="initView" :loading="loadDetails">刷新</a-button>
33
+ </a-button-group>
34
+ </template>
35
+ <template slot="footer">
36
+ <a-tabs :default-active-key="tabActiveKey" :activeKey="tabActiveKey" @change="handleTabChange" style="margin-bottom: 23px;">
37
+ <template v-for="value in tabList">
38
+ <a-tab-pane :key="value.key" :tab="value.tab"/>
39
+ </template>
40
+ </a-tabs>
41
+ <div>
42
+ <x-form-table
43
+ ref="XFormTable"
44
+ @afterSubmit="afterSubmit">
45
+ </x-form-table>
46
+ </div>
47
+ </template>
48
+ </a-page-header>
49
+ </a-spin>
50
+ </a-drawer>
51
+ </template>
52
+
53
+ <script>
54
+ import { DictionaryDetailsViewApi, post } from '@vue2-client/services/api'
55
+ import { mapState } from 'vuex'
56
+ import { formatDate } from '@vue2-client/utils/util'
57
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
58
+
59
+ export default {
60
+ name: 'DictionaryDetailsView',
61
+ components: {
62
+ XFormTable
63
+ },
64
+ data () {
65
+ return {
66
+ // 页面宽度
67
+ screenWidth: document.documentElement.clientWidth,
68
+ // Tab页签
69
+ tabActiveKey: '1',
70
+ // 字典详情
71
+ details: {
72
+ id: 0,
73
+ f_name: '',
74
+ f_key: '',
75
+ f_remark: '',
76
+ f_input_date: '',
77
+ f_state: 0
78
+ },
79
+ tabList: [
80
+ { key: '1', tab: '字典数据' }
81
+ ],
82
+ // 详情加载
83
+ loadDetails: false
84
+ }
85
+ },
86
+ mounted () {
87
+ this.initView()
88
+ },
89
+ computed: {
90
+ ...mapState('account', { currUser: 'user' }),
91
+ ...mapState('setting', ['isMobile'])
92
+ },
93
+ props: {
94
+ id: {
95
+ type: String,
96
+ required: true
97
+ },
98
+ visible: {
99
+ type: Boolean,
100
+ default: false
101
+ }
102
+ },
103
+ methods: {
104
+ // 初始化组件
105
+ initView () {
106
+ this.tabActiveKey = '1'
107
+ this.getDetails(this.id)
108
+ },
109
+ onClose () {
110
+ this.$emit('update:visible', false)
111
+ },
112
+ // 获取详情信息
113
+ getDetails (userId) {
114
+ this.loadDetails = true
115
+ return post(DictionaryDetailsViewApi.getDictionaryDetails, {
116
+ id: userId
117
+ })
118
+ .then(res => {
119
+ this.details = res
120
+ this.loadDetails = false
121
+ this.$refs.XFormTable.init({
122
+ title: '字典数据配置',
123
+ queryParamsName: 'dictionaryValueQueryParams',
124
+ fixedAddForm: {
125
+ v_f_dictionary_id: this.id
126
+ },
127
+ fixedQueryForm: {
128
+ v_f_dictionary_id: this.id
129
+ }
130
+ })
131
+ }, err => {
132
+ this.loadDetails = false
133
+ console.error(err)
134
+ })
135
+ },
136
+ // Tab切换
137
+ handleTabChange (key) {
138
+ this.tabActiveKey = key
139
+ },
140
+ // 日期格式化
141
+ format (date, format) {
142
+ return formatDate(date, format)
143
+ },
144
+ afterSubmit () {
145
+ this.$appdata.load()
146
+ }
147
+ },
148
+ watch: {
149
+ 'visible' (val) {
150
+ if (val) {
151
+ this.initView()
152
+ }
153
+ }
154
+ }
155
+ }
156
+ </script>
157
+
158
+ <style lang="less" scoped>
159
+ .business {
160
+ color: #ffffff;
161
+ }
162
+ .business:enabled:hover {
163
+ background-color: #85CE61 !important;
164
+ border-color: #85CE61 !important;
165
+ }
166
+ .business:enabled {
167
+ background-color: #67c23a;
168
+ border-color: #67c23a;
169
+ }
170
+ .business:disabled {
171
+ color: rgba(0, 0, 0, 0.25);
172
+ }
173
+ .detail-layout {
174
+ margin-left: 44px;
175
+ }
176
+ .text {
177
+ color: rgba(0, 0, 0, .45);
178
+ }
179
+
180
+ .heading {
181
+ color: rgba(0, 0, 0, .85);
182
+ font-size: 20px;
183
+ }
184
+
185
+ .no-data {
186
+ color: rgba(0, 0, 0, .25);
187
+ text-align: center;
188
+ line-height: 64px;
189
+ font-size: 16px;
190
+
191
+ i {
192
+ font-size: 24px;
193
+ margin-right: 16px;
194
+ position: relative;
195
+ top: 3px;
196
+ }
197
+ }
198
+
199
+ .mobile {
200
+ .detail-layout {
201
+ margin-left: unset;
202
+ }
203
+ .text {
204
+
205
+ }
206
+ .status-list {
207
+ text-align: left;
208
+ }
209
+ }
210
+
211
+ .row {
212
+ display: flex;
213
+
214
+ .content {
215
+ -webkit-box-flex: 1;
216
+ flex: auto;
217
+ -ms-flex: auto;
218
+ }
219
+
220
+ .extra {
221
+ flex: 0 1 auto;
222
+ -webkit-box-flex: 0;
223
+ -ms-flex: 0 1 auto;
224
+ min-width: 242px;
225
+ margin-left: 88px;
226
+ text-align: right;
227
+ }
228
+ }
229
+ </style>
@@ -6,8 +6,7 @@
6
6
  :visible.sync="detailVisible"
7
7
  />
8
8
  <x-form-table
9
- :queryParamsName="queryParamsName"
10
- title="字典"
9
+ ref="XFormTable"
11
10
  @action="toDetail">
12
11
  </x-form-table>
13
12
  </a-card>
@@ -27,12 +26,16 @@
27
26
  return {
28
27
  // 选中的编号
29
28
  selectId: undefined,
30
- // 查询配置文件名
31
- queryParamsName: 'dictionaryQueryParams',
32
29
  // 是否显示详情抽屉
33
30
  detailVisible: false
34
31
  }
35
32
  },
33
+ mounted () {
34
+ this.$refs.XFormTable.init({
35
+ title: '字典',
36
+ queryParamsName: 'dictionaryQueryParams'
37
+ })
38
+ },
36
39
  methods: {
37
40
  toDetail (record, id) {
38
41
  this.selectId = id + ''
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <a-card :bordered="false">
3
3
  <x-form-table
4
- title="登录日志"
5
- :queryParamsName="queryParamsName"
4
+ ref="XFormTable"
6
5
  @action="toDetail">
7
6
  </x-form-table>
8
7
  </a-card>
@@ -20,12 +19,16 @@ export default {
20
19
  return {
21
20
  // 选中的编号
22
21
  selectNo: undefined,
23
- // 查询配置文件名
24
- queryParamsName: 'loginInforQueryParams',
25
22
  // 是否显示详情抽屉
26
23
  detailVisible: false
27
24
  }
28
25
  },
26
+ mounted () {
27
+ this.$refs.XFormTable.init({
28
+ title: '登录日志',
29
+ queryParamsName: 'loginInforQueryParams'
30
+ })
31
+ },
29
32
  methods: {
30
33
  toDetail (record, id) {
31
34
  this.selectNo = id + ''
@@ -1,10 +1,8 @@
1
1
  <template>
2
2
  <a-card :bordered="false">
3
3
  <x-form-table
4
- title="操作日志"
5
- :queryParamsName="queryParamsName"
6
- @action="toDetail">
7
- </x-form-table>
4
+ ref="XFormTable"
5
+ @action="toDetail"/>
8
6
  </a-card>
9
7
  </template>
10
8
 
@@ -20,12 +18,16 @@ export default {
20
18
  return {
21
19
  // 选中的编号
22
20
  selectNo: undefined,
23
- // 查询配置文件名
24
- queryParamsName: 'operLogQueryParams',
25
21
  // 是否显示详情抽屉
26
22
  detailVisible: false
27
23
  }
28
24
  },
25
+ mounted () {
26
+ this.$refs.XFormTable.init({
27
+ title: '操作日志',
28
+ queryParamsName: 'operLogQueryParams'
29
+ })
30
+ },
29
31
  methods: {
30
32
  toDetail (record, id) {
31
33
  this.selectNo = id + ''
@@ -6,8 +6,7 @@
6
6
  :visible.sync="detailVisible"
7
7
  />
8
8
  <x-form-table
9
- :queryParamsName="queryParamsName"
10
- title="查询配置"
9
+ ref="XFormTable"
11
10
  @action="toDetail">
12
11
  </x-form-table>
13
12
  </a-card>
@@ -27,12 +26,16 @@
27
26
  return {
28
27
  // 选中的编号
29
28
  selectId: undefined,
30
- // 查询配置文件名
31
- queryParamsName: 'queryParams',
32
29
  // 是否显示详情抽屉
33
30
  detailVisible: false
34
31
  }
35
32
  },
33
+ mounted () {
34
+ this.$refs.XFormTable.init({
35
+ title: '查询配置',
36
+ queryParamsName: 'queryParams'
37
+ })
38
+ },
36
39
  methods: {
37
40
  toDetail (record, id) {
38
41
  this.selectId = id + ''