bri-components 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +8 -6
- package/package.json +120 -120
- package/src/components/controls/controlMixin.js +10 -15
- package/src/components/form/DshForm.vue +0 -2
- package/src/components/list/DshBox/DshPanel.vue +66 -77
- package/src/components/list/DshFlatTable.vue +9 -17
- package/src/components/unit/DshFormItem.vue +11 -4
- package/src/components/unit/DshUnit.vue +0 -2
package/package.json
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
2
|
+
"name": "bri-components",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"author": "dengshanghui",
|
|
5
|
+
"description": "a component lib for vue project",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"editor",
|
|
9
|
+
"tinymce"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
"lib",
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"directories": {
|
|
17
|
+
"test": "test"
|
|
18
|
+
},
|
|
19
|
+
"private": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
|
22
|
+
"start": "npm run dev",
|
|
23
|
+
"unit": "jest --config test/unit/jest.conf.js --coverage",
|
|
24
|
+
"e2e": "node test/e2e/runner.js",
|
|
25
|
+
"test": "npm run unit && npm run e2e",
|
|
26
|
+
"lint": "eslint --fix --ext .js,.vue src example build config",
|
|
27
|
+
"build": "node build/build.js",
|
|
28
|
+
"lib:style": "gulp --gulpfile build/build-style.js",
|
|
29
|
+
"lib:dev": "webpack --config build/webpack.lib.dev.config.js",
|
|
30
|
+
"lib:prod": "webpack --config build/webpack.lib.prod.config.js"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"axios": "^0.23.0",
|
|
34
|
+
"bri-datas": "^1.0.8-0",
|
|
35
|
+
"jshint": "^2.12.0",
|
|
36
|
+
"minio": "^7.0.26",
|
|
37
|
+
"stream": "^0.0.2",
|
|
38
|
+
"view-design": "^4.6.0",
|
|
39
|
+
"viewerjs": "^1.10.2",
|
|
40
|
+
"vue-codemirror": "^4.0.6",
|
|
41
|
+
"vue-cropperjs": "^4.1.0",
|
|
42
|
+
"vuedraggable": "^2.24.1",
|
|
43
|
+
"wangeditor": "^4.7.5"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"autoprefixer": "^7.1.2",
|
|
47
|
+
"babel-core": "^6.22.1",
|
|
48
|
+
"babel-eslint": "^8.2.1",
|
|
49
|
+
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
|
50
|
+
"babel-jest": "^21.0.2",
|
|
51
|
+
"babel-loader": "^7.1.1",
|
|
52
|
+
"babel-plugin-dynamic-import-node": "^1.2.0",
|
|
53
|
+
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
54
|
+
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
|
|
55
|
+
"babel-plugin-transform-runtime": "^6.22.0",
|
|
56
|
+
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
|
57
|
+
"babel-preset-env": "^1.3.2",
|
|
58
|
+
"babel-preset-stage-2": "^6.22.0",
|
|
59
|
+
"babel-register": "^6.22.0",
|
|
60
|
+
"chalk": "^2.0.1",
|
|
61
|
+
"chromedriver": "^2.27.2",
|
|
62
|
+
"compression-webpack-plugin": "^1.1.12",
|
|
63
|
+
"copy-webpack-plugin": "^4.0.1",
|
|
64
|
+
"cross-spawn": "^5.0.1",
|
|
65
|
+
"css": "^3.0.0",
|
|
66
|
+
"css-loader": "^0.28.11",
|
|
67
|
+
"eslint": "^4.15.0",
|
|
68
|
+
"eslint-config-standard": "^10.2.1",
|
|
69
|
+
"eslint-friendly-formatter": "^3.0.0",
|
|
70
|
+
"eslint-loader": "^1.7.1",
|
|
71
|
+
"eslint-plugin-import": "^2.22.1",
|
|
72
|
+
"eslint-plugin-node": "^5.2.0",
|
|
73
|
+
"eslint-plugin-promise": "^3.4.0",
|
|
74
|
+
"eslint-plugin-standard": "^3.0.1",
|
|
75
|
+
"eslint-plugin-vue": "^4.0.0",
|
|
76
|
+
"extract-text-webpack-plugin": "^3.0.0",
|
|
77
|
+
"file-loader": "^1.1.4",
|
|
78
|
+
"friendly-errors-webpack-plugin": "^1.6.1",
|
|
79
|
+
"gulp": "^4.0.2",
|
|
80
|
+
"gulp-clean-css": "^4.3.0",
|
|
81
|
+
"gulp-less": "^5.0.0",
|
|
82
|
+
"gulp-rename": "^2.0.0",
|
|
83
|
+
"html-webpack-plugin": "^2.30.1",
|
|
84
|
+
"jest": "^22.0.4",
|
|
85
|
+
"jest-serializer-vue": "^0.3.0",
|
|
86
|
+
"less": "^3.13.1",
|
|
87
|
+
"less-loader": "^5.0.0",
|
|
88
|
+
"nightwatch": "^0.9.12",
|
|
89
|
+
"node-notifier": "^5.1.2",
|
|
90
|
+
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
|
91
|
+
"ora": "^1.2.0",
|
|
92
|
+
"portfinder": "^1.0.13",
|
|
93
|
+
"postcss-import": "^11.0.0",
|
|
94
|
+
"postcss-loader": "^2.0.8",
|
|
95
|
+
"postcss-url": "^7.2.1",
|
|
96
|
+
"rimraf": "^2.6.0",
|
|
97
|
+
"selenium-server": "^3.0.1",
|
|
98
|
+
"semver": "^5.3.0",
|
|
99
|
+
"shelljs": "^0.7.6",
|
|
100
|
+
"uglifyjs-webpack-plugin": "^1.3.0",
|
|
101
|
+
"url-loader": "^0.5.8",
|
|
102
|
+
"vue": "^2.5.2",
|
|
103
|
+
"vue-jest": "^1.0.2",
|
|
104
|
+
"vue-loader": "^13.3.0",
|
|
105
|
+
"vue-router": "^3.0.1",
|
|
106
|
+
"vue-style-loader": "^3.0.1",
|
|
107
|
+
"vue-template-compiler": "^2.5.2",
|
|
108
|
+
"webpack": "^3.6.0",
|
|
109
|
+
"webpack-bundle-analyzer": "^2.9.0",
|
|
110
|
+
"webpack-dev-server": "^2.9.1",
|
|
111
|
+
"webpack-merge": "^4.1.0"
|
|
112
|
+
},
|
|
113
|
+
"engines": {
|
|
114
|
+
"node": ">= 6.0.0",
|
|
115
|
+
"npm": ">= 3.0.0"
|
|
116
|
+
},
|
|
117
|
+
"browserslist": [
|
|
118
|
+
"> 1%",
|
|
119
|
+
"last 2 versions",
|
|
120
|
+
"not ie <= 8"
|
|
121
|
+
]
|
|
122
122
|
}
|
|
@@ -19,8 +19,7 @@ export default {
|
|
|
19
19
|
default () {
|
|
20
20
|
return {};
|
|
21
21
|
}
|
|
22
|
-
}
|
|
23
|
-
isShare: Boolean
|
|
22
|
+
}
|
|
24
23
|
},
|
|
25
24
|
data () {
|
|
26
25
|
return {};
|
|
@@ -38,6 +37,9 @@ export default {
|
|
|
38
37
|
inTable () {
|
|
39
38
|
return !!this.propsObj.inTable;
|
|
40
39
|
},
|
|
40
|
+
isShare () {
|
|
41
|
+
return !!this.propsObj.isShare;
|
|
42
|
+
},
|
|
41
43
|
controlKey () {
|
|
42
44
|
return this.propsObj._key;
|
|
43
45
|
},
|
|
@@ -57,20 +59,13 @@ export default {
|
|
|
57
59
|
},
|
|
58
60
|
// 不同mode模式下readOnly 和disabled样式名
|
|
59
61
|
commonClass () {
|
|
60
|
-
let commonClass = `control-${this.mode}-${
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
? "disabled"
|
|
66
|
-
: "edit"
|
|
67
|
-
)
|
|
62
|
+
let commonClass = `control-${this.mode}-${this.$isReadonly(this.canEdit, this.propsObj)
|
|
63
|
+
? "readonly"
|
|
64
|
+
: this.$isDisabled(this.canEdit, this.propsObj)
|
|
65
|
+
? "disabled"
|
|
66
|
+
: "edit"
|
|
68
67
|
}`;
|
|
69
|
-
|
|
70
|
-
if (this.mode === "rimless" && this.propsObj._line) {
|
|
71
|
-
// otherClass = `control-${this.mode}-span${this.propsObj._span}`;
|
|
72
|
-
}
|
|
73
|
-
return commonClass + " " + otherClass;
|
|
68
|
+
return commonClass;
|
|
74
69
|
}
|
|
75
70
|
},
|
|
76
71
|
methods: {
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
:mode="mode"
|
|
26
26
|
:canEdit="canEdit"
|
|
27
27
|
:formData="formData"
|
|
28
|
-
:isShare="isShare"
|
|
29
28
|
:formItem="formItem"
|
|
30
29
|
:allFormList="allFormList"
|
|
31
30
|
:changedFields="changedFields"
|
|
@@ -141,7 +140,6 @@
|
|
|
141
140
|
labelWidth: [String, Number],
|
|
142
141
|
formItemClass: String,
|
|
143
142
|
formControlClass: String,
|
|
144
|
-
isShare: Boolean,
|
|
145
143
|
showRules: {
|
|
146
144
|
type: Boolean,
|
|
147
145
|
default: true
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
class="DshPanel-group-title"
|
|
11
11
|
:style="{
|
|
12
12
|
backgroundColor: getBgColor(groupItem),
|
|
13
|
-
color:
|
|
13
|
+
color: '#ffffff'
|
|
14
14
|
}"
|
|
15
15
|
>
|
|
16
16
|
<span class="DshPanel-group-title-name">
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
class="dsh-tip"
|
|
46
46
|
style="position: absolute; top: 0px; left: 0px; width: 100%;"
|
|
47
47
|
>
|
|
48
|
-
{{noDataText}}
|
|
48
|
+
{{ noDataText }}
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
51
|
<!-- 拖拽 -->
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
@scroll.native="groupScroll(groupItem, groupIndex, $event)"
|
|
65
65
|
>
|
|
66
66
|
<div
|
|
67
|
-
class="list-item"
|
|
68
67
|
v-for="(dataItem, dataIndex) in groupItem.list"
|
|
69
68
|
:key="dataItem._id"
|
|
70
69
|
:id="dataItem._id"
|
|
70
|
+
class="item"
|
|
71
71
|
@click="clickRow(dataItem, dataIndex)"
|
|
72
72
|
>
|
|
73
73
|
<!-- 下拉操作 -->
|
|
74
74
|
<dsh-dropdown
|
|
75
|
-
class="
|
|
75
|
+
class="item-dropdown"
|
|
76
76
|
:dropdownObj="dropdownObj"
|
|
77
77
|
:list="operationList"
|
|
78
78
|
@click="$dshEmit($event, dataItem, dataIndex)"
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
></dsh-dropdown>
|
|
81
81
|
|
|
82
82
|
<!-- 标题 -->
|
|
83
|
-
<div class="
|
|
83
|
+
<div class="item-title dsh-ellipsis">{{ dataItem[titleField] }}</div>
|
|
84
84
|
|
|
85
85
|
<!-- 显示字段 -->
|
|
86
86
|
<div
|
|
87
|
-
class="
|
|
87
|
+
class="item-cols unit"
|
|
88
88
|
v-for="colItem in selfColumns"
|
|
89
89
|
:key="colItem._key"
|
|
90
90
|
>
|
|
@@ -124,33 +124,21 @@
|
|
|
124
124
|
</div>
|
|
125
125
|
</transition-group>
|
|
126
126
|
</dsh-draggable>
|
|
127
|
+
|
|
127
128
|
<!-- 组 操作按钮(添加) -->
|
|
128
129
|
<dsh-buttons
|
|
129
|
-
class="
|
|
130
|
+
class="list-btns"
|
|
130
131
|
:list="groupBtnOperationList"
|
|
131
132
|
@click="$dshEmit($event, { [groupField]: groupItem._key })"
|
|
132
133
|
></dsh-buttons>
|
|
133
134
|
</div>
|
|
134
|
-
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
137
137
|
</template>
|
|
138
138
|
|
|
139
139
|
<script>
|
|
140
|
-
|
|
141
|
-
const colorMap = {
|
|
142
|
-
"#CDE6FF": "#6DAEF2",
|
|
143
|
-
"#C1FCFF": "#40CBD2",
|
|
144
|
-
"#C5FFD9": "#50C979",
|
|
145
|
-
"#FFEDC8": "#FFC53B",
|
|
146
|
-
"#FFDCAC": "#FF9300",
|
|
147
|
-
"#FFD3B6": "#FA6400",
|
|
148
|
-
"#EEB0FF": "#B620E0",
|
|
149
|
-
"#D1B3FF": "#7E41DF",
|
|
150
|
-
"#B1C7FF": "#25428D",
|
|
151
|
-
"#DCDCDC": "#5D5D5D"
|
|
140
|
+
import { resourceData } from "bri-datas";
|
|
152
141
|
|
|
153
|
-
};
|
|
154
142
|
export default {
|
|
155
143
|
name: "DshPanel",
|
|
156
144
|
props: {
|
|
@@ -204,10 +192,10 @@
|
|
|
204
192
|
|
|
205
193
|
getBgColor (groupItem) {
|
|
206
194
|
return this.groupFieldObj._useColor
|
|
207
|
-
? (this.groupFieldObj._data.find(item => item._key === groupItem._key) || { color: "
|
|
208
|
-
: "
|
|
195
|
+
? this.colorMap[(this.groupFieldObj._data.find(item => item._key === groupItem._key) || { color: "color-default" }).color]
|
|
196
|
+
: "color-default";
|
|
209
197
|
},
|
|
210
|
-
colorMap
|
|
198
|
+
colorMap: resourceData.colorMap
|
|
211
199
|
};
|
|
212
200
|
},
|
|
213
201
|
computed: {
|
|
@@ -293,7 +281,7 @@
|
|
|
293
281
|
};
|
|
294
282
|
</script>
|
|
295
283
|
|
|
296
|
-
<style lang="less"
|
|
284
|
+
<style lang="less">
|
|
297
285
|
.DshPanel {
|
|
298
286
|
min-width: 100%;
|
|
299
287
|
height: 100%;
|
|
@@ -317,6 +305,7 @@
|
|
|
317
305
|
display: flex;
|
|
318
306
|
border-radius: 10px 10px 0px 0px;
|
|
319
307
|
font-size: 14px;
|
|
308
|
+
|
|
320
309
|
&-name {
|
|
321
310
|
max-width: 120px;
|
|
322
311
|
}
|
|
@@ -330,77 +319,77 @@
|
|
|
330
319
|
flex: 1;
|
|
331
320
|
min-height: 0px;
|
|
332
321
|
border: 1px dashed #cccccc;
|
|
333
|
-
padding: 10px 10px 40px;
|
|
334
322
|
border-top: none;
|
|
335
|
-
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: column;
|
|
336
325
|
|
|
337
326
|
.list-drag {
|
|
338
327
|
width: 100%;
|
|
339
|
-
|
|
328
|
+
flex: 1;
|
|
329
|
+
min-height: 0px;
|
|
330
|
+
|
|
340
331
|
&-transition {
|
|
341
332
|
display: block;
|
|
342
333
|
width: 100%;
|
|
343
334
|
height: 100%;
|
|
335
|
+
padding: 10px;
|
|
344
336
|
overflow: auto;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
.list-item {
|
|
348
|
-
margin-bottom: 10px;
|
|
349
|
-
height: 60px;
|
|
350
|
-
background: #FFFFFF;
|
|
351
|
-
border: 1px solid rgba(102, 110, 126, 0.1);
|
|
352
|
-
border-radius: 4px;
|
|
353
|
-
cursor: pointer;
|
|
354
|
-
position: relative;
|
|
355
|
-
padding: 10px 17px;
|
|
356
337
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
338
|
+
.item {
|
|
339
|
+
height: 60px;
|
|
340
|
+
padding: 10px 17px;
|
|
341
|
+
margin-bottom: 10px;
|
|
342
|
+
border: 1px solid rgba(102, 110, 126, 0.1);
|
|
343
|
+
border-radius: 4px;
|
|
344
|
+
background: #FFFFFF;
|
|
345
|
+
cursor: pointer;
|
|
346
|
+
position: relative;
|
|
362
347
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
color: #515A6E;
|
|
369
|
-
margin-bottom: 2px;
|
|
370
|
-
}
|
|
348
|
+
&-dropdown {
|
|
349
|
+
position: absolute;
|
|
350
|
+
top: 5px;
|
|
351
|
+
right: 5px;
|
|
352
|
+
}
|
|
371
353
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
&-colon {
|
|
354
|
+
&-title {
|
|
355
|
+
width: calc(100% - 22px);
|
|
356
|
+
margin-bottom: 2px;
|
|
357
|
+
font-family: Source Han Sans CN;
|
|
358
|
+
font-size: 14px;
|
|
359
|
+
font-weight: 500;
|
|
360
|
+
color: #515A6E;
|
|
361
|
+
}
|
|
382
362
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
363
|
+
&-cols {}
|
|
364
|
+
|
|
365
|
+
.unit {
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: row;
|
|
368
|
+
color: #515A6E;
|
|
369
|
+
&-label {
|
|
370
|
+
max-width: 60px;
|
|
371
|
+
}
|
|
372
|
+
&-colon {
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
&-value {
|
|
376
|
+
flex: 1;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
386
379
|
}
|
|
387
380
|
}
|
|
388
381
|
}
|
|
389
|
-
|
|
382
|
+
|
|
383
|
+
.list-btns {
|
|
390
384
|
width: 100%;
|
|
385
|
+
height: 40px;
|
|
386
|
+
padding: 0px 10px;
|
|
391
387
|
text-align: center;
|
|
392
|
-
height: 33px;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
388
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
.DshPanel {
|
|
401
|
-
&-group-list-btns {
|
|
402
|
-
.ivu-btn {
|
|
403
|
-
background: transparent;
|
|
389
|
+
.ivu-btn {
|
|
390
|
+
background: transparent;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
404
393
|
}
|
|
405
394
|
}
|
|
406
395
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="`DshFlatTable control
|
|
2
|
+
<div :class="`DshFlatTable control-default`">
|
|
3
3
|
<!-- 表格内容 -->
|
|
4
4
|
<div class="DshFlatTable-block">
|
|
5
5
|
<table
|
|
@@ -74,8 +74,6 @@
|
|
|
74
74
|
class="td-inner"
|
|
75
75
|
:style="{
|
|
76
76
|
padding: '5px 8px 16px'
|
|
77
|
-
// margin: isShowCompare(col, row, oldListData[rowIndex]) ? '-1px' : undefined,
|
|
78
|
-
// border: isShowCompare(col, row, oldListData[rowIndex]) ? '1px solid #ed4014' : undefined
|
|
79
77
|
}"
|
|
80
78
|
>
|
|
81
79
|
<!--对比值 -->
|
|
@@ -89,12 +87,10 @@
|
|
|
89
87
|
>
|
|
90
88
|
<dsh-unit
|
|
91
89
|
class="td-inner-compare-unit"
|
|
92
|
-
:mode="mode"
|
|
93
90
|
:canEdit="getUnitCanEdit(col, row)"
|
|
94
91
|
:parentData="listData"
|
|
95
92
|
:formData="row"
|
|
96
93
|
:formItem="col"
|
|
97
|
-
:isShare="isShare"
|
|
98
94
|
:rowIndex="rowIndex"
|
|
99
95
|
@blur="controlBlur(null, col, row, arguments)"
|
|
100
96
|
@change="$dispatchEvent(operationMap.changeVal, col, row, rowIndex, arguments)"
|
|
@@ -103,12 +99,10 @@
|
|
|
103
99
|
|
|
104
100
|
<dsh-unit
|
|
105
101
|
v-else
|
|
106
|
-
:mode="mode"
|
|
107
102
|
:canEdit="getUnitCanEdit(col, row)"
|
|
108
103
|
:parentData="listData"
|
|
109
104
|
:formData="row"
|
|
110
105
|
:formItem="col"
|
|
111
|
-
:isShare="isShare"
|
|
112
106
|
:rowIndex="rowIndex"
|
|
113
107
|
@blur="controlBlur(null, col, row, arguments)"
|
|
114
108
|
@change="$dispatchEvent(operationMap.changeVal, col, row, rowIndex, arguments)"
|
|
@@ -184,11 +178,6 @@
|
|
|
184
178
|
DshUnit
|
|
185
179
|
},
|
|
186
180
|
props: {
|
|
187
|
-
mode: {
|
|
188
|
-
type: String,
|
|
189
|
-
default: "default"
|
|
190
|
-
},
|
|
191
|
-
|
|
192
181
|
canEdit: {
|
|
193
182
|
type: Boolean,
|
|
194
183
|
default: true
|
|
@@ -229,8 +218,7 @@
|
|
|
229
218
|
default () {
|
|
230
219
|
return {};
|
|
231
220
|
}
|
|
232
|
-
}
|
|
233
|
-
isShare: Boolean
|
|
221
|
+
}
|
|
234
222
|
},
|
|
235
223
|
data () {
|
|
236
224
|
return {
|
|
@@ -257,6 +245,7 @@
|
|
|
257
245
|
|
|
258
246
|
selfPropsObj () {
|
|
259
247
|
return {
|
|
248
|
+
isShare: false, // 是否是分享页在用
|
|
260
249
|
_contentHeight: 500,
|
|
261
250
|
_useSelection: false, // 使用选择列
|
|
262
251
|
_useIndex: true, // 使用序号列
|
|
@@ -268,6 +257,9 @@
|
|
|
268
257
|
...this.propsObj
|
|
269
258
|
};
|
|
270
259
|
},
|
|
260
|
+
isShare () {
|
|
261
|
+
return this.selfPropsObj.isShare;
|
|
262
|
+
},
|
|
271
263
|
contentHeight () {
|
|
272
264
|
return this.selfPropsObj._contentHeight;
|
|
273
265
|
},
|
|
@@ -289,10 +281,10 @@
|
|
|
289
281
|
disabledOldDataRow () {
|
|
290
282
|
return this.selfPropsObj._disabledOldDataRow;
|
|
291
283
|
},
|
|
292
|
-
|
|
284
|
+
|
|
285
|
+
useCompare () {
|
|
293
286
|
return !!this.oldListData.length;
|
|
294
287
|
},
|
|
295
|
-
|
|
296
288
|
showColumns () {
|
|
297
289
|
const operationList = this.$getOperationList(["delete"]);
|
|
298
290
|
const showColumns = [
|
|
@@ -507,7 +499,7 @@
|
|
|
507
499
|
(!col.dependRowCanEdit || row.canEdit !== false); // 在老数据行里某些列不可编辑
|
|
508
500
|
},
|
|
509
501
|
isShowCompare (col, row, oldRow = {}) {
|
|
510
|
-
return this.
|
|
502
|
+
return this.useCompare && ["number"].includes(col._type) &&
|
|
511
503
|
!(this.$isEmptyData(row[col._key]) && this.$isEmptyData(oldRow[col._key])) &&
|
|
512
504
|
row[col._key] !== oldRow[col._key];
|
|
513
505
|
},
|