doway-coms 1.4.47 → 1.4.48

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/package.json CHANGED
@@ -1,51 +1,52 @@
1
- {
2
- "name": "doway-coms",
3
- "version": "1.4.47",
4
- "description": "doway组件库",
5
- "author": "dowaysoft",
6
- "main": "packages/index.js",
7
- "license": "MIT",
8
- "scripts": {
9
- "dev": "vue-cli-service serve",
10
- "build": "vue-cli-service build",
11
- "lint": "vue-cli-service lint",
12
- "lib": "vue-cli-service build --target lib --name doway-coms --dest lib packages/index.js",
13
- "build:test": "vue-cli-service build --report"
14
- },
15
- "dependencies": {
16
- "ant-design-vue": "1.7.8",
17
- "axios": "0.18.0",
18
- "element-resize-detector": "^1.2.4",
19
- "js-cookie": "2.2.0",
20
- "vee-validate": "3.4.14",
21
- "vue": "2.7.14",
22
- "vue-router": "3.6.5",
23
- "vuedraggable": "^2.24.3",
24
- "vuex": "3.6.2",
25
- "vxe-table": "3.5.4",
26
- "xe-clipboard": "1.10.2",
27
- "xe-utils": "3.5.4"
28
- },
29
- "devDependencies": {
30
- "@vue/cli-plugin-babel": "~4.2.0",
31
- "@vue/cli-plugin-eslint": "~4.2.0",
32
- "@vue/cli-plugin-vuex": "~4.2.0",
33
- "@vue/cli-service": "~4.2.0",
34
- "babel-eslint": "^10.0.3",
35
- "babel-plugin-component": "^1.1.1",
36
- "babel-plugin-import": "^1.13.6",
37
- "eslint": "^6.7.2",
38
- "eslint-plugin-vue": "^6.1.2",
39
- "extract-text-webpack-plugin": "^3.0.2",
40
- "less-loader": "^6.0.0",
41
- "node-sass": "8.0.0",
42
- "sass-loader": "10.4.1",
43
- "vue-template-compiler": "^2.6.11"
44
- },
45
- "bundleDependencies": false,
46
- "repository": {
47
- "type": "git",
48
- "url": "https://www.npmjs.com/package/doway-coms.git"
49
- },
50
- "keywords": []
51
- }
1
+ {
2
+ "name": "doway-coms",
3
+ "version": "1.4.48",
4
+ "description": "doway组件库",
5
+ "author": "dowaysoft",
6
+ "main": "packages/index.js",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "dev": "vue-cli-service serve",
10
+ "build": "vue-cli-service build",
11
+ "lint": "vue-cli-service lint",
12
+ "lib": "vue-cli-service build --target lib --name doway-coms --dest lib packages/index.js",
13
+ "build:test": "vue-cli-service build --report"
14
+ },
15
+ "dependencies": {
16
+ "ant-design-vue": "1.7.8",
17
+ "axios": "0.18.0",
18
+ "element-resize-detector": "^1.2.4",
19
+ "js-cookie": "2.2.0",
20
+ "vee-validate": "3.4.14",
21
+ "vue": "2.7.14",
22
+ "vue-contextmenujs": "^1.4.9",
23
+ "vue-router": "3.6.5",
24
+ "vuedraggable": "^2.24.3",
25
+ "vuex": "3.6.2",
26
+ "vxe-table": "3.5.4",
27
+ "xe-clipboard": "1.10.2",
28
+ "xe-utils": "3.5.4"
29
+ },
30
+ "devDependencies": {
31
+ "@vue/cli-plugin-babel": "~4.2.0",
32
+ "@vue/cli-plugin-eslint": "~4.2.0",
33
+ "@vue/cli-plugin-vuex": "~4.2.0",
34
+ "@vue/cli-service": "~4.2.0",
35
+ "babel-eslint": "^10.0.3",
36
+ "babel-plugin-component": "^1.1.1",
37
+ "babel-plugin-import": "^1.13.6",
38
+ "eslint": "^6.7.2",
39
+ "eslint-plugin-vue": "^6.1.2",
40
+ "extract-text-webpack-plugin": "^3.0.2",
41
+ "less-loader": "^6.0.0",
42
+ "node-sass": "8.0.0",
43
+ "sass-loader": "10.4.1",
44
+ "vue-template-compiler": "^2.6.11"
45
+ },
46
+ "bundleDependencies": false,
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://www.npmjs.com/package/doway-coms.git"
50
+ },
51
+ "keywords": []
52
+ }
@@ -30,23 +30,31 @@
30
30
  {{ v.errors[0] }}
