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,328 +1,329 @@
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
- <ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
13
- </div>
14
- <input slot="reference" v-bind="model.attrs" readonly="readonly" v-model="model.text" :placeholder="soPlaceholder"
15
- ref="ct-input" :style="{height:inputHeight + 'px','line-height':inputLineHeight + 'px'}"
16
- @focus="focusHandle" @blur="blurHandle" @click="clickHandle" @input="inputHandler($event)"
17
- @change="changeHandler($event)" :disabled="model.lock" :class="model.lock ? 'ct-is-disabled' : 'ct-input_inner'" />
18
- </el-popover>
19
- <span v-if="!model.lock" class="el-input__suffix" @click="clickHandle" :class="[model.attrs.size?'el-input--'+model.attrs.size:'']">
20
- <span v-if="showClear === false" class="el-input__suffix-inner">
21
- <i class="el-select__caret el-input__icon el-icon-arrow-up" :class="{'is-reverse':showDrop}"></i>
22
- </span>
23
- <span v-if="showClear === true" class="el-input__suffix-inner ct-close">
24
- <i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
25
- </span>
26
- </span>
27
- </div>
28
- </div>
29
- <transition name="el-fade-in">
30
- <span v-show="!valid" class="errorMessage">
31
- {{validMessage}}
32
- </span>
33
- </transition>
34
- <div v-if="!model.lock && model.popupSearchListType === 1">
35
- <el-button v-if="!model.moreActionBtnName" size="mini" type="primary" class="h26" icon="el-icon-search" @click="popupSearchListHandle"></el-button>
36
- <el-button v-else size="mini" type="primary" class="h26" @click="popupSearchListHandle">{{model.moreActionBtnName}}</el-button>
37
- </div>
38
- </div>
39
- </div>
40
- </template>
41
-
42
- <script>
43
- import dynamicElement from '../../mixins/dynamicElement'
44
- import selectOption from '../../selectOption/src/selectOption.vue'
45
- import ctSelectOptionVertical from '../../selectOption/src/selectOptionVertical'
46
- export default {
47
- name: 'ct-so',
48
- mixins: [dynamicElement],
49
- components: {
50
- 'ct-select-option': selectOption,
51
- 'ctSelectOptionVertical': ctSelectOptionVertical
52
- },
53
- props: {
54
- api: String,
55
- vmodel: Object,
56
- popShow: {
57
- type: Boolean,
58
- default: true
59
- }
60
- },
61
- data() {
62
- return {
63
- focus: false,
64
- showDrop: false,
65
- inputHeight: 26,
66
- showClear:false
67
- }
68
- },
69
- created() {
70
- if (typeof this.vmodel === 'undefined') {
71
- this.model = this.loaderObj.So(this.source);
72
- }
73
- else {
74
- this.model = this.vmodel;
75
- }
76
- this.$watch('model.value', (n, o) => {
77
- if (typeof this.model.child !== 'undefined') {
78
- this.model.child.value = this.model.child.defaultValue || '';
79
- this.model.child.text = this.model.child.defaultText || '';
80
- }
81
- });
82
- this.inputHeight = this.inputLineHeight;
83
- },
84
- computed: {
85
- soPlaceholder: {
86
- get: function () {
87
- if (this.model.value !== '') {
88
- return '';
89
- }
90
- else {
91
- return this.model.attrs.placeholder;
92
- }
93
- },
94
- set: function (v) {
95
-
96
- }
97
- },
98
- inputLineHeight: {
99
- get: function () {
100
- switch (this.model.attrs.size) {
101
- case 'mini':
102
- return 26;
103
- case 'small':
104
- return 32;
105
- case 'medium':
106
- return 36;
107
- default:
108
- return 40;
109
- }
110
- }
111
- },
112
- optionColSpan: function () {
113
- return parseInt(24 / this.model.optionColCount);
114
- },
115
- optionRowCount: function () {
116
- 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);
117
- }
118
- },
119
- mounted() {
120
- var self = this;
121
- this.$nextTick(function () {
122
- var dropdown = self.$refs["pop"];
123
- self.$watch('model.options', function (newVal, oldVal) {
124
- self.$nextTick(() => {
125
- if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
126
- dropdown.popperJS.destroy();
127
- dropdown.popperJS = null;
128
- dropdown.updatePopper();
129
- }
130
- });
131
- }, { deep: true, immediate: true });
132
- });
133
- },
134
- methods: {
135
- getOptions: function () {
136
- this.model.getOptions(this.api);
137
- },
138
- soChange: function () {
139
- var self = this;
140
- if (typeof this.model.child !== 'undefined') {
141
- this.model.child.value = this.model.child.defaultValue || '';
142
- this.model.child.text = this.model.child.defaultText || '';
143
- }
144
- var currentOption = this.model.options.find((value) => {
145
- return self.model.value === value[self.model.optionAttrs.value];
146
- });
147
- if (currentOption) {
148
- this.model.text = currentOption[self.model.optionAttrs.label];
149
- }
150
- else {
151
- this.model.text = '';
152
- }
153
- this.inputHandler(self.model.value);
154
- this.changeHandler(self.model.value);
155
- if(this.model.autoSearch) this.$emit('click');
156
- },
157
- focusHandle: function () {
158
- this.$refs['ct-input'].focus();
159
- this.$set(this, 'focus', true);
160
- },
161
- blurHandle: function () {
162
- this.$set(this, 'focus', false);
163
- },
164
- clickHandle: function () {
165
- if (this.model.lock) {
166
- return false;
167
- }
168
- if (this.model.paramName) {
169
- this.$set(this, 'showDrop', !this.showDrop);
170
- if (this.showDrop) {
171
- this.getOptions();
172
- }
173
- this.focusHandle();
174
- }
175
- else if (this.model.popupSearchListType === 1) {
176
- this.popupSearchListHandle();
177
- }
178
- else if ((this.model.popupSearchListType === 0)){
179
- this.$message.warning("请配置参数paramName1");
180
- }
181
- },
182
- popupSearchListHandle: function () {
183
- var self = this;
184
- self.$emit('popupSearchList', true, self.model, self.model.moreActionRouter, (option) => {
185
- self.model.value = option[self.model.optionAttrs.value];
186
- self.model.text = option[self.model.optionAttrs.label];
187
- self.model.options.push(option);
188
-
189
- self.soChange();
190
- });
191
- },
192
- getOptionText: function (value) {
193
- var self = this;
194
- var option = this.model.options.find((v) => { return v[self.model.optionAttrs.value] === value });
195
- if (option) {
196
- return option[self.model.optionAttrs.label];
197
- } else {
198
- return value;
199
- }
200
- },
201
- getOptionSelect(value) {
202
- if (this.model.value === value) {
203
- return "danger";
204
- }
205
- else {
206
- return "success";
207
- }
208
- },
209
- selectOption(value) {
210
- if (this.model.value === value) {
211
- this.$set(this, 'showDrop', false);
212
- return;
213
- }
214
- else {
215
- this.model.value = value;
216
- }
217
- this.soChange();
218
- this.$set(this, 'showDrop', false);
219
- },
220
- mouseOverHandle: function () {
221
- if (this.model.value !== '' && this.model.clearable) {
222
- this.$set(this, 'showClear', true);
223
- }
224
- },
225
- mouseOutHandle: function () {
226
- this.$set(this, 'showClear', false);
227
- },
228
- clearClickHandle: function (event) {
229
- this.model.value = '';
230
- this.soChange();
231
- event.stopPropagation();
232
- }
233
- }
234
- }
235
- </script>
236
- <style>
237
- .ct-so {
238
- font-size: 14px;
239
- }
240
-
241
- .ct-so .ct-input_inner {
242
- -webkit-appearance: none;
243
- background-color: #fff;
244
- background-image: none;
245
- border-radius: 4px;
246
- border: 1px solid #dcdfe6;
247
- -webkit-box-sizing: border-box;
248
- box-sizing: border-box;
249
- color: #606266;
250
- display: inline-block;
251
- font-size: inherit;
252
- line-height: 26px;
253
- outline: 0;
254
- padding: 0 15px;
255
- padding-right: 30px;
256
- -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
257
- transition: border-color .2s cubic-bezier(.645,.045,.355,1);
258
- width: 100%;
259
- cursor: pointer;
260
- z-index: 2000;
261
- }
262
-
263
- .ct-so .ct-input_inner::-webkit-input-placeholder {
264
- color: #c0c4cc;
265
- }
266
-
267
- .ct-so .ct-input_inner::-moz-placeholder {
268
- color: #c0c4cc;
269
- }
270
-
271
- .ct-so .ct-input_inner:-ms-input-placeholder {
272
- color: #c0c4cc;
273
- }
274
-
275
- .ct-so .ct-input_inner:hover {
276
- border-color: #c0c4cc; /*border-color:#c0c4cc*/
277
- }
278
-
279
- .ct-so.isfocus .ct-input_inner:hover {
280
- border-color: #409EFF; /*border-color:#c0c4cc*/
281
- }
282
-
283
- .ct-so.isfocus .ct-input_inner {
284
- border-color: #409EFF;
285
- }
286
-
287
- .ct-so .el-input__suffix {
288
- right: 10px;
289
- cursor: pointer;
290
- }
291
-
292
- .ct-so .el-select__caret {
293
- color: #c0c4cc;
294
- font-size: inherit;
295
- -webkit-transition: -webkit-transform .3s;
296
- transition: -webkit-transform .3s;
297
- transition: transform .3s;
298
- transition: transform .3s, -webkit-transform .3s;
299
- transition: transform .3s,-webkit-transform .3s;
300
- -webkit-transform: rotateZ(180deg);
301
- transform: rotateZ(180deg);
302
- cursor: pointer;
303
- }
304
-
305
- .ct-so .is-reverse {
306
- -webkit-transform: rotateZ(0deg);
307
- transform: rotateZ(0deg);
308
- }
309
-
310
- .ct-so .el-tag {
311
- -webkit-box-sizing: border-box;
312
- box-sizing: border-box;
313
- border-color: transparent;
314
- margin: 2px 0 2px 6px;
315
- background-color: #f0f2f5;
316
- }
317
-
318
- .ct-option {
319
- margin: 5px;
320
- cursor:pointer;
321
- }
322
- .ct-so .ct-close > .el-select__caret.is-show-close:hover {
323
- color: #909399;
324
- }
325
- .h26{
326
- height: 26px;
327
- }
328
- </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
+ <ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
13
+ </div>
14
+ <input slot="reference" v-bind="model.attrs" readonly="readonly" v-model="model.text" :placeholder="soPlaceholder"
15
+ ref="ct-input" :style="{height:inputHeight + 'px','line-height':inputLineHeight + 'px'}"
16
+ @focus="focusHandle" @blur="blurHandle" @click="clickHandle" @input="inputHandler($event)"
17
+ @change="changeHandler($event)" :disabled="model.lock" :class="model.lock ? 'ct-is-disabled' : 'ct-input_inner'" />
18
+ </el-popover>
19
+ <span v-if="!model.lock" class="el-input__suffix" @click="clickHandle" :class="[model.attrs.size?'el-input--'+model.attrs.size:'']">
20
+ <span v-if="showClear === false" class="el-input__suffix-inner">
21
+ <i class="el-select__caret el-input__icon el-icon-arrow-up" :class="{'is-reverse':showDrop}"></i>
22
+ </span>
23
+ <span v-if="showClear === true" class="el-input__suffix-inner ct-close">
24
+ <i class="el-select__caret el-input__icon el-icon-circle-close is-show-close" @click="clearClickHandle($event)"></i>
25
+ </span>
26
+ </span>
27
+ </div>
28
+ </div>
29
+ <span v-if="model.sufLabel" class="spanMessage ct-flex-div-span">{{model.sufLabel}}</span>
30
+ <transition name="el-fade-in">
31
+ <span v-show="!valid" class="errorMessage">
32
+ {{validMessage}}
33
+ </span>
34
+ </transition>
35
+ <div v-if="!model.lock && model.popupSearchListType === 1">
36
+ <el-button v-if="!model.moreActionBtnName" size="mini" type="primary" class="h26" icon="el-icon-search" @click="popupSearchListHandle"></el-button>
37
+ <el-button v-else size="mini" type="primary" class="h26" @click="popupSearchListHandle">{{model.moreActionBtnName}}</el-button>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </template>
42
+
43
+ <script>
44
+ import dynamicElement from '../../mixins/dynamicElement'
45
+ import selectOption from '../../selectOption/src/selectOption.vue'
46
+ import ctSelectOptionVertical from '../../selectOption/src/selectOptionVertical'
47
+ export default {
48
+ name: 'ct-so',
49
+ mixins: [dynamicElement],
50
+ components: {
51
+ 'ct-select-option': selectOption,
52
+ 'ctSelectOptionVertical': ctSelectOptionVertical
53
+ },
54
+ props: {
55
+ api: String,
56
+ vmodel: Object,
57
+ popShow: {
58
+ type: Boolean,
59
+ default: true
60
+ }
61
+ },
62
+ data() {
63
+ return {
64
+ focus: false,
65
+ showDrop: false,
66
+ inputHeight: 26,
67
+ showClear:false
68
+ }
69
+ },
70
+ created() {
71
+ if (typeof this.vmodel === 'undefined') {
72
+ this.model = this.loaderObj.So(this.source);
73
+ }
74
+ else {
75
+ this.model = this.vmodel;
76
+ }
77
+ this.$watch('model.value', (n, o) => {
78
+ if (typeof this.model.child !== 'undefined') {
79
+ this.model.child.value = this.model.child.defaultValue || '';
80
+ this.model.child.text = this.model.child.defaultText || '';
81
+ }
82
+ });
83
+ this.inputHeight = this.inputLineHeight;
84
+ },
85
+ computed: {
86
+ soPlaceholder: {
87
+ get: function () {
88
+ if (this.model.value !== '') {
89
+ return '';
90
+ }
91
+ else {
92
+ return this.model.attrs.placeholder;
93
+ }
94
+ },
95
+ set: function (v) {
96
+
97
+ }
98
+ },
99
+ inputLineHeight: {
100
+ get: function () {
101
+ switch (this.model.attrs.size) {
102
+ case 'mini':
103
+ return 26;
104
+ case 'small':
105
+ return 32;
106
+ case 'medium':
107
+ return 36;
108
+ default:
109
+ return 40;
110
+ }
111
+ }
112
+ },
113
+ optionColSpan: function () {
114
+ return parseInt(24 / this.model.optionColCount);
115
+ },
116
+ optionRowCount: function () {
117
+ 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);
118
+ }
119
+ },
120
+ mounted() {
121
+ var self = this;
122
+ this.$nextTick(function () {
123
+ var dropdown = self.$refs["pop"];
124
+ self.$watch('model.options', function (newVal, oldVal) {
125
+ self.$nextTick(() => {
126
+ if (typeof dropdown.popperJS !== 'undefined' && dropdown.popperJS) {
127
+ dropdown.popperJS.destroy();
128
+ dropdown.popperJS = null;
129
+ dropdown.updatePopper();
130
+ }
131
+ });
132
+ }, { deep: true, immediate: true });
133
+ });
134
+ },
135
+ methods: {
136
+ getOptions: function () {
137
+ this.model.getOptions(this.api);
138
+ },
139
+ soChange: function () {
140
+ var self = this;
141
+ if (typeof this.model.child !== 'undefined') {
142
+ this.model.child.value = this.model.child.defaultValue || '';
143
+ this.model.child.text = this.model.child.defaultText || '';
144
+ }
145
+ var currentOption = this.model.options.find((value) => {
146
+ return self.model.value === value[self.model.optionAttrs.value];
147
+ });
148
+ if (currentOption) {
149
+ this.model.text = currentOption[self.model.optionAttrs.label];
150
+ }
151
+ else {
152
+ this.model.text = '';
153
+ }
154
+ this.inputHandler(self.model.value);
155
+ this.changeHandler(self.model.value);
156
+ if(this.model.autoSearch) this.$emit('click');
157
+ },
158
+ focusHandle: function () {
159
+ this.$refs['ct-input'].focus();
160
+ this.$set(this, 'focus', true);
161
+ },
162
+ blurHandle: function () {
163
+ this.$set(this, 'focus', false);
164
+ },
165
+ clickHandle: function () {
166
+ if (this.model.lock) {
167
+ return false;
168
+ }
169
+ if (this.model.paramName) {
170
+ this.$set(this, 'showDrop', !this.showDrop);
171
+ if (this.showDrop) {
172
+ this.getOptions();
173
+ }
174
+ this.focusHandle();
175
+ }
176
+ else if (this.model.popupSearchListType === 1) {
177
+ this.popupSearchListHandle();
178
+ }
179
+ else if ((this.model.popupSearchListType === 0)){
180
+ this.$message.warning("请配置参数paramName1");
181
+ }
182
+ },
183
+ popupSearchListHandle: function () {
184
+ var self = this;
185
+ self.$emit('popupSearchList', true, self.model, self.model.moreActionRouter, (option) => {
186
+ self.model.value = option[self.model.optionAttrs.value];
187
+ self.model.text = option[self.model.optionAttrs.label];
188
+ self.model.options.push(option);
189
+
190
+ self.soChange();
191
+ });
192
+ },
193
+ getOptionText: function (value) {
194
+ var self = this;
195
+ var option = this.model.options.find((v) => { return v[self.model.optionAttrs.value] === value });
196
+ if (option) {
197
+ return option[self.model.optionAttrs.label];
198
+ } else {
199
+ return value;
200
+ }
201
+ },
202
+ getOptionSelect(value) {
203
+ if (this.model.value === value) {
204
+ return "danger";
205
+ }
206
+ else {
207
+ return "success";
208
+ }
209
+ },
210
+ selectOption(value) {
211
+ if (this.model.value === value) {
212
+ this.$set(this, 'showDrop', false);
213
+ return;
214
+ }
215
+ else {
216
+ this.model.value = value;
217
+ }
218
+ this.soChange();
219
+ this.$set(this, 'showDrop', false);
220
+ },
221
+ mouseOverHandle: function () {
222
+ if (this.model.value !== '' && this.model.clearable) {
223
+ this.$set(this, 'showClear', true);
224
+ }
225
+ },
226
+ mouseOutHandle: function () {
227
+ this.$set(this, 'showClear', false);
228
+ },
229
+ clearClickHandle: function (event) {
230
+ this.model.value = '';
231
+ this.soChange();
232
+ event.stopPropagation();
233
+ }
234
+ }
235
+ }
236
+ </script>
237
+ <style>
238
+ .ct-so {
239
+ font-size: 14px;
240
+ }
241
+
242
+ .ct-so .ct-input_inner {
243
+ -webkit-appearance: none;
244
+ background-color: #fff;
245
+ background-image: none;
246
+ border-radius: 4px;
247
+ border: 1px solid #dcdfe6;
248
+ -webkit-box-sizing: border-box;
249
+ box-sizing: border-box;
250
+ color: #606266;
251
+ display: inline-block;
252
+ font-size: inherit;
253
+ line-height: 26px;
254
+ outline: 0;
255
+ padding: 0 15px;
256
+ padding-right: 30px;
257
+ -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
258
+ transition: border-color .2s cubic-bezier(.645,.045,.355,1);
259
+ width: 100%;
260
+ cursor: pointer;
261
+ z-index: 2000;
262
+ }
263
+
264
+ .ct-so .ct-input_inner::-webkit-input-placeholder {
265
+ color: #c0c4cc;
266
+ }
267
+
268
+ .ct-so .ct-input_inner::-moz-placeholder {
269
+ color: #c0c4cc;
270
+ }
271
+
272
+ .ct-so .ct-input_inner:-ms-input-placeholder {
273
+ color: #c0c4cc;
274
+ }
275
+
276
+ .ct-so .ct-input_inner:hover {
277
+ border-color: #c0c4cc; /*border-color:#c0c4cc*/
278
+ }
279
+
280
+ .ct-so.isfocus .ct-input_inner:hover {
281
+ border-color: #409EFF; /*border-color:#c0c4cc*/
282
+ }
283
+
284
+ .ct-so.isfocus .ct-input_inner {
285
+ border-color: #409EFF;
286
+ }
287
+
288
+ .ct-so .el-input__suffix {
289
+ right: 10px;
290
+ cursor: pointer;
291
+ }
292
+
293
+ .ct-so .el-select__caret {
294
+ color: #c0c4cc;
295
+ font-size: inherit;
296
+ -webkit-transition: -webkit-transform .3s;
297
+ transition: -webkit-transform .3s;
298
+ transition: transform .3s;
299
+ transition: transform .3s, -webkit-transform .3s;
300
+ transition: transform .3s,-webkit-transform .3s;
301
+ -webkit-transform: rotateZ(180deg);
302
+ transform: rotateZ(180deg);
303
+ cursor: pointer;
304
+ }
305
+
306
+ .ct-so .is-reverse {
307
+ -webkit-transform: rotateZ(0deg);
308
+ transform: rotateZ(0deg);
309
+ }
310
+
311
+ .ct-so .el-tag {
312
+ -webkit-box-sizing: border-box;
313
+ box-sizing: border-box;
314
+ border-color: transparent;
315
+ margin: 2px 0 2px 6px;
316
+ background-color: #f0f2f5;
317
+ }
318
+
319
+ .ct-option {
320
+ margin: 5px;
321
+ cursor:pointer;
322
+ }
323
+ .ct-so .ct-close > .el-select__caret.is-show-close:hover {
324
+ color: #909399;
325
+ }
326
+ .h26{
327
+ height: 26px;
328
+ }
329
+ </style>