centaline-data-driven 1.1.55 → 1.1.59

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.
Files changed (202) hide show
  1. package/.babelrc +12 -12
  2. package/.editorconfig +9 -9
  3. package/.gitattributes +63 -63
  4. package/.postcssrc.js +10 -10
  5. package/.vs/Centaline.Front_End.DataDriven/DesignTimeBuild/.dtbcache +0 -0
  6. package/.vs/Centaline.Front_End.DataDriven/v16/Server/sqlite3/db.lock +0 -0
  7. package/.vs/Centaline.Front_End.DataDriven/v16/Server/sqlite3/storage.ide +0 -0
  8. package/Centaline.Front_End.DataDriven.csproj +37 -37
  9. package/Centaline.Front_End.DataDriven.sln +25 -25
  10. package/Properties/launchSettings.json +26 -26
  11. package/README.md +140 -140
  12. package/build/build.js +41 -41
  13. package/build/centaline/centaline.path.js +59 -59
  14. package/build/centaline/webpack.centaline.conf.js +106 -106
  15. package/build/check-versions.js +54 -54
  16. package/build/utils.js +102 -102
  17. package/build/vue-loader.conf.js +22 -22
  18. package/build/webpack.base.conf.js +82 -82
  19. package/build/webpack.dev.conf.js +111 -111
  20. package/build/webpack.prod.conf.js +145 -145
  21. package/config/dev.env.js +12 -12
  22. package/config/index.js +73 -73
  23. package/config/prod.env.js +4 -4
  24. package/index.html +14 -14
  25. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.dgspec.json +73 -0
  26. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.g.props +29 -0
  27. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.g.targets +15 -0
  28. package/obj/Debug/netcoreapp2.1/Centaline.Front_End.DataDriven.AssemblyInfo.cs +23 -0
  29. package/obj/Debug/netcoreapp2.1/Centaline.Front_End.DataDriven.RazorAssemblyInfo.cs +20 -0
  30. package/obj/project.assets.json +11907 -0
  31. package/package.json +75 -75
  32. package/src/App.vue +10 -10
  33. package/src/Detail.vue +29 -26
  34. package/src/Edit.vue +32 -32
  35. package/src/Form.vue +45 -29
  36. package/src/SearchList.vue +41 -40
  37. package/src/SearchTree.vue +51 -51
  38. package/src/Tabs.vue +19 -19
  39. package/src/centaline/api/index.js +249 -249
  40. package/src/centaline/comfirm/index.js +11 -11
  41. package/src/centaline/comfirm/src/comfirm.vue +44 -44
  42. package/src/centaline/common/index.js +738 -738
  43. package/src/centaline/css/common.css +752 -748
  44. package/src/centaline/css/max.css +208 -208
  45. package/src/centaline/dialogList/index.js +11 -11
  46. package/src/centaline/dialogList/src/dialog.vue +210 -210
  47. package/src/centaline/dialogList/src/dialogList.vue +65 -65
  48. package/src/centaline/dialogList/src/dialogNew.vue +78 -78
  49. package/src/centaline/dialogList/src/drag.js +77 -77
  50. package/src/centaline/directives/index.js +23 -23
  51. package/src/centaline/dynamicBtn/index.js +11 -11
  52. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +100 -100
  53. package/src/centaline/dynamicCb/index.js +11 -11
  54. package/src/centaline/dynamicCb/src/dynamicCb.vue +72 -72
  55. package/src/centaline/dynamicCheckbox/index.js +11 -11
  56. package/src/centaline/dynamicCheckbox/src/dynamicCheckbox.vue +128 -128
  57. package/src/centaline/dynamicComboBoxWithTextBox/index.js +11 -11
  58. package/src/centaline/dynamicComboBoxWithTextBox/src/dynamicComboBoxWithTextBox.vue +240 -240
  59. package/src/centaline/dynamicD/index.js +11 -11
  60. package/src/centaline/dynamicD/src/dynamicD.vue +92 -92
  61. package/src/centaline/dynamicDetail/index.js +10 -10
  62. package/src/centaline/dynamicDetail/src/dynamicDetail.vue +40 -40
  63. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +1280 -1280
  64. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +1346 -1293
  65. package/src/centaline/dynamicDrop/index.js +11 -11
  66. package/src/centaline/dynamicDrop/src/dynamicDrop.vue +54 -54
  67. package/src/centaline/dynamicDtd/index.js +11 -11
  68. package/src/centaline/dynamicDtd/src/dynamicDtd.vue +125 -125
  69. package/src/centaline/dynamicDtd/src/dynamicDtdOld.vue +93 -93
  70. package/src/centaline/dynamicFile/index.js +11 -11
  71. package/src/centaline/dynamicFile/src/dynamicFile.vue +289 -288
  72. package/src/centaline/dynamicForm/index.js +24 -24
  73. package/src/centaline/dynamicForm/src/dynamicForm.vue +564 -564
  74. package/src/centaline/dynamicForm/src/dynamicFormList.vue +209 -209
  75. package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +376 -376
  76. package/src/centaline/dynamicGp/index.js +11 -11
  77. package/src/centaline/dynamicGp/src/dynamicGp.vue +27 -27
  78. package/src/centaline/dynamicHyperLink/index.js +10 -10
  79. package/src/centaline/dynamicHyperLink/src/dynamicHyperLink.vue +54 -54
  80. package/src/centaline/dynamicInput/index.js +35 -35
  81. package/src/centaline/dynamicInput/src/dynamicInput.vue +35 -35
  82. package/src/centaline/dynamicInputNumber/index.js +11 -11
  83. package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +157 -157
  84. package/src/centaline/dynamicIti/index.js +11 -11
  85. package/src/centaline/dynamicIti/src/dynamicIti.vue +148 -148
  86. package/src/centaline/dynamicL/index.js +11 -11
  87. package/src/centaline/dynamicL/src/dynamicL.vue +37 -37
  88. package/src/centaline/dynamicLabel/index.js +11 -11
  89. package/src/centaline/dynamicLabel/src/dynamicLabel.vue +73 -73
  90. package/src/centaline/dynamicLs/index.js +22 -22
  91. package/src/centaline/dynamicLs/src/dynamicLs.vue +233 -233
  92. package/src/centaline/dynamicMo/index.js +13 -13
  93. package/src/centaline/dynamicMo/src/dynamicMo.vue +421 -421
  94. package/src/centaline/dynamicMt/index.js +11 -11
  95. package/src/centaline/dynamicMt/src/dynamicMt.vue +44 -44
  96. package/src/centaline/dynamicPlaceHolder/index.js +10 -10
  97. package/src/centaline/dynamicPlaceHolder/src/dynamicPlaceHolder.vue +29 -29
  98. package/src/centaline/dynamicPopupSearchList/index.js +11 -11
  99. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchList.vue +157 -157
  100. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchListTable.vue +239 -239
  101. package/src/centaline/dynamicRichText/index.js +11 -11
  102. package/src/centaline/dynamicRichText/src/dynamicRichText.vue +33 -33
  103. package/src/centaline/dynamicSearchList/index.js +11 -11
  104. package/src/centaline/dynamicSearchList/src/dynamicSearchCategory.vue +121 -121
  105. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +135 -135
  106. package/src/centaline/dynamicSearchList/src/dynamicSearchScreen.vue +206 -206
  107. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1082 -1069
  108. package/src/centaline/dynamicSearchList/src/dynamicTableStatistics.vue +30 -30
  109. package/src/centaline/dynamicSearchList/src/dynamicTableTip.vue +46 -46
  110. package/src/centaline/dynamicSearchList/src/dynamicTableToolbar.vue +61 -61
  111. package/src/centaline/dynamicSeg/index.js +11 -11
  112. package/src/centaline/dynamicSeg/src/dynamicSeg.vue +100 -100
  113. package/src/centaline/dynamicSensitiveEye/index.js +11 -11
  114. package/src/centaline/dynamicSensitiveEye/src/dynamicSensitiveEye.vue +74 -74
  115. package/src/centaline/dynamicSo/index.js +14 -14
  116. package/src/centaline/dynamicSo/src/dynamicSo.vue +329 -328
  117. package/src/centaline/dynamicSo/src/dynamicSo/345/211/257/346/234/254.vue +69 -69
  118. package/src/centaline/dynamicSos/index.js +14 -14
  119. package/src/centaline/dynamicSos/src/dynamicSos - /345/244/215/345/210/266.vue" +223 -223
  120. package/src/centaline/dynamicSos/src/dynamicSos.vue +261 -260
  121. package/src/centaline/dynamicSw/index.js +11 -11
  122. package/src/centaline/dynamicSw/src/dynamicSw.vue +74 -74
  123. package/src/centaline/dynamicT/index.js +11 -11
  124. package/src/centaline/dynamicT/src/dynamicT.vue +79 -79
  125. package/src/centaline/dynamicTab/index.js +11 -11
  126. package/src/centaline/dynamicTab/src/dynamicTab.vue +49 -49
  127. package/src/centaline/dynamicTabs/index.js +11 -11
  128. package/src/centaline/dynamicTabs/src/dynamicTabs.vue +69 -69
  129. package/src/centaline/dynamicTags/index.js +13 -13
  130. package/src/centaline/dynamicTags/src/dynamicTags - /345/244/215/345/210/266.vue" +391 -391
  131. package/src/centaline/dynamicTags/src/dynamicTags.vue +427 -427
  132. package/src/centaline/dynamicTimeSelect/index.js +11 -11
  133. package/src/centaline/dynamicTimeSelect/src/dynamicTimeSelect.vue +141 -141
  134. package/src/centaline/dynamicTree/index.js +11 -11
  135. package/src/centaline/dynamicTree/src/dynamicSearchTree.vue +66 -66
  136. package/src/centaline/dynamicTree/src/dynamicTree.vue +233 -233
  137. package/src/centaline/dynamicTree/src/dynamicTreeList.vue +74 -74
  138. package/src/centaline/formData/index.js +290 -290
  139. package/src/centaline/imgPreview/index.js +42 -42
  140. package/src/centaline/imgPreview/src/imgPreview.vue +26 -26
  141. package/src/centaline/index.js +51 -51
  142. package/src/centaline/loader/index.js +157 -157
  143. package/src/centaline/loader/src/ctl/Base.js +270 -261
  144. package/src/centaline/loader/src/ctl/Button.js +44 -44
  145. package/src/centaline/loader/src/ctl/Cb.js +27 -27
  146. package/src/centaline/loader/src/ctl/Checkbox.js +107 -107
  147. package/src/centaline/loader/src/ctl/ComboBoxWithTextBox.js +162 -162
  148. package/src/centaline/loader/src/ctl/D.js +31 -31
  149. package/src/centaline/loader/src/ctl/Detail.js +228 -175
  150. package/src/centaline/loader/src/ctl/Dtd.js +115 -115
  151. package/src/centaline/loader/src/ctl/DtdOld.js +129 -129
  152. package/src/centaline/loader/src/ctl/File.js +292 -292
  153. package/src/centaline/loader/src/ctl/Form.js +380 -380
  154. package/src/centaline/loader/src/ctl/FormList.js +428 -428
  155. package/src/centaline/loader/src/ctl/GM.js +20 -20
  156. package/src/centaline/loader/src/ctl/Gp.js +9 -9
  157. package/src/centaline/loader/src/ctl/Hd.js +13 -13
  158. package/src/centaline/loader/src/ctl/HyperLink.js +24 -24
  159. package/src/centaline/loader/src/ctl/InputNumber.js +51 -51
  160. package/src/centaline/loader/src/ctl/Iti.js +108 -108
  161. package/src/centaline/loader/src/ctl/L.js +18 -18
  162. package/src/centaline/loader/src/ctl/Mo.js +183 -183
  163. package/src/centaline/loader/src/ctl/Mt.js +20 -20
  164. package/src/centaline/loader/src/ctl/PlaceHolder.js +15 -15
  165. package/src/centaline/loader/src/ctl/Router.js +273 -273
  166. package/src/centaline/loader/src/ctl/SearchCategory.js +54 -54
  167. package/src/centaline/loader/src/ctl/SearchScreen.js +236 -236
  168. package/src/centaline/loader/src/ctl/SearchTable.js +787 -772
  169. package/src/centaline/loader/src/ctl/Seg.js +37 -37
  170. package/src/centaline/loader/src/ctl/SensitiveEye.js +65 -65
  171. package/src/centaline/loader/src/ctl/So.js +117 -117
  172. package/src/centaline/loader/src/ctl/Sos.js +128 -128
  173. package/src/centaline/loader/src/ctl/Sw.js +27 -27
  174. package/src/centaline/loader/src/ctl/T.js +65 -65
  175. package/src/centaline/loader/src/ctl/Tabs.js +57 -57
  176. package/src/centaline/loader/src/ctl/Tags.js +191 -191
  177. package/src/centaline/loader/src/ctl/TimeSelect.js +87 -87
  178. package/src/centaline/loader/src/ctl/Tree.js +151 -151
  179. package/src/centaline/loader/src/ctl/Ttts.js +78 -78
  180. package/src/centaline/loader/src/ctl/lib/Enum.js +580 -563
  181. package/src/centaline/loader/src/ctl/lib/LibFunction.js +364 -364
  182. package/src/centaline/loader/src/ctl.js +36 -36
  183. package/src/centaline/mixins/dynamicElement.js +151 -151
  184. package/src/centaline/mixins/dynamicSelect.js +84 -84
  185. package/src/centaline/mixins/emitter.js +33 -33
  186. package/src/centaline/progress/index.js +11 -11
  187. package/src/centaline/progress/src/progress.vue +70 -70
  188. package/src/centaline/quickInput/src/quickInput.vue +64 -64
  189. package/src/centaline/selectOption/src/selectOption.vue +61 -61
  190. package/src/centaline/selectOption/src/selectOptionVertical.vue +80 -80
  191. package/src/centaline/templateControls/index.js +17 -17
  192. package/src/centaline/templateControls/src/dynamicTableA.vue +20 -20
  193. package/src/centaline/templateControls/src/dynamicTableCurrency.vue +62 -62
  194. package/src/centaline/templateControls/src/dynamicTableImg.vue +25 -25
  195. package/src/centaline/templates/index.js +34 -34
  196. package/src/centaline/templates/src/ContractSearch.js +67 -67
  197. package/src/centaline/templates/src/test.js +44 -44
  198. package/src/centaline/validate/index.js +332 -332
  199. package/src/main.js +55 -46
  200. package/src/router/index.js +44 -44
  201. package/wwwroot/static/centaline/centaline-data-driven.js +1 -1
  202. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
