hd-idevvue3 3.0.2 → 3.0.4
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/dist/assets/index.9c127719.css +1 -0
- package/dist/hd-idevvue3.mjs +3521 -3305
- package/dist/hd-idevvue3.umd.js +29 -29
- package/npminstall-debug.log +2 -10
- package/package.json +4 -2
- package/pnpm-lock.yaml +37 -4
- package/src/App.vue +11 -15
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +9 -10
- package/src/demo/dropdemo.vue +42 -43
- package/src/demo/extsets.vue +140 -39
- package/src/demo/formedit.vue +157 -145
- package/src/demo/hightquery.vue +263 -66
- package/src/demo/inlineedit.vue +129 -35
- package/src/demo/selfdrop.vue +32 -15
- package/src/directive/el-dragDialog/drag.js +13 -13
- package/src/directive/el-dragDialog/index.js +13 -13
- package/src/errorLog.js +3 -3
- package/src/hdcom/BigGrid.js +54 -48
- package/src/hdcom/BillShow.vue +84 -63
- package/src/hdcom/BillUpload.vue +144 -86
- package/src/hdcom/BtnRight.vue +26 -23
- package/src/hdcom/ErrHint.vue +36 -24
- package/src/hdcom/ExtendColumn.vue +97 -90
- package/src/hdcom/ExtendCommon.js +24 -13
- package/src/hdcom/ExtendForm.vue +107 -80
- package/src/hdcom/FacePicUpload.vue +59 -50
- package/src/hdcom/FaceRecTest.vue +87 -77
- package/src/hdcom/GridChart.vue +175 -162
- package/src/hdcom/GridExField.vue +328 -234
- package/src/hdcom/GridShow.vue +89 -39
- package/src/hdcom/HdAside.vue +192 -145
- package/src/hdcom/HdBtn.vue +44 -32
- package/src/hdcom/HdButton.vue +141 -117
- package/src/hdcom/HdComFaceRec.vue +80 -32
- package/src/hdcom/HdComGrid.vue +329 -229
- package/src/hdcom/HdComQuery.vue +179 -90
- package/src/hdcom/HdComQueryDetail.vue +159 -115
- package/src/hdcom/HdComSortDetail.vue +136 -130
- package/src/hdcom/HdDatePicker.vue +32 -16
- package/src/hdcom/HdDialog.vue +62 -44
- package/src/hdcom/HdDrop.vue +163 -138
- package/src/hdcom/HdFileUpload.vue +138 -119
- package/src/hdcom/HdFilterBox.vue +62 -62
- package/src/hdcom/HdFooter.vue +152 -119
- package/src/hdcom/HdForm.vue +276 -203
- package/src/hdcom/HdFormBtn.vue +81 -39
- package/src/hdcom/HdFormItem.vue +14 -10
- package/src/hdcom/HdGrid.vue +353 -156
- package/src/hdcom/HdGridEditBtn.vue +34 -20
- package/src/hdcom/HdGridExt.js +78 -47
- package/src/hdcom/HdGridSel.vue +227 -193
- package/src/hdcom/HdHeader.vue +149 -117
- package/src/hdcom/HdHotKey.vue +70 -67
- package/src/hdcom/HdInputHint.vue +40 -36
- package/src/hdcom/HdMain.vue +25 -27
- package/src/hdcom/HdMessage.vue +180 -171
- package/src/hdcom/HdNum.vue +67 -57
- package/src/hdcom/HdPopSel.vue +46 -24
- package/src/hdcom/HdRightMenu.vue +63 -61
- package/src/hdcom/HdSel/SelGridFieldcod.vue +46 -28
- package/src/hdcom/HdTableColumn.vue +156 -109
- package/src/hdcom/HdTempSave.vue +138 -116
- package/src/hdcom/HdTree.vue +89 -72
- package/src/hdcom/HdTreeTable/eval.js +8 -3
- package/src/hdcom/HdTreeTable/index.vue +229 -174
- package/src/hdcom/ImportExcel.vue +69 -34
- package/src/hdcom/index.js +39 -44
- package/src/idev.common.js +54 -47
- package/src/index.js +3 -6
- package/src/utils/HdQuery.js +25 -14
- package/src/utils/comutils.js +50 -28
- package/src/utils/gogocodeTransfer.js +59 -0
- package/src/utils/utils.js +30 -19
- package/src/vendor/Blob.js +187 -179
- package/src/vendor/Export2Excel.js +231 -220
- package/src/vendor/Export2Zip.js +25 -22
- package/src/views/layout/AppMain.vue +34 -32
- package/src/views/layout/HdLayout.vue +64 -52
- package/src/views/layout/header/ElasticSearch.vue +196 -159
- package/src/views/layout/header/HZRecorder.js +163 -135
- package/src/views/layout/header/HeaderSearch.vue +165 -145
- package/src/views/layout/header/Levelbar.vue +55 -49
- package/src/views/layout/header/MainHeader.vue +233 -189
- package/src/views/layout/header/Navbar.vue +74 -78
- package/src/views/layout/header/ScrollPane.vue +103 -81
- package/src/views/layout/header/TagsView.vue +169 -164
- package/src/views/layout/header/VocRec.vue +86 -78
- package/src/views/layout/header/changepswform.vue +98 -64
- package/src/views/layout/index.js +5 -7
- package/src/views/layout/menu/Hamburger.vue +63 -45
- package/src/views/layout/menu/HdMenu.vue +155 -118
- package/src/views/layout/menu/index.vue +21 -19
- package/src/views/privilege/commsg/commsg.vue +115 -41
- package/src/views/privilege/commsg/commsgOrgn.vue +40 -31
- package/src/views/privilege/commsg/commsgRole.vue +180 -109
- package/src/views/privilege/commsg/commsgform.vue +125 -101
- package/src/views/privilege/commsg/commsgiframe.vue +30 -23
- package/src/views/privilege/commsg/commsgto.vue +163 -84
- package/src/views/privilege/commsg/commsgtoform.vue +64 -58
- package/src/views/privilege/commsg/commsgtrans.vue +187 -115
- package/src/views/privilege/exfield/comexcolumn.vue +133 -43
- package/src/views/privilege/exfield/comexcolumnform.vue +85 -58
- package/src/views/privilege/exfield/comexfield.vue +15 -17
- package/src/views/privilege/exfield/comexfieldform.vue +71 -53
- package/src/views/privilege/exfield/comexfieldsub.vue +137 -46
- package/src/views/privilege/index.js +19 -20
- package/src/views/privilege/menu/comMenu.vue +49 -41
- package/src/views/privilege/menu/menu.vue +166 -49
- package/src/views/privilege/menu/menuinfo.vue +41 -34
- package/src/views/privilege/menu/rolelist.vue +78 -33
- package/src/views/privilege/menu/userlist.vue +76 -33
- package/src/views/privilege/mobile/authmobileupdate.vue +119 -43
- package/src/views/privilege/mobile/authmobileupdateform.vue +76 -46
- package/src/views/privilege/orgDept/authOrgn.vue +157 -65
- package/src/views/privilege/orgDept/authorgnform.vue +50 -38
- package/src/views/privilege/orgDept/orgDept.vue +38 -37
- package/src/views/privilege/orgDept/orgTree.vue +99 -88
- package/src/views/privilege/orgDept/orgnselect.vue +132 -111
- package/src/views/privilege/personDept/authuser.vue +197 -91
- package/src/views/privilege/personDept/authuserform.vue +123 -71
- package/src/views/privilege/personDept/facerec.vue +128 -83
- package/src/views/privilege/personDept/orgncascader.vue +134 -115
- package/src/views/privilege/personDept/personDept.vue +9 -7
- package/src/views/privilege/quartz/comquartzjob.vue +123 -38
- package/src/views/privilege/quartz/comquartzjobform.vue +67 -51
- package/src/views/privilege/quartz/comquartzlog.vue +116 -32
- package/src/views/privilege/role/btnRole.vue +123 -67
- package/src/views/privilege/role/menuRole.vue +65 -45
- package/src/views/privilege/role/orgnRole.vue +63 -41
- package/src/views/privilege/role/role.vue +26 -9
- package/src/views/privilege/role/rolelist.vue +114 -45
- package/src/views/privilege/role/roleselect.vue +34 -17
- package/src/views/privilege/search/comsearch.vue +164 -73
- package/src/views/privilege/search/menu.vue +38 -22
- package/src/views/privilege/syscode/syscode.vue +157 -69
- package/src/views/privilege/syscode/sysfield.vue +96 -43
- package/src/views/privilege/syscode/sysfieldframe.vue +30 -30
- package/src/views/privilege/syslog/menulog.vue +38 -22
- package/src/views/privilege/syslog/syslog.vue +145 -78
- package/src/views/privilege/syslog/syslogconfig.vue +91 -24
- package/src/views/privilege/syslog/syslogform.vue +45 -43
- package/src/views/privilege/syslog/syslogframe.vue +26 -26
- package/src/views/privilege/userRole/userRole.vue +187 -89
- package/vite.config.js +7 -0
- package/dist/assets/index.774ef40e.css +0 -1
- package/src/views/privilege.zip +0 -0
|
@@ -1,61 +1,63 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="rightmenu">
|
|
3
|
-
<slot name="rightMenu">
|
|
4
|
-
<el-button-group>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</ex-button>
|
|
8
|
-
<ex-button class="rightmenu_button" @click="doUpdate" vid="doUpdate"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</ex-button>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="rightmenu">
|
|
3
|
+
<slot name="rightMenu">
|
|
4
|
+
<el-button-group>
|
|
5
|
+
<ex-button class="rightmenu_button" @click="doAdd" vid="doAdd"
|
|
6
|
+
>增加
|
|
7
|
+
</ex-button>
|
|
8
|
+
<ex-button class="rightmenu_button" @click="doUpdate" vid="doUpdate"
|
|
9
|
+
>修改
|
|
10
|
+
</ex-button>
|
|
11
|
+
<ex-button class="rightmenu_button" @click="doRemove" vid="doRemove"
|
|
12
|
+
>删除
|
|
13
|
+
</ex-button>
|
|
14
|
+
<ex-button class="rightmenu_button" @click="doCopy" vid="doCopy"
|
|
15
|
+
>复制
|
|
16
|
+
</ex-button>
|
|
17
|
+
</el-button-group>
|
|
18
|
+
<div style="border: #555 1px solid" v-if="$slots.rightMenuExt"></div>
|
|
19
|
+
<el-button-group>
|
|
20
|
+
<slot name="rightMenuExt"> </slot>
|
|
21
|
+
</el-button-group>
|
|
22
|
+
</slot>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
// import BtnRight from './BtnRight'
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
name: 'HdRightMenu',
|
|
31
|
+
// mixins: [BtnRight],
|
|
32
|
+
props: {
|
|
33
|
+
noRoleManage: false,
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
isFocus: false,
|
|
38
|
+
rangeThis: {}, // 快捷键有效区域
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
created() {
|
|
42
|
+
// if (!this.noRoleManage) {
|
|
43
|
+
// if (this.$route && this.$route.meta.btnRoleCheck) { // 角色管理下激活
|
|
44
|
+
// this.addBtnMetaToParent()
|
|
45
|
+
// }
|
|
46
|
+
// }
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
doAdd() {
|
|
50
|
+
this.$emit('do-add')
|
|
51
|
+
},
|
|
52
|
+
doRemove() {
|
|
53
|
+
this.$emit('do-remove')
|
|
54
|
+
},
|
|
55
|
+
doUpdate() {
|
|
56
|
+
this.$emit('do-update')
|
|
57
|
+
},
|
|
58
|
+
doCopy() {
|
|
59
|
+
this.$emit('do-copy')
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
@@ -1,36 +1,54 @@
|
|
|
1
|
-
<!--代码表用popsel-->
|
|
2
1
|
<template>
|
|
3
|
-
<hd-grid-sel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<hd-grid-sel
|
|
3
|
+
:txtVal="txtVal"
|
|
4
|
+
:idVal="idVal"
|
|
5
|
+
placeholder="请点击选取"
|
|
6
|
+
height="50vh"
|
|
7
|
+
width="300px"
|
|
8
|
+
:hdQuery="hdQuery"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
url="webresources/login/privilege/SysField/vue/find"
|
|
11
|
+
@rowClick="doClick"
|
|
12
|
+
:beforeQuery="beforeQuery"
|
|
13
|
+
>
|
|
14
|
+
<el-table-column
|
|
15
|
+
width="120px"
|
|
16
|
+
align="left"
|
|
17
|
+
header-align="center"
|
|
18
|
+
label="代码"
|
|
19
|
+
prop="fieldCod"
|
|
20
|
+
sortable
|
|
21
|
+
></el-table-column>
|
|
22
|
+
<el-table-column
|
|
23
|
+
widhth="180px"
|
|
24
|
+
align="left"
|
|
25
|
+
header-align="center"
|
|
26
|
+
label="名称"
|
|
27
|
+
prop="fieldName"
|
|
28
|
+
sortable
|
|
29
|
+
></el-table-column>
|
|
8
30
|
</hd-grid-sel>
|
|
9
31
|
</template>
|
|
10
32
|
|
|
11
33
|
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
export default {
|
|
35
|
+
name: 'sel-grid-fieldcode',
|
|
36
|
+
components: {},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
hdQuery: new HdQuery(this),
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
mounted() {},
|
|
43
|
+
props: { txtVal: String, idVal: String, disabled: Boolean }, // 设置value为props属�??-必须
|
|
44
|
+
methods: {
|
|
45
|
+
beforeQuery(val) {
|
|
46
|
+
this.hdQuery.query.anyQuery = val
|
|
20
47
|
},
|
|
21
|
-
|
|
48
|
+
doClick(row) {
|
|
49
|
+
this.$emit('update:txtVal', row.fieldName)
|
|
50
|
+
this.$emit('update:idVal', row.fieldCod)
|
|
22
51
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
beforeQuery(val) {
|
|
26
|
-
this.hdQuery.query.anyQuery = val
|
|
27
|
-
},
|
|
28
|
-
doClick(row) {
|
|
29
|
-
this.$emit('update:txtVal', row.fieldName)
|
|
30
|
-
this.$emit('update:idVal', row.fieldCod)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
52
|
+
},
|
|
53
|
+
}
|
|
34
54
|
</script>
|
|
35
|
-
|
|
36
|
-
|
|
@@ -1,54 +1,103 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!--改动说明,btnRight 和isShow是该column是否显示,只在fixed:right时使用,-->
|
|
3
|
-
<div v-if="!btnRight
|
|
4
|
-
<ExTableColumn
|
|
5
|
-
:
|
|
6
|
-
|
|
3
|
+
<div v-if="!btnRight || !isShow"></div>
|
|
4
|
+
<ExTableColumn
|
|
5
|
+
:class-name="getClassName($attrs)"
|
|
6
|
+
:label="$t($attrs.label)"
|
|
7
|
+
:sortable="realSortable"
|
|
8
|
+
:width="autoWidth"
|
|
9
|
+
:showOverflowTooltip="showOverflowTooltip"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
v-else-if="!$slots.default"
|
|
12
|
+
v-on="$listeners"
|
|
13
|
+
:filters="filterData"
|
|
14
|
+
:filter-method="isOpenFilter ? () => true : null"
|
|
15
|
+
>
|
|
7
16
|
<template slot="header" slot-scope="scope">
|
|
8
17
|
<slot name="header" :index="scope.$index" :row="scope.row">
|
|
9
|
-
{{$t($attrs.label)}}
|
|
18
|
+
{{ $t($attrs.label) }}
|
|
10
19
|
</slot>
|
|
11
20
|
</template>
|
|
12
21
|
<template slot-scope="scope">
|
|
13
22
|
<slot :index="scope.$index" :row="scope.row">
|
|
14
23
|
<!--noEdit不允许编辑-->
|
|
15
|
-
<template v-if="scope.row.isEdit
|
|
16
|
-
<component
|
|
17
|
-
:
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
<template v-if="scope.row.isEdit && !noEdit">
|
|
25
|
+
<component
|
|
26
|
+
:gridRow="scope.row"
|
|
27
|
+
:idVal.sync="scope.row[$attrs.idVal]"
|
|
28
|
+
:is="input"
|
|
29
|
+
:txtVal.sync="scope.row[$attrs.txtVal]"
|
|
30
|
+
@blur="checkErr(scope.row)"
|
|
31
|
+
@change="
|
|
32
|
+
(v) => {
|
|
33
|
+
$emit('change', v, scope.row)
|
|
34
|
+
}
|
|
35
|
+
"
|
|
36
|
+
@selItem="
|
|
37
|
+
(v) => {
|
|
38
|
+
selItem(scope.row, v)
|
|
39
|
+
}
|
|
40
|
+
"
|
|
41
|
+
style="width: 100%"
|
|
42
|
+
v-bind="inputProp"
|
|
43
|
+
v-model="scope.row[$attrs.prop]"
|
|
44
|
+
></component>
|
|
20
45
|
</template>
|
|
21
|
-
<template v-else-if="!isHtml">{{
|
|
46
|
+
<template v-else-if="!isHtml">{{
|
|
47
|
+
getValueByPath(scope.row, $attrs.prop)
|
|
48
|
+
}}</template>
|
|
22
49
|
<template v-else>
|
|
23
50
|
<div v-html="getValueByPath(scope.row, $attrs.prop)"></div>
|
|
24
51
|
</template>
|
|
25
52
|
</slot>
|
|
26
|
-
<template v-if="scope.row.isEdit
|
|
27
|
-
<ErrHint
|
|
28
|
-
|
|
53
|
+
<template v-if="scope.row.isEdit && !noEdit">
|
|
54
|
+
<ErrHint
|
|
55
|
+
:errMsg="scope.row['_err_' + $attrs.prop]"
|
|
56
|
+
@checkErr="
|
|
57
|
+
(v) => {
|
|
58
|
+
checkErr(scope.row, v)
|
|
59
|
+
}
|
|
60
|
+
"
|
|
61
|
+
v-model="scope.row[$attrs.prop]"
|
|
62
|
+
></ErrHint>
|
|
29
63
|
</template>
|
|
30
64
|
</template>
|
|
31
65
|
</ExTableColumn>
|
|
32
66
|
<!--复合表头时,但是复合表头里的具体表头依然会进入第一个条件-->
|
|
33
|
-
<ExTableColumn
|
|
34
|
-
:
|
|
67
|
+
<ExTableColumn
|
|
68
|
+
:label="$t($attrs.label)"
|
|
69
|
+
:sortable="realSortable"
|
|
70
|
+
:width="autoWidth"
|
|
71
|
+
:showOverflowTooltip="showOverflowTooltip"
|
|
72
|
+
v-bind="$attrs"
|
|
73
|
+
v-else-if="$slots.default"
|
|
74
|
+
v-on="$listeners"
|
|
75
|
+
>
|
|
35
76
|
<slot></slot>
|
|
36
77
|
</ExTableColumn>
|
|
37
78
|
<!--没啥用-->
|
|
38
|
-
<ExTableColumn
|
|
39
|
-
:
|
|
79
|
+
<ExTableColumn
|
|
80
|
+
:label="$t($attrs.label)"
|
|
81
|
+
:sortable="realSortable"
|
|
82
|
+
:width="autoWidth"
|
|
83
|
+
:showOverflowTooltip="showOverflowTooltip"
|
|
84
|
+
v-bind="$attrs"
|
|
85
|
+
v-else
|
|
86
|
+
v-on="$listeners"
|
|
87
|
+
>
|
|
40
88
|
</ExTableColumn>
|
|
41
89
|
</template>
|
|
90
|
+
|
|
42
91
|
<script>
|
|
43
|
-
import AsyncValidator from
|
|
44
|
-
import BtnRight from
|
|
92
|
+
import AsyncValidator from 'async-validator'
|
|
93
|
+
import BtnRight from './BtnRight'
|
|
45
94
|
|
|
46
95
|
/**
|
|
47
96
|
*覆盖ElTableColumn 主要增加行内编辑的校验,及增加inputProp input inputFormat selFormat属性(与高级查询配合),在多数情况可以不用写templeate
|
|
48
97
|
* @module HdTableColumn
|
|
49
98
|
*/
|
|
50
99
|
export default {
|
|
51
|
-
name:
|
|
100
|
+
name: 'ElTableColumn',
|
|
52
101
|
inheritAttrs: false,
|
|
53
102
|
components: {},
|
|
54
103
|
mixins: [BtnRight],
|
|
@@ -79,7 +128,7 @@ export default {
|
|
|
79
128
|
type: [String, Object],
|
|
80
129
|
default: function () {
|
|
81
130
|
// updTimFirst是因为会触发HdQuery的排序及查询,默认不让查询
|
|
82
|
-
return
|
|
131
|
+
return 'ElInput'
|
|
83
132
|
},
|
|
84
133
|
},
|
|
85
134
|
inputProp: Object, // input的属性
|
|
@@ -89,7 +138,7 @@ export default {
|
|
|
89
138
|
// 编辑时是否可编辑
|
|
90
139
|
type: Boolean,
|
|
91
140
|
default: function () {
|
|
92
|
-
return false
|
|
141
|
+
return false
|
|
93
142
|
},
|
|
94
143
|
},
|
|
95
144
|
noZeroHide: {
|
|
@@ -101,7 +150,7 @@ export default {
|
|
|
101
150
|
// 排序只用custom不用前端排序
|
|
102
151
|
type: Boolean,
|
|
103
152
|
default: function () {
|
|
104
|
-
return false
|
|
153
|
+
return false
|
|
105
154
|
},
|
|
106
155
|
},
|
|
107
156
|
rules: Array, // 校验
|
|
@@ -113,39 +162,39 @@ export default {
|
|
|
113
162
|
// 编辑时是否可编辑
|
|
114
163
|
type: Boolean,
|
|
115
164
|
default: function () {
|
|
116
|
-
return true
|
|
165
|
+
return true
|
|
117
166
|
},
|
|
118
167
|
},
|
|
119
168
|
openFilter: {
|
|
120
169
|
type: Boolean,
|
|
121
170
|
default: function () {
|
|
122
|
-
return false
|
|
171
|
+
return false
|
|
123
172
|
},
|
|
124
173
|
},
|
|
125
174
|
isHtml: {
|
|
126
175
|
// 编辑时是否可编辑
|
|
127
176
|
type: Boolean,
|
|
128
177
|
default: function () {
|
|
129
|
-
return false
|
|
178
|
+
return false
|
|
130
179
|
},
|
|
131
180
|
},
|
|
132
181
|
},
|
|
133
182
|
mounted() {
|
|
134
|
-
this.isFixDo()
|
|
135
|
-
const comPar = this.getHdComGrid()
|
|
183
|
+
this.isFixDo()
|
|
184
|
+
const comPar = this.getHdComGrid()
|
|
136
185
|
if (comPar) {
|
|
137
|
-
const allrules = comPar.validate
|
|
186
|
+
const allrules = comPar.validate // hdcomgrid的rules
|
|
138
187
|
if (allrules && this.rules) {
|
|
139
|
-
allrules[this.$attrs.prop] = this.rules
|
|
188
|
+
allrules[this.$attrs.prop] = this.rules
|
|
140
189
|
}
|
|
141
190
|
if (this.$attrs.prop && !this.noQuery) {
|
|
142
191
|
// 高级查询用
|
|
143
|
-
comPar.allColumn.push(this)
|
|
192
|
+
comPar.allColumn.push(this)
|
|
144
193
|
}
|
|
145
194
|
}
|
|
146
|
-
const hdPar = this.getHdGrid()
|
|
195
|
+
const hdPar = this.getHdGrid()
|
|
147
196
|
if (hdPar) {
|
|
148
|
-
hdPar.colThis.push(this)
|
|
197
|
+
hdPar.colThis.push(this)
|
|
149
198
|
}
|
|
150
199
|
// this.flushFilterData()
|
|
151
200
|
},
|
|
@@ -155,141 +204,141 @@ export default {
|
|
|
155
204
|
btnRight: true, // 按钮权限判断 浮动区 隐藏显示
|
|
156
205
|
isShow: true, // 是否显示
|
|
157
206
|
// filterData: null
|
|
158
|
-
}
|
|
207
|
+
}
|
|
159
208
|
},
|
|
160
209
|
updated() {},
|
|
161
210
|
methods: {
|
|
162
211
|
isFixDo() {
|
|
163
212
|
// 浮动区权限控制
|
|
164
|
-
if (this.$attrs.fixed && this.$attrs.fixed ==
|
|
213
|
+
if (this.$attrs.fixed && this.$attrs.fixed == 'right') {
|
|
165
214
|
// 剧右的是按钮,左侧的不管
|
|
166
|
-
this.addBtnMetaToParent()
|
|
167
|
-
this.checkRight()
|
|
168
|
-
this.getHdComGrid().columnFlowThis = this
|
|
215
|
+
this.addBtnMetaToParent()
|
|
216
|
+
this.checkRight()
|
|
217
|
+
this.getHdComGrid().columnFlowThis = this
|
|
169
218
|
}
|
|
170
219
|
},
|
|
171
220
|
getName() {
|
|
172
221
|
// 按钮权限控制
|
|
173
|
-
return this.$t(
|
|
222
|
+
return this.$t('列表浮动区')
|
|
174
223
|
},
|
|
175
224
|
selItem(row, data) {
|
|
176
225
|
if (this.selFormat) {
|
|
177
226
|
// 有format的情况
|
|
178
|
-
return this.selFormat(row, this.$attrs.prop, data)
|
|
227
|
+
return this.selFormat(row, this.$attrs.prop, data)
|
|
179
228
|
}
|
|
180
229
|
},
|
|
181
230
|
checkErr(row) {
|
|
182
231
|
this.validate(row[this.$attrs.prop], (msg) => {
|
|
183
|
-
this.$set(row,
|
|
184
|
-
})
|
|
232
|
+
this.$set(row, '_err_' + this.$attrs.prop, msg)
|
|
233
|
+
})
|
|
185
234
|
},
|
|
186
235
|
getRules() {
|
|
187
|
-
const comPar = this.getHdComGrid()
|
|
236
|
+
const comPar = this.getHdComGrid()
|
|
188
237
|
if (comPar) {
|
|
189
|
-
const allrules = comPar.validate
|
|
190
|
-
return allrules
|
|
238
|
+
const allrules = comPar.validate // hdcomgrid的rules
|
|
239
|
+
return allrules
|
|
191
240
|
} else {
|
|
192
|
-
return false
|
|
241
|
+
return false
|
|
193
242
|
}
|
|
194
243
|
},
|
|
195
244
|
getHdComGrid() {
|
|
196
|
-
let par = this.$parent
|
|
245
|
+
let par = this.$parent
|
|
197
246
|
while (par) {
|
|
198
|
-
if (par.$options.name ==
|
|
199
|
-
return par
|
|
247
|
+
if (par.$options.name == 'HdComGrid') {
|
|
248
|
+
return par
|
|
200
249
|
}
|
|
201
|
-
par = par.$parent
|
|
250
|
+
par = par.$parent
|
|
202
251
|
}
|
|
203
|
-
return null
|
|
252
|
+
return null
|
|
204
253
|
},
|
|
205
254
|
getHdGrid() {
|
|
206
|
-
let par = this.$parent
|
|
255
|
+
let par = this.$parent
|
|
207
256
|
while (par) {
|
|
208
|
-
if (par.$options.name ==
|
|
209
|
-
return par
|
|
257
|
+
if (par.$options.name == 'HdGrid') {
|
|
258
|
+
return par
|
|
210
259
|
}
|
|
211
|
-
par = par.$parent
|
|
260
|
+
par = par.$parent
|
|
212
261
|
}
|
|
213
|
-
return null
|
|
262
|
+
return null
|
|
214
263
|
},
|
|
215
264
|
validate(data, callback) {
|
|
216
|
-
var descriptor = {}
|
|
217
|
-
const rules = this.getRules()
|
|
265
|
+
var descriptor = {}
|
|
266
|
+
const rules = this.getRules()
|
|
218
267
|
if (!rules) {
|
|
219
|
-
return false
|
|
268
|
+
return false
|
|
220
269
|
}
|
|
221
|
-
const oneRule = rules[this.$attrs.prop]
|
|
270
|
+
const oneRule = rules[this.$attrs.prop]
|
|
222
271
|
if (!oneRule) {
|
|
223
|
-
return false
|
|
272
|
+
return false
|
|
224
273
|
}
|
|
225
|
-
descriptor[this.$attrs.prop] = oneRule
|
|
226
|
-
var validator = new AsyncValidator(descriptor)
|
|
227
|
-
var model = {}
|
|
228
|
-
model[this.$attrs.prop] = data
|
|
274
|
+
descriptor[this.$attrs.prop] = oneRule
|
|
275
|
+
var validator = new AsyncValidator(descriptor)
|
|
276
|
+
var model = {}
|
|
277
|
+
model[this.$attrs.prop] = data
|
|
229
278
|
validator.validate(model, { firstFields: true }, (errors, fields) => {
|
|
230
|
-
callback(errors ? errors[0].message :
|
|
231
|
-
})
|
|
279
|
+
callback(errors ? errors[0].message : '')
|
|
280
|
+
})
|
|
232
281
|
},
|
|
233
282
|
getValueByPath(row, prop) {
|
|
234
283
|
// 支持多级
|
|
235
|
-
prop = prop ||
|
|
236
|
-
const paths = prop.split(
|
|
237
|
-
let current = row
|
|
238
|
-
let result = null
|
|
284
|
+
prop = prop || ''
|
|
285
|
+
const paths = prop.split('.')
|
|
286
|
+
let current = row
|
|
287
|
+
let result = null
|
|
239
288
|
for (let i = 0, j = paths.length; i < j; i++) {
|
|
240
|
-
const path = paths[i]
|
|
241
|
-
if (!current) break
|
|
289
|
+
const path = paths[i]
|
|
290
|
+
if (!current) break
|
|
242
291
|
|
|
243
292
|
if (i === j - 1) {
|
|
244
|
-
result = current[path]
|
|
245
|
-
break
|
|
293
|
+
result = current[path]
|
|
294
|
+
break
|
|
246
295
|
}
|
|
247
|
-
current = current[path]
|
|
296
|
+
current = current[path]
|
|
248
297
|
}
|
|
249
298
|
if (this.inputFormat) {
|
|
250
299
|
// 有format的情况
|
|
251
|
-
return this.inputFormat(result, row, prop)
|
|
300
|
+
return this.inputFormat(result, row, prop)
|
|
252
301
|
} else {
|
|
253
302
|
if (this.$attrs.txtVal) {
|
|
254
|
-
return row[this.$attrs.txtVal]
|
|
303
|
+
return row[this.$attrs.txtVal]
|
|
255
304
|
} else if (result === 0 && !this.noZeroHide) {
|
|
256
|
-
return
|
|
305
|
+
return ''
|
|
257
306
|
} else {
|
|
258
|
-
return result
|
|
307
|
+
return result
|
|
259
308
|
}
|
|
260
309
|
}
|
|
261
310
|
},
|
|
262
311
|
getRealWidth(str) {
|
|
263
312
|
//获取字符长度,中文为2英文为1
|
|
264
|
-
let l = str.length
|
|
265
|
-
let blen = 0
|
|
313
|
+
let l = str.length
|
|
314
|
+
let blen = 0
|
|
266
315
|
for (let i = 0; i < l; i++) {
|
|
267
316
|
if ((str.charCodeAt(i) & 0xff00) != 0) {
|
|
268
|
-
blen
|
|
317
|
+
blen++
|
|
269
318
|
}
|
|
270
|
-
blen
|
|
319
|
+
blen++
|
|
271
320
|
}
|
|
272
|
-
return blen
|
|
321
|
+
return blen
|
|
273
322
|
},
|
|
274
323
|
getClassName(attr) {
|
|
275
|
-
let c1 = attr[
|
|
276
|
-
let c2 = attr.fixed ? `backFF` :
|
|
277
|
-
return c2 + c1
|
|
324
|
+
let c1 = attr['class-name'] ? attr['class-name'] : ''
|
|
325
|
+
let c2 = attr.fixed ? `backFF` : ''
|
|
326
|
+
return c2 + c1
|
|
278
327
|
},
|
|
279
328
|
},
|
|
280
329
|
computed: {
|
|
281
330
|
autoWidth() {
|
|
282
331
|
//增加一个auto属性
|
|
283
|
-
if (this.$attrs.width ==
|
|
332
|
+
if (this.$attrs.width == 'auto') {
|
|
284
333
|
if (this.$attrs.label) {
|
|
285
334
|
return (
|
|
286
335
|
this.perWidth * this.getRealWidth(this.$t(this.$attrs.label)) + 17
|
|
287
|
-
)
|
|
336
|
+
)
|
|
288
337
|
} else {
|
|
289
|
-
return 100
|
|
338
|
+
return 100
|
|
290
339
|
}
|
|
291
340
|
} else {
|
|
292
|
-
return this.$attrs.width
|
|
341
|
+
return this.$attrs.width
|
|
293
342
|
}
|
|
294
343
|
},
|
|
295
344
|
filterData() {
|
|
@@ -298,37 +347,35 @@ export default {
|
|
|
298
347
|
this.getHdComGrid().hdResult &&
|
|
299
348
|
this.getHdComGrid().hdResult._rows
|
|
300
349
|
) {
|
|
301
|
-
let filter = []
|
|
302
|
-
let obj = {}
|
|
350
|
+
let filter = []
|
|
351
|
+
let obj = {}
|
|
303
352
|
|
|
304
353
|
this.getHdComGrid().hdResult._rows.forEach((row) => {
|
|
305
|
-
let value = row[this.$attrs.prop] || null
|
|
306
|
-
let text = this.getValueByPath(row, this.$attrs.prop) ||
|
|
354
|
+
let value = row[this.$attrs.prop] || null
|
|
355
|
+
let text = this.getValueByPath(row, this.$attrs.prop) || ''
|
|
307
356
|
|
|
308
357
|
if (!obj[value]) {
|
|
309
|
-
obj[value] = { number: 1, text: text }
|
|
358
|
+
obj[value] = { number: 1, text: text }
|
|
310
359
|
} else {
|
|
311
|
-
obj[value].number
|
|
360
|
+
obj[value].number++
|
|
312
361
|
}
|
|
313
|
-
})
|
|
362
|
+
})
|
|
314
363
|
this.$nextTick((v) => {
|
|
315
364
|
Object.keys(obj).forEach((v) => {
|
|
316
|
-
filter.push({ text: `${obj[v].text}(${obj[v].number})`, value: v })
|
|
317
|
-
})
|
|
318
|
-
})
|
|
365
|
+
filter.push({ text: `${obj[v].text}(${obj[v].number})`, value: v })
|
|
366
|
+
})
|
|
367
|
+
})
|
|
319
368
|
// console.log('filterData', this.getHdComGrid().hdResult._rows, filter)
|
|
320
|
-
return filter
|
|
369
|
+
return filter
|
|
321
370
|
}
|
|
322
371
|
},
|
|
323
372
|
isOpenFilter() {
|
|
324
|
-
return this.openFilter && this.$attrs.label !=
|
|
373
|
+
return this.openFilter && this.$attrs.label != '操作'
|
|
325
374
|
},
|
|
326
375
|
realSortable() {
|
|
327
376
|
// return this.sortable
|
|
328
|
-
return this.sortable ?
|
|
377
|
+
return this.sortable ? 'custom' : false
|
|
329
378
|
},
|
|
330
379
|
},
|
|
331
|
-
}
|
|
380
|
+
}
|
|
332
381
|
</script>
|
|
333
|
-
|
|
334
|
-
|