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,115 +1,190 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-dialog
|
|
2
|
+
<el-dialog
|
|
3
|
+
title="扩展字段设置"
|
|
4
|
+
:visible.sync="visible"
|
|
5
|
+
width="65%"
|
|
6
|
+
append-to-body
|
|
7
|
+
top="2vh"
|
|
8
|
+
>
|
|
3
9
|
<el-container style="height: 80vh; border: 1px solid #eee">
|
|
4
10
|
<el-main class="gridShow">
|
|
5
|
-
<hd-com-grid
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
<hd-com-grid
|
|
12
|
+
ref="grid"
|
|
13
|
+
:hdQuery="hdQuery"
|
|
14
|
+
url="/webresources/login/tech/ComExFieldCustom"
|
|
15
|
+
not-init
|
|
16
|
+
no-sets
|
|
17
|
+
ck-hide
|
|
18
|
+
no-sort
|
|
19
|
+
index-hide
|
|
20
|
+
:hd-btn-tool="false"
|
|
21
|
+
rec-hide
|
|
22
|
+
page-hide
|
|
23
|
+
:default-sort="{ prop: 'sortNo', order: 'ascending' }"
|
|
24
|
+
>
|
|
9
25
|
<!-- <div class="filter-container" slot="query">
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
<!– <el-input @keyup.enter.native="$refs.grid.doQuery()" style="width: 200px;" class="filter-item"
|
|
27
|
+
placeholder="名称"
|
|
28
|
+
v-model="hdQuery.query.anyQuery">
|
|
29
|
+
</el-input>
|
|
30
|
+
<el-button class="filter-item" @click="$refs.grid.doQuery()" icon="search" type="primary" ref="q"
|
|
31
|
+
keyType="query">搜索
|
|
32
|
+
</el-button>–>
|
|
33
|
+
<el-button class="filter-item" type="primary" @click="doAdd()" icon="edit" ref="a"
|
|
34
|
+
keyType="add">新增
|
|
35
|
+
</el-button>
|
|
36
|
+
</div>-->
|
|
21
37
|
|
|
22
38
|
<!-- <el-table-column width="60px" align="center" label="操作" fixed="right">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<el-table-column
|
|
36
|
-
|
|
39
|
+
<template slot-scope="scope">
|
|
40
|
+
<hd-btn icon="el-icon-edit" hint="编辑" @click.stop="$refs.grid.doEdit(scope.row)"
|
|
41
|
+
v-if="!scope.row.isEdit">
|
|
42
|
+
</hd-btn>
|
|
43
|
+
<hd-btn hint="撤销" @click.stop="$refs.grid.doCancel(scope.row)" v-if="scope.row.isEdit">
|
|
44
|
+
<svg-icon icon-class="undo"/>
|
|
45
|
+
</hd-btn>
|
|
46
|
+
<hd-btn icon="el-icon-check" hint="保存" @click.stop="$refs.grid.doSave(scope.row)" v-if="scope.row.isEdit">
|
|
47
|
+
</hd-btn>
|
|
48
|
+
</template>
|
|
49
|
+
</el-table-column>
|
|
50
|
+
-->
|
|
51
|
+
<el-table-column
|
|
52
|
+
width="100px"
|
|
53
|
+
align="center"
|
|
54
|
+
label="是否使用"
|
|
55
|
+
prop="useFlg"
|
|
56
|
+
sortable
|
|
57
|
+
:rules="$r(0, 0, 50)"
|
|
58
|
+
input="el-switch"
|
|
59
|
+
:inputProp="{ activeValue: '1', inactiveValue: '0' }"
|
|
60
|
+
:inputFormat="$ckFt"
|
|
61
|
+
>
|
|
37
62
|
</el-table-column>
|
|
38
63
|
|
|
39
64
|
<!-- <el-table-column width="100px" align="center" label="表名" prop="tableName" sortable
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<el-table-column
|
|
46
|
-
|
|
65
|
+
:rules="$r(1,0,50)" no-edit>
|
|
66
|
+
</el-table-column>
|
|
67
|
+
<el-table-column width="100px" align="center" label="字段名" prop="columnName" sortable
|
|
68
|
+
:rules="$r(1,0,50)" no-edit>
|
|
69
|
+
</el-table-column>-->
|
|
70
|
+
<el-table-column
|
|
71
|
+
width="100px"
|
|
72
|
+
align="center"
|
|
73
|
+
label="字段注解"
|
|
74
|
+
prop="columnComment"
|
|
75
|
+
:rules="$r(1, 0, 50)"
|
|
76
|
+
>
|
|
47
77
|
</el-table-column>
|
|
48
|
-
<el-table-column
|
|
49
|
-
|
|
50
|
-
|
|
78
|
+
<el-table-column
|
|
79
|
+
width="100px"
|
|
80
|
+
align="center"
|
|
81
|
+
label="字段类型"
|
|
82
|
+
prop="columnType"
|
|
83
|
+
:rules="$r(1)"
|
|
84
|
+
input="HdDrop"
|
|
85
|
+
:inputProp="{ field: 'IDV_COLUMN_TYPE' }"
|
|
86
|
+
@change="columnTypeChange"
|
|
87
|
+
>
|
|
51
88
|
</el-table-column>
|
|
52
|
-
<el-table-column
|
|
53
|
-
|
|
89
|
+
<el-table-column
|
|
90
|
+
width="110px"
|
|
91
|
+
align="center"
|
|
92
|
+
label="格式/代码"
|
|
93
|
+
prop="formatter"
|
|
94
|
+
:rules="$r(1)"
|
|
95
|
+
>
|
|
54
96
|
<template slot-scope="scope">
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
<!--noEdit不允许编辑-->
|
|
98
|
+
<template v-if="scope.row.isEdit">
|
|
99
|
+
<template v-if="scope.row.columnType == 'DROP'">
|
|
100
|
+
<sel-grid-fieldcode
|
|
101
|
+
:gridRow="scope.row"
|
|
102
|
+
:txtVal.sync="scope.row['formatter']"
|
|
103
|
+
:idVal.sync="scope.row['formatter']"
|
|
104
|
+
@blur="checkErr(scope.row)"
|
|
105
|
+
style="width: 100%"
|
|
106
|
+
v-model="scope.row['formatter']"
|
|
107
|
+
></sel-grid-fieldcode>
|
|
108
|
+
</template>
|
|
109
|
+
<template v-else-if="scope.row.columnType == 'NUMBER'">
|
|
110
|
+
<HdDrop
|
|
111
|
+
:gridRow="scope.row"
|
|
112
|
+
:txtVal.sync="scope.row['formatterStr']"
|
|
113
|
+
:idVal.sync="scope.row['formatter']"
|
|
114
|
+
@blur="checkErr(scope.row)"
|
|
115
|
+
style="width: 100%"
|
|
116
|
+
field="IDV_NUMBER_FORMATTER"
|
|
117
|
+
v-model="scope.row['formatter']"
|
|
118
|
+
></HdDrop>
|
|
76
119
|
</template>
|
|
120
|
+
<template v-else-if="scope.row.columnType == 'DATE'">
|
|
121
|
+
<HdDrop
|
|
122
|
+
:gridRow="scope.row"
|
|
123
|
+
:txtVal.sync="scope.row['formatterStr']"
|
|
124
|
+
:idVal.sync="scope.row['formatter']"
|
|
125
|
+
@blur="checkErr(scope.row)"
|
|
126
|
+
style="width: 100%"
|
|
127
|
+
field="IDV_DATE_FORMATTER"
|
|
128
|
+
v-model="scope.row['formatter']"
|
|
129
|
+
></HdDrop>
|
|
130
|
+
</template>
|
|
131
|
+
<template v-else> </template>
|
|
132
|
+
</template>
|
|
77
133
|
</template>
|
|
78
134
|
</el-table-column>
|
|
79
|
-
<el-table-column
|
|
80
|
-
|
|
135
|
+
<el-table-column
|
|
136
|
+
width="100px"
|
|
137
|
+
align="center"
|
|
138
|
+
label="是否必填"
|
|
139
|
+
prop="columnRequire"
|
|
140
|
+
input="el-switch"
|
|
141
|
+
:inputProp="{ 'active-value': 1, 'inactive-value': 0 }"
|
|
142
|
+
:inputFormat="$ckFt"
|
|
143
|
+
>
|
|
81
144
|
</el-table-column>
|
|
82
|
-
<el-table-column
|
|
83
|
-
|
|
145
|
+
<el-table-column
|
|
146
|
+
width="100px"
|
|
147
|
+
align="center"
|
|
148
|
+
label="最大长度"
|
|
149
|
+
prop="columnLen"
|
|
150
|
+
:rules="$r(1, 0, 255, 'number')"
|
|
151
|
+
input="HdNum"
|
|
152
|
+
>
|
|
84
153
|
</el-table-column>
|
|
85
154
|
<!-- <el-table-column width="100px" align="center" label="比例" prop="columnScale" sortable
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
155
|
+
:rules="$r(0, 'number', 0, 255)" input="HdNum">
|
|
156
|
+
</el-table-column>
|
|
157
|
+
<el-table-column width="100px" align="center" label="默认值" prop="columnDefaultValue" sortable
|
|
158
|
+
:rules="$r(0,0,50)">
|
|
159
|
+
</el-table-column>
|
|
91
160
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<el-table-column
|
|
95
|
-
|
|
161
|
+
<el-table-column width="100px" align="center" label="编码" prop="gridCode" sortable :rules="$r(1,0,50)" no-edit>
|
|
162
|
+
</el-table-column>-->
|
|
163
|
+
<el-table-column
|
|
164
|
+
width="100px"
|
|
165
|
+
align="center"
|
|
166
|
+
label="表格宽度"
|
|
167
|
+
prop="formSpan"
|
|
168
|
+
:rules="$r(1)"
|
|
169
|
+
input="HdDrop"
|
|
170
|
+
:inputProp="{ field: 'IDV_FORM_SPAN' }"
|
|
96
171
|
>
|
|
97
172
|
</el-table-column>
|
|
98
173
|
<!-- <el-table-column width="100px" align="center" label="表单高度" prop="formXs" sortable
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
174
|
+
:rules="$r(1, 'number', 0, 1024)" input="HdNum">
|
|
175
|
+
</el-table-column>-->
|
|
176
|
+
<!-- <el-table-column width="100px" align="center" label="列表宽度" prop="gridWidth"
|
|
177
|
+
:rules="$r(0, 0, 9999, 'number')" input="HdNum">
|
|
178
|
+
</el-table-column>-->
|
|
104
179
|
<!-- <el-table-column width="100px" align="center" label="默认值" prop="defaultValue" sortable :rules="$r(0,0,50)">
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
180
|
+
</el-table-column>
|
|
181
|
+
<el-table-column width="100px" align="center" label="描述" prop="placeHolder" sortable :rules="$r(0,0,50)">
|
|
182
|
+
</el-table-column>
|
|
183
|
+
<el-table-column width="100px" align="center" label="规则" prop="rules" sortable :rules="$r(1,0,50)">
|
|
184
|
+
</el-table-column>-->
|
|
110
185
|
<el-table-column align="center" label="排序" width="80px" noQuery>
|
|
111
186
|
<template slot-scope="scope">
|
|
112
|
-
<svg-icon class=
|
|
187
|
+
<svg-icon class="drag-handler" icon-class="drag"></svg-icon>
|
|
113
188
|
</template>
|
|
114
189
|
</el-table-column>
|
|
115
190
|
</hd-com-grid>
|
|
@@ -117,165 +192,184 @@
|
|
|
117
192
|
</el-container>
|
|
118
193
|
<div slot="footer" class="dialog-footer">
|
|
119
194
|
<!-- <el-button class="filter-item" type="primary" @click="doAdd()" icon="edit" ref="a"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<el-button @click="visible = false">{{$t('取 消')}}</el-button>
|
|
123
|
-
<el-button type="primary" @click="submit" :loading="loading">
|
|
195
|
+
keyType="add">新增
|
|
196
|
+
</el-button>-->
|
|
197
|
+
<el-button @click="visible = false">{{ $t('取 消') }}</el-button>
|
|
198
|
+
<el-button type="primary" @click="submit" :loading="loading">
|
|
199
|
+
{{ $t('确 定') }}</el-button
|
|
200
|
+
>
|
|
124
201
|
</div>
|
|
125
202
|
</el-dialog>
|
|
126
203
|
</template>
|
|
127
|
-
<script>
|
|
128
|
-
import Sortable from 'sortablejs'
|
|
129
|
-
import SelGridFieldcode from "./HdSel/SelGridFieldcod";
|
|
130
|
-
|
|
131
|
-
export default {
|
|
132
|
-
name: 'gridexfield',
|
|
133
|
-
components: {SelGridFieldcode},
|
|
134
|
-
props: {
|
|
135
|
-
table: String,
|
|
136
|
-
columnList: Array,
|
|
137
|
-
gridCode: String
|
|
138
|
-
},
|
|
139
|
-
data() {
|
|
140
|
-
return {
|
|
141
|
-
hdQuery: new HdQuery(this),
|
|
142
|
-
visible: false,
|
|
143
|
-
loading: false,
|
|
144
|
-
list: [],
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
mounted() {
|
|
148
|
-
this.init();
|
|
149
|
-
},
|
|
150
|
-
methods: {
|
|
151
|
-
init(exField) {
|
|
152
|
-
this.hdQuery.query.tableName = this.table;
|
|
153
|
-
this.hdQuery.query.columnList = this.columnList;
|
|
154
|
-
this.hdQuery.query.gridCode = this.gridCode;
|
|
155
|
-
this.hdQuery.sort = 'sortNo';
|
|
156
|
-
this.hdQuery.order = 'asc';
|
|
157
204
|
|
|
158
|
-
|
|
159
|
-
|
|
205
|
+
<script>
|
|
206
|
+
import Sortable from 'sortablejs'
|
|
207
|
+
import SelGridFieldcode from './HdSel/SelGridFieldcod'
|
|
160
208
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
209
|
+
export default {
|
|
210
|
+
name: 'gridexfield',
|
|
211
|
+
components: { SelGridFieldcode },
|
|
212
|
+
props: {
|
|
213
|
+
table: String,
|
|
214
|
+
columnList: Array,
|
|
215
|
+
gridCode: String,
|
|
216
|
+
},
|
|
217
|
+
data() {
|
|
218
|
+
return {
|
|
219
|
+
hdQuery: new HdQuery(this),
|
|
220
|
+
visible: false,
|
|
221
|
+
loading: false,
|
|
222
|
+
list: [],
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
mounted() {
|
|
226
|
+
this.init()
|
|
227
|
+
},
|
|
228
|
+
methods: {
|
|
229
|
+
init(exField) {
|
|
230
|
+
this.hdQuery.query.tableName = this.table
|
|
231
|
+
this.hdQuery.query.columnList = this.columnList
|
|
232
|
+
this.hdQuery.query.gridCode = this.gridCode
|
|
233
|
+
this.hdQuery.sort = 'sortNo'
|
|
234
|
+
this.hdQuery.order = 'asc'
|
|
176
235
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
row.formSpan = row.formSpan + "";
|
|
182
|
-
});
|
|
183
|
-
this.$refs.grid.doQuery({rows: this.list})
|
|
236
|
+
this.$http
|
|
237
|
+
.post('/webresources/login/tech/ComExFieldCustom/find', this.hdQuery)
|
|
238
|
+
.then((response) => {
|
|
239
|
+
this.list = response.data.rows
|
|
184
240
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
241
|
+
if (this.columnList) {
|
|
242
|
+
this.columnList.forEach((column) => {
|
|
243
|
+
if (
|
|
244
|
+
!response.data.rows.some((row) => {
|
|
245
|
+
return row.columnName == column
|
|
188
246
|
})
|
|
247
|
+
) {
|
|
248
|
+
this.list.unshift({
|
|
249
|
+
columnName: column,
|
|
250
|
+
tableName: this.table,
|
|
251
|
+
formXs: '20',
|
|
252
|
+
formSpan: '12',
|
|
253
|
+
isEdit: true,
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
}
|
|
189
258
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
259
|
+
let i = 0
|
|
260
|
+
this.list.forEach((row) => {
|
|
261
|
+
row.isEdit = true
|
|
262
|
+
row.sortNo = i++
|
|
263
|
+
row.formSpan = row.formSpan + ''
|
|
264
|
+
})
|
|
265
|
+
this.$refs.grid.doQuery({ rows: this.list })
|
|
193
266
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const el = elAll[i]
|
|
202
|
-
this.sortable = Sortable.create(el, {
|
|
203
|
-
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
|
204
|
-
onEnd: evt => {
|
|
205
|
-
// this.list.forEach(row => console.log(row.columnComment, row.sortNo))
|
|
206
|
-
// console.log('----------------------------------')
|
|
207
|
-
// console.log(evt)
|
|
208
|
-
// console.log('----------------------------------')
|
|
267
|
+
this.$nextTick(() => {
|
|
268
|
+
this.setSort()
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
show() {
|
|
273
|
+
this.visible = true
|
|
209
274
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
275
|
+
this.list.forEach((row) => {
|
|
276
|
+
row.isEdit = true
|
|
277
|
+
})
|
|
278
|
+
},
|
|
279
|
+
setSort() {
|
|
280
|
+
const elAll = document.querySelectorAll(
|
|
281
|
+
'.gridShow .el-table__body-wrapper > table > tbody'
|
|
282
|
+
)
|
|
283
|
+
for (let i = 0; i < elAll.length; i++) {
|
|
284
|
+
const el = elAll[i]
|
|
285
|
+
this.sortable = Sortable.create(el, {
|
|
286
|
+
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
|
287
|
+
onEnd: (evt) => {
|
|
288
|
+
// this.list.forEach(row => console.log(row.columnComment, row.sortNo))
|
|
289
|
+
// console.log('----------------------------------')
|
|
290
|
+
// console.log(evt)
|
|
291
|
+
// console.log('----------------------------------')
|
|
219
292
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
formXs: 12,
|
|
238
|
-
formSpan: '20',
|
|
239
|
-
isEdit: true
|
|
240
|
-
}
|
|
241
|
-
this.$refs.grid.doEdit('', exField)
|
|
242
|
-
},
|
|
243
|
-
submit() {
|
|
244
|
-
this.list.forEach(row => {
|
|
245
|
-
if (!row.columnComment || !row.columnType) {
|
|
246
|
-
row.isEdit = false;
|
|
247
|
-
}
|
|
248
|
-
row.gridCode = this.gridCode;
|
|
249
|
-
});
|
|
293
|
+
this.list.forEach((row) => {
|
|
294
|
+
if (row.sortNo == evt.oldIndex) {
|
|
295
|
+
row.sortNo = evt.newIndex
|
|
296
|
+
} else if (
|
|
297
|
+
evt.newIndex > evt.oldIndex &&
|
|
298
|
+
row.sortNo <= evt.newIndex &&
|
|
299
|
+
row.sortNo > evt.oldIndex
|
|
300
|
+
) {
|
|
301
|
+
row.sortNo = row.sortNo - 1
|
|
302
|
+
} else if (
|
|
303
|
+
evt.newIndex < evt.oldIndex &&
|
|
304
|
+
row.sortNo >= evt.newIndex &&
|
|
305
|
+
row.sortNo < evt.oldIndex
|
|
306
|
+
) {
|
|
307
|
+
row.sortNo = row.sortNo + 1
|
|
308
|
+
}
|
|
309
|
+
})
|
|
250
310
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
311
|
+
// this.list.forEach(row => console.log(row.columnComment, row.sortNo))
|
|
312
|
+
},
|
|
313
|
+
})
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
doAdd() {
|
|
317
|
+
let emptyColumn = this.getEmptyColumn()
|
|
318
|
+
if (emptyColumn == null) {
|
|
319
|
+
this.$message({
|
|
320
|
+
message: '没有剩余的扩展字段',
|
|
321
|
+
})
|
|
322
|
+
return
|
|
323
|
+
}
|
|
324
|
+
let exField = {
|
|
325
|
+
gridCode: this.gridCode,
|
|
326
|
+
tableName: this.table,
|
|
327
|
+
columnName: emptyColumn,
|
|
328
|
+
formXs: 12,
|
|
329
|
+
formSpan: '20',
|
|
330
|
+
isEdit: true,
|
|
331
|
+
}
|
|
332
|
+
this.$refs.grid.doEdit('', exField)
|
|
333
|
+
},
|
|
334
|
+
submit() {
|
|
335
|
+
this.list.forEach((row) => {
|
|
336
|
+
if (!row.columnComment || !row.columnType) {
|
|
337
|
+
row.isEdit = false
|
|
276
338
|
}
|
|
277
|
-
|
|
278
|
-
|
|
339
|
+
row.gridCode = this.gridCode
|
|
340
|
+
})
|
|
279
341
|
|
|
280
|
-
|
|
281
|
-
|
|
342
|
+
this.$refs.grid
|
|
343
|
+
.doSaveAll()
|
|
344
|
+
.then((v) => {
|
|
345
|
+
this.visible = false
|
|
346
|
+
this.$emit('save-ok')
|
|
347
|
+
})
|
|
348
|
+
.catch((e) => {
|
|
349
|
+
this.$message({
|
|
350
|
+
message: '填写有误',
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
},
|
|
354
|
+
getEmptyColumn() {
|
|
355
|
+
let emptyColumns = this.columnList.filter((column) => {
|
|
356
|
+
return !this.list.some((row) => {
|
|
357
|
+
return row.columnName == column
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
return emptyColumns.length > 0 ? emptyColumns[0] : null
|
|
361
|
+
},
|
|
362
|
+
columnTypeChange(v, row) {
|
|
363
|
+
if (row.exColumnId) {
|
|
364
|
+
this.$message({
|
|
365
|
+
type: 'warning',
|
|
366
|
+
message: this.$t('修改类型可能回造成数据混乱或丢失, 请慎重!'),
|
|
367
|
+
})
|
|
368
|
+
}
|
|
369
|
+
if (row.columnType == 'VARCHAR' || row.columnType == 'BOOLEAN') {
|
|
370
|
+
row.formatter = 'x'
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
}
|
|
375
|
+
</script>
|