vue2-client 1.14.4 → 1.14.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.14.4",
3
+ "version": "1.14.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -200,8 +200,7 @@ export default {
200
200
  const values = []
201
201
  if (extra.allCheckedNodes) {
202
202
  for (const item of extra.allCheckedNodes) {
203
- if (item.node.key) {
204
- // if (item.node.key && item.node?.data?.props?.label !== item.node?.data?.props?.value) {
203
+ if (item.node.key && (item.node?.data?.props?.label !== item.node?.data?.props?.value && item.children && item.children.length)) {
205
204
  values.push(`${item.node.key}`)
206
205
  }
207
206
  if (item.children && item.children.length) {
@@ -30,7 +30,7 @@
30
30
 
31
31
  <script>
32
32
 
33
- import { runLogic } from '@vue2-client/services/api/common'
33
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
34
34
 
35
35
  export default {
36
36
  name: 'XList',
@@ -55,13 +55,16 @@ export default {
55
55
  },
56
56
  methods: {
57
57
  async getData (config) {
58
- runLogic(config, {}, 'af-his').then(res => {
59
- this.button = res.button
60
- this.icon = res.icon
61
- this.buttonNames = res.buttonNames || []
62
- this.buttonMode = res.buttonMode || false
63
- this.data = res.data
58
+ const that = this
59
+ getConfigByName(config, 'af-his', res => {
60
+ that.button = res.button
61
+ that.icon = res.icon
62
+ that.buttonNames = res.buttonNames || []
63
+ that.buttonMode = res.buttonMode || false
64
+ runLogic(res.data, {}, 'af-his').then(ress => {
65
+ that.data = ress
64
66
  })
67
+ })
65
68
  },
66
69
  handleClick (index) {
67
70
  this.$emit('listClick', this.data[index])
@@ -132,14 +132,14 @@ export default {
132
132
  currentCol = currentCol.parentNode
133
133
  }
134
134
  if (currentCol) {
135
- // 更新当前列的宽度
135
+ // 更新当前列的宽度
136
136
  const drawerWidth = isOpen ? 33.3 : 2
137
137
  // 强制更新样式
138
138
  currentCol.style.cssText = `
139
139
  flex: 0 0 ${drawerWidth}% !important;
140
140
  max-width: ${drawerWidth}% !important;
141
141
  transition: all 0.3s;`
142
- // 触发XTab组件重新计算宽度
142
+ // 触发XTab组件重新计算宽度
143
143
  this.$nextTick(() => {
144
144
  const tabComponent = this.$el.querySelector('.ant-tabs')
145
145
  if (tabComponent) {
@@ -147,7 +147,7 @@ export default {
147
147
  window.dispatchEvent(new Event('resize'))
148
148
  }
149
149
  })
150
- // 更新其他列宽度
150
+ // 更新其他列宽度
151
151
  otherCols.forEach((col, index) => {
152
152
  if (index < this.mainWithData.length) {
153
153
  const widthValue = isOpen ? this.mainWithData[index].min : this.mainWithData[index].max
@@ -1,36 +1,107 @@
1
1
  <template>
2
- <a-drawer
3
- id="agencyManageDetail"
4
- title="用户详情信息"
5
- placement="right"
6
- :body-style="{padding:0}"
7
- :destroy-on-close="true"
8
- :z-index="200"
9
- width="85vw"
10
- :closable="false"
11
- :visible="userInfoDetailVisible"
12
- @close="onClose">
13
- <a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
14
- <x-descriptions
15
- :title="null"
16
- :content="userInfo"
17
- serviceName="af-revenue"
18
- :getRealData="true"
19
- :column="4"
20
- config-name="User_Info_Desc_Config">
21
- <template #addonAfter>
22
- <div style="text-align: right">
23
- <a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
24
- <a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
25
- </div>
2
+ <div>
3
+ <a-drawer
4
+ id="agencyManageDetail"
5
+ title="用户详情信息"
6
+ placement="right"
7
+ :body-style="{padding:0}"
8
+ :destroy-on-close="true"
9
+ :z-index="200"
10
+ width="85vw"
11
+ :closable="false"
12
+ :visible="userInfoDetailVisible"
13
+ @close="onClose">
14
+ <a-page-header v-if="userInfoDetailVisible && userInfo" :title="`用户编号:${ userInfo ? userInfo.f_userinfo_code : '' }`">
15
+ <x-descriptions
16
+ :title="null"
17
+ :content="userInfo"
18
+ serviceName="af-revenue"
19
+ :getRealData="true"
20
+ :column="4"
21
+ config-name="User_Info_Desc_Config">
22
+ <template #addonAfter>
23
+ <div style="text-align: right">
24
+ <a-statistic title="用户状态" :value="userInfo.f_user_state || 0"/>
25
+ <a-statistic title="表具状态" :precision="0" :value="userInfo.f_table_state || 0"/>
26
+ </div>
27
+ </template>
28
+ </x-descriptions>
29
+ <user-info-detail-query-tabs :userInfo="userInfo"/>
30
+ <template #extra>
31
+ <a-button type="primary" v-if="userInfo.gb_f_meter_type.includes('物联网表')" @click="openUser">开户</a-button>
32
+ <a-button type="primary" v-if="userInfo.gb_f_meter_type.includes('物联网表')&&!(userInfo.u_f_user_state === '停用')" @click="valvecontrol">开关阀</a-button>
33
+ <a-button type="dashed" @click="refresh">刷新</a-button>
26
34
  </template>
27
- </x-descriptions>
28
- <user-info-detail-query-tabs :userInfo="userInfo"/>
29
- <template #extra>
30
- <a-button type="dashed" @click="refresh">刷新</a-button>
35
+ </a-page-header>
36
+ </a-drawer>
37
+ <!-- 阀控管理弹框 -->
38
+ <a-modal
39
+ title="阀控管理"
40
+ :visible="valve"
41
+ :closable="false"
42
+ :width="600"
43
+ :body-style="{ padding: '24px' }"
44
+ >
45
+ <!-- 阀控状态选择 -->
46
+ <div style="margin-bottom: 16px;">
47
+ <label style="display: block; font-size: 14px; color: #555; margin-bottom: 8px;">阀控状态</label>
48
+ <a-select
49
+ v-model="selectedOption"
50
+ style="width: 100%;"
51
+ placeholder="请选择"
52
+ >
53
+ <a-select-option v-for="item in networkValveOptions" :value="item" :key="item">
54
+ {{ item }}
55
+ </a-select-option>
56
+ </a-select>
57
+ </div>
58
+
59
+ <!-- 操作原因输入框 -->
60
+ <div style="margin-bottom: 16px;">
61
+ <label
62
+ style="display: block; font-size: 14px; color: #555; margin-bottom: 8px;"
63
+ :style="operateReason ? '' : 'color: #ff4d4f;'"
64
+ >
65
+ 操作原因
66
+ </label>
67
+ <a-textarea
68
+ v-model="operateReason"
69
+ placeholder="请填写操作原因"
70
+ :rows="2"
71
+ style="width: 100%;"
72
+ />
73
+ </div>
74
+
75
+ <!-- 底部按钮 -->
76
+ <template #footer>
77
+ <div style="display: flex; justify-content: space-between; align-items: center;">
78
+ <!-- 左侧关闭按钮 -->
79
+ <a-button type="danger" @click="closeValveModal" style="border-radius: 4px;">
80
+ 关闭
81
+ </a-button>
82
+ <!-- 右侧开阀和关阀按钮 -->
83
+ <div>
84
+ <a-button
85
+ type="primary"
86
+ :disabled="!operateReason"
87
+ @click="valveoperate(true, 1)"
88
+ style="border-radius: 4px; margin-right: 8px;"
89
+ >
90
+ 开阀
91
+ </a-button>
92
+ <a-button
93
+ type="primary"
94
+ :disabled="!operateReason"
95
+ @click="valveoperate(false, 1)"
96
+ style="border-radius: 4px;"
97
+ >
98
+ 关阀
99
+ </a-button>
100
+ </div>
101
+ </div>
31
102
  </template>
32
- </a-page-header>
33
- </a-drawer>
103
+ </a-modal>
104
+ </div>
34
105
  </template>
35
106
 
36
107
  <script>
@@ -38,6 +109,7 @@ import XDescriptions from '@vue2-client/base-client/components/common/XDescripti
38
109
  import { mapState } from 'vuex'
39
110
  import { runLogic } from '@vue2-client/services/api/common'
40
111
  import userInfoDetailQueryTabs from '@vue2-client/pages/userInfoDetailManage/userInfoDetailQueryTabs'
112
+ import Vue from 'vue'
41
113
 
42
114
  export default {
43
115
  name: 'UserInfoDetailManage',
@@ -48,7 +120,18 @@ export default {
48
120
  data () {
49
121
  return {
50
122
  userInfo: undefined,
51
- userInfoDetailVisible: false
123
+ userInfoDetailVisible: false,
124
+ valve: false,
125
+ networkValveOptions: [
126
+ '手动',
127
+ '自动',
128
+ '1小时后自动',
129
+ '3小时后自动',
130
+ '6小时后自动',
131
+ '12小时后自动'
132
+ ],
133
+ selectedOption: '',
134
+ operateReason: '',
52
135
  }
53
136
  },
54
137
  methods: {
@@ -57,6 +140,33 @@ export default {
57
140
  this.userInfo = res
58
141
  })
59
142
  },
143
+ openUser () {
144
+ this.$confirm({
145
+ title: '开户确认',
146
+ content: '是否需要给用户进行开户?',
147
+ onOk: ()=> {
148
+ const data = {
149
+ f_userfiles_id: this.userInfo.f_userfiles_id
150
+ }
151
+ runLogic('StartUp', data, 'af-revenue').then(res => {
152
+ this.$message.success('开户成功')
153
+ })
154
+ }
155
+ })
156
+ },
157
+ // 阀控管理
158
+ valvecontrol () {
159
+ if (this.$login.r.includes('开关阀权限')) {
160
+ this.valve = true
161
+ } else {
162
+ this.$message.error('您没有【开关阀权限】,请联系管理员!!')
163
+ }
164
+ },
165
+ closeValveModal () {
166
+ this.valve = false
167
+ this.selectedOption = ''
168
+ this.operateReason = ''
169
+ },
60
170
  async init (user) {
61
171
  this.userInfo = user
62
172
  await this.refresh()
@@ -65,6 +175,77 @@ export default {
65
175
  onClose () {
66
176
  this.userInfoDetailVisible = false
67
177
  this.$emit('close')
178
+ },
179
+ // 开关阀操作
180
+ async valveoperate (oper, value) {
181
+ const msg = oper ? '开阀' : '关阀'
182
+ let delaySeconds = 0 // 初始化 delaySeconds 变量
183
+ const currentTime = new Date() // 获取当前时间
184
+ const adjustedTime = new Date(currentTime) // 创建一个新的 Date 对象用于计算延迟后的时间
185
+
186
+ const beijingTime = new Date(currentTime.getTime() + 8 * 60 * 60 * 1000)
187
+ const formattedBeijingTime = beijingTime.toISOString().slice(0, 19).replace('T', ' ')
188
+
189
+ const datas = {
190
+ instructType: '阀门控制',
191
+ instructTitle: `手动${msg}`,
192
+ condition: `t_userfiles.f_userfiles_id='${this.userInfo.f_userfiles_id}'`,
193
+ meterBrandName: this.userInfo.f_alias,
194
+ f_instruct_state: '待发送',
195
+ inputtor: Vue.$login.f.name,
196
+ inputtorid: Vue.$login.f.id,
197
+ reasonInfo: this.operateReason,
198
+ meternumberf: this.userInfo.f_meternumber,
199
+ contentData: { isOpen: oper ? 1 : 0 },
200
+ auto_adjust_option: this.selectedOption,
201
+ delaySeconds: delaySeconds,
202
+ executeDelayedOperation: true,
203
+ f_timestamp: formattedBeijingTime, // 使用北京时间
204
+ f_userfiles_id: this.userInfo.f_userfiles_id,
205
+ f_userinfo_id: this.userInfo.f_userinfo_id
206
+ }
207
+ console.log('看看datas', datas)
208
+ const _this = this
209
+ // 计算延迟时间
210
+ switch (_this.selectedOption) {
211
+ case '1小时后自动':
212
+ delaySeconds = 3600 // 1小时 = 3600秒
213
+ break
214
+ case '3小时后自动':
215
+ delaySeconds = 10800 // 3小时 = 10800秒
216
+ break
217
+ case '6小时后自动':
218
+ delaySeconds = 21600 // 6小时 = 21600秒
219
+ break
220
+ case '12小时后自动':
221
+ delaySeconds = 43200 // 12小时 = 43200秒
222
+ break
223
+ default:
224
+ delaySeconds = 0
225
+ }
226
+
227
+ adjustedTime.setSeconds(adjustedTime.getSeconds() + delaySeconds)
228
+ const adjustedBeijingTime = new Date(adjustedTime.getTime() + 8 * 60 * 60 * 1000)
229
+ const formattedAdjustedBeijingTime = adjustedBeijingTime.toISOString().slice(0, 19).replace('T', ' ')
230
+
231
+ // 更新 datas 对象
232
+ datas.delaySeconds = delaySeconds
233
+ datas.f_current_timestamp = formattedAdjustedBeijingTime // 使用延迟后的北京时间
234
+ runLogic('iot_saveInstruct', datas, 'af-revenue').then(res => {
235
+ _this.valve = false
236
+ _this.operateReason = ''
237
+ if (_this.selectedOption !== '手动') {
238
+ const msg = _this.selectedOption !== '自动' ? `阀控状态将在${_this.selectedOption}后自动调整为【自动】` : `阀控状态自动调整为 【自动】`
239
+ this.$message.success(msg)
240
+ runLogic('iot_processDelayedOperations',datas,'af-revenue').then(res => {
241
+ this.$emit('refresh')
242
+ console.log('延时操作逻辑已执行')
243
+ })
244
+ } else {
245
+ this.$emit('refresh')
246
+ }
247
+ this.$message.success('操作成功')
248
+ })
68
249
  }
69
250
  },
70
251
  created () {
@@ -59,7 +59,7 @@ routerResource.example = {
59
59
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
60
60
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
62
- // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
62
+ component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
63
63
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
64
64
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
65
65
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
@@ -74,7 +74,7 @@ routerResource.example = {
74
74
  // component: () => import('@vue2-client/components/g2Charts/demo.vue'),
75
75
  // component: () => import('@vue2-client/pages/LogicCallExample/index.vue'),
76
76
  // component: () => import('@vue2-client/components/FilePreview/FilePreviewDemo.vue'),
77
- component: () => import('@vue2-client/pages/ReportGrid/index.vue'),
77
+ // component: () => import('@vue2-client/pages/ReportGrid/index.vue'),
78
78
  }
79
79
  // routerResource.example = () =>
80
80
  // import('@vue2-client/pages/Example')