cnhis-design-vue 0.2.42-beta → 0.2.45-beta
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/es/affix/index.js +8 -8
- package/es/affix/style.css +0 -0
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/alert/style.css +0 -0
- package/es/anchor/index.js +8 -8
- package/es/anchor/style.css +0 -0
- package/es/auto-complete/index.js +8 -8
- package/es/auto-complete/style.css +0 -0
- package/es/avatar/index.js +8 -8
- package/es/avatar/style.css +0 -0
- package/es/back-top/index.js +8 -8
- package/es/back-top/style.css +0 -0
- package/es/badge/index.js +8 -8
- package/es/badge/style.css +0 -0
- package/es/base/index.js +8 -8
- package/es/base/style.css +0 -0
- package/es/big-table/index.js +169 -136
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/breadcrumb/style.css +0 -0
- package/es/button/index.js +64 -61
- package/es/calendar/index.js +8 -8
- package/es/calendar/style.css +0 -0
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/card/style.css +0 -0
- package/es/carousel/index.js +8 -8
- package/es/carousel/style.css +0 -0
- package/es/cascader/index.js +8 -8
- package/es/cascader/style.css +0 -0
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/col/style.css +0 -0
- package/es/collapse/index.js +8 -8
- package/es/collapse/style.css +0 -0
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/comment/style.css +0 -0
- package/es/config-provider/index.js +8 -8
- package/es/config-provider/style.css +0 -0
- package/es/date-picker/index.js +8 -8
- package/es/date-picker/style.css +0 -0
- package/es/descriptions/index.js +8 -8
- package/es/descriptions/style.css +0 -0
- package/es/divider/index.js +8 -8
- package/es/divider/style.css +0 -0
- package/es/drag-layout/index.js +39 -36
- package/es/drawer/index.js +8 -8
- package/es/drawer/style.css +0 -0
- package/es/dropdown/index.js +8 -8
- package/es/dropdown/style.css +0 -0
- package/es/editor/index.js +31 -11
- package/es/empty/index.js +8 -8
- package/es/empty/style.css +0 -0
- package/es/fabric-chart/index.js +588 -340
- package/es/fabric-chart/style.css +1 -1
- package/es/form/index.js +8 -8
- package/es/form/style.css +0 -0
- package/es/form-model/index.js +8 -8
- package/es/form-model/style.css +0 -0
- package/es/form-table/index.js +177 -154
- package/es/form-table/style.css +1 -1
- package/es/grid/index.js +24 -0
- package/es/grid/style.css +0 -0
- package/es/icon/style.css +0 -0
- package/es/index/index.js +1647 -1155
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/input-number/style.css +0 -0
- package/es/layout/index.js +8 -8
- package/es/layout/style.css +0 -0
- package/es/list/index.js +8 -8
- package/es/list/style.css +0 -0
- package/es/locale-provider/index.js +8 -8
- package/es/locale-provider/style.css +0 -0
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/mentions/style.css +0 -0
- package/es/menu/index.js +8 -8
- package/es/menu/style.css +0 -0
- package/es/message/index.js +8 -8
- package/es/message/style.css +0 -0
- package/es/modal/style.css +0 -0
- package/es/multi-chat/index.js +176 -146
- package/es/multi-chat/style.css +1 -1
- package/es/multi-chat-client/index.js +169 -139
- package/es/multi-chat-client/style.css +1 -1
- package/es/multi-chat-history/index.js +40 -37
- package/es/multi-chat-record/index.js +50 -47
- package/es/multi-chat-setting/index.js +97 -84
- package/es/multi-chat-setting/style.css +1 -1
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/notification/style.css +0 -0
- package/es/page-header/index.js +8 -8
- package/es/page-header/style.css +0 -0
- package/es/pagination/index.js +8 -8
- package/es/pagination/style.css +0 -0
- package/es/popconfirm/index.js +8 -8
- package/es/popconfirm/style.css +0 -0
- package/es/popover/index.js +8 -8
- package/es/popover/style.css +0 -0
- package/es/progress/index.js +8 -8
- package/es/progress/style.css +0 -0
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/rate/style.css +0 -0
- package/es/result/index.js +8 -8
- package/es/result/style.css +0 -0
- package/es/row/index.js +8 -8
- package/es/row/style.css +0 -0
- package/es/scale-view/index.js +92 -69
- package/es/select/index.js +487 -280
- package/es/select/style.css +1 -1
- package/es/select-label/index.js +78 -55
- package/es/select-person/index.js +63 -63
- package/es/select-person/style.css +1 -1
- package/es/skeleton/index.js +8 -8
- package/es/skeleton/style.css +0 -0
- package/es/slider/index.js +8 -8
- package/es/slider/style.css +0 -0
- package/es/space/index.js +8 -8
- package/es/space/style.css +0 -0
- package/es/spin/index.js +8 -8
- package/es/spin/style.css +0 -0
- package/es/statistic/index.js +8 -8
- package/es/statistic/style.css +0 -0
- package/es/steps/index.js +8 -8
- package/es/steps/style.css +0 -0
- package/es/switch/index.js +8 -8
- package/es/switch/style.css +0 -0
- package/es/table-filter/index.js +205 -171
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tabs/style.css +0 -0
- package/es/tag/index.js +45 -42
- package/es/time-picker/index.js +8 -8
- package/es/time-picker/style.css +0 -0
- package/es/timeline/index.js +8 -8
- package/es/timeline/style.css +0 -0
- package/es/tooltip/index.js +8 -8
- package/es/tooltip/style.css +0 -0
- package/es/transfer/index.js +8 -8
- package/es/transfer/style.css +0 -0
- package/es/tree/index.js +8 -8
- package/es/tree/style.css +0 -0
- package/es/tree-select/index.js +8 -8
- package/es/tree-select/style.css +0 -0
- package/es/upload/index.js +8 -8
- package/es/upload/style.css +0 -0
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +2807 -1378
- package/lib/cui.umd.js +2807 -1378
- package/lib/cui.umd.min.js +77 -77
- package/package.json +4 -2
- package/packages/big-table/src/BigTable.vue +2 -3
- package/packages/big-table/src/utils/bigTableProps.js +9 -1
- package/packages/fabric-chart/src/FabricChart.vue +3 -0
- package/packages/fabric-chart/src/components/DropPopup.vue +0 -2
- package/packages/fabric-chart/src/components/MouseRightClick.vue +1 -1
- package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +5 -1
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +181 -92
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +3 -2
- package/packages/form-table/src/FormTable.vue +1 -1
- package/packages/grid/src/grid.js +3 -0
- package/packages/multi-chat/chat/chatMain.vue +1 -1
- package/packages/multi-chat/setting/index.vue +6 -1
- package/packages/multi-chat/store/actions.js +4 -1
- package/packages/select/src/CustomSelect/index.vue +40 -13
- package/packages/select/src/TableSelect/index.vue +177 -113
- package/packages/select-person/select-person.vue +1 -9
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +8 -1
- package/packages/table-filter/src/components/multi-select/multi-select.vue +0 -1
- package/packages/table-filter/src/components/search-condition/SearchCondition.vue +3 -0
- package/src/component/select-pages/index.vue +2 -2
- package/packages/select/src/CustomSelect/components/select-pages.vue +0 -53
- package/packages/table-filter/src/components/multi-select/select-pages.vue +0 -72
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
import Vue from 'vue';
|
|
7
7
|
import 'xe-utils';
|
|
8
8
|
import VXETable from 'vxe-table';
|
|
9
|
+
import VXETablePluginAntd from 'vxe-table-plugin-antd'
|
|
9
10
|
import Grid from 'vxe-table/lib/grid';
|
|
10
11
|
import 'vxe-table/lib/style.css';
|
|
12
|
+
import 'vxe-table-plugin-antd/dist/style.css'
|
|
11
13
|
|
|
14
|
+
VXETable.use(VXETablePluginAntd);
|
|
12
15
|
import create from '@/core/create';
|
|
13
16
|
import tableMethods from '@/core/table-methods';
|
|
14
17
|
|
|
@@ -332,7 +332,7 @@ export default {
|
|
|
332
332
|
return this.assemblySetting.portraitPanelSetting?.targetIs;
|
|
333
333
|
},
|
|
334
334
|
showBroadcast() {
|
|
335
|
-
let res = (!this.isServer && this.assemblySetting
|
|
335
|
+
let res = (!this.isServer && this.assemblySetting?.broadcast?.PC?.isChecked == 'Y' && this.assemblySetting?.broadcast?.PC?.list?.length > 0) || false;
|
|
336
336
|
return res;
|
|
337
337
|
},
|
|
338
338
|
broadcastCarousel() {
|
|
@@ -56,6 +56,11 @@ export default {
|
|
|
56
56
|
},
|
|
57
57
|
assemblyId: {
|
|
58
58
|
type: [String, Number]
|
|
59
|
+
},
|
|
60
|
+
// 是否单独配置的菜单,比如系统设置->配置管理->进入本页面
|
|
61
|
+
isOtherEntry: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
59
64
|
}
|
|
60
65
|
},
|
|
61
66
|
data() {
|
|
@@ -125,7 +130,7 @@ export default {
|
|
|
125
130
|
},
|
|
126
131
|
useMenuList() {
|
|
127
132
|
let exclude = [];
|
|
128
|
-
if (!this.isOrgAdmin) {
|
|
133
|
+
if (!this.isOtherEntry && !this.isOrgAdmin) {
|
|
129
134
|
exclude = exclude.concat([
|
|
130
135
|
"authority",
|
|
131
136
|
"base-info",
|
|
@@ -53,7 +53,10 @@ export default {
|
|
|
53
53
|
userType,
|
|
54
54
|
relateId: getters.accessParams.relateId
|
|
55
55
|
};
|
|
56
|
-
!isServer
|
|
56
|
+
if (!isServer) {
|
|
57
|
+
params.source = 1;
|
|
58
|
+
params.serviceId = getters.queryParams.serviceId;
|
|
59
|
+
}
|
|
57
60
|
return fetch
|
|
58
61
|
.get(`/chat/${isServer ? 'service' : 'access'}/getHistoryRecord`, {
|
|
59
62
|
params
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a-select v-on="$listeners" v-bind="$attrs" :showSearch="true"
|
|
2
|
+
<a-select v-on="$listeners" v-bind="$attrs" :showSearch="true" @search="debounceSearch" :filterOption="false">
|
|
3
3
|
<div slot="dropdownRender" slot-scope="menu">
|
|
4
|
-
<a-spin v-if="fetching"
|
|
4
|
+
<a-spin style="width: 100%;margin: 100px 0 100px" v-if="fetching" />
|
|
5
5
|
<template v-else>
|
|
6
6
|
<v-nodes :vnodes="menu" />
|
|
7
|
-
<selectPages v-if="PagerConfig.total > 1" :
|
|
7
|
+
<selectPages v-if="PagerConfig.total > 1" :searchPageConfig="PagerConfig" :handleSearchChangePage="ChangePage" />
|
|
8
8
|
</template>
|
|
9
9
|
</div>
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
<a-select-option v-for="(item, i) in items" :key="item.value" :value="item.value" :disabled="showTitle && i === 0">
|
|
11
12
|
<div :class="['custom-select-option', { 'title-line': i === 0 }]">
|
|
12
13
|
<span v-for="(label, k) in item.showLabel" :key="(k + 9).toString(36) + k">{{ label }}</span>
|
|
13
14
|
</div>
|
|
@@ -23,8 +24,8 @@
|
|
|
23
24
|
import Vue from 'vue';
|
|
24
25
|
import { Select, Divider, Icon, Spin } from 'ant-design-vue';
|
|
25
26
|
import create from '@/core/create';
|
|
26
|
-
// import selectPages from './components/select-pages';
|
|
27
27
|
import selectPages from '@/component/select-pages';
|
|
28
|
+
import vexutils from '@/utils/vexutils';
|
|
28
29
|
|
|
29
30
|
export default create({
|
|
30
31
|
name: 'custom-select',
|
|
@@ -36,6 +37,10 @@ export default create({
|
|
|
36
37
|
optionItems: {
|
|
37
38
|
type: Array,
|
|
38
39
|
default: () => []
|
|
40
|
+
},
|
|
41
|
+
showTitle: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
beforeCreate() {
|
|
@@ -54,6 +59,7 @@ export default create({
|
|
|
54
59
|
selectPages
|
|
55
60
|
},
|
|
56
61
|
data() {
|
|
62
|
+
this.debounceSearch = vexutils.debounce(this.debounceSearch, 800);
|
|
57
63
|
return {
|
|
58
64
|
fetching: false,
|
|
59
65
|
items: [],
|
|
@@ -62,15 +68,28 @@ export default create({
|
|
|
62
68
|
};
|
|
63
69
|
},
|
|
64
70
|
mounted() {
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
if (this.optionItems.length) {
|
|
72
|
+
this.fetching = true;
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
this.allItems = this.group(this.showTitle ? this.optionItems.slice(1) : this.optionItems, 20);
|
|
75
|
+
this.PagerConfig.total = this.allItems.length;
|
|
76
|
+
this.items.push(...this.allItems[0]);
|
|
77
|
+
this.fetching = false;
|
|
78
|
+
}, 1000);
|
|
79
|
+
}
|
|
72
80
|
},
|
|
73
81
|
methods: {
|
|
82
|
+
debounceSearch(value) {
|
|
83
|
+
this.PagerConfig.page = 1;
|
|
84
|
+
const filters = this.optionItems.filter(v => v.showLabel.some(k => String(k).includes(value)));
|
|
85
|
+
this.allItems = this.group(this.showTitle && !value ? filters.slice(1) : filters, 20);
|
|
86
|
+
this.PagerConfig.total = this.allItems.length;
|
|
87
|
+
if (this.allItems.length) {
|
|
88
|
+
this.items.splice(0, this.items.length, ...this.allItems[0]);
|
|
89
|
+
} else {
|
|
90
|
+
this.items.splice(0, this.items.length);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
74
93
|
ChangePage(type) {
|
|
75
94
|
this.fetching = true;
|
|
76
95
|
setTimeout(() => {
|
|
@@ -82,8 +101,16 @@ export default create({
|
|
|
82
101
|
group(array, subGroupLength) {
|
|
83
102
|
let index = 0;
|
|
84
103
|
let newArray = [];
|
|
104
|
+
|
|
85
105
|
while (index < array.length) {
|
|
86
|
-
|
|
106
|
+
if (!this.showTitle) {
|
|
107
|
+
newArray.push(array.slice(index, (index += subGroupLength)));
|
|
108
|
+
} else {
|
|
109
|
+
newArray.push([{
|
|
110
|
+
value: `${index}${Date.now()}`,
|
|
111
|
+
showLabel: this.optionItems[0].showLabel
|
|
112
|
+
}, ...array.slice(index, (index += subGroupLength))]);
|
|
113
|
+
}
|
|
87
114
|
}
|
|
88
115
|
return newArray;
|
|
89
116
|
}
|
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
:dropdownStyle="{ 'z-index': 100 }"
|
|
23
23
|
@blur="isSearch = false"
|
|
24
24
|
@focus="isSearch = true"
|
|
25
|
-
@search="
|
|
25
|
+
@search="debounceSearch"
|
|
26
26
|
@change="valueChange"
|
|
27
|
-
@dropdownVisibleChange="dropdownVisibleChange"
|
|
28
27
|
:getPopupContainer="
|
|
29
28
|
triggerNode => {
|
|
30
29
|
return triggerNode.parentNode || document.body;
|
|
@@ -54,6 +53,7 @@
|
|
|
54
53
|
:data="tableData"
|
|
55
54
|
:radio-config="{ trigger: 'row', checkRowKey: defaultSelecteRow }"
|
|
56
55
|
:edit-config="{ trigger: 'click', mode: 'cell' }"
|
|
56
|
+
:edit-rules="rules"
|
|
57
57
|
@radio-change="radioChangeEvent"
|
|
58
58
|
@cell-click="cellClick"
|
|
59
59
|
>
|
|
@@ -61,6 +61,26 @@
|
|
|
61
61
|
<span class="opt-btn" @click="deleteRow(row)">删除</span>
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
|
+
<template v-for="item in colSelectList" #[item.slots.edit]="scope">
|
|
65
|
+
<a-select
|
|
66
|
+
:key="item.slots.edit"
|
|
67
|
+
show-search
|
|
68
|
+
:placeholder="`请选择${item.title}`"
|
|
69
|
+
style="width: 100%"
|
|
70
|
+
:default-active-first-option="false"
|
|
71
|
+
:filter-option="false"
|
|
72
|
+
:not-found-content="null"
|
|
73
|
+
:defaultValue="scope.row[item.field]"
|
|
74
|
+
v-model="scope.row[item.field]"
|
|
75
|
+
@change="$refs.xTable.updateStatus(scope)"
|
|
76
|
+
@search="value => cellSearch(value, scope.row, item.field)"
|
|
77
|
+
>
|
|
78
|
+
<a-select-option :key="option.value" :value="option.value" v-for="option in item.editRender.options">
|
|
79
|
+
{{option.label}}
|
|
80
|
+
</a-select-option>
|
|
81
|
+
</a-select>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
64
84
|
<template #empty>
|
|
65
85
|
<span>
|
|
66
86
|
<p class="no-data">暂无数据</p>
|
|
@@ -74,7 +94,7 @@
|
|
|
74
94
|
<a-button type="primary" style="margin-right: auto" @click="addRow">新增</a-button>
|
|
75
95
|
<span v-show="!isOk" class="tips">请完善表格信息</span>
|
|
76
96
|
<span v-show="isOk && isRepeat" class="tips">表格信息不能重复</span>
|
|
77
|
-
<a-button style="margin-right: 10px" @click="
|
|
97
|
+
<a-button style="margin-right: 10px" @click="cancel">取消</a-button>
|
|
78
98
|
<a-button type="primary" @click="saveRow">确定</a-button>
|
|
79
99
|
</template>
|
|
80
100
|
</div>
|
|
@@ -93,26 +113,7 @@ import Vue from 'vue';
|
|
|
93
113
|
import { Select, Button, Icon, Spin, Pagination } from 'ant-design-vue';
|
|
94
114
|
import Grid from '~/grid';
|
|
95
115
|
import create from '@/core/create';
|
|
96
|
-
|
|
97
|
-
// 防抖
|
|
98
|
-
function debounce(fn, wait, immadiate) {
|
|
99
|
-
let timeout;
|
|
100
|
-
return function () {
|
|
101
|
-
const context = this;
|
|
102
|
-
const args = [...arguments];
|
|
103
|
-
timeout && clearTimeout(timeout);
|
|
104
|
-
if (immadiate) {
|
|
105
|
-
!timeout && fn.apply(context, args);
|
|
106
|
-
timeout = setTimeout(() => {
|
|
107
|
-
timeout = null;
|
|
108
|
-
}, wait);
|
|
109
|
-
} else {
|
|
110
|
-
timeout = setTimeout(() => {
|
|
111
|
-
fn.apply(context, args);
|
|
112
|
-
}, wait);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
+
import vexutils from '@/utils/vexutils';
|
|
116
117
|
|
|
117
118
|
export default create({
|
|
118
119
|
name: 'table-select',
|
|
@@ -123,7 +124,7 @@ export default create({
|
|
|
123
124
|
},
|
|
124
125
|
columns: {
|
|
125
126
|
type: Array,
|
|
126
|
-
|
|
127
|
+
require: true
|
|
127
128
|
},
|
|
128
129
|
data: {
|
|
129
130
|
type: Array,
|
|
@@ -140,13 +141,20 @@ export default create({
|
|
|
140
141
|
fetching: {
|
|
141
142
|
type: Boolean,
|
|
142
143
|
default: false
|
|
144
|
+
},
|
|
145
|
+
validRules: {
|
|
146
|
+
type: Object,
|
|
147
|
+
default: () => {}
|
|
143
148
|
}
|
|
144
149
|
},
|
|
145
150
|
computed: {
|
|
146
151
|
mode() {
|
|
147
152
|
const obj = this.columns.find(v => v.type);
|
|
148
153
|
return obj?.type === 'checkbox' || this.type === 'edit' ? 'multiple' : 'default';
|
|
149
|
-
}
|
|
154
|
+
},
|
|
155
|
+
colSelectList() {
|
|
156
|
+
return this.columns.filter(v => v.slots?.edit);
|
|
157
|
+
},
|
|
150
158
|
},
|
|
151
159
|
beforeCreate() {
|
|
152
160
|
Vue.use(Select).use(Icon).use(Spin).use(Pagination).use(Button);
|
|
@@ -164,14 +172,14 @@ export default create({
|
|
|
164
172
|
return {
|
|
165
173
|
value: this.type === 'edit' ? [] : '',
|
|
166
174
|
tableData: [],
|
|
167
|
-
debounceSearch: '',
|
|
168
175
|
setDefaultValue: true,
|
|
169
176
|
defaultSelecteRow: '',
|
|
170
177
|
isOpen: false,
|
|
171
178
|
isOk: true,
|
|
172
179
|
isRepeat: false,
|
|
173
180
|
page: 1, // 配置page是因为,使用时分页触发page没有同步
|
|
174
|
-
isSearch: true
|
|
181
|
+
isSearch: true,
|
|
182
|
+
rules: {}
|
|
175
183
|
};
|
|
176
184
|
},
|
|
177
185
|
watch: {
|
|
@@ -179,13 +187,15 @@ export default create({
|
|
|
179
187
|
handler(value) {
|
|
180
188
|
if (value) {
|
|
181
189
|
this.tableData = JSON.parse(JSON.stringify(this.data));
|
|
190
|
+
const { defaultValue = '' } = this.$attrs;
|
|
182
191
|
// 默认值相关
|
|
183
|
-
if (this.tableData.length && this.type === 'noEdit' && this.setDefaultValue &&
|
|
184
|
-
this.value =
|
|
185
|
-
this.defaultSelecteRow = this.tableData.find(v => v[this.selectAttr] ===
|
|
192
|
+
if (this.tableData.length && this.type === 'noEdit' && this.setDefaultValue && defaultValue) {
|
|
193
|
+
this.value = defaultValue;
|
|
194
|
+
this.defaultSelecteRow = this.tableData.find(v => v[this.selectAttr] === defaultValue).id;
|
|
186
195
|
this.setDefaultValue = false;
|
|
187
196
|
}
|
|
188
|
-
|
|
197
|
+
|
|
198
|
+
if (this.type === 'edit' && this.tableData.length) {
|
|
189
199
|
this.setValues(this.tableData);
|
|
190
200
|
}
|
|
191
201
|
}
|
|
@@ -195,60 +205,73 @@ export default create({
|
|
|
195
205
|
}
|
|
196
206
|
},
|
|
197
207
|
mounted() {
|
|
198
|
-
this.$nextTick(() => {
|
|
199
|
-
|
|
200
|
-
// console.log(e.path);
|
|
201
|
-
// const focusCondition = e.path.some(v => v.innerHTML.includes('table-select') && v.innerHTML.includes('ant-select-selection__rendered'));
|
|
202
|
-
// if (focusCondition) {
|
|
203
|
-
// console.log('应该获取焦点');
|
|
204
|
-
// this.$refs.selectBox.focus();
|
|
205
|
-
// }
|
|
206
|
-
// if (!e.path.some(v => v.className === 'ant-select-dropdown-content' || v.className === 'table-select')) {
|
|
207
|
-
// this.isOpen = false;
|
|
208
|
-
// this.$refs.selectBox.blur();
|
|
209
|
-
// }
|
|
210
|
-
// };
|
|
208
|
+
this.$nextTick().then(() => {
|
|
209
|
+
document.addEventListener('mouseup', this.handlerMouseUp, true);
|
|
211
210
|
});
|
|
212
211
|
},
|
|
213
212
|
created() {
|
|
214
213
|
this.init();
|
|
215
214
|
},
|
|
216
215
|
methods: {
|
|
216
|
+
cellSearch(value, row, field) {
|
|
217
|
+
// 需要处理:保留不为空的上一个的value值
|
|
218
|
+
if (value) {
|
|
219
|
+
row[field] = value;
|
|
220
|
+
}
|
|
221
|
+
},
|
|
217
222
|
mousedown(e) {
|
|
218
|
-
// console.log(e);
|
|
219
223
|
this.isOpen = true;
|
|
224
|
+
this.type === 'edit' && (this.isOk = true);
|
|
220
225
|
if (e.target?.className === 'ant-select-selection__rendered') {
|
|
221
|
-
this.
|
|
222
|
-
|
|
226
|
+
if (this.type === 'noEdit') {
|
|
227
|
+
this.isSearch = true;
|
|
228
|
+
// 展开就搜索会导致当前选中行显示错误
|
|
229
|
+
// this.onSearch('');
|
|
230
|
+
}
|
|
223
231
|
e.preventDefault();
|
|
224
232
|
}
|
|
225
233
|
},
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
handlerMouseUp(e) {
|
|
235
|
+
const target = e.target;
|
|
236
|
+
const className = target?.className;
|
|
237
|
+
if (this.isOpen) {
|
|
238
|
+
if (!this.$el?.contains(target) && !className?.includes('vxe-select-option') && !className?.includes('ant-select-dropdown-menu-item')) {
|
|
239
|
+
if (this.type === 'noEdit') {
|
|
240
|
+
this.isOpen = false;
|
|
241
|
+
} else {
|
|
242
|
+
this.cancel();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
228
246
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
// this.$refs.selectBox.focus();
|
|
234
|
-
// } else {
|
|
235
|
-
// // this.isOpen = false;
|
|
236
|
-
// this.$refs.selectBox.blur();
|
|
237
|
-
// }
|
|
247
|
+
init() {
|
|
248
|
+
this.debounceSearch = vexutils.debounce(this.debounceSearch, 800);
|
|
249
|
+
|
|
250
|
+
this.setValidRules();
|
|
238
251
|
},
|
|
239
|
-
|
|
240
|
-
if (this.type === '
|
|
241
|
-
|
|
242
|
-
|
|
252
|
+
setValidRules() {
|
|
253
|
+
if (this.type === 'edit') {
|
|
254
|
+
if (!Object.keys(this.validRules || {}).length) {
|
|
255
|
+
const rules = {};
|
|
256
|
+
this.columns.forEach(v => {
|
|
257
|
+
v.field && (rules[v.field] = [{ required: true, message: `请填入${v.title}` }]);
|
|
258
|
+
});
|
|
259
|
+
this.$set(this, 'rules', rules);
|
|
260
|
+
} else {
|
|
261
|
+
this.$set(this, 'rules', JSON.parse(JSON.stringify(this.validRules)));
|
|
262
|
+
}
|
|
243
263
|
}
|
|
244
264
|
},
|
|
245
|
-
|
|
246
|
-
if (this.
|
|
247
|
-
this
|
|
248
|
-
|
|
249
|
-
|
|
265
|
+
debounceSearch(value) {
|
|
266
|
+
if (this.type === 'noEdit') {
|
|
267
|
+
if (this.isSearch) {
|
|
268
|
+
// 防止离开焦点时触发paginationchange
|
|
269
|
+
this.$emit('update:fetching', true);
|
|
270
|
+
this.page = 1;
|
|
271
|
+
this.$emit('paginationchange', { page: 1, selectAttrVal: value });
|
|
272
|
+
}
|
|
273
|
+
if (!this.isSearch && !value) this.isSearch = true;
|
|
250
274
|
}
|
|
251
|
-
if (!this.isSearch && !value) this.isSearch = true;
|
|
252
275
|
},
|
|
253
276
|
change(page, pageSize) {
|
|
254
277
|
this.$emit('update:fetching', true);
|
|
@@ -278,56 +301,90 @@ export default create({
|
|
|
278
301
|
const $table = this.$refs.xTable;
|
|
279
302
|
const tableData = $table.getTableData().tableData;
|
|
280
303
|
let record = {
|
|
281
|
-
id: tableData.length ?
|
|
304
|
+
id: tableData.length ? +(tableData[tableData.length - 1]?.id || 0) + 1 + '' : '1'
|
|
282
305
|
};
|
|
283
|
-
// if (this.tableData.length) {
|
|
284
|
-
// const row = this.tableData[0];
|
|
285
|
-
// record = JSON.parse(JSON.stringify(row));
|
|
286
|
-
// record.id = parseInt(tableData[tableData.length - 1].id) + 1;
|
|
287
|
-
// } else {
|
|
288
306
|
this.columns.forEach(v => {
|
|
289
307
|
if (v.field) {
|
|
290
308
|
record[v.field] = '';
|
|
291
309
|
}
|
|
310
|
+
if (v?.slots?.edit) {
|
|
311
|
+
record[v.field] = undefined;
|
|
312
|
+
}
|
|
292
313
|
});
|
|
293
|
-
// }
|
|
294
314
|
const { row: newRow } = await $table.insertAt(record, -1);
|
|
295
|
-
// await $table.setActiveCell(newRow, Object.keys(record)[0]);
|
|
296
315
|
},
|
|
297
316
|
async deleteRow(row) {
|
|
298
317
|
const $table = this.$refs.xTable;
|
|
299
318
|
const index = $table.getRowIndex(row);
|
|
300
319
|
await $table.remove(row);
|
|
301
|
-
this.value.splice(index, 1);
|
|
320
|
+
!!~index && this.value.splice(index, 1);
|
|
302
321
|
},
|
|
303
|
-
|
|
322
|
+
async cancel() {
|
|
323
|
+
this.isOpen = false;
|
|
324
|
+
const index = this.value?.length || 0;
|
|
304
325
|
const $table = this.$refs.xTable;
|
|
305
326
|
const tableData = $table.getTableData().tableData;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
327
|
+
const invalidTableData = tableData.slice(index);
|
|
328
|
+
index !== tableData.length && (await $table.remove(invalidTableData));
|
|
329
|
+
},
|
|
330
|
+
async saveRow() {
|
|
331
|
+
const $table = this.$refs.xTable;
|
|
332
|
+
const tableData = $table.getTableData().tableData;
|
|
333
|
+
// 校验已经填入数据的行全部值不能为空
|
|
334
|
+
// const effectiveTableData = tableData.filter(v => Object.keys(v).some(k => k !== 'id' && (v[k] !== '' || v[k].length)));
|
|
335
|
+
// const invalidTableData = tableData.filter(v => Object.keys(v).every(k => k !== 'id' && (!v[k]?.length))); // 失效的数据,即新增全部为空的
|
|
336
|
+
|
|
337
|
+
const effectiveTableData = tableData.filter(v => {
|
|
338
|
+
return Object.keys(v).some(k => {
|
|
339
|
+
if (k == 'id') {
|
|
340
|
+
return false;
|
|
341
|
+
} else {
|
|
342
|
+
return v[k] || v[k]?.length;
|
|
343
|
+
}
|
|
344
|
+
})
|
|
309
345
|
});
|
|
346
|
+
const invalidTableData = tableData.filter(v => {
|
|
347
|
+
return Object.keys(v).every(k => {
|
|
348
|
+
if (k == 'id') {
|
|
349
|
+
return true;
|
|
350
|
+
} else {
|
|
351
|
+
return !v[k]?.length;
|
|
352
|
+
}
|
|
353
|
+
})
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
let isOk = false;
|
|
357
|
+
if (Object.keys(this.rules).length && this.type === 'edit') {
|
|
358
|
+
const errMap = await $table.validate(effectiveTableData).catch(errMap => errMap);
|
|
359
|
+
isOk = !errMap ? true : false;
|
|
360
|
+
} else {
|
|
361
|
+
isOk = effectiveTableData.every(v => Object.values(v).every(k => k !== '' || v.length));
|
|
362
|
+
}
|
|
363
|
+
|
|
310
364
|
if (isOk) {
|
|
311
365
|
this.isOk = true;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (newArr.length !== this.value.length) {
|
|
326
|
-
this.isRepeat = true;
|
|
366
|
+
this.setValues(effectiveTableData);
|
|
367
|
+
$table.remove(invalidTableData);
|
|
368
|
+
// 去重 表格信息不能重复,否则会报警告
|
|
369
|
+
let newArr = effectiveTableData.reduce((pre, cur) => {
|
|
370
|
+
let newCur = { ...cur };
|
|
371
|
+
newCur.id && delete newCur.id;
|
|
372
|
+
const index = pre.findIndex(v => {
|
|
373
|
+
let newV = { ...v };
|
|
374
|
+
newV.id && delete newV.id;
|
|
375
|
+
return JSON.stringify(newV) === JSON.stringify(newCur);
|
|
376
|
+
});
|
|
377
|
+
if (!~index) {
|
|
378
|
+
return pre.concat(cur);
|
|
327
379
|
} else {
|
|
328
|
-
|
|
329
|
-
this.isOpen = false;
|
|
380
|
+
return pre;
|
|
330
381
|
}
|
|
382
|
+
}, []);
|
|
383
|
+
if (newArr.length !== this.value.length) {
|
|
384
|
+
this.isRepeat = true;
|
|
385
|
+
} else {
|
|
386
|
+
this.isRepeat = false;
|
|
387
|
+
this.isOpen = false;
|
|
331
388
|
}
|
|
332
389
|
} else {
|
|
333
390
|
this.isOk = false;
|
|
@@ -336,10 +393,18 @@ export default create({
|
|
|
336
393
|
setValues(tableData) {
|
|
337
394
|
this.value = tableData.map(v => {
|
|
338
395
|
let newV = { ...v };
|
|
339
|
-
Object.keys(v).
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
396
|
+
Object.keys(v).forEach(k => {
|
|
397
|
+
if (!this.selectAttr || this.selectAttr.includes(k)) {
|
|
398
|
+
const cellObj = this.columns.find(j => j.field === k);
|
|
399
|
+
if (cellObj?.editRender?.name.includes('$select')) {
|
|
400
|
+
newV[k] = cellObj.editRender.options.find(q => q.value == v[k])?.label || '';
|
|
401
|
+
}
|
|
402
|
+
if (cellObj?.editRender?.name.includes('ASelect')) {
|
|
403
|
+
newV[k] = cellObj.editRender.options.find(q => q.value == v[k])?.label || v[k];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (this.selectAttr && !this.selectAttr.includes(k)) {
|
|
407
|
+
delete newV[k];
|
|
343
408
|
}
|
|
344
409
|
});
|
|
345
410
|
if (newV.id) delete newV.id;
|
|
@@ -354,6 +419,9 @@ export default create({
|
|
|
354
419
|
await $table.remove(tableData[index]);
|
|
355
420
|
this.value = value;
|
|
356
421
|
}
|
|
422
|
+
},
|
|
423
|
+
beforeDestroy() {
|
|
424
|
+
document.removeEventListener('mouseup', this.handlerMouseUp, true);
|
|
357
425
|
}
|
|
358
426
|
});
|
|
359
427
|
</script>
|
|
@@ -404,6 +472,13 @@ export default create({
|
|
|
404
472
|
font-size: 14px;
|
|
405
473
|
}
|
|
406
474
|
}
|
|
475
|
+
|
|
476
|
+
.ant-select-selection--single {
|
|
477
|
+
height: 28px;
|
|
478
|
+
.ant-select-selection__rendered {
|
|
479
|
+
line-height: 28px;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
407
482
|
}
|
|
408
483
|
.vxe-cell .vxe-default-input,
|
|
409
484
|
.vxe-cell .vxe-default-select,
|
|
@@ -415,17 +490,6 @@ export default create({
|
|
|
415
490
|
height: 28px;
|
|
416
491
|
}
|
|
417
492
|
}
|
|
418
|
-
// @{deep} .ant-pagination-prev,
|
|
419
|
-
// @{deep} .ant-pagination-next,
|
|
420
|
-
// @{deep} .ant-pagination-jump-prev,
|
|
421
|
-
// @{deep} .ant-pagination-item,
|
|
422
|
-
// @{deep} .ant-pagination-options-quick-jumper,
|
|
423
|
-
// @{deep} .ant-select-selection--single,
|
|
424
|
-
// @{deep} .ant-pagination-jump-next {
|
|
425
|
-
// min-width: 30px;
|
|
426
|
-
// height: 30px;
|
|
427
|
-
// line-height: 30px;
|
|
428
|
-
// }
|
|
429
493
|
@{deep} .table-select .ant-pagination-item-active a {
|
|
430
494
|
color: #5585f5 !important;
|
|
431
495
|
}
|
|
@@ -43,13 +43,11 @@
|
|
|
43
43
|
</div>
|
|
44
44
|
<!-- main tree -->
|
|
45
45
|
<a-tree
|
|
46
|
-
v-on="$listeners"
|
|
47
46
|
class="main-tree-container"
|
|
48
47
|
v-show="search.status == 0"
|
|
49
48
|
ref="antTree"
|
|
50
49
|
v-model="checkedKeys.main"
|
|
51
50
|
@expand="onExpand"
|
|
52
|
-
@check="onCheck"
|
|
53
51
|
checkable
|
|
54
52
|
:expandedKeys="expandedKeys"
|
|
55
53
|
:autoExpandParent="autoExpandParent"
|
|
@@ -334,6 +332,7 @@ export default create({
|
|
|
334
332
|
this.isAllCheck(val);
|
|
335
333
|
this.isSearchAllCheck(val)
|
|
336
334
|
// this.handleEmitValue();
|
|
335
|
+
this.$emit("check", val);
|
|
337
336
|
}
|
|
338
337
|
},
|
|
339
338
|
data: {
|
|
@@ -835,13 +834,6 @@ export default create({
|
|
|
835
834
|
this.searchFetch();
|
|
836
835
|
},
|
|
837
836
|
|
|
838
|
-
// 选中事件
|
|
839
|
-
onCheck() {
|
|
840
|
-
// this.$emit('check', ...arg)
|
|
841
|
-
// console.log(arguments, "oncheck");
|
|
842
|
-
// console.log(this.checkedKeys.main, "checkedKeys.main");
|
|
843
|
-
},
|
|
844
|
-
|
|
845
837
|
isAllCheck(checkedKeys = []) {
|
|
846
838
|
if (!checkedKeys || checkedKeys.length == 0) {
|
|
847
839
|
this.indeterminate = false;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</a-dropdown>
|
|
31
31
|
</div>
|
|
32
32
|
<slot name="classification"></slot>
|
|
33
|
-
<li v-if="
|
|
33
|
+
<li v-if="showQuickSearch" ref="quickSearchLi">
|
|
34
34
|
<a-button class="search-default" type="default" @click="foldQuickSearch">
|
|
35
35
|
<svg-icon icon-class="xitongtubiaoBIxitongshaixuan" style="color: #2d7aff; margin-right: 6px"></svg-icon>
|
|
36
36
|
筛选 {{ qqConObjCount ? `(${qqConObjCount})` : '' }}
|
|
@@ -745,11 +745,18 @@ export default create({
|
|
|
745
745
|
return item.formTitle || item.alias || item.title;
|
|
746
746
|
})
|
|
747
747
|
.filter(Boolean);
|
|
748
|
+
if(!strList?.length) return ''
|
|
748
749
|
str = "输入" + strList.join("/");
|
|
749
750
|
return str || "请输入关键字搜索";
|
|
750
751
|
},
|
|
751
752
|
showRelatedSearch() {
|
|
752
753
|
return this.showRelatedTreeBtn && this.isShowSetting('hideSearch')
|
|
754
|
+
},
|
|
755
|
+
showQuickSearch() {
|
|
756
|
+
let showQuick = this.isShowSetting('hideQuickSearch')
|
|
757
|
+
// 平铺列表, 左侧不为tree, 而是table
|
|
758
|
+
if(this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != "TREE") return showQuick
|
|
759
|
+
return showQuick && this.isRelatedSearchFold
|
|
753
760
|
}
|
|
754
761
|
},
|
|
755
762
|
data() {
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
<script>
|
|
64
64
|
import { Select, Spin, Icon,Button } from 'ant-design-vue';
|
|
65
65
|
import utils from '@/utils/utils-map';
|
|
66
|
-
// import selectPages from './select-pages';
|
|
67
66
|
import selectPages from '@/component/select-pages';
|
|
68
67
|
export default {
|
|
69
68
|
name: 'multiSelect',
|