@@ -1,260 +1,261 @@
1
- <template>
2
- <div class="field-top">
3
- <div style="width:100%;display:flex">
4
- <div style="flex:1;" class="ct-so" :class="[(focus || showDrop)?'isfocus':'',model.attrs.size?'ct-so-'+model.attrs.size:''
5
- ]" @mouseover="mouseOverHandle" @mouseout="mouseOutHandle">
6
- <div :class="[model.showLabel?'el-input-group el-input-group--prepend':'',!valid?'inputError':'']">
7
- <div v-if="model.showLabel && model.label" class="el-input-group__prepend" :class="[model.labelClass]">
8
- {{model.label}}
9
- </div>
10
- <el-popover ref="pop" placement="bottom-start" v-model="showDrop" :class="[model.showLabel?'showLabel':'']" :trigger="(!model.paramName || model.lock)? 'manual' : 'click'">
11
- <div>
12
- <div>
13
- <el-input ref="searchInput" :size="model.attrs.size" suffix-icon="el-icon-search" v-model="searchText" @input="searchInputHandle"></el-input>
14
- </div>
15
- <ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
16
- </div>
17
- <input slot="reference" v-bind="model.attrs" readonly="readonly" v-model="model.text" :placeholder="soPlaceholder"
18
- ref="ct-input" :style="{height:inputHeight + 'px','line-height':inputLineHeight + 'px'}"
19
- @focus="focusHandle" @blur="blurHandle" @click="clickHandle" @input="inputHandler($event)" @change="changeHandler($event)"
20
- :disabled="model.lock" :class="model.lock ? 'ct-is-disabled' : 'ct-input_inner'" />
21
- </el-popover>
22
- <span v-if="!model.lock" class="el-input__suffix" @click="clickHandle" :class="[model.attrs.size?'el-input--'+model.attrs.size:'']">
23
- <span v-if="showClear === false" class="el-input__suffix-inner">
24
- <i class="el-select__caret el-input__icon el-icon-arrow-up" :class="{'is-reverse':showDrop}"></i>
25
- </span>
26
- <span v-if="showClear === true" class="el-input__suffix-inner ct-close">
27
- <i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
28
- </span>
29
- </span>
30
- </div>
31
- </div>
32
- <transition name="el-fade-in">
33
- <span v-show="!valid" class="errorMessage">
34
- {{validMessage}}
35
- </span>
36
- </transition>
37
- <div v-if="!model.lock && model.popupSearchListType === 1">
38
- <el-button v-if="!model.moreActionBtnName" size="mini" class="h26" type="primary" icon="el-icon-search" @click="popupSearchListHandle"></el-button>
39
- <el-button v-else size="mini" type="primary" class="h26" @click="popupSearchListHandle">{{model.moreActionBtnName}}</el-button>
40
- </div>
41
- </div>
42
- </div>
43
- </template>
44
-
45
- <script>
46
- import dynamicElement from '../../mixins/dynamicElement'
47
- import selectOption from '../../selectOption/src/selectOption'
48
- import ctSelectOptionVertical from '../../selectOption/src/selectOptionVertical'
49
- export default {
50
- name: 'ct-sos',
51
- mixins: [dynamicElement],
52
- components: {
53
- 'ctSelectOption': selectOption,
54
- 'ctSelectOptionVertical': ctSelectOptionVertical
55
- },
56
- props: {
57
- api: String,
58
- vmodel: Object,
59
- popShow: {
60
- type: Boolean,
61
- default: true
62
- }
63
- },
64
- data() {
65
- return {
66
- focus: false,
67
- showDrop: false,
68
- inputHeight: 26,
69
- showClear: false,
70
- searchText: ""
71
- }
72
- },
73
- created() {
74
- if (typeof this.vmodel === 'undefined') {
75
- this.model = this.loaderObj.Sos(this.source);
76
- }
77
- else {
78
- this.model = this.vmodel;
79
- }
80
- this.$watch('model.value', (n, o) => {
81
- if (typeof this.model.child !== 'undefined') {
82
- this.model.child.value = this.model.child.defaultValue || '';
83
- this.model.child.text = this.model.child.defaultText || '';
84
- }
85
- });
86
- this.inputHeight = this.inputLineHeight;
87
- },
88
- computed: {
89
- soPlaceholder: {
90
- get: function () {
91
- if (this.model.value !== '') {
92
- return '';
93
- }
94
- else {
95
- return this.model.attrs.placeholder;
96
- }
97
- },
98
- set: function (v) {
99
-
100
- }
101
- },
102
- inputLineHeight: {
103
- get: function () {
104
- switch (this.model.attrs.size) {
105
- case 'mini':
106
- return 26;
107
- case 'small':
108
- return 32;
109
- case 'medium':
110
- return 36;
111
- default:
112
- return 40;
113
- }
114
- }
115
- },
116
- optionColSpan: function () {
117
- return parseInt(24 / this.model.optionColCount);
118
- },
119
- optionRowCount: function () {
120
- return parseInt(this.model.options.length % this.model.optionColCount > 0 ? (this.model.options.length / this.model.optionColCount) + 1 : this.model.options.length / this.model.optionColCount);
121
- }
122
- },
123
- mounted() {
124
- var self = this;
125
- this.$nextTick(function () {
126
- var dropdown = self.$refs["pop"];
127
- self.$watch('model.options', function (newVal, oldVal) {
128
- self.$nextTick(() => {
129
- if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
130
- dropdown.popperJS.destroy();
131
- dropdown.popperJS = null;
132
- dropdown.updatePopper();
133
- }
134
- self.$refs["searchInput"].$el.querySelector("input").focus();
135
- });
136
- }, { deep: true, immediate: true });
137
- });
138
- },
139
- methods: {
140
- getOptions: function () {
141
- var self = this;
142
- this.model.getOptions(this.api, self.searchText);
143
- },
144
- soChange: function () {
145
- var self = this;
146
- if (typeof this.model.child !== 'undefined') {
147
- this.model.child.value = this.model.child.defaultValue || '';
148
- this.model.child.text = this.model.child.defaultText || '';
149
- }
150
- var currentOption = this.model.options.find((value) => {
151
- return self.model.value === value[self.model.optionAttrs.value];
152
- });
153
- if (currentOption) {
154
- this.model.text =currentOption[self.model.optionAttrs.label];
155
- }
156
- else {
157
- this.model.text = '';
158
- }
159
- this.inputHandler(self.model.value);
160
- this.changeHandler(self.model.value);
161
- if(this.model.autoSearch) this.$emit('click');
162
- },
163
- focusHandle: function () {
164
- this.$set(this, 'focus', true);
165
- },
166
- blurHandle: function () {
167
- this.$set(this, 'focus', false);
168
- },
169
- clickHandle: function () {
170
- if (this.model.lock) {
171
- return false;
172
- }
173
- if (this.model.paramName) {
174
- this.$set(this, 'showDrop', !this.showDrop);
175
- if (this.showDrop) {
176
- this.getOptions();
177
- }
178
- this.focusHandle();
179
- }
180
- else if (this.model.popupSearchListType === 1) {
181
- this.popupSearchListHandle();
182
- }
183
- else if ((this.model.popupSearchListType === 0)) {
184
- this.$message.warning("请配置参数paramName1");
185
- }
186
- },
187
- popupSearchListHandle: function () {
188
- var self = this;
189
-
190
- self.$emit('popupSearchList', true, self.model, self.model.moreActionRouter, (option) => {
191
- if (option) {
192
- self.model.value = option[self.model.optionAttrs.value];
193
- self.model.text = option[self.model.optionAttrs.label];
194
- self.model.options.push(option);
195
-
196
- self.soChange();
197
- }
198
- });
199
- },
200
- getOptionText: function (value) {
201
- var self = this;
202
- var option = this.model.options.find((v) => { return v[self.model.optionAttrs.value] === value });
203
- if (option) {
204
- return option[self.model.optionAttrs.label];
205
- } else {
206
- return value;
207
- }
208
- },
209
- getOptionSelect(value) {
210
- if (this.model.value === value) {
211
- return "danger";
212
- }
213
- else {
214
- return "success";
215
- }
216
- },
217
- selectOption(value) {
218
- if (this.model.value === value) {
219
- this.$set(this, 'showDrop', false);
220
- return;
221
- }
222
- else {
223
- this.model.value = value;
224
- }
225
- this.soChange();
226
- this.$set(this, 'showDrop', false);
227
- },
228
- mouseOverHandle: function () {
229
- if (this.model.value !== '' && this.model.clearable) {
230
- this.$set(this, 'showClear', true);
231
- }
232
- },
233
- mouseOutHandle: function () {
234
- this.$set(this, 'showClear', false);
235
- },
236
- clearClickHandle: function (event) {
237
- this.model.value = '';
238
- this.soChange();
239
- event.stopPropagation();
240
- },
241
- searchInputHandle: function () {
242
- var currentSeatch = this.searchText;
243
- this.searchTickControl(currentSeatch);
244
- },
245
- searchTickControl: function (search) {
246
- var self = this;
247
- setTimeout(function () {
248
- if (search === self.searchText) {
249
- self.getOptions(self.searchText);
250
- }
251
- }, self.model.searchTick);
252
- }
253
- }
254
- }
255
- </script>
256
- <style>
257
- .h26{
258
- height: 26px;
259
- }
260
- </style>
1
+ <template>
2
+ <div class="field-top">
3
+ <div style="width:100%;display:flex">
4
+ <div style="flex:1;" class="ct-so" :class="[(focus || showDrop)?'isfocus':'',model.attrs.size?'ct-so-'+model.attrs.size:''
5
+ ]" @mouseover="mouseOverHandle" @mouseout="mouseOutHandle">
6
+ <div :class="[model.showLabel?'el-input-group el-input-group--prepend':'',!valid?'inputError':'']">
7
+ <div v-if="model.showLabel && model.label" class="el-input-group__prepend" :class="[model.labelClass]">
8
+ {{model.label}}
9
+ </div>
10
+ <el-popover ref="pop" placement="bottom-start" v-model="showDrop" :class="[model.showLabel?'showLabel':'']" :trigger="(!model.paramName || model.lock)? 'manual' : 'click'">
11
+ <div>
12
+ <div>
13
+ <el-input ref="searchInput" :size="model.attrs.size" suffix-icon="el-icon-search" v-model="searchText" @input="searchInputHandle"></el-input>
14
+ </div>
15
+ <ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
16
+ </div>
17
+ <input slot="reference" v-bind="model.attrs" readonly="readonly" v-model="model.text" :placeholder="soPlaceholder"
18
+ ref="ct-input" :style="{height:inputHeight + 'px','line-height':inputLineHeight + 'px'}"
19
+ @focus="focusHandle" @blur="blurHandle" @click="clickHandle" @input="inputHandler($event)" @change="changeHandler($event)"
20
+ :disabled="model.lock" :class="model.lock ? 'ct-is-disabled' : 'ct-input_inner'" />
21
+ </el-popover>
22
+ <span v-if="!model.lock" class="el-input__suffix" @click="clickHandle" :class="[model.attrs.size?'el-input--'+model.attrs.size:'']">
23
+ <span v-if="showClear === false" class="el-input__suffix-inner">
24
+ <i class="el-select__caret el-input__icon el-icon-arrow-up" :class="{'is-reverse':showDrop}"></i>
25
+ </span>
26
+ <span v-if="showClear === true" class="el-input__suffix-inner ct-close">
27
+ <i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
28
+ </span>
29
+ </span>
30
+ </div>
31
+ </div>
32
+ <span v-if="model.sufLabel" class="spanMessage ct-flex-div-span">{{model.sufLabel}}</span>
33
+ <transition name="el-fade-in">
34
+ <span v-show="!valid" class="errorMessage">
35
+ {{validMessage}}
36
+ </span>
37
+ </transition>
38
+ <div v-if="!model.lock && model.popupSearchListType === 1">
39
+ <el-button v-if="!model.moreActionBtnName" size="mini" class="h26" type="primary" icon="el-icon-search" @click="popupSearchListHandle"></el-button>
40
+ <el-button v-else size="mini" type="primary" class="h26" @click="popupSearchListHandle">{{model.moreActionBtnName}}</el-button>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import dynamicElement from '../../mixins/dynamicElement'
48
+ import selectOption from '../../selectOption/src/selectOption'
49
+ import ctSelectOptionVertical from '../../selectOption/src/selectOptionVertical'
50
+ export default {
51
+ name: 'ct-sos',
52
+ mixins: [dynamicElement],
53
+ components: {
54
+ 'ctSelectOption': selectOption,
55
+ 'ctSelectOptionVertical': ctSelectOptionVertical
56
+ },
57
+ props: {
58
+ api: String,
59
+ vmodel: Object,
60
+ popShow: {
61
+ type: Boolean,
62
+ default: true
63
+ }
64
+ },
65
+ data() {
66
+ return {
67
+ focus: false,
68
+ showDrop: false,
69
+ inputHeight: 26,
70
+ showClear: false,
71
+ searchText: ""
72
+ }
73
+ },
74
+ created() {
75
+ if (typeof this.vmodel === 'undefined') {
76
+ this.model = this.loaderObj.Sos(this.source);
77
+ }
78
+ else {
79
+ this.model = this.vmodel;
80
+ }
81
+ this.$watch('model.value', (n, o) => {
82
+ if (typeof this.model.child !== 'undefined') {
83
+ this.model.child.value = this.model.child.defaultValue || '';
84
+ this.model.child.text = this.model.child.defaultText || '';
85
+ }
86
+ });
87
+ this.inputHeight = this.inputLineHeight;
88
+ },
89
+ computed: {
90
+ soPlaceholder: {
91
+ get: function () {
92
+ if (this.model.value !== '') {
93
+ return '';
94
+ }
95
+ else {
96
+ return this.model.attrs.placeholder;
97
+ }
98
+ },
99
+ set: function (v) {
100
+
101
+ }
102
+ },
103
+ inputLineHeight: {
104
+ get: function () {
105
+ switch (this.model.attrs.size) {
106
+ case 'mini':
107
+ return 26;
108
+ case 'small':
109
+ return 32;
110
+ case 'medium':
111
+ return 36;
112
+ default:
113
+ return 40;
114
+ }
115
+ }
116
+ },
117
+ optionColSpan: function () {
118
+ return parseInt(24 / this.model.optionColCount);
119
+ },
120
+ optionRowCount: function () {
121
+ return parseInt(this.model.options.length % this.model.optionColCount > 0 ? (this.model.options.length / this.model.optionColCount) + 1 : this.model.options.length / this.model.optionColCount);
122
+ }
123
+ },
124
+ mounted() {
125
+ var self = this;
126
+ this.$nextTick(function () {
127
+ var dropdown = self.$refs["pop"];
128
+ self.$watch('model.options', function (newVal, oldVal) {
129
+ self.$nextTick(() => {
130
+ if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
131
+ dropdown.popperJS.destroy();
132
+ dropdown.popperJS = null;
133
+ dropdown.updatePopper();
134
+ }
135
+ self.$refs["searchInput"].$el.querySelector("input").focus();
136
+ });
137
+ }, { deep: true, immediate: true });
138
+ });
139
+ },
140
+ methods: {
141
+ getOptions: function () {
142
+ var self = this;
143
+ this.model.getOptions(this.api, self.searchText);
144
+ },
145
+ soChange: function () {
146
+ var self = this;
147
+ if (typeof this.model.child !== 'undefined') {
148
+ this.model.child.value = this.model.child.defaultValue || '';
149
+ this.model.child.text = this.model.child.defaultText || '';
150
+ }
151
+ var currentOption = this.model.options.find((value) => {
152
+ return self.model.value === value[self.model.optionAttrs.value];
153
+ });
154
+ if (currentOption) {
155
+ this.model.text =currentOption[self.model.optionAttrs.label];
156
+ }
157
+ else {
158
+ this.model.text = '';
159
+ }
160
+ this.inputHandler(self.model.value);
161
+ this.changeHandler(self.model.value);
162
+ if(this.model.autoSearch) this.$emit('click');
163
+ },
164
+ focusHandle: function () {
165
+ this.$set(this, 'focus', true);
166
+ },
167
+ blurHandle: function () {
168
+ this.$set(this, 'focus', false);
169
+ },
170
+ clickHandle: function () {
171
+ if (this.model.lock) {
172
+ return false;
173
+ }
174
+ if (this.model.paramName) {
175
+ this.$set(this, 'showDrop', !this.showDrop);
176
+ if (this.showDrop) {
177
+ this.getOptions();
178
+ }
179
+ this.focusHandle();
180
+ }
181
+ else if (this.model.popupSearchListType === 1) {
182
+ this.popupSearchListHandle();
183
+ }
184
+ else if ((this.model.popupSearchListType === 0)) {
185
+ this.$message.warning("请配置参数paramName1");
186
+ }
187
+ },
188
+ popupSearchListHandle: function () {
189
+ var self = this;
190
+
191
+ self.$emit('popupSearchList', true, self.model, self.model.moreActionRouter, (option) => {
192
+ if (option) {
193
+ self.model.value = option[self.model.optionAttrs.value];
194
+ self.model.text = option[self.model.optionAttrs.label];
195
+ self.model.options.push(option);
196
+
197
+ self.soChange();
198
+ }
199
+ });
200
+ },
201
+ getOptionText: function (value) {
202
+ var self = this;
203
+ var option = this.model.options.find((v) => { return v[self.model.optionAttrs.value] === value });
204
+ if (option) {
205
+ return option[self.model.optionAttrs.label];
206
+ } else {
207
+ return value;
208
+ }
209
+ },
210
+ getOptionSelect(value) {
211
+ if (this.model.value === value) {
212
+ return "danger";
213
+ }
214
+ else {
215
+ return "success";
216
+ }
217
+ },
218
+ selectOption(value) {
219
+ if (this.model.value === value) {
220
+ this.$set(this, 'showDrop', false);
221
+ return;
222
+ }
223
+ else {
224
+ this.model.value = value;
225
+ }
226
+ this.soChange();
227
+ this.$set(this, 'showDrop', false);
228
+ },
229
+ mouseOverHandle: function () {
230
+ if (this.model.value !== '' && this.model.clearable) {
231
+ this.$set(this, 'showClear', true);
232
+ }
233
+ },
234
+ mouseOutHandle: function () {
235
+ this.$set(this, 'showClear', false);
236
+ },
237
+ clearClickHandle: function (event) {
238
+ this.model.value = '';
239
+ this.soChange();
240
+ event.stopPropagation();
241
+ },
242
+ searchInputHandle: function () {
243
+ var currentSeatch = this.searchText;
244
+ this.searchTickControl(currentSeatch);
245
+ },
246
+ searchTickControl: function (search) {
247
+ var self = this;
248
+ setTimeout(function () {
249
+ if (search === self.searchText) {
250
+ self.getOptions(self.searchText);
251
+ }
252
+ }, self.model.searchTick);
253
+ }
254
+ }
255
+ }
256
+ </script>
257
+ <style>
258
+ .h26{
259
+ height: 26px;
260
+ }
261
+ </style>
@@ -1,11 +1,11 @@
1
- import dynamicSw from './src/dynamicSw'
2
-
3
- dynamicSw.install = function (Vue, options) {
4
- Vue.component(dynamicSw.name, dynamicSw);
5
- }
6
-
7
- if (typeof window !== 'undefined' && window.Vue) {
8
- window.Vue.use(dynamicSw);
9
- }
10
-
11
- export default dynamicSw;
1
+ import dynamicSw from './src/dynamicSw'
2
+
3
+ dynamicSw.install = function (Vue, options) {
4
+ Vue.component(dynamicSw.name, dynamicSw);
5
+ }
6
+
7
+ if (typeof window !== 'undefined' && window.Vue) {
8
+ window.Vue.use(dynamicSw);
9
+ }
10
+
11
+ export default dynamicSw;