centaline-data-driven 1.1.55 → 1.1.56

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