three-trees-ui 1.0.83 → 1.0.84
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/lib/three-trees-ui.common.js +17132 -16295
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +17132 -16295
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/CustomDialog/src/customDialog.vue +78 -17
- package/packages/DataLists/src/main.vue +2 -3
- package/packages/OrgPostDialog/src/main.vue +1 -1
- package/packages/OrgSelector/src/main.vue +1 -1
- package/packages/QuerySqlPreview/src/QuerySqlPreview.vue +43 -1
- package/packages/Subtable/src/SubPagination.vue +3 -3
- package/packages/Table/src/Table.vue +23 -3
- package/packages/TableSearchField/src/main.vue +5 -0
- package/packages/TemplatePreview/src/TemplatePreview.vue +43 -0
- package/src/mixins/querySqlPreview.js +407 -34
- package/src/mixins/templatePreview.js +577 -69
package/package.json
CHANGED
|
@@ -1137,8 +1137,11 @@
|
|
|
1137
1137
|
}
|
|
1138
1138
|
const pInst = utils.getOnlineFormInstance(this)
|
|
1139
1139
|
this.selectOrgs = this.convertComment2Field(str, field)
|
|
1140
|
-
|
|
1141
|
-
|
|
1140
|
+
this.custdialog.custDialog.mappingConf.forEach((con) => {
|
|
1141
|
+
let val = ''
|
|
1142
|
+
let bindValue = ''
|
|
1143
|
+
//改造,绑定值,表单列表查询字段绑定对话框时,新增的绑定字段选项
|
|
1144
|
+
const bindValueField = con.bindValue && con.bindValue.toLowerCase()
|
|
1142
1145
|
str.forEach((item, index) => {
|
|
1143
1146
|
// 此处添加url跳转参数保存逻辑
|
|
1144
1147
|
if (
|
|
@@ -1159,6 +1162,10 @@
|
|
|
1159
1162
|
},`
|
|
1160
1163
|
} else {
|
|
1161
1164
|
val += item[con.from] + ','
|
|
1165
|
+
//绑定字段处理
|
|
1166
|
+
if (bindValueField) {
|
|
1167
|
+
bindValue += item[bindValueField] + ','
|
|
1168
|
+
}
|
|
1162
1169
|
}
|
|
1163
1170
|
})
|
|
1164
1171
|
if (this.modelName == 'data.' + con['target'][0]) {
|
|
@@ -1169,12 +1176,28 @@
|
|
|
1169
1176
|
thisIndex
|
|
1170
1177
|
)
|
|
1171
1178
|
} else if (this.modelName == 'searchForm.' + con['target'][0]) {
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
)
|
|
1179
|
+
const bInst = pInst['searchForm'] ? pInst: pInst.data
|
|
1180
|
+
const currentValue = val.substring(0, val.length - 1)
|
|
1181
|
+
if (this.modelName && this.modelName.endsWith(con['target'][0])) {
|
|
1182
|
+
this.$emit('updateInput', currentValue);
|
|
1183
|
+
}
|
|
1184
|
+
utils.setValueByPath(bInst, 'searchForm.' + con['target'][0], currentValue, thisIndex)
|
|
1185
|
+
//绑定字段值处理,bindValue: {target: {id: xxx}}, bindKey: {target: id }
|
|
1186
|
+
if (bindValue && bindValueField) {
|
|
1187
|
+
const bindValueObj = {}
|
|
1188
|
+
//显示value对象
|
|
1189
|
+
bindValueObj[bindValueField] = bindValue.substring(0, bindValue.length - 1)
|
|
1190
|
+
|
|
1191
|
+
const anInst = pInst['searchForm'] ? pInst['searchForm'] : pInst.data.searchForm
|
|
1192
|
+
//若bindKey不存在,则默认空对象,若存在,则取出bindKey
|
|
1193
|
+
anInst.bindKey = anInst.bindKey || {}
|
|
1194
|
+
//格式 {target: id }
|
|
1195
|
+
anInst.bindKey[con['target'][0]] = bindValueField
|
|
1196
|
+
//若bindValue不存在,则默认空对象,若存在,则取出bindValue
|
|
1197
|
+
anInst.bindValue = anInst.bindValue || {}
|
|
1198
|
+
//格式 {target: {id: xxx}}
|
|
1199
|
+
anInst.bindValue[con['target'][0]] = bindValueObj
|
|
1200
|
+
}
|
|
1178
1201
|
} else {
|
|
1179
1202
|
let configAttr = con['target'][0].split('.')
|
|
1180
1203
|
let path = con['target'][0]
|
|
@@ -1199,10 +1222,26 @@
|
|
|
1199
1222
|
}
|
|
1200
1223
|
utils.setValueByPath(
|
|
1201
1224
|
pInst,
|
|
1202
|
-
`${pInst.data ? 'data.' : 'model.'}${path}`,
|
|
1225
|
+
`${pInst.data ? 'data.' : 'model.'}${this.modelName.includes('searchForm') ? `searchForm.${path}` : path}`,
|
|
1203
1226
|
_val,
|
|
1204
1227
|
thisIndex
|
|
1205
1228
|
)
|
|
1229
|
+
//绑定字段值处理,bindValue: {target: {id: xxx}}, bindKey: {target: id }
|
|
1230
|
+
if (bindValue && bindValueField) {
|
|
1231
|
+
const bindValueObj = {}
|
|
1232
|
+
//显示value对象
|
|
1233
|
+
bindValueObj[bindValueField] = bindValue.substring(0, bindValue.length - 1)
|
|
1234
|
+
|
|
1235
|
+
const anInst = pInst['searchForm'] ? pInst['searchForm'] : pInst.data.searchForm
|
|
1236
|
+
//若bindKey不存在,则默认空对象,若存在,则取出bindKey
|
|
1237
|
+
anInst.bindKey = anInst.bindKey || {}
|
|
1238
|
+
//格式 {target: id }
|
|
1239
|
+
anInst.bindKey[con['target'][0]] = bindValueField
|
|
1240
|
+
//若bindValue不存在,则默认空对象,若存在,则取出bindValue
|
|
1241
|
+
anInst.bindValue = anInst.bindValue || {}
|
|
1242
|
+
//格式 {target: {id: xxx}}
|
|
1243
|
+
anInst.bindValue[con['target'][0]] = bindValueObj
|
|
1244
|
+
}
|
|
1206
1245
|
}
|
|
1207
1246
|
}
|
|
1208
1247
|
})
|
|
@@ -1856,8 +1895,11 @@
|
|
|
1856
1895
|
}
|
|
1857
1896
|
const pInst = utils.getOnlineFormInstance(this)
|
|
1858
1897
|
this.custdialog.custDialog.mappingConf.forEach((con) => {
|
|
1859
|
-
|
|
1860
|
-
|
|
1898
|
+
let val = ''
|
|
1899
|
+
let bindValue = ''
|
|
1900
|
+
const from = con.from.toLowerCase()
|
|
1901
|
+
//改造,绑定值,表单列表查询字段绑定对话框时,新增的绑定字段选项
|
|
1902
|
+
const bindValueField = con.bindValue && con.bindValue.toLowerCase()
|
|
1861
1903
|
str.forEach((item) => {
|
|
1862
1904
|
// 如果有绑定url跳转参数 需获取跳转参数的key
|
|
1863
1905
|
if (item) {
|
|
@@ -1885,6 +1927,10 @@
|
|
|
1885
1927
|
)}¯${jumpParamKey}:${decodeURIComponent(item[returnMapKey])},`
|
|
1886
1928
|
} else {
|
|
1887
1929
|
val += decodeURIComponent(item[from]) + ','
|
|
1930
|
+
//绑定字段处理
|
|
1931
|
+
if (bindValueField) {
|
|
1932
|
+
bindValue += decodeURIComponent(item[bindValueField]) + ','
|
|
1933
|
+
}
|
|
1888
1934
|
}
|
|
1889
1935
|
}
|
|
1890
1936
|
})
|
|
@@ -1900,13 +1946,28 @@
|
|
|
1900
1946
|
this.modelName &&
|
|
1901
1947
|
this.modelName.startsWith('searchForm.')
|
|
1902
1948
|
) {
|
|
1949
|
+
const currentValue = val.substring(0, val.length - 1)
|
|
1950
|
+
if (this.modelName && this.modelName.endsWith(con['target'][0])) {
|
|
1951
|
+
this.$emit('updateInput', currentValue);
|
|
1952
|
+
}
|
|
1903
1953
|
let prePath = pInst['searchForm'] ? '' : 'data.'
|
|
1904
|
-
utils.setValueByPath(
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1954
|
+
utils.setValueByPath(pInst, prePath + 'searchForm.' + con['target'][0], currentValue, thisIndex)
|
|
1955
|
+
//绑定字段值处理,bindValue: {target: {id: xxx}}, bindKey: {target: id }
|
|
1956
|
+
if (bindValue && bindValueField) {
|
|
1957
|
+
const bindValueObj = {}
|
|
1958
|
+
//显示value对象
|
|
1959
|
+
bindValueObj[bindValueField] = bindValue.substring(0, bindValue.length - 1)
|
|
1960
|
+
|
|
1961
|
+
const anInst = pInst['searchForm'] ? pInst['searchForm'] : pInst.data.searchForm
|
|
1962
|
+
//若bindKey不存在,则默认空对象,若存在,则取出bindKey
|
|
1963
|
+
anInst.bindKey = anInst.bindKey || {}
|
|
1964
|
+
//格式 {target: id }
|
|
1965
|
+
anInst.bindKey[con['target'][0]] = bindValueField
|
|
1966
|
+
//若bindValue不存在,则默认空对象,若存在,则取出bindValue
|
|
1967
|
+
anInst.bindValue = anInst.bindValue || {}
|
|
1968
|
+
//格式 {target: {id: xxx}}
|
|
1969
|
+
anInst.bindValue[con['target'][0]] = bindValueObj
|
|
1970
|
+
}
|
|
1910
1971
|
} else {
|
|
1911
1972
|
let configAttr = con['target'][0].split('.')
|
|
1912
1973
|
let path = con['target'][0]
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
<script>
|
|
35
35
|
import permission from '@/mixins/permission.js'
|
|
36
|
-
export default {
|
|
36
|
+
export default {
|
|
37
37
|
name: 'HtDataLists',
|
|
38
38
|
mixins: [permission],
|
|
39
39
|
props: {
|
|
@@ -56,7 +56,6 @@ export default {
|
|
|
56
56
|
watch: {
|
|
57
57
|
options: {
|
|
58
58
|
handler(val) {
|
|
59
|
-
debugger
|
|
60
59
|
if (val) {
|
|
61
60
|
this.tabPaneList = JSON.parse(val)
|
|
62
61
|
this.activeName = this.tabPaneList[0].dataTemplateKey
|
|
@@ -114,4 +113,4 @@ export default {
|
|
|
114
113
|
margin-top: 24px;
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
|
-
</style>
|
|
116
|
+
</style>
|
|
@@ -163,4 +163,46 @@ export default {
|
|
|
163
163
|
font-weight: bold;
|
|
164
164
|
color: #f56c6c;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
::v-deep .page-btn-count {
|
|
167
|
+
margin: 0 24px;
|
|
168
|
+
float: left;
|
|
169
|
+
padding: 10px 0;
|
|
170
|
+
}
|
|
171
|
+
::v-deep .page-btn-total {
|
|
172
|
+
margin: 5px 0px;
|
|
173
|
+
float: left;
|
|
174
|
+
padding: 11px 0px;
|
|
175
|
+
color: #606266;
|
|
176
|
+
font-weight: normal;
|
|
177
|
+
font-size: 13px;
|
|
178
|
+
}
|
|
179
|
+
::v-deep .pagination {
|
|
180
|
+
display: flex;
|
|
181
|
+
justify-content: flex-end;
|
|
182
|
+
padding: 10px 0;
|
|
183
|
+
float: right;
|
|
184
|
+
.el-select {
|
|
185
|
+
width: 100px;
|
|
186
|
+
}
|
|
187
|
+
.page-btn {
|
|
188
|
+
margin: 0 24px;
|
|
189
|
+
}
|
|
190
|
+
.target-page {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
color: #606266;
|
|
194
|
+
font-weight: normal;
|
|
195
|
+
font-size: 13px;
|
|
196
|
+
.el-input {
|
|
197
|
+
width: 50px;
|
|
198
|
+
margin: 0 3px;
|
|
199
|
+
}
|
|
200
|
+
//::v-deep input::-webkit-outer-spin-button, ::v-deep input::-webkit-inner-spin-button {
|
|
201
|
+
// -webkit-appearance: none !important;
|
|
202
|
+
//}
|
|
203
|
+
//::v-deep input[type='number'] {
|
|
204
|
+
// -moz-appearnce: textfield !important
|
|
205
|
+
//}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
mounted() {
|
|
107
107
|
this.paginationChange()
|
|
108
108
|
},
|
|
109
|
-
destroyed() {
|
|
110
|
-
|
|
111
|
-
},
|
|
109
|
+
// destroyed() {
|
|
110
|
+
// SubPagination.clear(this.dataSubname, this)
|
|
111
|
+
// },
|
|
112
112
|
methods: {
|
|
113
113
|
paginationChange() {
|
|
114
114
|
// 分页变化时,以dataPath为key设置到公共的js对象中
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
:highlight-current-row="highlightCurrentRow"
|
|
113
113
|
:row-class-name="rowClassName"
|
|
114
114
|
:cell-class-name="cellClassName"
|
|
115
|
-
:style="{ height: `${tableMaxHeight ? tableMaxHeight : 400}` + 'px' }"
|
|
116
115
|
:row-key="rowKey"
|
|
117
116
|
:show-summary="showSummary"
|
|
118
117
|
:summary-method="getSummaries"
|
|
118
|
+
v-bind="tableOptions"
|
|
119
119
|
@row-click="handleRowClick"
|
|
120
120
|
@select="handleTableSelect"
|
|
121
121
|
@select-all="handleTableSelect"
|
|
@@ -447,6 +447,20 @@
|
|
|
447
447
|
isLoading() {
|
|
448
448
|
return this.loading && !this.noLoading
|
|
449
449
|
},
|
|
450
|
+
tableOptions() {
|
|
451
|
+
if (this.showSummary) {
|
|
452
|
+
return {
|
|
453
|
+
height: `${this.tableMaxHeight ? this.tableMaxHeight : 400}`,
|
|
454
|
+
}
|
|
455
|
+
} else {
|
|
456
|
+
return {
|
|
457
|
+
style: {
|
|
458
|
+
height:
|
|
459
|
+
`${this.tableMaxHeight ? this.tableMaxHeight : 400}` + 'px',
|
|
460
|
+
},
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
},
|
|
450
464
|
},
|
|
451
465
|
watch: {
|
|
452
466
|
justShowSearch: {
|
|
@@ -957,11 +971,11 @@
|
|
|
957
971
|
const {
|
|
958
972
|
summaryMethod,
|
|
959
973
|
summaryType,
|
|
960
|
-
name,
|
|
961
974
|
tableName,
|
|
962
975
|
oldTableField,
|
|
963
976
|
fieldDesc,
|
|
964
977
|
} = tableFieldItem
|
|
978
|
+
let name = tableFieldItem.fieldsAlias || tableFieldItem.name
|
|
965
979
|
if (!summaryMethod) {
|
|
966
980
|
sums[index] = ''
|
|
967
981
|
return
|
|
@@ -1022,7 +1036,13 @@
|
|
|
1022
1036
|
return hasValueList.length
|
|
1023
1037
|
},
|
|
1024
1038
|
getSum(data, field) {
|
|
1025
|
-
const sumResult = data.reduce((pre, cur) =>
|
|
1039
|
+
const sumResult = data.reduce((pre, cur) => {
|
|
1040
|
+
if (!isNaN(Number(cur[field]))) {
|
|
1041
|
+
return pre + Number(cur[field])
|
|
1042
|
+
} else {
|
|
1043
|
+
return pre
|
|
1044
|
+
}
|
|
1045
|
+
}, 0)
|
|
1026
1046
|
return sumResult ? utils.thousandBit(sumResult) : sumResult
|
|
1027
1047
|
},
|
|
1028
1048
|
getPropTable(field, tableName, oldTableField) {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
:class="{ 'is-align-right': isAlignRight }"
|
|
16
16
|
>
|
|
17
17
|
<label v-if="label" v-ellipsis :title="label" class="search-field-label">
|
|
18
|
+
<span v-if="isRequired" class="red-color">*</span>
|
|
18
19
|
{{ label }}
|
|
19
20
|
</label>
|
|
20
21
|
</div>
|
|
@@ -167,6 +168,7 @@
|
|
|
167
168
|
type: Boolean,
|
|
168
169
|
default: false,
|
|
169
170
|
},
|
|
171
|
+
isRequired: Boolean,
|
|
170
172
|
},
|
|
171
173
|
data() {
|
|
172
174
|
return {
|
|
@@ -317,6 +319,9 @@
|
|
|
317
319
|
display: inline-block;
|
|
318
320
|
max-width: calc(100% - 10px);
|
|
319
321
|
line-height: 100%;
|
|
322
|
+
.red-color {
|
|
323
|
+
color: #f56c6c;
|
|
324
|
+
}
|
|
320
325
|
|
|
321
326
|
&::after {
|
|
322
327
|
content: ':';
|
|
@@ -223,6 +223,49 @@
|
|
|
223
223
|
margin: 0;
|
|
224
224
|
padding: 0;
|
|
225
225
|
}
|
|
226
|
+
::v-deep .page-btn-count {
|
|
227
|
+
margin: 0 24px;
|
|
228
|
+
float: left;
|
|
229
|
+
padding: 10px 0;
|
|
230
|
+
}
|
|
231
|
+
::v-deep .page-btn-total {
|
|
232
|
+
margin: 5px 0px;
|
|
233
|
+
float: left;
|
|
234
|
+
padding: 11px 0px;
|
|
235
|
+
color: #606266;
|
|
236
|
+
font-weight: normal;
|
|
237
|
+
font-size: 13px;
|
|
238
|
+
}
|
|
239
|
+
::v-deep .pagination {
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: flex-end;
|
|
242
|
+
padding: 10px 0;
|
|
243
|
+
float: right;
|
|
244
|
+
.el-select {
|
|
245
|
+
width: 100px;
|
|
246
|
+
}
|
|
247
|
+
.page-btn {
|
|
248
|
+
margin: 0 24px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.target-page {
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
color: #606266;
|
|
255
|
+
font-weight: normal;
|
|
256
|
+
font-size: 13px;
|
|
257
|
+
.el-input {
|
|
258
|
+
width: 50px;
|
|
259
|
+
margin: 0 3px;
|
|
260
|
+
}
|
|
261
|
+
//::v-deep input::-webkit-outer-spin-button, ::v-deep input::-webkit-inner-spin-button {
|
|
262
|
+
// -webkit-appearance: none !important;
|
|
263
|
+
//}
|
|
264
|
+
//::v-deep input[type='number'] {
|
|
265
|
+
// -moz-appearnce: textfield !important
|
|
266
|
+
//}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
226
269
|
</style>
|
|
227
270
|
<style lang="scss">
|
|
228
271
|
.template-dropdown {
|