swordpass-ui 1.0.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/LICENSE +21 -0
- package/README.md +37 -0
- package/lib/demo.html +10 -0
- package/lib/img/icon_found_img.c785c1b7.png +0 -0
- package/lib/sword-vue-ui.common.js +61402 -0
- package/lib/sword-vue-ui.css +1 -0
- package/lib/sword-vue-ui.umd.js +61412 -0
- package/lib/sword-vue-ui.umd.min.js +6 -0
- package/package.json +109 -0
- package/packages/AddQueryStrategy/index.js +7 -0
- package/packages/AddQueryStrategy/src/main.vue +236 -0
- package/packages/Autocomplete/index.js +7 -0
- package/packages/Autocomplete/src/main.vue +192 -0
- package/packages/Button/index.js +7 -0
- package/packages/Button/src/main.vue +90 -0
- package/packages/Cascader/index.js +7 -0
- package/packages/Cascader/src/main.vue +210 -0
- package/packages/Chart/index.js +7 -0
- package/packages/Chart/src/Chart.vue +831 -0
- package/packages/Checkbox/index.js +7 -0
- package/packages/Checkbox/src/main.vue +200 -0
- package/packages/Collapse/index.js +7 -0
- package/packages/Collapse/src/ClCollapse.vue +67 -0
- package/packages/Collapse/src/ClCollapseItem.vue +21 -0
- package/packages/CollapseItem/index.js +7 -0
- package/packages/CustomDialog/index.js +7 -0
- package/packages/CustomDialog/src/customDialog.js +99 -0
- package/packages/CustomDialog/src/main.vue +1944 -0
- package/packages/DataView/index.js +7 -0
- package/packages/DataView/src/DataView.vue +45 -0
- package/packages/Date/index.js +7 -0
- package/packages/Date/src/main.vue +180 -0
- package/packages/DatePicker/index.js +7 -0
- package/packages/DatePicker/src/main.vue +155 -0
- package/packages/Demension/index.js +7 -0
- package/packages/Demension/src/main.vue +379 -0
- package/packages/Dialog/index.js +7 -0
- package/packages/Dialog/src/main.vue +160 -0
- package/packages/Dictionary/index.js +7 -0
- package/packages/Dictionary/src/main.vue +204 -0
- package/packages/DimensionSelector/index.js +7 -0
- package/packages/DimensionSelector/src/main.vue +359 -0
- package/packages/DimensionSelectorInput/index.js +7 -0
- package/packages/DimensionSelectorInput/src/main.vue +79 -0
- package/packages/Divider/index.js +7 -0
- package/packages/Divider/src/main.vue +38 -0
- package/packages/Duration/index.js +7 -0
- package/packages/Duration/src/main.vue +172 -0
- package/packages/Editor/index.js +7 -0
- package/packages/Editor/src/main.vue +280 -0
- package/packages/Explain/index.js +7 -0
- package/packages/Explain/src/main.vue +55 -0
- package/packages/FieldTail/index.js +7 -0
- package/packages/FieldTail/src/main.vue +163 -0
- package/packages/File/index.js +7 -0
- package/packages/File/src/FileCard.vue +169 -0
- package/packages/File/src/FileList.vue +180 -0
- package/packages/File/src/FileTable.vue +223 -0
- package/packages/File/src/main.vue +467 -0
- package/packages/FileUpload/index.js +7 -0
- package/packages/FileUpload/src/main.vue +222 -0
- package/packages/FlowChart/index.js +7 -0
- package/packages/FlowChart/src/main.vue +386 -0
- package/packages/FormItem/index.js +7 -0
- package/packages/FormItem/src/main.vue +167 -0
- package/packages/Global/index.js +12 -0
- package/packages/Global/src/GlobalQuery.vue +200 -0
- package/packages/Global/src/GlobalValidate.vue +69 -0
- package/packages/Icon/index.js +7 -0
- package/packages/Icon/src/icons/ad.js +14 -0
- package/packages/Icon/src/icons/address-book.js +14 -0
- package/packages/Icon/src/icons/arrow.js +14 -0
- package/packages/Icon/src/icons/attachment.js +18 -0
- package/packages/Icon/src/icons/balance.js +14 -0
- package/packages/Icon/src/icons/ban.js +14 -0
- package/packages/Icon/src/icons/bell.js +14 -0
- package/packages/Icon/src/icons/block.js +26 -0
- package/packages/Icon/src/icons/book.js +14 -0
- package/packages/Icon/src/icons/bookmark.js +14 -0
- package/packages/Icon/src/icons/bug.js +22 -0
- package/packages/Icon/src/icons/bullhorn.js +14 -0
- package/packages/Icon/src/icons/calc.js +14 -0
- package/packages/Icon/src/icons/checkbox.js +14 -0
- package/packages/Icon/src/icons/circle.js +14 -0
- package/packages/Icon/src/icons/close.js +14 -0
- package/packages/Icon/src/icons/cloud-sun.js +14 -0
- package/packages/Icon/src/icons/coffee.js +14 -0
- package/packages/Icon/src/icons/component.js +14 -0
- package/packages/Icon/src/icons/compress.js +14 -0
- package/packages/Icon/src/icons/copyright.js +14 -0
- package/packages/Icon/src/icons/dialog.js +14 -0
- package/packages/Icon/src/icons/download.js +14 -0
- package/packages/Icon/src/icons/duration.js +14 -0
- package/packages/Icon/src/icons/excel.js +18 -0
- package/packages/Icon/src/icons/expand.js +14 -0
- package/packages/Icon/src/icons/export.js +21 -0
- package/packages/Icon/src/icons/eye-slash.js +14 -0
- package/packages/Icon/src/icons/eye.js +14 -0
- package/packages/Icon/src/icons/file.js +18 -0
- package/packages/Icon/src/icons/form.js +14 -0
- package/packages/Icon/src/icons/ganged.js +14 -0
- package/packages/Icon/src/icons/gaode.js +27 -0
- package/packages/Icon/src/icons/gift.js +14 -0
- package/packages/Icon/src/icons/home.js +14 -0
- package/packages/Icon/src/icons/image.js +14 -0
- package/packages/Icon/src/icons/import.js +18 -0
- package/packages/Icon/src/icons/index.js +67 -0
- package/packages/Icon/src/icons/info.js +21 -0
- package/packages/Icon/src/icons/laptop.js +14 -0
- package/packages/Icon/src/icons/line.js +34 -0
- package/packages/Icon/src/icons/lock.js +14 -0
- package/packages/Icon/src/icons/map.js +18 -0
- package/packages/Icon/src/icons/more.js +19 -0
- package/packages/Icon/src/icons/move.js +14 -0
- package/packages/Icon/src/icons/org.js +18 -0
- package/packages/Icon/src/icons/palette.js +14 -0
- package/packages/Icon/src/icons/plan.js +17 -0
- package/packages/Icon/src/icons/ppt.js +18 -0
- package/packages/Icon/src/icons/question.js +18 -0
- package/packages/Icon/src/icons/radio.js +14 -0
- package/packages/Icon/src/icons/refresh.js +14 -0
- package/packages/Icon/src/icons/search.js +14 -0
- package/packages/Icon/src/icons/select.js +14 -0
- package/packages/Icon/src/icons/setting.js +18 -0
- package/packages/Icon/src/icons/simple-collapse.js +18 -0
- package/packages/Icon/src/icons/simple-expand.js +14 -0
- package/packages/Icon/src/icons/sort.js +22 -0
- package/packages/Icon/src/icons/sword.js +26 -0
- package/packages/Icon/src/icons/table.js +14 -0
- package/packages/Icon/src/icons/time.js +14 -0
- package/packages/Icon/src/icons/tree.js +14 -0
- package/packages/Icon/src/icons/typography.js +18 -0
- package/packages/Icon/src/icons/upload.js +18 -0
- package/packages/Icon/src/icons/user.js +14 -0
- package/packages/Icon/src/icons/users.js +30 -0
- package/packages/Icon/src/icons/video.js +14 -0
- package/packages/Icon/src/icons/word.js +18 -0
- package/packages/Icon/src/main.vue +432 -0
- package/packages/Image/index.js +7 -0
- package/packages/Image/src/main.vue +66 -0
- package/packages/Input/index.js +7 -0
- package/packages/Input/src/main.vue +552 -0
- package/packages/JobSelector/index.js +7 -0
- package/packages/JobSelector/src/main.vue +339 -0
- package/packages/JobSelectorInput/index.js +7 -0
- package/packages/JobSelectorInput/src/main.vue +87 -0
- package/packages/Map/index.js +7 -0
- package/packages/Map/src/Map.vue +427 -0
- package/packages/Milepost/index.js +7 -0
- package/packages/Milepost/src/main.vue +45 -0
- package/packages/OnlineForm/index.js +7 -0
- package/packages/OnlineForm/src/Form.vue +359 -0
- package/packages/OrgPostDialog/index.js +7 -0
- package/packages/OrgPostDialog/src/main.vue +244 -0
- package/packages/OrgSelector/index.js +7 -0
- package/packages/OrgSelector/src/main.vue +493 -0
- package/packages/OrgSelectorInput/index.js +7 -0
- package/packages/OrgSelectorInput/src/OrgSelectorInput.vue +216 -0
- package/packages/PostSelector/index.js +7 -0
- package/packages/PostSelector/src/main.vue +463 -0
- package/packages/PostSelectorInput/index.js +7 -0
- package/packages/PostSelectorInput/src/PostSelectorInput.vue +200 -0
- package/packages/Preview/index.js +7 -0
- package/packages/Preview/src/FillPage.vue +311 -0
- package/packages/Preview/src/FrameViewer.vue +135 -0
- package/packages/Preview/src/Loading.vue +126 -0
- package/packages/Preview/src/PdfViewer.vue +125 -0
- package/packages/Preview/src/TextViewer.vue +99 -0
- package/packages/Preview/src/main.vue +242 -0
- package/packages/Preview/src/watermark.js +124 -0
- package/packages/ProcessRecord/index.js +7 -0
- package/packages/ProcessRecord/src/main.vue +392 -0
- package/packages/Qrcode/index.js +7 -0
- package/packages/Qrcode/src/Qrcode.vue +105 -0
- package/packages/QuerySqlPreview/index.js +7 -0
- package/packages/QuerySqlPreview/src/QuerySqlPreview.vue +163 -0
- package/packages/Radio/index.js +7 -0
- package/packages/Radio/src/main.vue +172 -0
- package/packages/Rate/index.js +7 -0
- package/packages/Rate/src/main.vue +89 -0
- package/packages/ReadonlyInput/index.js +7 -0
- package/packages/ReadonlyInput/src/main.vue +92 -0
- package/packages/RelevantFlow/index.js +7 -0
- package/packages/RelevantFlow/src/main.vue +547 -0
- package/packages/RelevantFlow/src/relevantFlow.js +28 -0
- package/packages/RoleSelector/index.js +7 -0
- package/packages/RoleSelector/src/main.vue +358 -0
- package/packages/RoleSelectorInput/index.js +7 -0
- package/packages/RoleSelectorInput/src/main.vue +84 -0
- package/packages/SaveButton/index.js +7 -0
- package/packages/SaveButton/src/main.vue +73 -0
- package/packages/Select/index.js +7 -0
- package/packages/Select/src/main.vue +330 -0
- package/packages/SelectTree/index.js +7 -0
- package/packages/SelectTree/src/SelectTree.vue +352 -0
- package/packages/Selector/index.js +7 -0
- package/packages/Selector/src/main.vue +617 -0
- package/packages/SidebarDialog/index.js +7 -0
- package/packages/SidebarDialog/src/main.vue +156 -0
- package/packages/Slider/index.js +7 -0
- package/packages/Slider/src/main.vue +84 -0
- package/packages/Step/index.js +7 -0
- package/packages/StepLayout/index.js +7 -0
- package/packages/Steps/index.js +7 -0
- package/packages/Steps/src/Step.vue +122 -0
- package/packages/Steps/src/StepLayout.vue +35 -0
- package/packages/Steps/src/Steps.vue +65 -0
- package/packages/Subtable/index.js +33 -0
- package/packages/Subtable/src/SubDialog.vue +1926 -0
- package/packages/Subtable/src/SubExportDialog.vue +115 -0
- package/packages/Subtable/src/SubImportDialog.vue +316 -0
- package/packages/Subtable/src/SubPagination.vue +112 -0
- package/packages/Subtable/src/SubtableBackfill.vue +83 -0
- package/packages/Subtable/src/dialog.js +42 -0
- package/packages/Switch/index.js +7 -0
- package/packages/Switch/src/main.vue +83 -0
- package/packages/Table/index.js +7 -0
- package/packages/Table/src/CustomColumn.vue +351 -0
- package/packages/Table/src/Table.vue +979 -0
- package/packages/TableColumn/index.js +7 -0
- package/packages/TableColumn/src/main.vue +177 -0
- package/packages/TableSearchField/index.js +7 -0
- package/packages/TableSearchField/src/main.vue +334 -0
- package/packages/TableSearchPanel/index.js +7 -0
- package/packages/TableSearchPanel/src/main.vue +149 -0
- package/packages/Tabs/index.js +7 -0
- package/packages/Tabs/src/Tabs.vue +140 -0
- package/packages/Tag/index.js +7 -0
- package/packages/Tag/src/main.vue +264 -0
- package/packages/TemplateBatchUpdate/index.js +7 -0
- package/packages/TemplateBatchUpdate/src/TemplateBatchUpdateDialog.vue +174 -0
- package/packages/TemplateForm/index.js +7 -0
- package/packages/TemplateForm/src/main.vue +645 -0
- package/packages/TemplateFormDialog/index.js +7 -0
- package/packages/TemplateFormDialog/src/main.vue +61 -0
- package/packages/TemplateImportResult/index.js +7 -0
- package/packages/TemplateImportResult/src/main.vue +158 -0
- package/packages/TemplatePreview/index.js +19 -0
- package/packages/TemplatePreview/src/TemplatePreview.vue +169 -0
- package/packages/TemplatePreview/src/TemplatePreviewFile.vue +171 -0
- package/packages/TemplatePreview/src/TemplatePreviewImage.vue +83 -0
- package/packages/TemplateTaskCirculate/index.js +7 -0
- package/packages/TemplateTaskCirculate/src/main.vue +238 -0
- package/packages/Text/index.js +7 -0
- package/packages/Text/src/main.vue +57 -0
- package/packages/TimePicker/index.js +7 -0
- package/packages/TimePicker/src/main.vue +139 -0
- package/packages/TimeSelect/index.js +7 -0
- package/packages/TimeSelect/src/main.vue +96 -0
- package/packages/Tree/index.js +7 -0
- package/packages/Tree/src/main.vue +439 -0
- package/packages/TreeDialog/index.js +7 -0
- package/packages/TreeDialog/src/main.vue +293 -0
- package/packages/TreeListDialog/index.js +7 -0
- package/packages/TreeListDialog/src/main.vue +219 -0
- package/packages/Typography/index.js +8 -0
- package/packages/Typography/src/create-header.js +72 -0
- package/packages/UserDialog/index.js +7 -0
- package/packages/UserDialog/src/main.vue +250 -0
- package/packages/UserSelector/index.js +7 -0
- package/packages/UserSelector/src/main.vue +746 -0
- package/packages/UserSelectorInput/index.js +7 -0
- package/packages/UserSelectorInput/src/main.vue +319 -0
- package/packages/picture/index.js +7 -0
- package/packages/picture/src/main.vue +530 -0
- package/packages/plugins/Echarts.js +30 -0
- package/packages/plugins/Map.js +29 -0
- package/packages/plugins/Preview.js +49 -0
- package/packages/plugins/Qrcode.js +7 -0
- package/packages/plugins/XLSX.js +7 -0
- package/packages/plugins/wangeditor.js +19 -0
- package/src/assets/icon_found_img.png +0 -0
- package/src/assets/table-no-data.png +0 -0
- package/src/directive/badge.js +53 -0
- package/src/directive/copy.js +47 -0
- package/src/directive/ellipsis.js +6 -0
- package/src/directive/expandClick.js +23 -0
- package/src/directive/express.js +86 -0
- package/src/directive/form.js +122 -0
- package/src/directive/format.js +24 -0
- package/src/directive/formulas.js +708 -0
- package/src/directive/index.js +42 -0
- package/src/directive/permissionLine.js +59 -0
- package/src/directive/permissionLineLable.js +56 -0
- package/src/directive/permit.js +23 -0
- package/src/directive/popconfirm.js +86 -0
- package/src/directive/relatedQuery.js +61 -0
- package/src/directive/resize.js +18 -0
- package/src/directive/subSort.js +18 -0
- package/src/directive/tableDrag.js +25 -0
- package/src/directive/tooltip.js +37 -0
- package/src/filter/computerSize.js +23 -0
- package/src/filter/dateFormat.js +10 -0
- package/src/filter/index.js +10 -0
- package/src/index.js +267 -0
- package/src/locale/format.js +44 -0
- package/src/locale/index.js +48 -0
- package/src/locale/lang/en.js +59 -0
- package/src/locale/lang/zh-CN.js +58 -0
- package/src/locale/lang/zh-TW.js +57 -0
- package/src/locale/validate/dict.js +223 -0
- package/src/math.js +270 -0
- package/src/mixins/emitter.js +33 -0
- package/src/mixins/form.js +25 -0
- package/src/mixins/formDataUpdate.js +32 -0
- package/src/mixins/ganged.js +126 -0
- package/src/mixins/inputName.js +30 -0
- package/src/mixins/linkage.js +403 -0
- package/src/mixins/locale.js +9 -0
- package/src/mixins/mobileMode.js +27 -0
- package/src/mixins/onlineHottable.js +105 -0
- package/src/mixins/onlineSubtable.js +468 -0
- package/src/mixins/permission.js +84 -0
- package/src/mixins/querySqlPreview.js +747 -0
- package/src/mixins/regionValidator.js +70 -0
- package/src/mixins/script.js +35 -0
- package/src/mixins/templatePreview.js +3673 -0
- package/src/service.js +336 -0
- package/src/services/CustomQuery.js +199 -0
- package/src/services/SubPagination.js +132 -0
- package/src/styles/index.scss +7 -0
- package/src/styles/selector.scss +127 -0
- package/src/styles/variables.scss +71 -0
- package/src/util/base64.js +21 -0
- package/src/util/brower.js +15 -0
- package/src/util/clone.js +61 -0
- package/src/util/path.js +4 -0
- package/src/util/request.js +14 -0
- package/src/utils.js +1205 -0
- package/src/validate.js +184 -0
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
import { Loading } from 'element-ui'
|
|
2
|
+
import utils from 'sword-vue-ui/src/utils.js'
|
|
3
|
+
const { Base64 } = require('js-base64')
|
|
4
|
+
const { saveAs } = require('file-saver')
|
|
5
|
+
import Vue from 'vue'
|
|
6
|
+
import $ from 'jquery'
|
|
7
|
+
export default {
|
|
8
|
+
data() {
|
|
9
|
+
return {
|
|
10
|
+
bpmRunTime: window.context.bpmRunTime,
|
|
11
|
+
fileList: [],
|
|
12
|
+
tableData: { selectRows: [], querys: '' },
|
|
13
|
+
dialogExportVisible: false,
|
|
14
|
+
exportData: { getType: 'all', expField: [] },
|
|
15
|
+
exportSellection: [],
|
|
16
|
+
searchForm: {},
|
|
17
|
+
displayFields: [],
|
|
18
|
+
alarmSettingMap: {},
|
|
19
|
+
summaryTypeMap: {},
|
|
20
|
+
queryForm: {
|
|
21
|
+
queryData: '',
|
|
22
|
+
},
|
|
23
|
+
uploadParams: { id: [] },
|
|
24
|
+
formType: false,
|
|
25
|
+
labelPosition: 'left',
|
|
26
|
+
incons: 'el-icon-arrow-down',
|
|
27
|
+
formatterMap: {},
|
|
28
|
+
options: {
|
|
29
|
+
fullscreen: true,
|
|
30
|
+
lock: true,
|
|
31
|
+
},
|
|
32
|
+
uploadError: '/runtime/photoErrorCsv/v1/uploadErrorList',
|
|
33
|
+
upoadPdfToAzure:
|
|
34
|
+
window.context.bpmRunTime + '/runtime/blob/v1/upoadPdfToAzure',
|
|
35
|
+
uploadUnprepare: '/runtime/blob/v1/upoadToAzure',
|
|
36
|
+
summarySetting: [],
|
|
37
|
+
activeNames: ['1'],
|
|
38
|
+
pagination: {
|
|
39
|
+
page: 1,
|
|
40
|
+
pageSize: 30,
|
|
41
|
+
total: 0,
|
|
42
|
+
},
|
|
43
|
+
rows: [],
|
|
44
|
+
queryParam: {},
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// computed: mapState({
|
|
48
|
+
// uploadHeaders: (state) => {
|
|
49
|
+
// return { Authorization: `Bearer ${state.login.currentUser.token}` }
|
|
50
|
+
// },
|
|
51
|
+
// uploadErrorHttp() {
|
|
52
|
+
// return this.bpmRunTime + this.uploadError
|
|
53
|
+
// },
|
|
54
|
+
// uploadUnprepareHttp() {
|
|
55
|
+
// return this.bpmRunTime + this.uploadUnprepare
|
|
56
|
+
// },
|
|
57
|
+
// }),
|
|
58
|
+
watch: {
|
|
59
|
+
formKey: function (newVal) {
|
|
60
|
+
if (newVal) {
|
|
61
|
+
this.init()
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
'tableData.selectRows': function (newVal) {
|
|
65
|
+
if (newVal.length > 0) {
|
|
66
|
+
let me_ = this
|
|
67
|
+
me_.uploadParams.id = []
|
|
68
|
+
newVal.forEach((item) => {
|
|
69
|
+
me_.uploadParams.id.push(item.INSTID)
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
$route: 'init',
|
|
74
|
+
queryView: {
|
|
75
|
+
handler(newVal) {
|
|
76
|
+
if (newVal.shows) {
|
|
77
|
+
let displayField = utils.parseToJson(newVal.shows)
|
|
78
|
+
for (var i = 0; i < displayField.length; i++) {
|
|
79
|
+
if (displayField[i].hidden == 0) {
|
|
80
|
+
this.displayFields.push(displayField[i])
|
|
81
|
+
if (displayField[i].summaryType) {
|
|
82
|
+
this.summaryTypeMap[displayField[i].fieldName] =
|
|
83
|
+
displayField[i].summaryType
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (displayField[i].formater) {
|
|
87
|
+
this.formatterMap[displayField[i].fieldName] =
|
|
88
|
+
displayField[i].formater
|
|
89
|
+
}
|
|
90
|
+
if (displayField[i].alarmSetting) {
|
|
91
|
+
this.alarmSettingMap[displayField[i].fieldName] =
|
|
92
|
+
displayField[i].alarmSetting
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (newVal.summarySetting) {
|
|
97
|
+
this.summarySetting = JSON.parse(newVal.summarySetting)
|
|
98
|
+
}
|
|
99
|
+
//handle pageSize
|
|
100
|
+
this.pagination.pageSize = newVal.pageSize || 30
|
|
101
|
+
},
|
|
102
|
+
immediate: true,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
//打印
|
|
107
|
+
printList() {
|
|
108
|
+
document.body.innerHTML = document.getElementById('printData').innerHTML
|
|
109
|
+
window.print()
|
|
110
|
+
location.reload()
|
|
111
|
+
},
|
|
112
|
+
//生成二维码
|
|
113
|
+
|
|
114
|
+
//路由跳转
|
|
115
|
+
routerPush(url) {
|
|
116
|
+
this.$router.push(url)
|
|
117
|
+
},
|
|
118
|
+
//查看与处理流程按钮
|
|
119
|
+
dispose(row) {
|
|
120
|
+
let url
|
|
121
|
+
if (row.TASKID) {
|
|
122
|
+
//审批任务
|
|
123
|
+
url = '/task/' + row.TASKID
|
|
124
|
+
} else {
|
|
125
|
+
//查看流程实例
|
|
126
|
+
url = '/inst/' + row.INSTID
|
|
127
|
+
}
|
|
128
|
+
this.$router.push(url)
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
handleSizeChange: function (size) {
|
|
132
|
+
//每页下拉显示数据
|
|
133
|
+
this.pagination.pageSize = size
|
|
134
|
+
if (this.$refs.queryViewList) {
|
|
135
|
+
this.$refs.queryViewList.load()
|
|
136
|
+
} else {
|
|
137
|
+
this.search()
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
handleCurrentChange: function (currentPage) {
|
|
141
|
+
//点击第几页
|
|
142
|
+
this.pagination.page = currentPage
|
|
143
|
+
if (this.$refs.queryViewList) {
|
|
144
|
+
this.$refs.queryViewList.load()
|
|
145
|
+
} else {
|
|
146
|
+
this.search()
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
//回车查询
|
|
150
|
+
searchEnterFun: function (e) {
|
|
151
|
+
let keyCode = window.event ? e.keyCode : e.which
|
|
152
|
+
if (keyCode == 13) {
|
|
153
|
+
this.pagination.page = 1
|
|
154
|
+
this.search()
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
search(param, cb) {
|
|
158
|
+
!param && (param = {})
|
|
159
|
+
param.pageBean = this.pagination
|
|
160
|
+
//保存查询参数,用于作为导出的查询参数
|
|
161
|
+
this.queryParam = { ...param }
|
|
162
|
+
let obj = {
|
|
163
|
+
sqlAlias: this.sqlAlias || this.queryView.sqlAlias,
|
|
164
|
+
alias: this.alias || this.queryView.alias,
|
|
165
|
+
param: param,
|
|
166
|
+
}
|
|
167
|
+
this.getQuerySqlViewByPagination(obj, cb)
|
|
168
|
+
},
|
|
169
|
+
getQuerySqlViewByPagination(param, cb) {
|
|
170
|
+
this.$requestConfig
|
|
171
|
+
.getQueryViewDataList(param)
|
|
172
|
+
.then((response) => {
|
|
173
|
+
this.rows = response.rows
|
|
174
|
+
this.pagination.total = response.total
|
|
175
|
+
this.pagination.page = response.page
|
|
176
|
+
this.pagination.pageSize = response.pageSize
|
|
177
|
+
})
|
|
178
|
+
.finally(() => {
|
|
179
|
+
cb && cb()
|
|
180
|
+
})
|
|
181
|
+
},
|
|
182
|
+
getQueryFilter() {
|
|
183
|
+
let operationMap = this.getSearchItems() //查询条件类型
|
|
184
|
+
// let fieldQueryMap = this.getFieldQuery() //查询条件字段
|
|
185
|
+
let specialMap = this.getSpecialMap() //获取特殊查询情况(自定义对话框)
|
|
186
|
+
let querys = [] //查询条件
|
|
187
|
+
let queryFilter = {}
|
|
188
|
+
let pageBean = { pageBean: this.pagination }
|
|
189
|
+
let params = {
|
|
190
|
+
sqlAlias: this.sqlAlias || this.queryView.sqlAlias,
|
|
191
|
+
alias: this.alias || this.queryView.alias,
|
|
192
|
+
}
|
|
193
|
+
params.pagination = pageBean
|
|
194
|
+
if ($.isEmptyObject(this.searchForm)) {
|
|
195
|
+
return params
|
|
196
|
+
} else {
|
|
197
|
+
for (var key in this.searchForm) {
|
|
198
|
+
if (
|
|
199
|
+
typeof this.searchForm[key] != 'undefined' &&
|
|
200
|
+
this.searchForm[key] != '' &&
|
|
201
|
+
this.searchForm[key] != null
|
|
202
|
+
) {
|
|
203
|
+
if (this.searchForm[key] instanceof Array) {
|
|
204
|
+
if (operationMap[key] === 'BETWEEN') {
|
|
205
|
+
let valueArray = []
|
|
206
|
+
for (let i = 0; i < this.searchForm[key].length; i++) {
|
|
207
|
+
valueArray.push(this.searchForm[key][i])
|
|
208
|
+
}
|
|
209
|
+
querys.push({
|
|
210
|
+
property: key,
|
|
211
|
+
value: valueArray.join(','),
|
|
212
|
+
group: 'main',
|
|
213
|
+
operation: operationMap[key],
|
|
214
|
+
relation: 'AND',
|
|
215
|
+
})
|
|
216
|
+
} else {
|
|
217
|
+
for (let i = 0; i < this.searchForm[key].length; i++) {
|
|
218
|
+
querys.push({
|
|
219
|
+
property: key,
|
|
220
|
+
value: this.searchForm[key][i],
|
|
221
|
+
group: 'main',
|
|
222
|
+
operation: operationMap[key],
|
|
223
|
+
relation: 'AND',
|
|
224
|
+
})
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} else if (this.searchForm[key].includes(',') && !specialMap[key]) {
|
|
228
|
+
let arr = this.searchForm[key].split(',')
|
|
229
|
+
for (let i = 0; i < arr.length; i++) {
|
|
230
|
+
if (
|
|
231
|
+
arr[i] == '' ||
|
|
232
|
+
arr[i] == null ||
|
|
233
|
+
typeof arr[i] == 'undefined'
|
|
234
|
+
) {
|
|
235
|
+
arr.splice(i, 1)
|
|
236
|
+
i = i - 1
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
arr.forEach((v) => {
|
|
240
|
+
querys.push({
|
|
241
|
+
property: key,
|
|
242
|
+
value: v,
|
|
243
|
+
group: 'main',
|
|
244
|
+
operation: operationMap[key],
|
|
245
|
+
relation: 'AND',
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
} else {
|
|
249
|
+
querys.push({
|
|
250
|
+
property: key,
|
|
251
|
+
value: this.searchForm[key],
|
|
252
|
+
group: 'main',
|
|
253
|
+
operation: operationMap[key],
|
|
254
|
+
relation: 'AND',
|
|
255
|
+
})
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
queryFilter = { pageBean: this.pagination, querys }
|
|
260
|
+
params.pagination = queryFilter
|
|
261
|
+
return params
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
//获取查询条件类型
|
|
265
|
+
getSearchItems() {
|
|
266
|
+
let searchItems = $('.search-item')
|
|
267
|
+
let operationMap = {} //查询条件类型
|
|
268
|
+
let operationType = {
|
|
269
|
+
LK: 'LIKE',
|
|
270
|
+
EQ: 'EQUAL',
|
|
271
|
+
between: 'BETWEEN',
|
|
272
|
+
LFK: 'LEFT_LIKE',
|
|
273
|
+
RHK: 'RIGHT_LIKE',
|
|
274
|
+
NE: 'NOT_EQUAL',
|
|
275
|
+
LT: 'LESS',
|
|
276
|
+
LE: 'LESS_EQUAL',
|
|
277
|
+
GT: 'GREAT',
|
|
278
|
+
GE: 'GREAT_EQUAL',
|
|
279
|
+
}
|
|
280
|
+
if (searchItems) {
|
|
281
|
+
for (var i = 0; i < searchItems.length; i++) {
|
|
282
|
+
var operation = '='
|
|
283
|
+
if (typeof $(searchItems[i]).attr('cl-query') != 'undefined') {
|
|
284
|
+
//查询条件类型
|
|
285
|
+
operation = $(searchItems[i]).attr('operation')
|
|
286
|
+
operationMap[$(searchItems[i]).attr('cl-query')] =
|
|
287
|
+
typeof operationType[operation] != 'undefined'
|
|
288
|
+
? operationType[operation]
|
|
289
|
+
: operation
|
|
290
|
+
} else if (
|
|
291
|
+
typeof $(searchItems[i]).children().attr('cl-query') != 'undefined'
|
|
292
|
+
) {
|
|
293
|
+
//查询条件类型
|
|
294
|
+
operation = $(searchItems[i]).children().attr('operation')
|
|
295
|
+
operationMap[$(searchItems[i]).children().attr('cl-query')] =
|
|
296
|
+
typeof operationType[operation] != 'undefined'
|
|
297
|
+
? operationType[operation]
|
|
298
|
+
: operation
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return operationMap
|
|
303
|
+
},
|
|
304
|
+
//获取查询条件字段
|
|
305
|
+
getFieldQuery() {
|
|
306
|
+
let searchItems = $('.search-item')
|
|
307
|
+
let fieldQueryMap = {} //查询条件字段
|
|
308
|
+
|
|
309
|
+
if (searchItems) {
|
|
310
|
+
for (var i = 0; i < searchItems.length; i++) {
|
|
311
|
+
if (typeof $(searchItems[i]).attr('cl-query') != 'undefined') {
|
|
312
|
+
//查询条件字段
|
|
313
|
+
fieldQueryMap[$(searchItems[i]).attr('cl-query')] = $(
|
|
314
|
+
searchItems[i]
|
|
315
|
+
).attr('field-query')
|
|
316
|
+
} else if (
|
|
317
|
+
typeof $(searchItems[i]).children().attr('cl-query') != 'undefined'
|
|
318
|
+
) {
|
|
319
|
+
//查询条件字段
|
|
320
|
+
fieldQueryMap[$(searchItems[i]).children().attr('cl-query')] = $(
|
|
321
|
+
searchItems[i]
|
|
322
|
+
)
|
|
323
|
+
.children()
|
|
324
|
+
.attr('field-query')
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return fieldQueryMap
|
|
329
|
+
},
|
|
330
|
+
//获取特殊查询情况(自定义对话框)
|
|
331
|
+
getSpecialMap() {
|
|
332
|
+
let searchItems = $('.search-item')
|
|
333
|
+
let fieldQueryMap = {} //查询条件字段
|
|
334
|
+
|
|
335
|
+
if (searchItems) {
|
|
336
|
+
for (var i = 0; i < searchItems.length; i++) {
|
|
337
|
+
if (typeof $(searchItems[i]).attr('cl-query') != 'undefined') {
|
|
338
|
+
//查询条件字段
|
|
339
|
+
fieldQueryMap[$(searchItems[i]).attr('cl-query')] =
|
|
340
|
+
typeof $(searchItems[i]).attr('special-query') != 'undefined'
|
|
341
|
+
? true
|
|
342
|
+
: false
|
|
343
|
+
} else if (
|
|
344
|
+
typeof $(searchItems[i]).children().attr('cl-query') != 'undefined'
|
|
345
|
+
) {
|
|
346
|
+
//查询条件字段
|
|
347
|
+
fieldQueryMap[$(searchItems[i]).children().attr('cl-query')] =
|
|
348
|
+
typeof $(searchItems[i]).children().attr('special-query') !=
|
|
349
|
+
'undefined'
|
|
350
|
+
? true
|
|
351
|
+
: false
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return fieldQueryMap
|
|
356
|
+
},
|
|
357
|
+
getConditionQuery(param) {
|
|
358
|
+
// let searchAll = $('.search-query')
|
|
359
|
+
// let values = ''
|
|
360
|
+
let querys = [] //查询条件
|
|
361
|
+
let queryFilter = {}
|
|
362
|
+
let pageBean = { pageBean: this.pagination }
|
|
363
|
+
let params = {
|
|
364
|
+
sqlAlias: this.sqlAlias || this.queryView.sqlAlias,
|
|
365
|
+
alias: this.alias || this.queryView.alias,
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
params.pagination = pageBean
|
|
369
|
+
// if (this.queryForm.queryData == '') {
|
|
370
|
+
// return params
|
|
371
|
+
// } else {
|
|
372
|
+
// if (
|
|
373
|
+
// typeof $($(searchAll[0]).children()[0]).attr('cl-quick-search') !=
|
|
374
|
+
// 'undefined'
|
|
375
|
+
// ) {
|
|
376
|
+
// values = $($(searchAll[0]).children()[0]).attr('cl-quick-search')
|
|
377
|
+
// var arr = values.split(',')
|
|
378
|
+
// for (let value of arr) {
|
|
379
|
+
// querys.push({
|
|
380
|
+
// property: value,
|
|
381
|
+
// value: this.queryForm.queryData,
|
|
382
|
+
// group: 'main',
|
|
383
|
+
// operation: 'LIKE',
|
|
384
|
+
// relation: 'OR',
|
|
385
|
+
// })
|
|
386
|
+
// }
|
|
387
|
+
// }
|
|
388
|
+
// }
|
|
389
|
+
if (param && param.querys) {
|
|
390
|
+
let temquerys = [...param.querys]
|
|
391
|
+
temquerys.forEach((q) => {
|
|
392
|
+
// if (q.property.indexOf(prefix) == -1) {
|
|
393
|
+
// q.property = prefix + q.property
|
|
394
|
+
// }
|
|
395
|
+
querys.push(q)
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
queryFilter = { pageBean: this.pagination, querys }
|
|
399
|
+
params.pagination = queryFilter
|
|
400
|
+
return params
|
|
401
|
+
},
|
|
402
|
+
//打开高级检索
|
|
403
|
+
advanced() {
|
|
404
|
+
this.formType = !this.formType
|
|
405
|
+
if (this.formType) {
|
|
406
|
+
this.incons = 'el-icon-arrow-up'
|
|
407
|
+
this.queryForm.queryData = ''
|
|
408
|
+
} else {
|
|
409
|
+
this.incons = 'el-icon-arrow-down'
|
|
410
|
+
this.searchForm = {}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
reset() {
|
|
414
|
+
this.queryForm.queryData = ''
|
|
415
|
+
this.searchForm = {}
|
|
416
|
+
this.pagination.page = 1
|
|
417
|
+
this.search()
|
|
418
|
+
},
|
|
419
|
+
handleSelectionChange(val) {
|
|
420
|
+
this.tableData.selectRows = val
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
selectable(row) {
|
|
424
|
+
if (row.BATCH_COVER_FLAG != 'YES' && row.NODEID == 'UserTask171') {
|
|
425
|
+
return true
|
|
426
|
+
}
|
|
427
|
+
return false
|
|
428
|
+
},
|
|
429
|
+
//点击导出按钮
|
|
430
|
+
exports() {
|
|
431
|
+
this.dialogExportVisible = true
|
|
432
|
+
},
|
|
433
|
+
punchOrder() {
|
|
434
|
+
this.$store
|
|
435
|
+
.dispatch('storeProcess/downLoadToFile', 'Batchkeijyo')
|
|
436
|
+
.then(() => {})
|
|
437
|
+
},
|
|
438
|
+
beforeAvatarUpload(file) {
|
|
439
|
+
var fileName = new Array()
|
|
440
|
+
fileName = file.name.split('.')
|
|
441
|
+
const extension = fileName[fileName.length - 1] === 'pdf'
|
|
442
|
+
if (!extension) {
|
|
443
|
+
this.$message({
|
|
444
|
+
message: '上传模板只能是PDF格式!',
|
|
445
|
+
type: 'warning',
|
|
446
|
+
})
|
|
447
|
+
return false
|
|
448
|
+
}
|
|
449
|
+
if (this.tableData.selectRows.length == 0) {
|
|
450
|
+
this.$message({
|
|
451
|
+
type: 'warning',
|
|
452
|
+
message: '请选择要上传送付状的案件',
|
|
453
|
+
})
|
|
454
|
+
return false
|
|
455
|
+
}
|
|
456
|
+
return true
|
|
457
|
+
},
|
|
458
|
+
|
|
459
|
+
onSuccessUpload() {
|
|
460
|
+
this.$message.success('送付状成功')
|
|
461
|
+
window.location.reload()
|
|
462
|
+
},
|
|
463
|
+
handlePreview() {},
|
|
464
|
+
//确定导出
|
|
465
|
+
submitExport() {
|
|
466
|
+
if (!this.exportData || this.exportData.expField.length < 1) {
|
|
467
|
+
this.$message({
|
|
468
|
+
type: 'info',
|
|
469
|
+
message: '请选择要导出的字段!',
|
|
470
|
+
})
|
|
471
|
+
return
|
|
472
|
+
}
|
|
473
|
+
let expField = ''
|
|
474
|
+
for (var i = 0; i < this.exportData.expField.length; i++) {
|
|
475
|
+
if (i > 0) {
|
|
476
|
+
expField += ','
|
|
477
|
+
}
|
|
478
|
+
expField += this.exportData.expField[i].fieldName
|
|
479
|
+
}
|
|
480
|
+
expField = Base64.encode(expField).replace(/\+/g, '%2B')
|
|
481
|
+
// let params = {
|
|
482
|
+
// sqlAlias: this.sqlAlias || this.queryView.sqlAlias,
|
|
483
|
+
// alias: this.alias || this.queryView.alias,
|
|
484
|
+
// }
|
|
485
|
+
let data = {
|
|
486
|
+
sqlAlias: this.sqlAlias || this.queryView.sqlAlias,
|
|
487
|
+
alias: this.alias || this.queryView.alias,
|
|
488
|
+
getType: this.exportData.getType,
|
|
489
|
+
expField: expField,
|
|
490
|
+
}
|
|
491
|
+
data.query = this.queryParam
|
|
492
|
+
let loadingInstance = Loading.service({ fullscreen: true }) //开始
|
|
493
|
+
this.$requestConfig
|
|
494
|
+
.querySqlViewExport(data)
|
|
495
|
+
.then(({ data, headers }) => {
|
|
496
|
+
const fileName = decodeURIComponent(
|
|
497
|
+
headers['content-disposition'].split(';')[1].split('filename=')[1]
|
|
498
|
+
)
|
|
499
|
+
const blob = new Blob([data])
|
|
500
|
+
saveAs(blob, fileName)
|
|
501
|
+
})
|
|
502
|
+
.finally(() => {
|
|
503
|
+
loadingInstance.close() // 结束
|
|
504
|
+
this.dialogExportVisible = false
|
|
505
|
+
})
|
|
506
|
+
},
|
|
507
|
+
|
|
508
|
+
//取消导出
|
|
509
|
+
exportCancel() {
|
|
510
|
+
this.dialogExportVisible = false
|
|
511
|
+
this.exportData.expField = []
|
|
512
|
+
},
|
|
513
|
+
|
|
514
|
+
handleExportSelectionChange(val) {
|
|
515
|
+
this.exportData.expField = []
|
|
516
|
+
if (val) {
|
|
517
|
+
this.exportData.expField = val
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
//全选
|
|
522
|
+
handleExportSelectAll(val) {
|
|
523
|
+
this.exportData.expField = val
|
|
524
|
+
},
|
|
525
|
+
|
|
526
|
+
//排序
|
|
527
|
+
sort(index, type) {
|
|
528
|
+
if ('up' == type) {
|
|
529
|
+
if (index === 0) {
|
|
530
|
+
this.$message({
|
|
531
|
+
message: '已经是列表中第一位',
|
|
532
|
+
type: 'warning',
|
|
533
|
+
})
|
|
534
|
+
} else {
|
|
535
|
+
let temp = this.displayFields[index - 1]
|
|
536
|
+
Vue.set(this.displayFields, index - 1, this.displayFields[index])
|
|
537
|
+
Vue.set(this.displayFields, index, temp)
|
|
538
|
+
}
|
|
539
|
+
} else {
|
|
540
|
+
if (index === this.displayFields.length - 1) {
|
|
541
|
+
this.$message({
|
|
542
|
+
message: '已经是列表中最后一位',
|
|
543
|
+
type: 'warning',
|
|
544
|
+
})
|
|
545
|
+
} else {
|
|
546
|
+
this.isTransition = true
|
|
547
|
+
let i = this.displayFields[index + 1]
|
|
548
|
+
Vue.set(this.displayFields, index + 1, this.displayFields[index])
|
|
549
|
+
Vue.set(this.displayFields, index, i)
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
|
|
554
|
+
getSubEntsByFormKey(refId) {
|
|
555
|
+
let _me = this
|
|
556
|
+
_me.tabs = []
|
|
557
|
+
if (!_me.ents || _me.ents.length < 1) {
|
|
558
|
+
this.$requestConfig
|
|
559
|
+
.getSubEntsByFormKey(this.templateInfo.alias)
|
|
560
|
+
.then((ents) => {
|
|
561
|
+
_me.ents = ents
|
|
562
|
+
this.getSubData(_me, refId)
|
|
563
|
+
})
|
|
564
|
+
} else {
|
|
565
|
+
this.getSubData(_me, refId)
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
getSummaries(param) {
|
|
569
|
+
let _summaryTypeMap = this.summaryTypeMap
|
|
570
|
+
const { columns, data } = param
|
|
571
|
+
const sums = []
|
|
572
|
+
columns.forEach((column, index) => {
|
|
573
|
+
if (index === 0) {
|
|
574
|
+
sums[index] = '合计'
|
|
575
|
+
return
|
|
576
|
+
}
|
|
577
|
+
if (
|
|
578
|
+
_summaryTypeMap[column.property] &&
|
|
579
|
+
_summaryTypeMap[column.property] == 'sum'
|
|
580
|
+
) {
|
|
581
|
+
const values = data.map((item) => Number(item[column.property]))
|
|
582
|
+
if (!values.every((value) => isNaN(value))) {
|
|
583
|
+
sums[index] = values.reduce((prev, curr) => {
|
|
584
|
+
const value = Number(curr)
|
|
585
|
+
if (!isNaN(value)) {
|
|
586
|
+
return prev + curr
|
|
587
|
+
} else {
|
|
588
|
+
return prev
|
|
589
|
+
}
|
|
590
|
+
}, 0)
|
|
591
|
+
} else {
|
|
592
|
+
sums[index] = 'N/A'
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
})
|
|
596
|
+
|
|
597
|
+
return sums
|
|
598
|
+
},
|
|
599
|
+
columnFormatter(row, column, cellValue) {
|
|
600
|
+
let formatter = this.formatterMap[column.property]
|
|
601
|
+
if (formatter) {
|
|
602
|
+
try {
|
|
603
|
+
var script =
|
|
604
|
+
'var formatterFunction = function(row,column,cellValue){ ' +
|
|
605
|
+
formatter +
|
|
606
|
+
'};'
|
|
607
|
+
var result = eval(script + 'formatterFunction(row,column,cellValue);')
|
|
608
|
+
return result
|
|
609
|
+
} catch (e) {
|
|
610
|
+
return cellValue
|
|
611
|
+
}
|
|
612
|
+
} else {
|
|
613
|
+
return cellValue
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
dateFormatter(row, column, cellValue) {
|
|
617
|
+
if (cellValue) {
|
|
618
|
+
return cellValue.replace('.0', '')
|
|
619
|
+
} else {
|
|
620
|
+
return cellValue
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
getAlarmColor(field, cellValue) {
|
|
624
|
+
let alarmSetting = this.alarmSettingMap[field]
|
|
625
|
+
let type = ''
|
|
626
|
+
this.displayFields.forEach((item) => {
|
|
627
|
+
if (item.fieldName === field) {
|
|
628
|
+
type = item.dataType
|
|
629
|
+
}
|
|
630
|
+
})
|
|
631
|
+
if (alarmSetting) {
|
|
632
|
+
try {
|
|
633
|
+
let alarmSettingJson = utils.parseToJson(alarmSetting)
|
|
634
|
+
let alarmScript = ''
|
|
635
|
+
for (var i = 0; i < alarmSettingJson.length; i++) {
|
|
636
|
+
let alarm = alarmSettingJson[i]
|
|
637
|
+
let condition = alarm.condition
|
|
638
|
+
let conditionStr = ''
|
|
639
|
+
for (var m = 0; m < condition.length; m++) {
|
|
640
|
+
if (m > 0) {
|
|
641
|
+
conditionStr += ' && '
|
|
642
|
+
}
|
|
643
|
+
if (type === 'number' || type === 'bigint' || type === 'int') {
|
|
644
|
+
if (condition[m].op == 'indexOf' && condition[m].val) {
|
|
645
|
+
conditionStr =
|
|
646
|
+
conditionStr +
|
|
647
|
+
"'" +
|
|
648
|
+
cellValue +
|
|
649
|
+
"'.indexOf('" +
|
|
650
|
+
condition[m].val +
|
|
651
|
+
"')!=-1"
|
|
652
|
+
} else if (condition[m].op == 'notIndexOf') {
|
|
653
|
+
conditionStr =
|
|
654
|
+
conditionStr +
|
|
655
|
+
"'" +
|
|
656
|
+
cellValue +
|
|
657
|
+
"'.indexOf('" +
|
|
658
|
+
condition[m].val +
|
|
659
|
+
"')==-1"
|
|
660
|
+
} else {
|
|
661
|
+
conditionStr =
|
|
662
|
+
conditionStr +
|
|
663
|
+
cellValue +
|
|
664
|
+
condition[m].op +
|
|
665
|
+
condition[m].val
|
|
666
|
+
}
|
|
667
|
+
} else {
|
|
668
|
+
if (condition[m].op == 'indexOf' && condition[m].val) {
|
|
669
|
+
conditionStr =
|
|
670
|
+
conditionStr +
|
|
671
|
+
"'" +
|
|
672
|
+
cellValue +
|
|
673
|
+
"'.indexOf('" +
|
|
674
|
+
condition[m].val +
|
|
675
|
+
"')!=-1"
|
|
676
|
+
} else if (condition[m].op == 'notIndexOf') {
|
|
677
|
+
conditionStr =
|
|
678
|
+
conditionStr +
|
|
679
|
+
"'" +
|
|
680
|
+
cellValue +
|
|
681
|
+
"'.indexOf('" +
|
|
682
|
+
condition[m].val +
|
|
683
|
+
"')==-1"
|
|
684
|
+
} else {
|
|
685
|
+
conditionStr =
|
|
686
|
+
conditionStr +
|
|
687
|
+
"'" +
|
|
688
|
+
cellValue +
|
|
689
|
+
"'" +
|
|
690
|
+
condition[m].op +
|
|
691
|
+
"'" +
|
|
692
|
+
condition[m].val +
|
|
693
|
+
"'"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
//conditionStr = conditionStr+cellValue+condition[m].op+condition[m].val;
|
|
697
|
+
}
|
|
698
|
+
if (i > 0) {
|
|
699
|
+
alarmScript += ' else '
|
|
700
|
+
}
|
|
701
|
+
let colorStr = 'color:' + alarm.color + ''
|
|
702
|
+
alarmScript =
|
|
703
|
+
alarmScript +
|
|
704
|
+
'if(' +
|
|
705
|
+
conditionStr +
|
|
706
|
+
"){return '" +
|
|
707
|
+
colorStr +
|
|
708
|
+
"';}"
|
|
709
|
+
}
|
|
710
|
+
if (alarmScript) {
|
|
711
|
+
alarmScript += 'else{ return "";}'
|
|
712
|
+
var script = 'var alarmFunction = function(){ ' + alarmScript + '};'
|
|
713
|
+
var result = eval(script + 'alarmFunction();')
|
|
714
|
+
return result
|
|
715
|
+
} else {
|
|
716
|
+
return ''
|
|
717
|
+
}
|
|
718
|
+
} catch (e) {
|
|
719
|
+
return ''
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
summary(method, field, decimal) {
|
|
724
|
+
let list = this.rows
|
|
725
|
+
.filter((item) => item[field] !== undefined && item[field] !== '')
|
|
726
|
+
.map((item) => new Number(item[field]))
|
|
727
|
+
try {
|
|
728
|
+
if (method === 'count') {
|
|
729
|
+
return list.length
|
|
730
|
+
} else if (method === 'sum') {
|
|
731
|
+
return list.reduce((a, b) => a + b).toFixed(decimal)
|
|
732
|
+
} else if (method === 'min') {
|
|
733
|
+
return Math.min(...list).toFixed(decimal)
|
|
734
|
+
} else if (method === 'max') {
|
|
735
|
+
return Math.max(...list).toFixed(decimal)
|
|
736
|
+
} else if (method === 'avg') {
|
|
737
|
+
return (list.reduce((a, b) => a + b) / list.length).toFixed(decimal)
|
|
738
|
+
}
|
|
739
|
+
} catch (e) {
|
|
740
|
+
console.error(e)
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
showSearchPane() {
|
|
744
|
+
return true
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
}
|