mooho-base-admin-plus 2.9.4 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/history.md +3 -0
- package/package/mooho-base-admin-plus.min.esm.js +3114 -3584
- 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/mixins/page.js +1 -1
- 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 +33 -7
- package/src/store/modules/admin/modules/user.js +0 -1
- package/src/components/view/modal-form-filter.vue +0 -322
- package/src/components/view/modal-form-sort.vue +0 -253
|
@@ -1,253 +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_Sorting_Setting_Desc') }}</span>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
<div class="i-table-no-border">
|
|
11
|
-
<Table stripe :columns="columnsSorting" :data="dataSorting">
|
|
12
|
-
<template #action="{ row, index }">
|
|
13
|
-
<Button size="small" :title="$t('Front_Btn_Edit')" type="primary" ghost custom-icon="fa fa-edit" @click="sortingFmModalopen(row)"></Button>
|
|
14
|
-
<Button size="small" :title="$t('Front_Btn_Up')" type="primary" ghost custom-icon="fa fa-chevron-up" @click="upSorting(row, index)"></Button>
|
|
15
|
-
<Button size="small" :title="$t('Front_Btn_Down')" type="primary" ghost custom-icon="fa fa-chevron-down" @click="downSorting(row, index)"></Button>
|
|
16
|
-
<Button size="small" :title="$t('Front_Btn_Remove')" type="primary" ghost custom-icon="fa fa-times" @click="removeSorting(row, index)"></Button>
|
|
17
|
-
</template>
|
|
18
|
-
</Table>
|
|
19
|
-
</div>
|
|
20
|
-
<template #footer>
|
|
21
|
-
<Button type="primary" ghost custom-icon="fa fa-plus" @click="sortingFmModalopen(null)">{{ $t('Front_Btn_Add') }}</Button>
|
|
22
|
-
<Button type="primary" custom-icon="fa fa-check" @click="SaveSorting">{{ $t('Front_Btn_OK') }}</Button>
|
|
23
|
-
</template>
|
|
24
|
-
<!-- 对排序字段进行处理 -->
|
|
25
|
-
<Modal v-model="sortingFmModal" scrollable :mask-closable="layout.maskClosable" :draggable="layout.draggable" :sticky="true" :reset-drag-position="true" width="800">
|
|
26
|
-
<template #header>
|
|
27
|
-
<div>
|
|
28
|
-
<span class="title">{{ $t('Front_Label_Sorting_Setting_Edit') }}</span>
|
|
29
|
-
<span class="description">{{ $t('Front_Label_Sorting_Setting_Edit_Desc') }}</span>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
<Form ref="sortingform">
|
|
33
|
-
<Row :gutter="24" type="flex">
|
|
34
|
-
<Col>
|
|
35
|
-
<FormItem :label="$t('Front_Label_Column')" prop="Code">
|
|
36
|
-
<Input type="text" readonly v-model="data.code" @on-focus="openSelect()">
|
|
37
|
-
<template #prepend>
|
|
38
|
-
<Button custom-icon="fa fa-search" @click="openSelect()"></Button>
|
|
39
|
-
</template>
|
|
40
|
-
</Input>
|
|
41
|
-
</FormItem>
|
|
42
|
-
</Col>
|
|
43
|
-
<Col>
|
|
44
|
-
<FormItem :label="$t('Front_Label_Operator')" prop="SortingRule">
|
|
45
|
-
<Select v-model="data.rule" :transfer="true">
|
|
46
|
-
<Option v-for="item in sortingList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
47
|
-
</Select>
|
|
48
|
-
</FormItem>
|
|
49
|
-
</Col>
|
|
50
|
-
</Row>
|
|
51
|
-
</Form>
|
|
52
|
-
<template #footer>
|
|
53
|
-
<Button type="primary" custom-icon="fa fa-check" @click="saveSortingForm($event)">{{ $t('Front_Btn_OK') }}</Button>
|
|
54
|
-
</template>
|
|
55
|
-
</Modal>
|
|
56
|
-
<column-check ref="columnCheck" />
|
|
57
|
-
</Modal>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
import mixinPage from '../../mixins/page';
|
|
62
|
-
import columnCheck from './column-check.vue';
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
mixins: [mixinPage],
|
|
66
|
-
components: { columnCheck },
|
|
67
|
-
props: {
|
|
68
|
-
sort: String, //原排序字段json值
|
|
69
|
-
dataView: {} //原表单对象
|
|
70
|
-
},
|
|
71
|
-
data() {
|
|
72
|
-
return {
|
|
73
|
-
opened: false,
|
|
74
|
-
formView: {},
|
|
75
|
-
sortingFmModal: false,
|
|
76
|
-
dataSorting: [],
|
|
77
|
-
data: {}
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
computed: {
|
|
81
|
-
columnsSorting() {
|
|
82
|
-
return [
|
|
83
|
-
{
|
|
84
|
-
type: 'index',
|
|
85
|
-
width: 100,
|
|
86
|
-
title: ' ',
|
|
87
|
-
align: 'center'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
title: this.$t('Front_Label_Column'),
|
|
91
|
-
key: 'column'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title: this.$t('Front_Label_Rule'),
|
|
95
|
-
key: 'rule'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
title: ' ',
|
|
99
|
-
slot: 'action',
|
|
100
|
-
width: 200,
|
|
101
|
-
fixed: 'right',
|
|
102
|
-
align: 'center'
|
|
103
|
-
}
|
|
104
|
-
];
|
|
105
|
-
},
|
|
106
|
-
sortingList() {
|
|
107
|
-
return [
|
|
108
|
-
{
|
|
109
|
-
value: 'asc',
|
|
110
|
-
label: this.$t('Front_Label_Asc')
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: 'desc',
|
|
114
|
-
label: this.$t('Front_Label_Desc')
|
|
115
|
-
}
|
|
116
|
-
];
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
async created() {},
|
|
120
|
-
methods: {
|
|
121
|
-
open() {
|
|
122
|
-
this.toData();
|
|
123
|
-
this.opened = true;
|
|
124
|
-
},
|
|
125
|
-
close() {
|
|
126
|
-
this.opened = false;
|
|
127
|
-
},
|
|
128
|
-
// 打开排序字段设置表单
|
|
129
|
-
sortingFmModalopen(row) {
|
|
130
|
-
// row = null表示新增
|
|
131
|
-
if (row != null) {
|
|
132
|
-
this.data.code = row.column;
|
|
133
|
-
this.data.rule = row.rule;
|
|
134
|
-
}
|
|
135
|
-
// 表示新增
|
|
136
|
-
else {
|
|
137
|
-
this.data.code = '';
|
|
138
|
-
this.data.rule = '';
|
|
139
|
-
}
|
|
140
|
-
this.sortingFmModal = true;
|
|
141
|
-
},
|
|
142
|
-
// 将数据库获取的json字符串转换为数组对象
|
|
143
|
-
toData() {
|
|
144
|
-
let array = [];
|
|
145
|
-
// 如果该字段为空,则如下转换不进行
|
|
146
|
-
if (this.sort !== '' && this.sort != null) {
|
|
147
|
-
let json = JSON.parse(this.sort);
|
|
148
|
-
for (let key in json) {
|
|
149
|
-
array.push({
|
|
150
|
-
column: key,
|
|
151
|
-
rule: json[key]
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
this.dataSorting = array;
|
|
156
|
-
},
|
|
157
|
-
// 添加排序规则确认
|
|
158
|
-
async saveSortingForm() {
|
|
159
|
-
// 保存前字段均不为空
|
|
160
|
-
if (this.data.code !== '' && this.data.code != null && this.data.rule != null && this.data.rule !== '') {
|
|
161
|
-
let checkSort = false;
|
|
162
|
-
// 遍历原排序对象 dataSorting 中是否有与新增的字段相同的
|
|
163
|
-
// 暂时不做此判断,后续再优化2021年3月19日18:39:13
|
|
164
|
-
// this.dataSorting.forEach(item => {
|
|
165
|
-
// if (item.column == this.data.code) {
|
|
166
|
-
// checkSort = true;
|
|
167
|
-
// }
|
|
168
|
-
// });
|
|
169
|
-
this.dataSorting.forEach(item => {
|
|
170
|
-
// 如果编辑列与原数据中有相同列,则做更新不做添加
|
|
171
|
-
if (item.column == this.data.code) {
|
|
172
|
-
checkSort = true;
|
|
173
|
-
item.rule = this.data.rule;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
if (!checkSort) {
|
|
177
|
-
// 将新加的字段对象添加到原排序对象 dataSorting 中
|
|
178
|
-
this.dataSorting.push({
|
|
179
|
-
column: this.data.code,
|
|
180
|
-
rule: this.data.rule
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
// 确认后关闭modal
|
|
184
|
-
this.sortingFmModal = false;
|
|
185
|
-
} else {
|
|
186
|
-
this.error('Front_Msg_Column_Sorting_Required');
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
// 添加排序字段table确认
|
|
190
|
-
SaveSorting() {
|
|
191
|
-
this.toSortingJson();
|
|
192
|
-
},
|
|
193
|
-
// 排序数据的移动操作
|
|
194
|
-
// 移除一行数据
|
|
195
|
-
removeSorting(row, index) {
|
|
196
|
-
if (row != null) {
|
|
197
|
-
this.dataSorting.splice(index, 1);
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
// 上移
|
|
201
|
-
upSorting(row, index) {
|
|
202
|
-
if (index > 0) {
|
|
203
|
-
this.dataSorting.splice(index, 1);
|
|
204
|
-
this.dataSorting.splice(index - 1, 0, row);
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
// 下移
|
|
208
|
-
downSorting(row, index) {
|
|
209
|
-
if (index < this.dataSorting.length - 1) {
|
|
210
|
-
this.dataSorting.splice(index, 1);
|
|
211
|
-
this.dataSorting.splice(index + 1, 0, row);
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
// 打开字段选择界面
|
|
215
|
-
openSelect() {
|
|
216
|
-
this.$refs.columnCheck.openView(this.dataView, checked => {
|
|
217
|
-
this.data.code = checked.code;
|
|
218
|
-
this.data.name = checked.name;
|
|
219
|
-
this.data.dataType = checked.dataType;
|
|
220
|
-
this.data.source = checked.objColumn != null ? checked.objColumn.dataType : null;
|
|
221
|
-
this.data.sourceDataCode = checked.objColumn != null ? 'id' : null;
|
|
222
|
-
this.data.sourceDisplayCode =
|
|
223
|
-
checked.objColumn != null &&
|
|
224
|
-
checked.objColumn.columns.some(function (column) {
|
|
225
|
-
return column.code === checked.objColumn.code + '.name';
|
|
226
|
-
})
|
|
227
|
-
? 'name'
|
|
228
|
-
: null;
|
|
229
|
-
setTimeout(() => {
|
|
230
|
-
//this.$forceUpdate();
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
},
|
|
234
|
-
//[{column: 'type.orderNo',rule: 'asc'},{column: 'orderNo',rule: 'asc'}]
|
|
235
|
-
// { "type.orderNo": "asc", "orderNo": "asc" }
|
|
236
|
-
// 排序结果 将table对象转换为json字符串
|
|
237
|
-
toSortingJson() {
|
|
238
|
-
let jsonStr = '{';
|
|
239
|
-
if (this.dataSorting.length > 0) {
|
|
240
|
-
for (let key in this.dataSorting) {
|
|
241
|
-
jsonStr += '"' + this.dataSorting[key].column + '":"' + this.dataSorting[key].rule + '",';
|
|
242
|
-
}
|
|
243
|
-
jsonStr = jsonStr.substring(0, jsonStr.length - 1);
|
|
244
|
-
jsonStr += '}';
|
|
245
|
-
} else {
|
|
246
|
-
jsonStr = '';
|
|
247
|
-
}
|
|
248
|
-
this.$emit('bindSort', jsonStr);
|
|
249
|
-
this.close();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
</script>
|