cloud-web-corejs 1.0.54-dev.322 → 1.0.54-dev.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.322",
4
+ "version": "1.0.54-dev.324",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1,10 +1,32 @@
1
- <template>
2
- <el-input-number class="noButton" autocomplete="off" size="small" v-limit-number="$attrs.scale" v-bind="$attrs" v-on="$listeners" />
3
- </template>
4
-
5
- <script>
6
- export default {
7
- name: 'baseInputNumber'
8
- };
9
- </script>
1
+ <template>
2
+ <div class="anumber">
3
+ <span @click="test" class="tt1">111</span>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'baseInputNumber',
10
+ computed:{
11
+ numberValue: {
12
+ get() {
13
+ debugger
14
+ let fieldModel = this.$$attrs.value;
15
+ return fieldModel === null ? undefined : fieldModel;
16
+ },
17
+ set(val) {
18
+ debugger
19
+ let newValue = val === undefined ? null : val;
20
+ this.$$attrs.value = newValue
21
+ },
22
+ },
23
+ },
24
+ methods:{
25
+ test(){
26
+ let a = this.$$attrs;
27
+ debugger
28
+ }
29
+ }
30
+ };
31
+ </script>
10
32
  <style></style>
@@ -1,105 +1,131 @@
1
1
  <template>
2
- <form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
3
- :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
- :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
5
- <el-input-number ref="fieldEditor" v-model="fieldModel" class="full-width-input"
6
- :disabled="field.options.disabled"
7
- :size="field.options.size" :controls-position="field.options.controlsPosition"
8
- :placeholder="getI18nLabel(field.options.placeholder)"
9
- :min="field.options.min" :max="field.options.max"
10
- :precision="field.options.precision" :step="field.options.step"
11
- @focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
12
- @change="handleChangeEvent"
13
- :class="[field.options.showbutton ? '' : 'noButton']"
14
- >
2
+ <form-item-wrapper
3
+ :designer="designer"
4
+ :field="field"
5
+ :rules="rules"
6
+ :design-state="designState"
7
+ :parent-widget="parentWidget"
8
+ :parent-list="parentList"
9
+ :index-of-parent-list="indexOfParentList"
10
+ :sub-form-row-index="subFormRowIndex"
11
+ :sub-form-col-index="subFormColIndex"
12
+ :sub-form-row-id="subFormRowId"
13
+ >
14
+ <el-input-number
15
+ ref="fieldEditor"
16
+ v-model="numberValue"
17
+ class="full-width-input"
18
+ :disabled="field.options.disabled"
19
+ :size="field.options.size"
20
+ :controls-position="field.options.controlsPosition"
21
+ :placeholder="getI18nLabel(field.options.placeholder)"
22
+ :min="field.options.min"
23
+ :max="field.options.max"
24
+ :precision="field.options.precision"
25
+ :step="field.options.step"
26
+ @focus="handleFocusCustomEvent"
27
+ @blur="handleBlurCustomEvent"
28
+ @change="handleChangeEvent"
29
+ :class="[field.options.showbutton ? '' : 'noButton']"
30
+ >
15
31
  </el-input-number>
16
32
  </form-item-wrapper>
17
33
  </template>
18
34
 
19
35
  <script>
20
- import FormItemWrapper from './form-item-wrapper'
21
- import emitter from '../../../../../components/xform/utils/emitter'
22
- import i18n from "../../../../../components/xform/utils/i18n";
23
- import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
36
+ import FormItemWrapper from "./form-item-wrapper";
37
+ import emitter from "../../../../../components/xform/utils/emitter";
38
+ import i18n from "../../../../../components/xform/utils/i18n";
39
+ import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
24
40
 