31
31
  </div>
32
32
  </ValidationProvider>
33
- <span v-else>{{ currentValue }}</span>
33
+ <Tooltip placement="topLeft" v-else>
34
+ <template slot="title">
35
+ {{ currentValue }}
36
+ </template>
37
+ <span @contextmenu.prevent="onContextmenu">
38
+ {{ currentValue }}
39
+ </span>
40
+ </Tooltip>
34
41
  </div>
35
42
  </div>
36
43
  </template>
37
44
 
38
45
  <script>
39
-
40
- import { Input } from 'ant-design-vue'
46
+ //VXETable插件
47
+ import VXETable from "vxe-table";
48
+ //轻量级剪贴板复制函数
49
+ import XEClipboard from "xe-clipboard";
50
+ import { Input, Tooltip } from 'ant-design-vue'
41
51
  import { ValidationProvider } from 'vee-validate'
42
- import { Tooltip } from 'ant-design-vue'
43
52
  export default {
44
53
  name: 'BaseInput',
45
54
  components:{
46
55
  Input,
47
56
  ValidationProvider,
48
57
  Tooltip,
49
-
50
58
  },
51
59
  data() {
52
60
  return {
@@ -125,11 +133,32 @@ export default {
125
133
  },
126
134
  blur() {
127
135
  this.$emit('blur')
136
+ },
137
+ onContextmenu(event) {
138
+ this.$contextmenu({
139
+ items: [
140
+ {
141
+ icon: 'ant-design:folder-open-filled',
142
+ label: "复制",
143
+ onClick: () => {
144
+ if (XEClipboard.copy(event.target.innerText)) {
145
+ VXETable.modal.message({
146
+ content: "已复制到剪贴板!",
147
+ status: "success",
148
+ });
149
+ }
150
+ }
151
+ }
152
+ ],
153
+ event,
154
+ zIndex: 100,
155
+ minWidth: 150
156
+ });
157
+ return false;
128
158
  }
129
159
  }
130
160
  }
131
161
  </script>
132
-
133
162
  <style lang="less">
134
163
  @import '../../styles/default.less';
135
164
  </style>
@@ -1,152 +1,179 @@
1
1
  <template>
2
- <div class="d-control-container">
3
- <div class="d-control-label" v-if="showLabel === true">
4
- {{ label
5
- }}
6
- <span v-if="rules && rules['required']" class="d-control-label-required"
2
+ <div class="d-control-container">
3
+ <div class="d-control-label" v-if="showLabel === true">
4
+ {{ label }}
5
+ <span v-if="rules && rules['required']" class="d-control-label-required"
7
6
  >*</span
8
- >
9
- <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
10
- <img src="../../styles/icon/help.png" alt="" style="width: 14px">
11
- </Tooltip>
12
- </div>
13
- <div
14
- :style="{ width: width ? width : '100%', height: height ? height : '' }"
15
7
  >
16
- <ValidationProvider
17
- :name="label"
18
- v-slot="v"
19
- :rules="rules"
20
- v-if="edit === true"
21
- >
22
- <a-textarea
23
- :size="'small'"
24
- v-model="currentValue"
25
- :placeholder="placeholder"
26
- @change="change"
27
- style="height:100%;width:100%"
28
- :class="{ 'd-error-input': v.errors.length > 0 }"
29
- />
30
- <div class="d-error-msg">
31
- {{ v.errors[0] }}
32
- </div>
33
- </ValidationProvider>
34
- <span v-else>{{ currentValue }}</span>
35
- </div>
8
+ <Tooltip :title="tooltip" v-if="tooltip" style="margin: 0 2px">
9
+ <img src="../../styles/icon/help.png" alt="" style="width: 14px" />
10
+ </Tooltip>
36
11
  </div>
37
- </template>
12
+ <div class="d-control">
13
+ <ValidationProvider
14
+ :name="label"
15
+ v-slot="v"
16
+ :rules="rules"
17
+ v-if="edit === true"
18
+ >
19
+ <a-textarea
20
+ :size="'small'"
21
+ v-model="currentValue"
22
+ :placeholder="placeholder"
23
+ @change="change"
24
+ style="height: 100%; width: 100%"
25
+ :class="{ 'd-error-input': v.errors.length > 0 }"
26
+ />
27
+ <div class="d-error-msg">
28
+ {{ v.errors[0] }}
29
+ </div>
30
+ </ValidationProvider>
31
+ <Tooltip placement="topLeft" v-else>
32
+ <template slot="title">
33
+ {{ currentValue }}
34
+ </template>
35
+ <span @contextmenu.prevent="onContextmenu">
36
+ {{ currentValue }}
37
+ </span>
38
+ </Tooltip>
39
+ </div>
40
+ </div>
41
+ </template>
38
42
 
39
43
  <script>
40
- import { Input } from 'ant-design-vue'
41
- import { ValidationProvider } from 'vee-validate'
42
- import { Tooltip } from 'ant-design-vue'
44
+ //VXETable插件
45
+ import VXETable from "vxe-table";
46
+ //轻量级剪贴板复制函数
47
+ import XEClipboard from "xe-clipboard";
48
+ import { Input, Tooltip } from "ant-design-vue";
49
+ import { ValidationProvider } from "vee-validate";
43
50
 
44
- export default {
45
- name: 'BaseTextArea',
46
- components:{
47
- 'a-textarea':Input.TextArea,
51
+ export default {
52
+ name: "BaseTextArea",
53
+ components: {
54
+ "a-textarea": Input.TextArea,
48
55
  ValidationProvider,
49
- Tooltip,
50
-
56
+ Tooltip,
51
57
  },
52
- data() {
53
- return {
54
- filterValue: '',
55
- isInputChanged: false,
56
- inputTimeout: null,
57
- searchRows: [],
58
- filterCols: [],
59
- gridLoading: false,
60
- gridPagerConfig: {
61
- total: 0,
62
- currentPage: 1,
63
- pageSize: 10
64
- }
65
- }
58
+ data() {
59
+ return {
60
+ filterValue: "",
61
+ isInputChanged: false,
62
+ inputTimeout: null,
63
+ searchRows: [],
64
+ filterCols: [],
65
+ gridLoading: false,
66
+ gridPagerConfig: {
67
+ total: 0,
68
+ currentPage: 1,
69
+ pageSize: 10,
70
+ },
71
+ };
72
+ },
73
+ computed: {
74
+ currentValue: {
75
+ // 动态计算currentValue的值
76
+ get: function () {
77
+ return this.value; // 将props中的value赋值给currentValue
78
+ },
79
+ set: function (val) {
80
+ this.$emit("input", val); // 通过$emit触发父组件
81
+ },
66
82
  },
67
- computed: {
68
- currentValue: {
69
- // 动态计算currentValue的值
70
- get: function() {
71
- return this.value // 将props中的value赋值给currentValue
72
- },
73
- set: function(val) {
74
- this.$emit('input', val) // 通过$emit触发父组件
75
- }
76
- }
83
+ },
84
+ props: {
85
+ showLabel: {
86
+ type: Boolean,
87
+ default: function () {
88
+ return true;
89
+ },
77
90
  },
78
- props: {
79
- showLabel: {
80
- type: Boolean,
81
- default: function() {
82
- return true
83
- }
91
+ width: {
92
+ type: String,
93
+ default: function () {
94
+ return null;
84
95
  },
85
- width: {
86
- type: String,
87
- default: function() {
88
- return null
89
- }
96
+ },
97
+ height: {
98
+ type: String,
99
+ default: function () {
100
+ return null;
90
101
  },
91
- height: {
92
- type: String,
93
- default: function() {
94
- return null
95
- }
102
+ },
103
+ rules: {
104
+ type: Object,
105
+ default: function () {
106
+ return null;
96
107
  },
97
- rules: {
98
- type: Object,
99
- default: function() {
100
- return null
101
- }
108
+ },
109
+ value: {
110
+ type: String,
111
+ default: function () {
112
+ return "";
102
113
  },
103
- value: {
104
- type: String,
105
- default: function() {
106
- return ''
107
- }
114
+ },
115
+ edit: {
116
+ type: Boolean,
117
+ default: function () {
118
+ return false;
108
119
  },
109
- edit: {
110
- type: Boolean,
111
- default: function() {
112
- return false
113
- }
120
+ },
121
+ name: {
122
+ type: String,
123
+ default: function () {
124
+ return "";
114
125
  },
115
- name: {
116
- type: String,
117
- default: function() {
118
- return ''
119
- }
126
+ },
127
+ label: {
128
+ type: String,
129
+ default: function () {
130
+ return "";
120
131
  },
121
- label: {
122
- type: String,
123
- default: function() {
124
- return ''
125
- }
132
+ },
133
+ placeholder: {
134
+ type: String,
135
+ default: function () {
136
+ return "";
126
137
  },
127
- placeholder: {
128
- type: String,
129
- default: function() {
130
- return ''
131
- }
138
+ },
139
+ tooltip: {
140
+ type: String,
141
+ default: function () {
142
+ return "";
132
143
  },
133
- tooltip: {
134
- type: String,
135
- default: function() {
136
- return ''
137
- }
138
- }
139
144
  },
140
- created() {},
141
- methods: {
142
- change() {
143
- this.$emit('change')
144
- }
145
- }
146
- }
147
- </script>
145
+ },
146
+ methods: {
147
+ change() {
148
+ this.$emit("change");
149
+ },
150
+ onContextmenu(event) {
151
+ this.$contextmenu({
152
+ items: [
153
+ {
154
+ icon: "ant-design:folder-open-filled",
155
+ label: "复制",
156
+ onClick: () => {
157
+ if (XEClipboard.copy(event.target.innerText)) {
158
+ VXETable.modal.message({
159
+ content: "已复制到剪贴板!",
160
+ status: "success",
161
+ });
162
+ }
163
+ },
164
+ },
165
+ ],
166
+ event,
167
+ zIndex: 100,
168
+ minWidth: 150,
169
+ });
170
+ return false;
171
+ },
172
+ },
173
+ };
174
+ </script>
148
175
 
149
176
  <style lang="scss" scoped></style>
150
177
  <style lang="less">
151
- @import '../../styles/default.less';
178
+ @import "../../styles/default.less";
152
179
  </style>
@@ -3,17 +3,18 @@
3
3
  }
4
4
  .d-control-label {
5
5
  font-size:12px;
6
- // position: absolute;
7
- // display: inline;
8
6
  font-weight: bold;
9
- width:100px;
7
+ // width:100px;
8
+ flex: 0 0 100px;
10
9
  }
11
10
  .d-control {
12
11
  flex:1;
13
- // display: inline;
14
- // padding-left: 80px;
15
12
  width: 100%;
16
13
  height: 30px;
14
+ word-wrap: 'break-word';
15
+ overflow:hidden;
16
+ text-overflow: ellipsis;
17
+ -webkit-line-clamp: 3;
17
18
  }
18
19
  .d-control-label-required{
19
20
  color:red;