mooho-base-admin-plus 2.9.5 → 2.10.1
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/history.md +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +3210 -3588
- package/package/mooho-base-admin-plus.min.js +38 -38
- package/package/style.css +1 -1
- package/package.json +1 -1
- package/src/api/application.js +9 -0
- package/src/api/i18nText.js +17 -0
- package/src/api/task.js +10 -0
- package/src/components/input/dialog-select.vue +0 -2
- package/src/components/view/modal-setting-filtering.vue +197 -0
- package/src/components/view/modal-setting-sorting.vue +166 -0
- package/src/components/view/table-setting.vue +6 -33
- package/src/components/view/view-table.vue +13 -9
- package/src/components/workflow/task-form.vue +26 -0
- package/src/pages/common/home.vue +2 -2
- package/src/pages/system/i18nText.vue +35 -2
- package/src/pages/system/tableView.vue +5 -41
- package/src/pages/template/processPage.vue +84 -9
- package/src/store/modules/admin/modules/user.js +0 -1
- package/test/pages/test/issueReport.vue +21 -0
- package/src/components/view/modal-form-filter.vue +0 -322
- package/src/components/view/modal-form-sort.vue +0 -253
|
@@ -7,11 +7,23 @@
|
|
|
7
7
|
<view-form ref="form" view-code="I18nTextFilter" @on-change="formChange"></view-form>
|
|
8
8
|
<div v-if="canSave" style="margin-bottom: 8px; text-align: center">
|
|
9
9
|
<Button type="primary" style="margin-right: 8px" custom-icon="fa fa-save" @click="save()">{{ $t('Front_Btn_Save') }}</Button>
|
|
10
|
-
<Button
|
|
10
|
+
<Button
|
|
11
|
+
v-if="i18nType == 'Server' || i18nType == 'Front'"
|
|
12
|
+
type="primary"
|
|
13
|
+
style="margin-right: 8px"
|
|
14
|
+
custom-icon="fa fa-plus"
|
|
15
|
+
@click="$refs.newForm.openDefault({ i18nType: i18nType })"
|
|
16
|
+
>
|
|
11
17
|
{{ $t('Front_Btn_Add') }}
|
|
12
18
|
</Button>
|
|
19
|
+
<Button v-if="allow('export')" style="margin-right: 8px" type="info" custom-icon="fa fa-cloud-download-alt" @click="exportFile()">{{ $t('Front_Btn_Export') }}</Button>
|
|
20
|
+
<file-upload v-if="allow('import')" url="api/I18nText/importFile" accept=".i18n" @on-success="importFileSuccess">
|
|
21
|
+
<template #>
|
|
22
|
+
<Button type="primary" custom-icon="fa fa-cloud-upload-alt">{{ $t('Front_Btn_Import') }}</Button>
|
|
23
|
+
</template>
|
|
24
|
+
</file-upload>
|
|
13
25
|
</div>
|
|
14
|
-
<view-table ref="table" view-code="I18nText" :static="true" :onSearch="loadData">
|
|
26
|
+
<view-table ref="table" view-code="I18nText" :static="true" :select-enable="true" :onSearch="loadData">
|
|
15
27
|
<template #command="{ row }">
|
|
16
28
|
<Button
|
|
17
29
|
v-if="i18nType == 'Server' || i18nType == 'Front'"
|
|
@@ -92,6 +104,27 @@
|
|
|
92
104
|
this.loadData();
|
|
93
105
|
});
|
|
94
106
|
});
|
|
107
|
+
},
|
|
108
|
+
// 导出文件
|
|
109
|
+
exportFile() {
|
|
110
|
+
let ids = this.$refs.table.getSelected().map(x => {
|
|
111
|
+
return x.id;
|
|
112
|
+
});
|
|
113
|
+
if (ids.length > 0) {
|
|
114
|
+
i18nTextApi.exportFile(ids);
|
|
115
|
+
} else {
|
|
116
|
+
this.error('Front_Msg_Please_Select_Export_Item');
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
// 导入成功
|
|
120
|
+
importFileSuccess(res) {
|
|
121
|
+
if (res.code == 0) {
|
|
122
|
+
this.success('Front_Msg_Success', () => {
|
|
123
|
+
this.loadData();
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
this.error(res.message);
|
|
127
|
+
}
|
|
95
128
|
}
|
|
96
129
|
}
|
|
97
130
|
};
|
|
@@ -34,18 +34,10 @@
|
|
|
34
34
|
<Input type="text" :readonly="true" v-model="data.keywordColumn" @click="keywordColumnOpen()"></Input>
|
|
35
35
|
</div>
|
|
36
36
|
<div v-if="code == 'sorting'">
|
|
37
|
-
<
|
|
38
|
-
<template #prepend>
|
|
39
|
-
<Button custom-icon="fa fa-edit" @click="openSort"></Button>
|
|
40
|
-
</template>
|
|
41
|
-
</Input>
|
|
37
|
+
<modal-setting-sorting ref="settingSorting" v-model="data.sorting" :is-data-source="data.isDataSource" :model="data.model" :data-source="data.dataSource" />
|
|
42
38
|
</div>
|
|
43
39
|
<div v-if="code == 'filtering'">
|
|
44
|
-
<
|
|
45
|
-
<template #prepend>
|
|
46
|
-
<Button custom-icon="fa fa-edit" @click="openFilter"></Button>
|
|
47
|
-
</template>
|
|
48
|
-
</Input>
|
|
40
|
+
<modal-setting-filtering ref="settingFiltering" v-model="data.filtering" :is-data-source="data.isDataSource" :model="data.model" :data-source="data.dataSource" />
|
|
49
41
|
</div>
|
|
50
42
|
<div v-if="code == 'batchSelectDataCode'">
|
|
51
43
|
<Input type="text" :readonly="true" v-model="$refs.form.data.batchSelectDataCode" @click="openColumnCheck($refs.form.data, 'batchSelectDataCode')">
|
|
@@ -172,8 +164,6 @@
|
|
|
172
164
|
<Button type="primary" v-if="canCopy" custom-icon="fa fa-copy" @click="copy">{{ $t('Front_Btn_Copy') }}</Button>
|
|
173
165
|
</template>
|
|
174
166
|
</modal-form>
|
|
175
|
-
<modal-form-sort ref="modal_sort" :sort="data.sorting" :dataView="data" @bindSort="bindSort" />
|
|
176
|
-
<modal-form-filter ref="modal_filter" :filter="data.filtering" :dataView="data" @bindFilter="bindFilter" />
|
|
177
167
|
<table-setting ref="tableSetting" />
|
|
178
168
|
<filter-setting ref="filterSetting" />
|
|
179
169
|
<column-select ref="columnSelect" />
|
|
@@ -194,11 +184,13 @@
|
|
|
194
184
|
import groupMethod from '../../components/view/group-method.vue';
|
|
195
185
|
import groupColumn from '../../components/view/group-column.vue';
|
|
196
186
|
import conditionEdit from '../../components/view/condition-edit.vue';
|
|
187
|
+
import modalSettingSorting from '../../components/view/modal-setting-sorting.vue';
|
|
188
|
+
import modalSettingFiltering from '../../components/view/modal-setting-filtering.vue';
|
|
197
189
|
|
|
198
190
|
export default {
|
|
199
191
|
name: 'system-ui-tableView',
|
|
200
192
|
mixins: [mixinPage],
|
|
201
|
-
components: { columnSelect, columnCheck, filterSetting, groupMethod, groupColumn,
|
|
193
|
+
components: { columnSelect, columnCheck, conditionEdit, filterSetting, groupMethod, groupColumn, modalSettingFiltering, modalSettingSorting },
|
|
202
194
|
data() {
|
|
203
195
|
return {
|
|
204
196
|
filter: {
|
|
@@ -267,34 +259,6 @@
|
|
|
267
259
|
let res = await filterColumnApi.queryByDataViewID(row.id);
|
|
268
260
|
this.$refs.filterSetting.open(row, res.data);
|
|
269
261
|
},
|
|
270
|
-
//绑定排序组件返回的排序json
|
|
271
|
-
bindSort(value) {
|
|
272
|
-
this.$refs.form.data.sorting = value;
|
|
273
|
-
// this.data.sorting = value;
|
|
274
|
-
},
|
|
275
|
-
//绑定筛选组件返回的排序json
|
|
276
|
-
bindFilter(value) {
|
|
277
|
-
this.$refs.form.data.filtering = value;
|
|
278
|
-
// this.data.filtering = value;
|
|
279
|
-
},
|
|
280
|
-
// 打开排序编辑框
|
|
281
|
-
async openSort() {
|
|
282
|
-
if (!this.$refs.form.data.model == '') {
|
|
283
|
-
this.data = this.$refs.form.data;
|
|
284
|
-
this.$refs.modal_sort.open();
|
|
285
|
-
} else {
|
|
286
|
-
this.error('Front_Msg_Please_Select_Model_First');
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
// 打开筛选编辑框
|
|
290
|
-
async openFilter() {
|
|
291
|
-
if (!this.$refs.form.data.model == '') {
|
|
292
|
-
this.data = this.$refs.form.data;
|
|
293
|
-
this.$refs.modal_filter.open();
|
|
294
|
-
} else {
|
|
295
|
-
this.error('Front_Msg_Please_Select_Model_First');
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
262
|
// 导出文件
|
|
299
263
|
exportFile() {
|
|
300
264
|
let ids = this.$refs.table.getSelected().map(x => {
|
|
@@ -4,10 +4,29 @@
|
|
|
4
4
|
<PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
|
|
5
5
|
</div>
|
|
6
6
|
<Card :bordered="false" dis-hover class="ivu-mt">
|
|
7
|
-
|
|
7
|
+
{{ allow('create') }}
|
|
8
|
+
<view-table ref="table" v-if="page" :create-enable="allow('create')" @create="create">
|
|
9
|
+
<template #top>
|
|
10
|
+
<slot name="top"></slot>
|
|
11
|
+
</template>
|
|
8
12
|
<template #filter>
|
|
9
13
|
<slot name="filter"></slot>
|
|
10
14
|
</template>
|
|
15
|
+
<template #customFilter>
|
|
16
|
+
<slot name="customFilter"></slot>
|
|
17
|
+
</template>
|
|
18
|
+
<template #filterColumn="{ column, code }">
|
|
19
|
+
<slot name="filterColumn" :column="column" :code="code"></slot>
|
|
20
|
+
</template>
|
|
21
|
+
<template #filterCommand>
|
|
22
|
+
<slot name="filterCommand"></slot>
|
|
23
|
+
</template>
|
|
24
|
+
<template #middle>
|
|
25
|
+
<slot name="middle"></slot>
|
|
26
|
+
</template>
|
|
27
|
+
<template #commandBefore="{ row, index }">
|
|
28
|
+
<slot name="commandBefore" :row="row" :index="index"></slot>
|
|
29
|
+
</template>
|
|
11
30
|
<template #command="{ row, index }">
|
|
12
31
|
<Button
|
|
13
32
|
size="small"
|
|
@@ -30,6 +49,21 @@
|
|
|
30
49
|
</view-table>
|
|
31
50
|
</Card>
|
|
32
51
|
<modal-form ref="form" v-if="page" @on-after-save="$refs.table.loadData()">
|
|
52
|
+
<template #top>
|
|
53
|
+
<slot name="formTop"></slot>
|
|
54
|
+
</template>
|
|
55
|
+
<template #tableColumn="{ table, tableColumn, tableCode, row, index, column, code }">
|
|
56
|
+
<slot name="formTableCommand" :table="table" :tableColumn="tableColumn" :tableCode="tableCode" :row="row" :index="row" :column="column" :code="code"></slot>
|
|
57
|
+
</template>
|
|
58
|
+
<template #tableCommand="{ table, tableColumn, tableCode, row, index }">
|
|
59
|
+
<slot name="formTableCommand" :table="table" :tableColumn="tableColumn" :tableCode="tableCode" :row="row" :index="row"></slot>
|
|
60
|
+
</template>
|
|
61
|
+
<template #column="{ form, data, column, code }">
|
|
62
|
+
<slot name="formColumn" :form="form" :data="data" :column="column" :code="code"></slot>
|
|
63
|
+
</template>
|
|
64
|
+
<template #bottom>
|
|
65
|
+
<slot name="formBottom"></slot>
|
|
66
|
+
</template>
|
|
33
67
|
<template #footer>
|
|
34
68
|
<span></span>
|
|
35
69
|
<Button type="primary" custom-icon="fa fa-cloud-upload-alt" @click="submit">{{ $t('Front_Btn_Submit') }}</Button>
|
|
@@ -37,7 +71,7 @@
|
|
|
37
71
|
<Button
|
|
38
72
|
type="warning"
|
|
39
73
|
v-if="
|
|
40
|
-
|
|
74
|
+
isCancelable &&
|
|
41
75
|
$refs.form &&
|
|
42
76
|
$refs.form.data &&
|
|
43
77
|
$refs.form.data.application &&
|
|
@@ -60,8 +94,38 @@
|
|
|
60
94
|
</template>
|
|
61
95
|
</modal-form>
|
|
62
96
|
<modal-form ref="showForm" v-if="page" :readonly="page.showViewCode == null" @on-after-save="$refs.table.loadData()">
|
|
97
|
+
<template #top>
|
|
98
|
+
<slot name="showFormTop"></slot>
|
|
99
|
+
</template>
|
|
100
|
+
<template #tableColumn="{ table, tableColumn, tableCode, row, index, column, code }">
|
|
101
|
+
<slot name="showFormTableCommand" :table="table" :tableColumn="tableColumn" :tableCode="tableCode" :row="row" :index="row" :column="column" :code="code"></slot>
|
|
102
|
+
</template>
|
|
103
|
+
<template #tableCommand="{ table, tableColumn, tableCode, row, index }">
|
|
104
|
+
<slot name="showFormTableCommand" :table="table" :tableColumn="tableColumn" :tableCode="tableCode" :row="row" :index="row"></slot>
|
|
105
|
+
</template>
|
|
106
|
+
<template #column="{ form, data, column, code }">
|
|
107
|
+
<slot name="showFormColumn" :form="form" :data="data" :column="column" :code="code"></slot>
|
|
108
|
+
</template>
|
|
109
|
+
<template #bottom>
|
|
110
|
+
<slot name="showFormBottom"></slot>
|
|
111
|
+
</template>
|
|
63
112
|
<template #footer>
|
|
64
113
|
<span></span>
|
|
114
|
+
<Button
|
|
115
|
+
type="warning"
|
|
116
|
+
v-if="
|
|
117
|
+
isRecallable &&
|
|
118
|
+
$refs.showForm &&
|
|
119
|
+
$refs.showForm.data &&
|
|
120
|
+
$refs.showForm.data.application &&
|
|
121
|
+
$refs.showForm.data.applicationID &&
|
|
122
|
+
$refs.showForm.data.application.status == 'Running'
|
|
123
|
+
"
|
|
124
|
+
custom-icon="fa fa-reply-all"
|
|
125
|
+
@click="recall"
|
|
126
|
+
>
|
|
127
|
+
{{ $t('Front_Btn_Recall') }}
|
|
128
|
+
</Button>
|
|
65
129
|
<Button
|
|
66
130
|
type="primary"
|
|
67
131
|
v-if="
|
|
@@ -139,7 +203,9 @@
|
|
|
139
203
|
messageData: {
|
|
140
204
|
message: null
|
|
141
205
|
},
|
|
142
|
-
messageOpened: false
|
|
206
|
+
messageOpened: false,
|
|
207
|
+
isCancelable: false,
|
|
208
|
+
isRecallable: false
|
|
143
209
|
};
|
|
144
210
|
},
|
|
145
211
|
props: {
|
|
@@ -158,11 +224,6 @@
|
|
|
158
224
|
// 申请类别
|
|
159
225
|
applicationTypeCode: {
|
|
160
226
|
type: String
|
|
161
|
-
},
|
|
162
|
-
// 允许撤销
|
|
163
|
-
cancelEnable: {
|
|
164
|
-
type: Boolean,
|
|
165
|
-
default: true
|
|
166
227
|
}
|
|
167
228
|
},
|
|
168
229
|
computed: {},
|
|
@@ -198,9 +259,12 @@
|
|
|
198
259
|
...mapActions('admin/viewPage', { loadPage: 'load' }),
|
|
199
260
|
// 初始化
|
|
200
261
|
async init() {
|
|
262
|
+
this.isCancelable = this.page.applicationType.isCancelable;
|
|
263
|
+
this.isRecallable = this.page.applicationType.isRecallable;
|
|
264
|
+
|
|
201
265
|
setTimeout(() => {
|
|
202
266
|
if (!this.allow('all')) {
|
|
203
|
-
this.
|
|
267
|
+
this.filterData['createUserID'] = this.info.id;
|
|
204
268
|
}
|
|
205
269
|
|
|
206
270
|
this.$refs.table.init(this.page.tableViewCode, () => {
|
|
@@ -302,6 +366,17 @@
|
|
|
302
366
|
this.$refs.form.close();
|
|
303
367
|
});
|
|
304
368
|
});
|
|
369
|
+
},
|
|
370
|
+
// 撤回
|
|
371
|
+
async recall() {
|
|
372
|
+
this.confirm('Front_Msg_Sure_To_Recall_Application', async () => {
|
|
373
|
+
await applicationApi.recall(this.$refs.showForm.data.applicationID);
|
|
374
|
+
|
|
375
|
+
this.success('Front_Msg_Success', () => {
|
|
376
|
+
this.$refs.table.loadData();
|
|
377
|
+
this.$refs.showForm.close();
|
|
378
|
+
});
|
|
379
|
+
});
|
|
305
380
|
}
|
|
306
381
|
}
|
|
307
382
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<process-page ref="processPage" application-type-code="ExpenseApplication" table-view-code="ExpenseApplication" form-view-code="ExpenseApplicationEdit"></process-page>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
import { mixinPage } from '/src';
|
|
6
|
+
import processPage from '/src/pages/template/processPage.vue';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'pqcp-issueReport',
|
|
10
|
+
mixins: [mixinPage],
|
|
11
|
+
components: { processPage },
|
|
12
|
+
data() {
|
|
13
|
+
return {};
|
|
14
|
+
},
|
|
15
|
+
computed: {},
|
|
16
|
+
created() {
|
|
17
|
+
setTimeout(() => {});
|
|
18
|
+
},
|
|
19
|
+
methods: {}
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- 字段筛选table展示 -->
|
|
3
|
-
<Modal v-model="opened" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" :width="formView.width || '800'">
|
|
4
|
-
<template #header>
|
|
5
|
-
<div>
|
|
6
|
-
<span class="title">{{ $t('Front_Label_Sorting_Setting') }}</span>
|
|
7
|
-
<span class="description">{{ $t('Front_Label_Filtering_Setting_Desc') }}</span>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<div class="i-table-no-border">
|
|
12
|
-
<Table stripe :columns="columnsFiltering" :data="dataFiltering">
|
|
13
|
-
<template #action="{ row, index }">
|
|
14
|
-
<Button size="small" :title="$t('Front_Btn_Edit')" type="primary" ghost custom-icon="fa fa-edit" @click="filteringFmModalopen(row)"></Button>
|
|
15
|
-
<Button size="small" :title="$t('Front_Btn_Up')" type="primary" ghost custom-icon="fa fa-chevron-up" @click="upfiltering(row, index)"></Button>
|
|
16
|
-
<Button size="small" :title="$t('Front_Btn_Down')" type="primary" ghost custom-icon="fa fa-chevron-down" @click="downfiltering(row, index)"></Button>
|
|
17
|
-
<Button size="small" :title="$t('Front_Btn_Remove')" type="primary" ghost custom-icon="fa fa-times" @click="removefiltering(row, index)"></Button>
|
|
18
|
-
</template>
|
|
19
|
-
</Table>
|
|
20
|
-
</div>
|
|
21
|
-
<template #footer>
|
|
22
|
-
<Button type="primary" ghost custom-icon="fa fa-plus" @click="filteringFmModalopen(null)">{{ $t('Front_Btn_Add') }}</Button>
|
|
23
|
-
<Button type="primary" custom-icon="fa fa-check" @click="SaveFiltering">{{ $t('Front_Btn_OK') }}</Button>
|
|
24
|
-
</template>
|
|
25
|
-
<!-- 对筛选条件进行处理 -->
|
|
26
|
-
<Modal v-model="filteringFmModal" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
|
|
27
|
-
<template #header>
|
|
28
|
-
<div>
|
|
29
|
-
<span class="title">{{ $t('Front_Label_Filtering_Setting_Edit') }}</span>
|
|
30
|
-
<span class="description">{{ $t('Front_Label_Filtering_Setting_Edit_Desc') }}</span>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
<Form ref="filteringform">
|
|
34
|
-
<Row :gutter="24" type="flex">
|
|
35
|
-
<Col>
|
|
36
|
-
<FormItem :label="$t('Front_Label_Column')" prop="Code">
|
|
37
|
-
<Input type="text" v-model="data.code">
|
|
38
|
-
<template #prepend>
|
|
39
|
-
<Button custom-icon="fa fa-search" @click="openSelect()"></Button>
|
|
40
|
-
</template>
|
|
41
|
-
</Input>
|
|
42
|
-
</FormItem>
|
|
43
|
-
</Col>
|
|
44
|
-
<Col>
|
|
45
|
-
<FormItem :label="$t('Front_Label_Operator')" prop="Operator">
|
|
46
|
-
<Select v-model="data.operator" :transfer="true">
|
|
47
|
-
<Option v-for="item in getEnumList('Operator')" :key="item.value" :value="item.id">{{ item.name }}</Option>
|
|
48
|
-
</Select>
|
|
49
|
-
</FormItem>
|
|
50
|
-
</Col>
|
|
51
|
-
<Col>
|
|
52
|
-
<FormItem :label="$t('Front_Label_Keyword')" prop="KeyValue">
|
|
53
|
-
<Input type="text" v-model="data.keyValue" maxlength="200" />
|
|
54
|
-
</FormItem>
|
|
55
|
-
</Col>
|
|
56
|
-
</Row>
|
|
57
|
-
</Form>
|
|
58
|
-
<template #footer>
|
|
59
|
-
<Button type="primary" custom-icon="fa fa-check" @click="saveFilteringForm($event)">{{ $t('Front_Btn_OK') }}</Button>
|
|
60
|
-
</template>
|
|
61
|
-
<column-check ref="columnCheck" />
|
|
62
|
-
</Modal>
|
|
63
|
-
</Modal>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<script>
|
|
67
|
-
import mixinPage from '../../mixins/page';
|
|
68
|
-
import columnCheck from './column-check.vue';
|
|
69
|
-
|
|
70
|
-
export default {
|
|
71
|
-
mixins: [mixinPage],
|
|
72
|
-
components: { columnCheck },
|
|
73
|
-
|
|
74
|
-
props: {
|
|
75
|
-
filter: String, //原表单筛选字段json值
|
|
76
|
-
dataView: {} //原表单对象
|
|
77
|
-
},
|
|
78
|
-
data() {
|
|
79
|
-
return {
|
|
80
|
-
opened: false,
|
|
81
|
-
formView: {},
|
|
82
|
-
filteringFmModal: false,
|
|
83
|
-
dataFiltering: [],
|
|
84
|
-
data: {}
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
computed: {
|
|
88
|
-
columnsFiltering() {
|
|
89
|
-
return [
|
|
90
|
-
{
|
|
91
|
-
type: 'index',
|
|
92
|
-
width: 100,
|
|
93
|
-
title: ' ',
|
|
94
|
-
align: 'center'
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
title: this.$t('Front_Label_Column'),
|
|
98
|
-
key: 'column'
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
title: this.$t('Front_Label_Operator'),
|
|
102
|
-
key: 'operatorType'
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
title: this.$t('Front_Label_Keyword'),
|
|
106
|
-
key: 'keyValue'
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
title: ' ',
|
|
110
|
-
slot: 'action',
|
|
111
|
-
width: 200,
|
|
112
|
-
fixed: 'right',
|
|
113
|
-
align: 'center'
|
|
114
|
-
}
|
|
115
|
-
];
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
methods: {
|
|
119
|
-
open() {
|
|
120
|
-
this.toData();
|
|
121
|
-
this.opened = true;
|
|
122
|
-
},
|
|
123
|
-
close() {
|
|
124
|
-
this.opened = false;
|
|
125
|
-
},
|
|
126
|
-
// 将数据库获取的json字符串转换为数组对象
|
|
127
|
-
toData() {
|
|
128
|
-
let filterArr = [];
|
|
129
|
-
if (this.filter !== '' && this.filter != null) {
|
|
130
|
-
let json = JSON.parse(this.filter);
|
|
131
|
-
for (let key in json) {
|
|
132
|
-
let operatorArr = [];
|
|
133
|
-
operatorArr = this.operatorChange(key);
|
|
134
|
-
filterArr.push({
|
|
135
|
-
column: operatorArr[0],
|
|
136
|
-
operatorType: operatorArr[1],
|
|
137
|
-
rule: operatorArr[2],
|
|
138
|
-
operator: operatorArr[3],
|
|
139
|
-
keyValue: json[key]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
this.dataFiltering = filterArr;
|
|
144
|
-
},
|
|
145
|
-
// 操作符数据转换( companyType_g ---> companyType,_g,大于,GreaterThan)
|
|
146
|
-
operatorChange(operator) {
|
|
147
|
-
let operatorArr = new Array(4);
|
|
148
|
-
if (operator.indexOf('_g') >= 0 && operator.indexOf('_ge') == -1) {
|
|
149
|
-
operatorArr[0] = operator.replace('_g', '');
|
|
150
|
-
operatorArr[1] = '大于';
|
|
151
|
-
operatorArr[2] = '_g';
|
|
152
|
-
operatorArr[3] = 'GreaterThan';
|
|
153
|
-
} else if (operator.indexOf('_l') >= 0 && operator.indexOf('_le') == -1) {
|
|
154
|
-
operatorArr[0] = operator.replace('_l', '');
|
|
155
|
-
operatorArr[1] = '小于';
|
|
156
|
-
operatorArr[2] = '_l';
|
|
157
|
-
operatorArr[3] = 'LessThan';
|
|
158
|
-
} else if (operator.indexOf('_ge') >= 0) {
|
|
159
|
-
operatorArr[0] = operator.replace('_ge', '');
|
|
160
|
-
operatorArr[1] = '大于等于';
|
|
161
|
-
operatorArr[2] = '_ge';
|
|
162
|
-
operatorArr[3] = 'GreaterThanOrEqual';
|
|
163
|
-
} else if (operator.indexOf('_le') >= 0) {
|
|
164
|
-
operatorArr[0] = operator.replace('_le', '');
|
|
165
|
-
operatorArr[1] = '小于等于';
|
|
166
|
-
operatorArr[2] = '_le';
|
|
167
|
-
operatorArr[3] = 'LessThanOrEqual';
|
|
168
|
-
} else if (operator.indexOf('_n') >= 0) {
|
|
169
|
-
operatorArr[0] = operator.replace('_n', '');
|
|
170
|
-
operatorArr[1] = '不等于';
|
|
171
|
-
operatorArr[2] = '_n';
|
|
172
|
-
operatorArr[3] = 'NotEqual';
|
|
173
|
-
} else if (operator.indexOf('_c') >= 0) {
|
|
174
|
-
operatorArr[0] = operator;
|
|
175
|
-
operatorArr[1] = '文字包含';
|
|
176
|
-
operatorArr[2] = '_c';
|
|
177
|
-
operatorArr[3] = 'Contains';
|
|
178
|
-
} else {
|
|
179
|
-
operatorArr[0] = operator;
|
|
180
|
-
operatorArr[1] = '等于';
|
|
181
|
-
operatorArr[2] = '';
|
|
182
|
-
operatorArr[3] = 'Equal';
|
|
183
|
-
}
|
|
184
|
-
return operatorArr;
|
|
185
|
-
},
|
|
186
|
-
// 操作符数据转换 ( companyType,_g,大于,GreaterThan ---> companyType_g )
|
|
187
|
-
operatorReChange(operator) {
|
|
188
|
-
let operatorArr = new Array(2);
|
|
189
|
-
if (operator == 'GreaterThan') {
|
|
190
|
-
operatorArr[0] = '大于';
|
|
191
|
-
operatorArr[1] = '_g';
|
|
192
|
-
} else if (operator == 'LessThan') {
|
|
193
|
-
operatorArr[0] = '小于';
|
|
194
|
-
operatorArr[1] = '_l';
|
|
195
|
-
} else if (operator == 'GreaterThanOrEqual') {
|
|
196
|
-
operatorArr[0] = '大于等于';
|
|
197
|
-
operatorArr[1] = '_ge';
|
|
198
|
-
} else if (operator == 'LessThanOrEqual') {
|
|
199
|
-
operatorArr[0] = '小于等于';
|
|
200
|
-
operatorArr[1] = '_le';
|
|
201
|
-
} else if (operator == 'NotEqual') {
|
|
202
|
-
operatorArr[0] = '不等于';
|
|
203
|
-
operatorArr[1] = '_n';
|
|
204
|
-
} else if (operator == 'Contains') {
|
|
205
|
-
operatorArr[0] = '文字包含';
|
|
206
|
-
operatorArr[1] = '_c';
|
|
207
|
-
} else {
|
|
208
|
-
operatorArr[0] = '等于';
|
|
209
|
-
operatorArr[1] = '';
|
|
210
|
-
}
|
|
211
|
-
return operatorArr;
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
// 筛选结果 将table对象转换为json字符串
|
|
215
|
-
toFilteringJson() {
|
|
216
|
-
let jsonStr = '{';
|
|
217
|
-
if (this.dataFiltering.length > 0) {
|
|
218
|
-
for (let key in this.dataFiltering) {
|
|
219
|
-
jsonStr += '"' + this.dataFiltering[key].column + this.dataFiltering[key].rule + '":"' + this.dataFiltering[key].keyValue + '",';
|
|
220
|
-
}
|
|
221
|
-
jsonStr = jsonStr.substring(0, jsonStr.length - 1);
|
|
222
|
-
jsonStr += '}';
|
|
223
|
-
} else {
|
|
224
|
-
jsonStr = '';
|
|
225
|
-
}
|
|
226
|
-
this.$emit('bindFilter', jsonStr);
|
|
227
|
-
this.close();
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
// 打开筛选编辑表单
|
|
231
|
-
filteringFmModalopen(row) {
|
|
232
|
-
// // row = null表示新增
|
|
233
|
-
if (row != null) {
|
|
234
|
-
this.data.code = row.column;
|
|
235
|
-
this.data.operator = row.operator;
|
|
236
|
-
this.data.keyValue = row.keyValue;
|
|
237
|
-
}
|
|
238
|
-
// 表示新增
|
|
239
|
-
else {
|
|
240
|
-
this.data.code = '';
|
|
241
|
-
this.data.rule = '';
|
|
242
|
-
this.data.operator = 'Equal';
|
|
243
|
-
this.data.keyValue = '';
|
|
244
|
-
}
|
|
245
|
-
this.filteringFmModal = true;
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
// 添加筛选字段表单确认
|
|
249
|
-
async saveFilteringForm() {
|
|
250
|
-
if (!!(this.data.code || '').trim() && !!(this.data.keyValue || '').trim() && !!(this.data.operator || '').trim()) {
|
|
251
|
-
let ope = this.operatorReChange(this.data.operator);
|
|
252
|
-
let checkSort = false;
|
|
253
|
-
this.dataFiltering.forEach(item => {
|
|
254
|
-
// 如果编辑列与原数据中有相同列,则做更新不做添加
|
|
255
|
-
if (item.column == this.data.code) {
|
|
256
|
-
checkSort = true;
|
|
257
|
-
(item.operatorType = ope[0]), (item.rule = ope[1]), (item.operator = this.data.operator), (item.keyValue = this.data.keyValue);
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
if (!checkSort) {
|
|
261
|
-
this.dataFiltering.push({
|
|
262
|
-
column: this.data.code,
|
|
263
|
-
operatorType: ope[0],
|
|
264
|
-
rule: ope[1],
|
|
265
|
-
operator: this.data.operator,
|
|
266
|
-
keyValue: this.data.keyValue
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
this.filteringFmModal = false;
|
|
271
|
-
} else {
|
|
272
|
-
this.error('Front_Msg_Column_Filtering_Required');
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
SaveFiltering() {
|
|
276
|
-
this.toFilteringJson();
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
// 筛选字段的移动操作
|
|
280
|
-
// 移除一行数据
|
|
281
|
-
removefiltering(row, index) {
|
|
282
|
-
if (row != null) {
|
|
283
|
-
this.dataFiltering.splice(index, 1);
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
// 上移
|
|
287
|
-
upfiltering(row, index) {
|
|
288
|
-
if (index > 0) {
|
|
289
|
-
this.dataFiltering.splice(index, 1);
|
|
290
|
-
this.dataFiltering.splice(index - 1, 0, row);
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
// 下移
|
|
294
|
-
downfiltering(row, index) {
|
|
295
|
-
if (index < this.dataFiltering.length - 1) {
|
|
296
|
-
this.dataFiltering.splice(index, 1);
|
|
297
|
-
this.dataFiltering.splice(index + 1, 0, row);
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
// 打开字段选择界面
|
|
301
|
-
openSelect() {
|
|
302
|
-
this.$refs.columnCheck.open(this.dataView.model, checked => {
|
|
303
|
-
this.data.code = checked.code;
|
|
304
|
-
this.data.name = checked.name;
|
|
305
|
-
this.data.dataType = checked.dataType;
|
|
306
|
-
this.data.source = checked.objColumn != null ? checked.objColumn.dataType : null;
|
|
307
|
-
this.data.sourceDataCode = checked.objColumn != null ? 'id' : null;
|
|
308
|
-
this.data.sourceDisplayCode =
|
|
309
|
-
checked.objColumn != null &&
|
|
310
|
-
checked.objColumn.columns.some(function (column) {
|
|
311
|
-
return column.code === checked.objColumn.code + '.name';
|
|
312
|
-
})
|
|
313
|
-
? 'name'
|
|
314
|
-
: null;
|
|
315
|
-
setTimeout(() => {
|
|
316
|
-
//this.$forceUpdate();
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
</script>
|