25
- export default {
26
- name: "number-widget",
27
- componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
28
- mixins: [emitter, fieldMixin, i18n],
29
- props: {
30
- field: Object,
31
- parentWidget: Object,
32
- parentList: Array,
33
- indexOfParentList: Number,
34
- designer: Object,
35
-
36
- designState: {
37
- type: Boolean,
38
- default: false
39
- },
40
-
41
- subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
42
- type: Number,
43
- default: -1
44
- },
45
- subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
46
- type: Number,
47
- default: -1
48
- },
49
- subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
50
- type: String,
51
- default: ''
52
- },
41
+ export default {
42
+ name: "number-widget",
43
+ componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
44
+ mixins: [emitter, fieldMixin, i18n],
45
+ props: {
46
+ field: Object,
47
+ parentWidget: Object,
48
+ parentList: Array,
49
+ indexOfParentList: Number,
50
+ designer: Object,
53
51
 
52
+ designState: {
53
+ type: Boolean,
54
+ default: false,
54
55
  },
55
- components: {
56
- FormItemWrapper,
56
+
57
+ subFormRowIndex: {
58
+ /* 子表单组件行索引,从0开始计数 */ type: Number,
59
+ default: -1,
57
60
  },
58
- inject: ['refList', 'globalOptionData', 'globalModel'],
59
- data() {
60
- return {
61
- oldFieldValue: null, //field组件change之前的值
62
- fieldModel: undefined,
63
- rules: [],
64
- }
61
+ subFormColIndex: {
62
+ /* 子表单组件列索引,从0开始计数 */ type: Number,
63
+ default: -1,
65
64
  },
66
- computed: {
67
-
65
+ subFormRowId: {
66
+ /* 子表单组件行Id,唯一id且不可变 */ type: String,
67
+ default: "",
68
68
  },
69
- beforeCreate() {
70
- /* 这里不能访问方法和属性!! */
69
+ },
70
+ components: {
71
+ FormItemWrapper,
72
+ },
73
+ inject: ["refList", "globalOptionData", "globalModel"],
74
+ data() {
75
+ return {
76
+ oldFieldValue: null, //field组件change之前的值
77
+ fieldModel: null,
78
+ rules: [],
79
+ };
80
+ },
81
+ computed: {
82
+ numberValue: {
83
+ get() {
84
+ let fieldModel = this.fieldModel;
85
+ return fieldModel === null ? undefined : fieldModel;
86
+ },
87
+ set(val) {
88
+ let newValue = val === undefined ? null : val;
89
+ this.fieldModel = newValue
90
+ let currentData =
91
+ this.tableParam && this.tableParam.row
92
+ ? this.tableParam.row
93
+ : this.formModel;
94
+ currentData[this.fieldKeyName] = newValue;
95
+ },
71
96
  },
97
+ },
98
+ beforeCreate() {
99
+ /* 这里不能访问方法和属性!! */
100
+ },
72
101
 
73
- created() {
74
- /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
102
+ created() {
103
+ /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
75
104
  需要在父组件created中初始化!! */
76
- this.registerToRefList()
77
- this.initFieldModel()
78
- this.initEventHandler()
79
- this.buildFieldRules()
105
+ this.registerToRefList();
106
+ this.initFieldModel();
107
+ this.initEventHandler();
108
+ this.buildFieldRules();
80
109
 
81
- this.handleOnCreated()
82
- },
110
+ this.handleOnCreated();
111
+ },
83
112
 
84
- mounted() {
85
- this.handleOnMounted()
86
- },
113
+ mounted() {
114
+ this.handleOnMounted();
115
+ },
87
116
 
88
- beforeDestroy() {
89
- this.unregisterFromRefList()
90
- },
91
-
92
- methods: {
117
+ beforeDestroy() {
118
+ this.unregisterFromRefList();
119
+ },
93
120
 
94
- }
95
- }
121
+ methods: {},
122
+ };
96
123
  </script>
97
124
 
98
125
  <style lang="scss" scoped>
99
- @import "~@/styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
100
-
101
- .full-width-input {
102
- width: 100% !important;
103
- }
126
+ @import "~@/styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
104
127
 
128
+ .full-width-input {
129
+ width: 100% !important;
130
+ }
105
131
  </style>
@@ -50,8 +50,8 @@ service.interceptors.request.use(
50
50
  config.data = window.commonDataUtil.handleForm(config.data, config.filterConfig);
51
51
  }
52
52
  if (
53
- (config.headers['Content-Type'] == "application/x-www-form-urlencoded" ||
54
- config.headers['Content-Type'] == "application/x-www-form-urlencoded;charset=UTF-8") &&
53
+ (config.headers['Content-Type'] === "application/x-www-form-urlencoded" ||
54
+ config.headers['Content-Type'] === "application/x-www-form-urlencoded;charset=UTF-8") &&
55
55
  typeof (config.data) !== 'string' && config.data) {
56
56
  config.data = qs.stringify(config.data);
57
57
  } else if (settingConfig.base64Urls && settingConfig.base64Urls.includes(config.url)) {
@@ -100,7 +100,7 @@ function removeModel(config) {
100
100
 
101
101
  async function handleNickName(option) {
102
102
  let {vueTarget, res, callback, config} = option;
103
- if (res.type != "success" || !res.objx) {
103
+ if (res.type !== "success" || !res.objx) {
104
104
  callback && callback(res)
105
105
  return
106
106
  }
@@ -135,14 +135,14 @@ async function handleNickName(option) {
135
135
  success: res2 => {
136
136
  let arr = res2.objx || [];
137
137
  if (createBy) {
138
- let obj = arr.find(item => item.loginAccount == createBy);
138
+ let obj = arr.find(item => item.loginAccount === createBy);
139
139
  if (obj && obj.nickName) {
140
140
  res.objx._createNickName = obj.nickName;
141
141
  res.objx._createMobile = obj.mobile;
142
142
  }
143
143
  }
144
144
  if (modifyBy) {
145
- let obj = arr.find(item => item.loginAccount == modifyBy);
145
+ let obj = arr.find(item => item.loginAccount === modifyBy);
146
146
  if (obj && obj.nickName) {
147
147
  res.objx._modifyNickName = obj.nickName;
148
148
  res.objx._modifyMobile = obj.mobile;
@@ -163,16 +163,16 @@ function handleCreateInfo(config, res) {
163
163
  let _createBy = null;
164
164
  let _modifyBy = null;
165
165
  if (row._createNickName) {
166
- if (queryCreateInfo == "1") {
166
+ if (queryCreateInfo === "1") {
167
167
  _createBy = getCreateBy(row) + "(" + row._createNickName + ")";
168
- } else if (queryCreateInfo == "2") {
168
+ } else if (queryCreateInfo === "2") {
169
169
  _createBy = row._createNickName;
170
170
  }
171
171
  }
172
172
  if (row._modifyNickName) {
173
- if (queryCreateInfo == "1") {
173
+ if (queryCreateInfo === "1") {
174
174
  _modifyBy = getModifyBy(row) + "(" + row._modifyNickName + ")";
175
- } else if (queryCreateInfo == "2") {
175
+ } else if (queryCreateInfo === "2") {
176
176
  _modifyBy = row._modifyNickName;
177
177
  }
178
178
  }
@@ -180,7 +180,7 @@ function handleCreateInfo(config, res) {
180
180
  row._modifyBy = _modifyBy || getCreateBy(row) || null;
181
181
  }
182
182
  let data = res.objx;
183
- if (typeof res.objx == "object") {
183
+ if (typeof res.objx === "object") {
184
184
  if (Array.isArray(data)) {
185
185
  res.objx.forEach(item => {
186
186
  toDo(item);
@@ -222,7 +222,7 @@ function getModifyBy(row) {
222
222
 
223
223
  async function handleNickName2(option) {
224
224
  let {vueTarget, res, callback, config} = option;
225
- if (res.type != "success" || !res.objx) {
225
+ if (res.type !== "success" || !res.objx) {
226
226
  callback && callback(res)
227
227
  return
228
228
  }
@@ -263,14 +263,14 @@ async function handleNickName2(option) {
263
263
  let createBy = getCreateBy(item);
264
264
  let modifyBy = getModifyBy(item);
265
265
  if (createBy) {
266
- let obj = arr.find(item => item.loginAccount == createBy);
266
+ let obj = arr.find(item => item.loginAccount === createBy);
267
267
  if (obj && obj.nickName) {
268
268
  item._createNickName = obj.nickName;
269
269
  item._createMobile = obj.mobile;
270
270
  }
271
271
  }
272
272
  if (modifyBy) {
273
- let obj = arr.find(item => item.loginAccount == modifyBy);
273
+ let obj = arr.find(item => item.loginAccount === modifyBy);
274
274
  if (obj && obj.nickName) {
275
275
  item._modifyNickName = obj.nickName;
276
276
  item._modifyMobile = obj.mobile;
@@ -286,13 +286,13 @@ service.interceptors.response.use(
286
286
  async response => {
287
287
  const res = response.data;
288
288
  const config = response.config;
289
- if (config.resultType == "other") {
289
+ if (config.resultType === "other") {
290
290
  config.callback && config.callback(res, response);
291
291
  removeModel(config);
292
292
  return res;
293
293
  } else if (res.type) {
294
- if (res.type == "success") {
295
- if (settingConfig.queryCreateInfo !== false && config.queryCreateInfo && config.queryCreateInfo != "0") {
294
+ if (res.type === "success") {
295
+ if (settingConfig.queryCreateInfo !== false && config.queryCreateInfo && config.queryCreateInfo !== "0") {
296
296
  let vueTarget = config.vueTarget;
297
297
  await handleNickName({vueTarget, res, config});
298
298
  }
@@ -305,7 +305,7 @@ service.interceptors.response.use(
305
305
  removeModel(config);
306
306
  return res;
307
307
  } else {
308
- if (res.rmid == "999999999") {
308
+ if (res.rmid === "999999999") {
309
309
  removeModel(config);
310
310
  configUtil.logout();
311
311
  } else {
@@ -314,7 +314,7 @@ service.interceptors.response.use(
314
314
  if (config.modalStrictly !== true) {
315
315
  removeModel(config);
316
316
  }
317
- if (config.resultType != "special" && config.failMsg !== false) {
317
+ if (config.resultType !== "special" && config.failMsg !== false) {
318
318
  ErroreBox.msg(res);
319
319
  }
320
320
  }
@@ -329,7 +329,7 @@ service.interceptors.response.use(
329
329
  },
330
330
  error => {
331
331
  let config = error.config;
332
- if (error.response && error.response.data && error.response.data.rmid == "999999999") {
332
+ if (error.response && error.response.data && error.response.data.rmid === "999999999") {
333
333
  removeModel(config);
334
334
  configUtil.logout();
335
335
  } else {