vue2-client 1.8.302 → 1.8.303
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/.env +1 -1
- package/package.json +2 -1
- package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +3 -3
- package/src/base-client/components/common/XForm/XFormItem.vue +9 -0
- package/src/base-client/components/common/XForm/XTreeSelect.vue +1 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +19 -3
- package/src/base-client/components/common/XTable/XTable.vue +2 -2
- package/src/base-client/components/common/XTree/XTree.vue +98 -12
- package/src/pages/Example/index.vue +15 -407
- package/src/theme/default/style.less +2 -2
- package/src/theme/global.less +9 -0
package/.env
CHANGED
|
@@ -14,6 +14,6 @@ VUE_APP_SINGLEVALUE_KEY=admin.singlevalue
|
|
|
14
14
|
VUE_APP_DIVISIONSOHCHINA=admin.divisionsohchina
|
|
15
15
|
VUE_APP_WEB_CONFIG_KEY=admin.webconfig
|
|
16
16
|
VUE_APP_API_BASE_URL=http://123.60.214.109:8405
|
|
17
|
-
VUE_APP_SYSTEM_NAME=af-
|
|
17
|
+
VUE_APP_SYSTEM_NAME=af-system
|
|
18
18
|
VUE_APP_LOGIN_VERSION=V4
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.303",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"vue-video-player": "^5.0.2",
|
|
53
53
|
"vue-virtual-scroller": "^1.1.2",
|
|
54
54
|
"vuedraggable": "^2.24.3",
|
|
55
|
+
"vue-draggable-resizable": "^2",
|
|
55
56
|
"vuex": "^3.6.2",
|
|
56
57
|
"xlsx": "0.18.5"
|
|
57
58
|
},
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
<a-col :span="showLeftTab ? 20 : 24" ref="descriptionsGroupContext" class="descriptionsGroupContext">
|
|
15
15
|
<div
|
|
16
16
|
class="descriptions-item"
|
|
17
|
-
:ref="`descriptions-item-${
|
|
18
|
-
:key="
|
|
19
|
-
v-for="(realDataItem,
|
|
17
|
+
:ref="`descriptions-item-${realDataIndex}`"
|
|
18
|
+
:key="realDataIndex"
|
|
19
|
+
v-for="(realDataItem, realDataIndex) in realData">
|
|
20
20
|
<template v-if="!loadError">
|
|
21
21
|
<!-- 带有子的详情 -->
|
|
22
22
|
<template
|
|
@@ -750,6 +750,15 @@ export default {
|
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
+
} else {
|
|
754
|
+
this.attr.flex = {
|
|
755
|
+
xs: 24,
|
|
756
|
+
sm: 24,
|
|
757
|
+
md: 24,
|
|
758
|
+
lg: 12,
|
|
759
|
+
xl: 8,
|
|
760
|
+
xxl: 8
|
|
761
|
+
}
|
|
753
762
|
}
|
|
754
763
|
if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
|
|
755
764
|
this.getData({}, res => this.getDataCallback(res))
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a-row type="flex" :gutter="16">
|
|
3
|
-
<a-col
|
|
2
|
+
<a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
|
|
3
|
+
<a-col
|
|
4
|
+
:xs="14"
|
|
5
|
+
:sm="14"
|
|
6
|
+
:md="12"
|
|
7
|
+
:lg="9"
|
|
8
|
+
:xl="6"
|
|
9
|
+
v-if="xTreeConfigName"
|
|
10
|
+
:style="{ maxWidth: '450px'}">
|
|
4
11
|
<x-tree
|
|
5
12
|
:config-name="xTreeConfigName"
|
|
6
13
|
:env="env"
|
|
7
14
|
@action="action"
|
|
15
|
+
@btnFuncClick="treeBtnFuncClick"
|
|
8
16
|
@treeOnChecked="treeOnChecked"
|
|
9
17
|
ref="xtree"
|
|
10
18
|
></x-tree>
|
|
11
19
|
</a-col>
|
|
12
|
-
<a-col
|
|
20
|
+
<a-col
|
|
21
|
+
:xs="xTreeConfigName ? 10 : 24"
|
|
22
|
+
:sm="xTreeConfigName ? 10 : 24"
|
|
23
|
+
:md="xTreeConfigName ? 12 : 24"
|
|
24
|
+
:lg="xTreeConfigName ? 15 : 24"
|
|
25
|
+
:xl="xTreeConfigName ? 18 : 24">
|
|
13
26
|
<a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
|
|
14
27
|
<a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
|
|
15
28
|
<div v-show="!loading">
|
|
@@ -385,6 +398,9 @@ export default {
|
|
|
385
398
|
treeOnChecked (checkedKeys, deepNodes, deepKeys) {
|
|
386
399
|
this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
|
|
387
400
|
},
|
|
401
|
+
treeBtnFuncClick (index, func) {
|
|
402
|
+
this.$emit('treeBtnFuncClick', index, func)
|
|
403
|
+
},
|
|
388
404
|
/**
|
|
389
405
|
* 新增按钮事件
|
|
390
406
|
*/
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
</a>
|
|
96
96
|
<a-menu slot="overlay" style="min-width: 60px">
|
|
97
97
|
<a-menu-item
|
|
98
|
-
v-for="(action_item,
|
|
99
|
-
:key="
|
|
98
|
+
v-for="(action_item, actionIndex) in item.actionArr"
|
|
99
|
+
:key="actionIndex"
|
|
100
100
|
v-if="!action_item.customFunction || executeStrFunction( action_item.customFunction,[record,index])">
|
|
101
101
|
<a
|
|
102
102
|
style="text-align: center"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
3
|
-
import { reactive, ref, watch, defineExpose } from 'vue'
|
|
3
|
+
import { reactive, ref, watch, defineExpose, nextTick } from 'vue'
|
|
4
4
|
import executeStrFunction from '@vue2-client/utils/runEvalFunction'
|
|
5
5
|
import debounce from 'lodash.debounce'
|
|
6
6
|
|
|
@@ -17,6 +17,12 @@ const _treeData = ref([])
|
|
|
17
17
|
const filteredTreeData = ref([])
|
|
18
18
|
// 定义最深一层的 数据
|
|
19
19
|
const deepestNodes = ref([])
|
|
20
|
+
// 定义激活的按钮
|
|
21
|
+
const activeButtonIndex = ref({})
|
|
22
|
+
// 是否全选
|
|
23
|
+
const checkall = ref(false)
|
|
24
|
+
// 选了但没有全选
|
|
25
|
+
const indeterminate = ref(false)
|
|
20
26
|
// 替换字段
|
|
21
27
|
let _replaceFields = reactive({ children: 'children', title: 'title', key: 'key' })
|
|
22
28
|
// 暂存查询信息
|
|
@@ -43,6 +49,24 @@ const props = defineProps({
|
|
|
43
49
|
default: () => ({ children: 'children', title: 'title', key: 'key' })
|
|
44
50
|
}
|
|
45
51
|
})
|
|
52
|
+
// maxHeight:config.search?'calc(100vh - 200px - 5.6rem)':
|
|
53
|
+
// 定义一个计算属性
|
|
54
|
+
function heightStore () {
|
|
55
|
+
if (config.search) {
|
|
56
|
+
if (config.tabBtn && config.tabBtn.length > 0) {
|
|
57
|
+
return ['7rem', 'calc(100vh - 200px - 7.6rem)']
|
|
58
|
+
} else {
|
|
59
|
+
return ['5rem', 'calc(100vh - 200px - 5.6rem)']
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
if (config.tabBtn && config.tabBtn.length > 0) {
|
|
63
|
+
return ['5rem', 'calc(100vh - 200px - 5rem)']
|
|
64
|
+
} else {
|
|
65
|
+
return ['3rem', 'calc(100vh - 200px - 3rem)']
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
46
70
|
// 监听 checkbox 选中 的变化
|
|
47
71
|
watch(checkedKeys, (checkedKeys) => {
|
|
48
72
|
// 筛选出最底层的数据 返回
|
|
@@ -55,6 +79,14 @@ watch(checkedKeys, (checkedKeys) => {
|
|
|
55
79
|
deepKeys.push(node[_replaceFields.key])
|
|
56
80
|
}
|
|
57
81
|
})
|
|
82
|
+
nextTick(() => {
|
|
83
|
+
if (deepNodes.length === 0) {
|
|
84
|
+
checkall.value = false
|
|
85
|
+
indeterminate.value = false
|
|
86
|
+
} else {
|
|
87
|
+
indeterminate.value = !checkall.value
|
|
88
|
+
}
|
|
89
|
+
})
|
|
58
90
|
emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
|
|
59
91
|
}, { immediate: true })
|
|
60
92
|
//
|
|
@@ -91,12 +123,11 @@ function onSelect (keys, e) {
|
|
|
91
123
|
async function getData (param = {}) {
|
|
92
124
|
spinning.value = true
|
|
93
125
|
const currentUser = JSON.parse(localStorage.getItem(process.env.VUE_APP_USER_KEY))
|
|
94
|
-
|
|
126
|
+
await runLogic(config.treeData.substring(6), Object.assign(param, {
|
|
95
127
|
orgId: currentUser.orgid,
|
|
96
128
|
userId: currentUser.id,
|
|
97
129
|
depId: currentUser.f_department_id
|
|
98
|
-
})
|
|
99
|
-
await runLogic(config.treeData.substring(6), searchInfo.value, config.serviceName, props.env === 'dev').then(res => {
|
|
130
|
+
}), config.serviceName, props.env === 'dev').then(res => {
|
|
100
131
|
_treeData.value = res
|
|
101
132
|
deepestNodes.value = getDeepestNodes(_treeData.value)
|
|
102
133
|
spinning.value = false
|
|
@@ -168,8 +199,35 @@ function getDeepestNodes (treeData) {
|
|
|
168
199
|
return deepestNodes
|
|
169
200
|
}
|
|
170
201
|
|
|
171
|
-
function
|
|
172
|
-
|
|
202
|
+
function onCheckAllChange (e) {
|
|
203
|
+
checkedKeys.value = e.target.checked ? deepestNodes.value.map(node => node[_replaceFields.key]).filter(item => item !== 'noCatch') : []
|
|
204
|
+
nextTick(() => {
|
|
205
|
+
checkall.value = e.target.checked
|
|
206
|
+
indeterminate.value = false
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async function btnFuncClick (index) {
|
|
211
|
+
activeButtonIndex.value = Object.assign({}, activeButtonIndex.value, { [index]: !!!activeButtonIndex.value[index] })
|
|
212
|
+
// 组织参数
|
|
213
|
+
// 把activeButtonIndex.value groupType 相同的其他值改成 false
|
|
214
|
+
Object.keys(activeButtonIndex.value).forEach((key) => {
|
|
215
|
+
if (key != index && config.tabBtn[key].groupType === config.tabBtn[index].groupType) {
|
|
216
|
+
activeButtonIndex.value[key] = false
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
const param = {}
|
|
220
|
+
// 循环执行已经激活的自定义方法
|
|
221
|
+
Object.keys(activeButtonIndex.value).forEach((key) => {
|
|
222
|
+
if (activeButtonIndex.value[key]) {
|
|
223
|
+
const item = config.tabBtn[key]
|
|
224
|
+
if (item.customFunction) {
|
|
225
|
+
Object.assign(param, executeStrFunction(item.customFunction, [param]))
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
// 获取到 param 执行 getData
|
|
230
|
+
await getData(param)
|
|
173
231
|
}
|
|
174
232
|
|
|
175
233
|
// 使用 defineExpose 暴露方法
|
|
@@ -181,7 +239,7 @@ defineExpose({
|
|
|
181
239
|
|
|
182
240
|
<template>
|
|
183
241
|
<div id="XTreeWarp">
|
|
184
|
-
<div class="tree_title"
|
|
242
|
+
<div class="tree_title" v-if="config.title">
|
|
185
243
|
<a-row style="font-size: medium;line-height: 3rem">
|
|
186
244
|
<a-col :offset="2">
|
|
187
245
|
<span>{{ config.title }}</span>
|
|
@@ -189,6 +247,13 @@ defineExpose({
|
|
|
189
247
|
</a-row>
|
|
190
248
|
<a-row v-if="config.search">
|
|
191
249
|
<div class="content-search">
|
|
250
|
+
<a-checkbox
|
|
251
|
+
class="checkbox"
|
|
252
|
+
:indeterminate="indeterminate"
|
|
253
|
+
:checked="checkall"
|
|
254
|
+
@change="onCheckAllChange">
|
|
255
|
+
</a-checkbox>
|
|
256
|
+
|
|
192
257
|
<a-input
|
|
193
258
|
placeholder="请输入搜索关键字"
|
|
194
259
|
@change="onChange">
|
|
@@ -197,10 +262,22 @@ defineExpose({
|
|
|
197
262
|
</div>
|
|
198
263
|
</a-row>
|
|
199
264
|
</div>
|
|
265
|
+
<a-row v-if="config.tabBtn && config.tabBtn.length > 0">
|
|
266
|
+
<div class="content-search" style="padding-top:7px;padding-left: 10px">
|
|
267
|
+
<a-space>
|
|
268
|
+
<a-button
|
|
269
|
+
v-for="(item,index) in config.tabBtn"
|
|
270
|
+
@click="btnFuncClick(index,item.customFunction)"
|
|
271
|
+
:class="{ 'active-button': activeButtonIndex[index] }"
|
|
272
|
+
:key="index">{{ item.name }}
|
|
273
|
+
</a-button>
|
|
274
|
+
</a-space>
|
|
275
|
+
</div>
|
|
276
|
+
</a-row>
|
|
200
277
|
<div
|
|
201
278
|
class="tree_main"
|
|
202
279
|
:style="{
|
|
203
|
-
maxHeight:
|
|
280
|
+
maxHeight:heightStore()[1]
|
|
204
281
|
}">
|
|
205
282
|
<a-spin :spinning="spinning">
|
|
206
283
|
<a-tree
|
|
@@ -216,12 +293,12 @@ defineExpose({
|
|
|
216
293
|
>
|
|
217
294
|
<template slot="title" slot-scope="item">
|
|
218
295
|
<span @click="nodeItemClick(item)">
|
|
219
|
-
<a-tooltip placement="right" :title="item[_replaceFields.title]"
|
|
296
|
+
<a-tooltip placement="right" :title="item[_replaceFields.title]">
|
|
220
297
|
{{
|
|
221
298
|
item.dataRef[replaceFields.children] && item.dataRef[replaceFields.children].length > 0 ?
|
|
222
299
|
item[_replaceFields.title]
|
|
223
300
|
: config.deepNodeMaxWidth && item[_replaceFields.title].length > config.deepNodeMaxWidth ? item[_replaceFields.title].substring(0, config.deepNodeMaxWidth) + '...' : item[_replaceFields.title]
|
|
224
|
-
}}{{ item.hasOwnProperty('count')?' ('+item.count+')':'' }}
|
|
301
|
+
}}{{ item.hasOwnProperty('count') ? ' (' + item.count + ')' : '' }}
|
|
225
302
|
</a-tooltip>
|
|
226
303
|
</span>
|
|
227
304
|
<a-space style="float:right;margin-right: .2rem">
|
|
@@ -257,12 +334,21 @@ defineExpose({
|
|
|
257
334
|
}
|
|
258
335
|
}
|
|
259
336
|
|
|
337
|
+
.active-button {
|
|
338
|
+
border-color: @primary-color !important;
|
|
339
|
+
color: @primary-color !important;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.ant-btn:focus {
|
|
343
|
+
color: rgba(0, 0, 0, 0.65);
|
|
344
|
+
background-color: #fff;
|
|
345
|
+
border-color: #d9d9d9
|
|
346
|
+
}
|
|
347
|
+
|
|
260
348
|
.tree_main {
|
|
261
|
-
margin-top: 1rem;
|
|
262
349
|
width: 100%;
|
|
263
350
|
display: inline-block;
|
|
264
351
|
overflow-y: auto;
|
|
265
|
-
|
|
266
352
|
//:deep(.ant-tree-child-tree){
|
|
267
353
|
// .ant-space-item {
|
|
268
354
|
// display: none;
|
|
@@ -1,425 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:x-tree-config-name="xTreeConfigName"
|
|
7
|
-
serviceName="af-revenue"
|
|
8
|
-
@addArea="addArea"
|
|
9
|
-
@editArea="editArea"
|
|
10
|
-
@delArea="delArea"
|
|
11
|
-
@addAddress="addAddress"
|
|
12
|
-
@editAddress="editAddress"
|
|
13
|
-
@delAddress="delAddress"
|
|
14
|
-
@treeOnChecked="treeOnChecked"
|
|
15
|
-
:fixedQueryForm="fixedQueryForm"
|
|
16
|
-
ref="xformtable"
|
|
17
|
-
@action="toDetail">
|
|
18
|
-
<template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
|
|
19
|
-
<a-button v-if="selectedRowKeys.length > 0 " type="primary" @click="asigAddress(selectedRowKeys, selectedRows)">
|
|
20
|
-
地址分配
|
|
21
|
-
</a-button>
|
|
22
|
-
</template>
|
|
23
|
-
<template #importExcelSlot>
|
|
24
|
-
<div style="margin-top: 8px">* 导入的内容必须放在第一个工作表中</div>
|
|
25
|
-
<div style="margin-top: 8px">* 导入的内容表头以及字段顺序必须和模板一致</div>
|
|
26
|
-
<div style="margin-top: 8px">* 当导入模板中地址编号字段不为空时,会根据地址编号更新地址信息</div>
|
|
27
|
-
</template>
|
|
28
|
-
</x-form-table>
|
|
29
|
-
<!-- 新增小区 -->
|
|
30
|
-
<a-modal
|
|
31
|
-
v-model="addAreaFlag"
|
|
32
|
-
:footer="null"
|
|
33
|
-
:dialog-style="{ top: '5rem'}"
|
|
34
|
-
:z-index="1001"
|
|
35
|
-
:title="addAreaMsg"
|
|
36
|
-
:destroyOnClose="true">
|
|
37
|
-
<x-add-native-form ref="xForm" @onSubmit="addAreaSubmit"/>
|
|
38
|
-
</a-modal>
|
|
39
|
-
<!-- 修改小区 -->
|
|
40
|
-
<a-modal
|
|
41
|
-
v-model="editAreaFlag"
|
|
42
|
-
:footer="null"
|
|
43
|
-
:dialog-style="{ top: '30px' }"
|
|
44
|
-
:z-index="1001"
|
|
45
|
-
:title="editAreaMsg"
|
|
46
|
-
:destroyOnClose="true">
|
|
47
|
-
<x-add-native-form ref="xEditForm" @onSubmit="editAreaSubmit"/>
|
|
48
|
-
</a-modal>
|
|
49
|
-
<!-- 添加地址 -->
|
|
50
|
-
<a-modal
|
|
51
|
-
v-model="addAddressFlag"
|
|
52
|
-
:dialog-style="{ top: '30px' }"
|
|
53
|
-
:z-index="1001"
|
|
54
|
-
@ok="addressSubmit"
|
|
55
|
-
@cancel="addAddressFlag=false"
|
|
56
|
-
:title="addAddressMsg"
|
|
57
|
-
:destroyOnClose="true">
|
|
58
|
-
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
59
|
-
<a-form-model-item label="旧地址" v-if="form.old_address">
|
|
60
|
-
<a-input :value="form.old_address" readonly disabled/>
|
|
61
|
-
</a-form-model-item>
|
|
62
|
-
<a-form-model-item label="地址类型">
|
|
63
|
-
<a-radio-group v-model="form.f_address_type">
|
|
64
|
-
<a-radio :value="item.value" v-for="(item, index) in addressModel" :key="index">
|
|
65
|
-
{{ item.label }}
|
|
66
|
-
</a-radio>
|
|
67
|
-
</a-radio-group>
|
|
68
|
-
</a-form-model-item>
|
|
69
|
-
<a-form-model-item label="详细地址">
|
|
70
|
-
<div v-for="(item, index) in formItems" :key="index" style="display: inline;white-space: nowrap">
|
|
71
|
-
<a-input v-model="addressData[item.value]" style="display: inline;" :style="{width:inputWidth}"/>
|
|
72
|
-
<span>{{ item.label }}</span>
|
|
73
|
-
</div>
|
|
74
|
-
</a-form-model-item>
|
|
75
|
-
</a-form-model>
|
|
76
|
-
</a-modal>
|
|
77
|
-
<!-- 地址分配 -->
|
|
78
|
-
<a-modal
|
|
79
|
-
v-model="asigAddressFlag"
|
|
80
|
-
:dialog-style="{ top: '30px' }"
|
|
81
|
-
:z-index="1001"
|
|
82
|
-
@ok="asigAddressSubmit"
|
|
83
|
-
@cancel="asigAddressFlag=false"
|
|
84
|
-
:title="asigAddressMsg"
|
|
85
|
-
:destroyOnClose="true">
|
|
86
|
-
<a-form-model :model="asigAddressModel" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
87
|
-
<a-form-model-item label="选择小区">
|
|
88
|
-
<CitySelect v-model="asigAddressModel.f_residential_area_id" :contexts="5"></CitySelect>
|
|
89
|
-
</a-form-model-item>
|
|
90
|
-
</a-form-model>
|
|
91
|
-
</a-modal>
|
|
92
|
-
</a-card>
|
|
2
|
+
<div id="test">
|
|
3
|
+
<!-- 修改 import 路径展示不同的组件 Demo -->
|
|
4
|
+
<demo></demo>
|
|
5
|
+
</div>
|
|
93
6
|
</template>
|
|
94
7
|
|
|
95
8
|
<script>
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import
|
|
101
|
-
import { getRealKeyData } from '@vue2-client/utils/formatter'
|
|
102
|
-
import { mapState } from 'vuex'
|
|
9
|
+
import XReport from '@vue2-client/base-client/components/common/XReport'
|
|
10
|
+
// import Demo from '@vue2-client/base-client/components/common/XFormGroup/demo.vue'
|
|
11
|
+
// import Demo from '@vue2-client/base-client/components/common/XDescriptions/demo.vue'
|
|
12
|
+
// import Demo from '@vue2-client/base-client/components/common/AddressSearchCombobox/demo.vue'
|
|
13
|
+
import Demo from '@vue2-client/base-client/components/common/XFormTable/demo.vue'
|
|
103
14
|
|
|
104
15
|
export default {
|
|
105
|
-
name: '
|
|
16
|
+
name: 'Example',
|
|
106
17
|
components: {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
18
|
+
Demo,
|
|
19
|
+
XReport
|
|
20
|
+
},
|
|
21
|
+
mounted () {
|
|
111
22
|
},
|
|
112
23
|
data () {
|
|
113
24
|
return {
|
|
114
|
-
// 选中的编号
|
|
115
|
-
selectNo: undefined,
|
|
116
|
-
// 查询配置文件名
|
|
117
|
-
queryParamsName: 'address_management',
|
|
118
|
-
// 查询配置左侧tree
|
|
119
|
-
xTreeConfigName: 'addressType',
|
|
120
|
-
// 是否显示详情抽屉
|
|
121
|
-
detailVisible: false,
|
|
122
|
-
// 添加小区 flag
|
|
123
|
-
addAreaFlag: false,
|
|
124
|
-
addAreaMsg: '',
|
|
125
|
-
// 修改小区 flag
|
|
126
|
-
editAreaFlag: false,
|
|
127
|
-
editAreaMsg: '',
|
|
128
|
-
// 添加地址 flag
|
|
129
|
-
addAddressFlag: false,
|
|
130
|
-
addAddressMsg: '',
|
|
131
|
-
// 地址分配 flag
|
|
132
|
-
asigAddressFlag: false,
|
|
133
|
-
asigAddressMsg: '',
|
|
134
|
-
asigAddressModel: {},
|
|
135
|
-
labelCol: { span: 4 },
|
|
136
|
-
wrapperCol: { span: 20 },
|
|
137
|
-
fixedQueryForm: {},
|
|
138
|
-
// 列表选中的数据
|
|
139
|
-
// eslint-disable-next-line vue/no-reserved-keys
|
|
140
|
-
_selectedRowKeys: [],
|
|
141
|
-
addressModel: [
|
|
142
|
-
{
|
|
143
|
-
expression: '{f_building}楼号{f_unit}单元{f_floor}楼层{f_room}门牌号',
|
|
144
|
-
label: '城市',
|
|
145
|
-
value: '城市'
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
expression: '{f_building}组{f_unit}号',
|
|
149
|
-
label: '乡镇',
|
|
150
|
-
value: '乡镇'
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
expression: '{f_address}',
|
|
154
|
-
label: '自定义',
|
|
155
|
-
value: '自定义'
|
|
156
|
-
}
|
|
157
|
-
],
|
|
158
|
-
formItems: [],
|
|
159
|
-
form: {
|
|
160
|
-
f_address_type: '',
|
|
161
|
-
f_iscity: ''
|
|
162
|
-
},
|
|
163
|
-
addressData: {}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
watch: {
|
|
167
|
-
'form.f_address_type' (newVal, oldVal) {
|
|
168
|
-
this.onAddressTypeChange(newVal, oldVal)
|
|
169
25
|
}
|
|
170
26
|
},
|
|
171
|
-
computed: {
|
|
172
|
-
inputWidth () {
|
|
173
|
-
return this.formItems.length ? `${65 / this.formItems.length}%` : '75%'
|
|
174
|
-
},
|
|
175
|
-
...mapState('account', { currUser: 'user' }),
|
|
176
|
-
},
|
|
177
27
|
methods: {
|
|
178
|
-
asigAddress (selectedRowKeys, selectedRows) {
|
|
179
|
-
// 获取地址模式配置
|
|
180
|
-
this._selectedRowKeys = selectedRowKeys
|
|
181
|
-
this.asigAddressFlag = true
|
|
182
|
-
this.asigAddressMsg = `为 ${selectedRowKeys.length} 条地址信息重新分配小区`
|
|
183
|
-
},
|
|
184
|
-
asigAddressSubmit () {
|
|
185
|
-
if (this.asigAddressModel.f_residential_area_id) {
|
|
186
|
-
if (this.asigAddressModel.f_residential_area_id.indexOf('area') === -1) {
|
|
187
|
-
this.$message.error('请选择小区')
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
runLogic('asigAddres', {
|
|
192
|
-
selectedRowKeys: this._selectedRowKeys.join(','),
|
|
193
|
-
f_residential_area_id: this.asigAddressModel.f_residential_area_id.replace('area', '')
|
|
194
|
-
}, 'af-revenue').then(res => {
|
|
195
|
-
if (res) {
|
|
196
|
-
this.$message.success('分配成功')
|
|
197
|
-
this.asigAddressFlag = false
|
|
198
|
-
this.$refs.xformtable.refreshTable(true)
|
|
199
|
-
}
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
toDetail (record, id) {
|
|
203
|
-
this.selectNo = id + ''
|
|
204
|
-
this.detailVisible = true
|
|
205
|
-
},
|
|
206
|
-
// 选中左侧树查询逻辑
|
|
207
|
-
treeOnChecked (checkedKeys, deepNodes, deepKeys) {
|
|
208
|
-
if (deepKeys && deepKeys.length) {
|
|
209
|
-
this.fixedQueryForm.tua_f_residential_area_id = deepKeys.map(h => h.replace('area', ''))
|
|
210
|
-
this.$refs.xformtable.refreshTable(true)
|
|
211
|
-
} else {
|
|
212
|
-
this.fixedQueryForm = {}
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
delAddress (record, id) {
|
|
216
|
-
const that = this
|
|
217
|
-
if (record.tu_f_userinfo_code) {
|
|
218
|
-
this.$message.error('已关联用户禁止删除')
|
|
219
|
-
return
|
|
220
|
-
}
|
|
221
|
-
this.$confirm({
|
|
222
|
-
title: '确认要删除小区吗?',
|
|
223
|
-
content: '注意:删除数据后不可恢复。',
|
|
224
|
-
onOk () {
|
|
225
|
-
// 获取小区详情之后 通过配置文件获取表单 进行修改
|
|
226
|
-
runLogic('delAddress', { id: id }, 'af-revenue').then(res => {
|
|
227
|
-
that.$refs.xformtable.refreshTable(true)
|
|
228
|
-
})
|
|
229
|
-
},
|
|
230
|
-
onCancel () {
|
|
231
|
-
},
|
|
232
|
-
})
|
|
233
|
-
},
|
|
234
|
-
editAddress (record, a, b, c) {
|
|
235
|
-
getConfigByName('addressTypeDic', 'af-revenue', (res) => {
|
|
236
|
-
// 地址模式赋值
|
|
237
|
-
if (res.value?.length) {
|
|
238
|
-
this.addressModel = res.value
|
|
239
|
-
}
|
|
240
|
-
record = getRealKeyData(record)
|
|
241
|
-
// 赋值默认地址模式
|
|
242
|
-
record.old_address = record.f_address
|
|
243
|
-
this.form = Object.assign({}, record)
|
|
244
|
-
this.addressData = Object.assign({}, record)
|
|
245
|
-
if (!this.form.f_address_type) {
|
|
246
|
-
this.form.f_address_type = this.addressModel[0].value
|
|
247
|
-
}
|
|
248
|
-
// 根据小区信息赋值
|
|
249
|
-
this.addAddressFlag = true
|
|
250
|
-
this.addAddressMsg = '修改地址'
|
|
251
|
-
})
|
|
252
|
-
},
|
|
253
|
-
onAddressTypeChange (newVal, oldVal) {
|
|
254
|
-
console.log(newVal, oldVal)
|
|
255
|
-
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
256
|
-
// 暂存 oldFormItems
|
|
257
|
-
const oldFormItems = this.formItems
|
|
258
|
-
if (selectedModel) {
|
|
259
|
-
const matches = selectedModel.expression.match(/{(.*?)}([^{}]*)(?={|$)/g)
|
|
260
|
-
this.formItems = matches.map(item => {
|
|
261
|
-
const value = item.match(/{(.*?)}/)[1]
|
|
262
|
-
const label = item.replace(/{.*?}/, '').trim()
|
|
263
|
-
return {
|
|
264
|
-
label: label || (value === 'f_address' ? '' : value), // 如果存在后面的文字,就使用后面的文字作为 label,否则使用原来的值
|
|
265
|
-
value: `${value}`
|
|
266
|
-
}
|
|
267
|
-
})
|
|
268
|
-
// 把 oldFormItems 存在, formitem 中不存在的赋值为 undefined
|
|
269
|
-
oldFormItems.forEach(item => {
|
|
270
|
-
if (!this.formItems.find(newItem => newItem.value === item.value)) {
|
|
271
|
-
this.addressData[item.value] = ''
|
|
272
|
-
}
|
|
273
|
-
})
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
generateAddressString () {
|
|
277
|
-
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
278
|
-
if (selectedModel) {
|
|
279
|
-
let addressString = selectedModel.expression
|
|
280
|
-
this.formItems.forEach(item => {
|
|
281
|
-
const value = this.addressData[item.value]
|
|
282
|
-
addressString = addressString.replace(`{${item.value}}`, value)
|
|
283
|
-
})
|
|
284
|
-
return addressString
|
|
285
|
-
}
|
|
286
|
-
return ''
|
|
287
|
-
},
|
|
288
|
-
addressSubmit () {
|
|
289
|
-
runLogic('addAddress', Object.assign(this.form, this.addressData, {
|
|
290
|
-
f_address: this.generateAddressString()
|
|
291
|
-
}, {
|
|
292
|
-
orgid: this.currUser.orgid,
|
|
293
|
-
}), 'af-revenue').then(res => {
|
|
294
|
-
if (res) {
|
|
295
|
-
this.$message.success(`${this.addAddressMsg}成功`)
|
|
296
|
-
this.addAddressFlag = false
|
|
297
|
-
this.$refs.xformtable.refreshTable(true)
|
|
298
|
-
}
|
|
299
|
-
})
|
|
300
|
-
},
|
|
301
|
-
addAddress (record) {
|
|
302
|
-
// 获取地址模式配置
|
|
303
|
-
getConfigByName('addressTypeDic', 'af-revenue', (res) => {
|
|
304
|
-
// 地址模式赋值
|
|
305
|
-
if (res.value?.length) {
|
|
306
|
-
this.addressModel = res.value
|
|
307
|
-
}
|
|
308
|
-
// 赋值默认地址模式
|
|
309
|
-
this.form.f_address_type = this.addressModel[0].value
|
|
310
|
-
// 根据小区信息赋值
|
|
311
|
-
this.form.f_residential_area = record.name
|
|
312
|
-
this.form.f_residential_area_id = record.code.replace('area', '')
|
|
313
|
-
this.addAddressFlag = true
|
|
314
|
-
this.addAddressMsg = record.name + ' 添加地址'
|
|
315
|
-
this.onAddressTypeChange()
|
|
316
|
-
})
|
|
317
|
-
},
|
|
318
|
-
delArea (record) {
|
|
319
|
-
const that = this
|
|
320
|
-
this.$confirm({
|
|
321
|
-
title: '确认要删除小区吗?',
|
|
322
|
-
content: '注意:删除数据后不可恢复。',
|
|
323
|
-
onOk () {
|
|
324
|
-
// 获取小区详情之后 通过配置文件获取表单 进行修改
|
|
325
|
-
runLogic('delArea', { id: record.code.replace('area', '') }, 'af-revenue').then(res => {
|
|
326
|
-
that.$refs.xformtable.$refs.xtree.reLoad()
|
|
327
|
-
})
|
|
328
|
-
},
|
|
329
|
-
onCancel () {
|
|
330
|
-
},
|
|
331
|
-
})
|
|
332
|
-
},
|
|
333
|
-
editArea (record) {
|
|
334
|
-
this.editAreaFlag = true
|
|
335
|
-
this.editAreaMsg = record.describe + ' 修改小区'
|
|
336
|
-
// 获取小区详情之后 通过配置文件获取表单 进行修改
|
|
337
|
-
runLogic('getAreaMsg', { id: record.code.replace('area', '') }, 'af-revenue').then(areaRes => {
|
|
338
|
-
if (areaRes.length === 0) {
|
|
339
|
-
this.$message.error('获取小区信息失败')
|
|
340
|
-
} else {
|
|
341
|
-
console.log(areaRes)
|
|
342
|
-
if (!areaRes[0].f_pcd_id) {
|
|
343
|
-
areaRes[0].f_pcd_id = record.parentcode
|
|
344
|
-
}
|
|
345
|
-
getConfigByName('editAreaForm', 'af-revenue', (res) => {
|
|
346
|
-
this.$refs.xEditForm.init({
|
|
347
|
-
formItems: res.formJson,
|
|
348
|
-
title: '添加小区',
|
|
349
|
-
modifyModelData: {
|
|
350
|
-
data: areaRes[0]
|
|
351
|
-
},
|
|
352
|
-
fixedAddForm: {
|
|
353
|
-
id: areaRes[0].id
|
|
354
|
-
}
|
|
355
|
-
})
|
|
356
|
-
})
|
|
357
|
-
}
|
|
358
|
-
})
|
|
359
|
-
},
|
|
360
|
-
editAreaSubmit (areaMsg) {
|
|
361
|
-
runLogic('editArea', {
|
|
362
|
-
id: areaMsg.realForm.id,
|
|
363
|
-
residential_area: areaMsg.realForm.residential_area,
|
|
364
|
-
area_address: areaMsg.realForm.area_address,
|
|
365
|
-
linkname: areaMsg.realForm.linkname,
|
|
366
|
-
pcd_id: areaMsg.realForm.pcd_id,
|
|
367
|
-
comments: areaMsg.realForm.comments,
|
|
368
|
-
operatorid: areaMsg.currUserId,
|
|
369
|
-
operator: areaMsg.currUserName,
|
|
370
|
-
pcd: areaMsg.realForm.pcd,
|
|
371
|
-
orgid: areaMsg.orgId
|
|
372
|
-
}, 'af-revenue').then(
|
|
373
|
-
res => {
|
|
374
|
-
if (res) {
|
|
375
|
-
this.$message.success('修改成功')
|
|
376
|
-
this.editAreaFlag = false
|
|
377
|
-
this.$refs.xformtable.$refs.xtree.reLoad()
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
)
|
|
381
|
-
},
|
|
382
|
-
addArea (record) {
|
|
383
|
-
this.addAreaFlag = true
|
|
384
|
-
this.addAreaMsg = '添加小区'
|
|
385
|
-
getConfigByName('addAreaForm', 'af-revenue', (res) => {
|
|
386
|
-
this.$refs.xForm.init({
|
|
387
|
-
formItems: res.formJson,
|
|
388
|
-
title: '添加小区',
|
|
389
|
-
businessType: '新增',
|
|
390
|
-
fixedAddForm: {
|
|
391
|
-
f_pcd: record.describe,
|
|
392
|
-
f_pcd_id: record.code
|
|
393
|
-
}
|
|
394
|
-
})
|
|
395
|
-
})
|
|
396
|
-
},
|
|
397
|
-
addAreaSubmit (areaMsg) {
|
|
398
|
-
runLogic('addArea', {
|
|
399
|
-
residential_area: areaMsg.realForm.residential_area,
|
|
400
|
-
area_address: areaMsg.realForm.area_address,
|
|
401
|
-
linkname: areaMsg.realForm.linkname,
|
|
402
|
-
pcd_id: areaMsg.realForm.pcd_id,
|
|
403
|
-
comments: areaMsg.realForm.comments,
|
|
404
|
-
operatorid: areaMsg.currUserId,
|
|
405
|
-
operator: areaMsg.currUserName,
|
|
406
|
-
pcd: areaMsg.realForm.pcd,
|
|
407
|
-
orgid: areaMsg.orgId
|
|
408
|
-
}, 'af-revenue').then(
|
|
409
|
-
res => {
|
|
410
|
-
if (res) {
|
|
411
|
-
this.$message.success('添加成功')
|
|
412
|
-
this.addAreaFlag = false
|
|
413
|
-
this.$refs.xformtable.$refs.xtree.reLoad()
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
}
|
|
418
28
|
}
|
|
419
29
|
}
|
|
420
30
|
</script>
|
|
421
31
|
<style scoped>
|
|
422
|
-
|
|
423
|
-
background-color: transparent !important;
|
|
424
|
-
}
|
|
32
|
+
|
|
425
33
|
</style>
|
package/src/theme/global.less
CHANGED
|
@@ -42,6 +42,7 @@ ol {
|
|
|
42
42
|
.table-alert {
|
|
43
43
|
margin-bottom: 16px;
|
|
44
44
|
}
|
|
45
|
+
|
|
45
46
|
// 数据列表 操作
|
|
46
47
|
.table-operator {
|
|
47
48
|
margin-bottom: 18px;
|
|
@@ -83,6 +84,7 @@ ol {
|
|
|
83
84
|
white-space: pre;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
87
|
+
|
|
86
88
|
.ant-form-item-control {
|
|
87
89
|
height: 32px;
|
|
88
90
|
line-height: 32px;
|
|
@@ -108,6 +110,11 @@ ol {
|
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
.ant-checkbox-inner, .ant-checkbox-input, .ant-checkbox {
|
|
114
|
+
width: 20px;
|
|
115
|
+
height: 20px;
|
|
116
|
+
}
|
|
117
|
+
|
|
111
118
|
.ant-layout-footer {
|
|
112
119
|
display: none;
|
|
113
120
|
}
|
|
@@ -116,11 +123,13 @@ ol {
|
|
|
116
123
|
.ant-table {
|
|
117
124
|
width: 100%;
|
|
118
125
|
overflow-x: auto;
|
|
126
|
+
|
|
119
127
|
&-thead > tr,
|
|
120
128
|
&-tbody > tr {
|
|
121
129
|
> th,
|
|
122
130
|
> td {
|
|
123
131
|
white-space: pre;
|
|
132
|
+
|
|
124
133
|
> span {
|
|
125
134
|
display: block;
|
|
126
135
|
}
|