cloudcc-cli 1.0.9 → 1.1.2

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/template/indexvue CHANGED
@@ -1,297 +1,297 @@
1
- <template>
2
- <div class="dev-button" :class="elePropObj.className" @mouseover="myMouseover">
3
- <el-button
4
- v-loading.fullscreen.lock="fullscreenLoading"
5
- element-loading-text="加载中,请稍后..."
6
- :style="`font-size:` + elePropObj.fontSize + `px`"
7
- :type="elePropObj.type"
8
- @click="handleClick"
9
- >{{ elePropObj.defaultValue }}</el-button
10
- >
11
- </div>
12
- </template>
13
-
14
- <script>
15
- import axios from "../utils/http";
16
- export default {
17
- name: "dev-button",
18
- props: {
19
- elePropObj: {
20
- type: Object,
21
- default: () => ({}),
22
- },
23
- eleEventObj: {
24
- type: Object,
25
- default: () => ({}),
26
- }
27
- },
28
- data() {
29
- return {
30
- fullscreenLoading: false,
31
- componentInfo: {
32
- component: "dev-button",
33
- compName: "按钮-dev",
34
- icon: "#icon-anniu",
35
- sort: 1,
36
- bizType: "基础组件",
37
- compDesc: "常用的操作按钮。",
38
- /* 组件分类:
39
- * public: 公开组件(其他组织可见)
40
- * private:私有组件(自己组织可见)
41
- * beta:组件测试版本
42
- */
43
- category: "private",
44
- },
45
- style: {
46
- unit: "px",
47
- width: 72,
48
- height: 38,
49
- top: 0,
50
- left: 0,
51
- rotate: 0,
52
- opacity: 1,
53
- },
54
- styleOption: {
55
- unit: {
56
- lable: "单位",
57
- type: "option",
58
- options: [
59
- {
60
- value: "px",
61
- label: "像素",
62
- },
63
- {
64
- value: "%",
65
- label: "百分比",
66
- },
67
- {
68
- value: "hw",
69
- label: "视口",
70
- },
71
- ],
72
- },
73
- width: {
74
- lable: "宽",
75
- type: "input",
76
- inputType: "number",
77
- },
78
- height: {
79
- lable: "高",
80
- type: "input",
81
- inputType: "number",
82
- },
83
- top: {
84
- lable: "y 坐标",
85
- type: "input",
86
- inputType: "number",
87
- },
88
- left: {
89
- lable: "x 坐标",
90
- type: "input",
91
- inputType: "number",
92
- },
93
- },
94
- propObj: {
95
- id: "",
96
- pageApi: "createPage",
97
- defaultValue: "按钮-dev",
98
- type: "primary",
99
- fontSize: 16,
100
- functionContent: `function test(conext,value) {
101
- alert(JSON.stringify(value.getObject()))
102
- }`,
103
- handleComponentId: "",
104
- axiosAddres: "http://localhost:8080/api/pc/1.0/school/add",
105
- className: "",
106
- },
107
- propOption: {
108
- className: {
109
- lable: "tailwind样式,'cc-'开头,多个空格隔开",
110
- type: "input",
111
- },
112
- defaultValue: {
113
- lable: "默认值",
114
- type: "defaultValueInput",
115
- },
116
- type: {
117
- lable: "主题",
118
- type: "option",
119
- options: [
120
- {
121
- value: "primary",
122
- label: "primary",
123
- },
124
- {
125
- value: "success",
126
- label: "success",
127
- },
128
- {
129
- value: "info",
130
- label: "info",
131
- },
132
- {
133
- value: "warning",
134
- label: "warning",
135
- },
136
- {
137
- value: "danger",
138
- label: "danger",
139
- },
140
- ],
141
- },
142
- fontSize: {
143
- lable: "字号",
144
- type: "input",
145
- inputType: "number",
146
- },
147
- handleComponentId: {
148
- lable: "组件ID,使用英文逗号分隔",
149
- type: "input",
150
- },
151
- functionContent: {
152
- lable: "方法体",
153
- type: "code",
154
- },
155
- axiosAddres: {
156
- lable: "网络请求地址",
157
- type: "code",
158
- },
159
- },
160
- events:{
161
- myCreated: `function created(self) {
162
- // self即this,本组件的vue实例
163
- }`,
164
- myMounted: `function mounted(self) {
165
- // self即this,本组件的vue实例
166
- }`,
167
- myDestroyed: `function destroyed(self) {
168
- // self即this,本组件的vue实例
169
- }`,
170
- myMouseover: `function myMouseover(self) {
171
- // self即this,本组件的vue实例
172
- }`,
173
- },
174
- eventsOption:{
175
- myCreated: {
176
- lable: "创建:",
177
- type: "code",
178
- },
179
- myMounted: {
180
- lable: "显示:",
181
- type: "code",
182
- },
183
- myDestroyed: {
184
- lable: "销毁:",
185
- type: "code",
186
- },
187
- myMouseover: {
188
- lable: "鼠标移入:",
189
- type: "code",
190
- },
191
- },
192
- animations: [],
193
- groupStyle: {},
194
- isLock: false,
195
- };
196
- },
197
- created() {
198
- if (this.$Components.get('editMode') == "edit") { // 编辑模式不触发
199
- return
200
- }
201
- let myCreated = eval(
202
- "(false || " + this.eleEventObj.myCreated + ")"
203
- );
204
- myCreated(this)
205
- },
206
- mounted() {
207
- if (this.$Components.get('editMode') == "edit") { // 编辑模式不触发
208
- return
209
- }
210
- let myMounted = eval(
211
- "(false || " + this.eleEventObj.myMounted + ")"
212
- );
213
- myMounted(this)
214
- },
215
- destroyed() {
216
- let myDestroyed = eval(
217
- "(false || " + this.eleEventObj.myDestroyed + ")"
218
- );
219
- myDestroyed(this)
220
- },
221
- methods: {
222
- myMouseover() {
223
- let mouseoverEvent = eval(
224
- "(false || " + this.eleEventObj.myMouseover + ")"
225
- );
226
- mouseoverEvent(this)
227
- },
228
- handleClick() {
229
- if (
230
- null == this.elePropObj.handleComponentId ||
231
- "" == this.elePropObj.handleComponentId
232
- ) {
233
- return;
234
- }
235
- let components = this.elePropObj.handleComponentId
236
- .split(",")
237
- .map((item) => {
238
- return this.$Components.get(item);
239
- });
240
- let test = eval("(false || " + this.elePropObj.functionContent + ")");
241
- // 接收请求体,访问接口
242
- let body = test(
243
- this.$Components.get(this.elePropObj.pageApi),
244
- ...components
245
- );
246
- if (this.elePropObj.axiosAddres && body) {
247
- this.handleAxios(this.elePropObj.axiosAddres, body);
248
- }
249
- },
250
- /**
251
- * 网络请求
252
- */
253
- handleAxios(path, params) {
254
- this.fullscreenLoading = true;
255
- axios
256
- .postLight(path, params)
257
- .then(
258
- (res) => {
259
- this.fullscreenLoading = false;
260
- if (res.returnCode == 200 || "1" == res.returnCode) {
261
- this.$message({
262
- message: "提交成功",
263
- type: "success",
264
- });
265
- }
266
- },
267
- (err) => {
268
- this.fullscreenLoading = false;
269
- this.$message({
270
- message: err,
271
- type: "error",
272
- });
273
- }
274
- )
275
- .catch((error) => {
276
- this.fullscreenLoading = false;
277
- this.$message({
278
- message: error,
279
- type: "error",
280
- });
281
- });
282
- },
283
- },
284
- };
285
- </script>
286
- <style scoped>
287
- .dev-button {
288
- height: 100%;
289
- width: 100%;
290
- padding: 0px !important;
291
- }
292
- .dev-button .el-button {
293
- height: 100%;
294
- width: 100%;
295
- padding: 0px !important;
296
- }
1
+ <template>
2
+ <div class="dev-button" :class="elePropObj.className" @mouseover="myMouseover">
3
+ <el-button
4
+ v-loading.fullscreen.lock="fullscreenLoading"
5
+ element-loading-text="加载中,请稍后..."
6
+ :style="`font-size:` + elePropObj.fontSize + `px`"
7
+ :type="elePropObj.type"
8
+ @click="handleClick"
9
+ >{{ elePropObj.defaultValue }}</el-button
10
+ >
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ import axios from "../utils/http";
16
+ export default {
17
+ name: "dev-button",
18
+ props: {
19
+ elePropObj: {
20
+ type: Object,
21
+ default: () => ({}),
22
+ },
23
+ eleEventObj: {
24
+ type: Object,
25
+ default: () => ({}),
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ fullscreenLoading: false,
31
+ componentInfo: {
32
+ component: "dev-button",
33
+ compName: "按钮-dev",
34
+ icon: "#icon-anniu",
35
+ sort: 1,
36
+ bizType: "基础组件",
37
+ compDesc: "常用的操作按钮。",
38
+ /* 组件分类:
39
+ * public: 公开组件(其他组织可见)
40
+ * private:私有组件(自己组织可见)
41
+ * beta:组件测试版本
42
+ */
43
+ category: "private",
44
+ },
45
+ style: {
46
+ unit: "px",
47
+ width: 72,
48
+ height: 38,
49
+ top: 0,
50
+ left: 0,
51
+ rotate: 0,
52
+ opacity: 1,
53
+ },
54
+ styleOption: {
55
+ unit: {
56
+ lable: "单位",
57
+ type: "option",
58
+ options: [
59
+ {
60
+ value: "px",
61
+ label: "像素",
62
+ },
63
+ {
64
+ value: "%",
65
+ label: "百分比",
66
+ },
67
+ {
68
+ value: "hw",
69
+ label: "视口",
70
+ },
71
+ ],
72
+ },
73
+ width: {
74
+ lable: "宽",
75
+ type: "input",
76
+ inputType: "number",
77
+ },
78
+ height: {
79
+ lable: "高",
80
+ type: "input",
81
+ inputType: "number",
82
+ },
83
+ top: {
84
+ lable: "y 坐标",
85
+ type: "input",
86
+ inputType: "number",
87
+ },
88
+ left: {
89
+ lable: "x 坐标",
90
+ type: "input",
91
+ inputType: "number",
92
+ },
93
+ },
94
+ propObj: {
95
+ id: "",
96
+ pageApi: "createPage",
97
+ defaultValue: "按钮-dev",
98
+ type: "primary",
99
+ fontSize: 16,
100
+ functionContent: `function test(conext,value) {
101
+ alert(JSON.stringify(value.getObject()))
102
+ }`,
103
+ handleComponentId: "",
104
+ axiosAddres: "http://localhost:8080/api/pc/1.0/school/add",
105
+ className: "",
106
+ },
107
+ propOption: {
108
+ className: {
109
+ lable: "tailwind样式,'cc-'开头,多个空格隔开",
110
+ type: "input",
111
+ },
112
+ defaultValue: {
113
+ lable: "默认值",
114
+ type: "defaultValueInput",
115
+ },
116
+ type: {
117
+ lable: "主题",
118
+ type: "option",
119
+ options: [
120
+ {
121
+ value: "primary",
122
+ label: "primary",
123
+ },
124
+ {
125
+ value: "success",
126
+ label: "success",
127
+ },
128
+ {
129
+ value: "info",
130
+ label: "info",
131
+ },
132
+ {
133
+ value: "warning",
134
+ label: "warning",
135
+ },
136
+ {
137
+ value: "danger",
138
+ label: "danger",
139
+ },
140
+ ],
141
+ },
142
+ fontSize: {
143
+ lable: "字号",
144
+ type: "input",
145
+ inputType: "number",
146
+ },
147
+ handleComponentId: {
148
+ lable: "组件ID,使用英文逗号分隔",
149
+ type: "input",
150
+ },
151
+ functionContent: {
152
+ lable: "方法体",
153
+ type: "code",
154
+ },
155
+ axiosAddres: {
156
+ lable: "网络请求地址",
157
+ type: "code",
158
+ },
159
+ },
160
+ events:{
161
+ myCreated: `function created(self) {
162
+ // self即this,本组件的vue实例
163
+ }`,
164
+ myMounted: `function mounted(self) {
165
+ // self即this,本组件的vue实例
166
+ }`,
167
+ myDestroyed: `function destroyed(self) {
168
+ // self即this,本组件的vue实例
169
+ }`,
170
+ myMouseover: `function myMouseover(self) {
171
+ // self即this,本组件的vue实例
172
+ }`,
173
+ },
174
+ eventsOption:{
175
+ myCreated: {
176
+ lable: "创建:",
177
+ type: "code",
178
+ },
179
+ myMounted: {
180
+ lable: "显示:",
181
+ type: "code",
182
+ },
183
+ myDestroyed: {
184
+ lable: "销毁:",
185
+ type: "code",
186
+ },
187
+ myMouseover: {
188
+ lable: "鼠标移入:",
189
+ type: "code",
190
+ },
191
+ },
192
+ animations: [],
193
+ groupStyle: {},
194
+ isLock: false,
195
+ };
196
+ },
197
+ created() {
198
+ if (this.$Components.get('editMode') == "edit") { // 编辑模式不触发
199
+ return
200
+ }
201
+ let myCreated = eval(
202
+ "(false || " + this.eleEventObj.myCreated + ")"
203
+ );
204
+ myCreated(this)
205
+ },
206
+ mounted() {
207
+ if (this.$Components.get('editMode') == "edit") { // 编辑模式不触发
208
+ return
209
+ }
210
+ let myMounted = eval(
211
+ "(false || " + this.eleEventObj.myMounted + ")"
212
+ );
213
+ myMounted(this)
214
+ },
215
+ destroyed() {
216
+ let myDestroyed = eval(
217
+ "(false || " + this.eleEventObj.myDestroyed + ")"
218
+ );
219
+ myDestroyed(this)
220
+ },
221
+ methods: {
222
+ myMouseover() {
223
+ let mouseoverEvent = eval(
224
+ "(false || " + this.eleEventObj.myMouseover + ")"
225
+ );
226
+ mouseoverEvent(this)
227
+ },
228
+ handleClick() {
229
+ if (
230
+ null == this.elePropObj.handleComponentId ||
231
+ "" == this.elePropObj.handleComponentId
232
+ ) {
233
+ return;
234
+ }
235
+ let components = this.elePropObj.handleComponentId
236
+ .split(",")
237
+ .map((item) => {
238
+ return this.$Components.get(item);
239
+ });
240
+ let test = eval("(false || " + this.elePropObj.functionContent + ")");
241
+ // 接收请求体,访问接口
242
+ let body = test(
243
+ this.$Components.get(this.elePropObj.pageApi),
244
+ ...components
245
+ );
246
+ if (this.elePropObj.axiosAddres && body) {
247
+ this.handleAxios(this.elePropObj.axiosAddres, body);
248
+ }
249
+ },
250
+ /**
251
+ * 网络请求
252
+ */
253
+ handleAxios(path, params) {
254
+ this.fullscreenLoading = true;
255
+ axios
256
+ .postLight(path, params)
257
+ .then(
258
+ (res) => {
259
+ this.fullscreenLoading = false;
260
+ if (res.returnCode == 200 || "1" == res.returnCode) {
261
+ this.$message({
262
+ message: "提交成功",
263
+ type: "success",
264
+ });
265
+ }
266
+ },
267
+ (err) => {
268
+ this.fullscreenLoading = false;
269
+ this.$message({
270
+ message: err,
271
+ type: "error",
272
+ });
273
+ }
274
+ )
275
+ .catch((error) => {
276
+ this.fullscreenLoading = false;
277
+ this.$message({
278
+ message: error,
279
+ type: "error",
280
+ });
281
+ });
282
+ },
283
+ },
284
+ };
285
+ </script>
286
+ <style scoped>
287
+ .dev-button {
288
+ height: 100%;
289
+ width: 100%;
290
+ padding: 0px !important;
291
+ }
292
+ .dev-button .el-button {
293
+ height: 100%;
294
+ width: 100%;
295
+ padding: 0px !important;
296
+ }
297
297
  </style>
package/template/mainjs CHANGED
@@ -1,13 +1,13 @@
1
- import Vue from 'vue';
2
- import ElementUI from 'element-ui';
3
- Vue.use(ElementUI);
4
- import 'element-ui/lib/theme-chalk/index.css';
5
- import App from './App.vue';
6
-
7
- Vue.config.productionTip = false
8
-
9
- Vue.prototype.$Components = new Map()
10
-
11
- new Vue({
12
- render: h => h(App),
13
- }).$mount('#app')
1
+ import Vue from 'vue';
2
+ import ElementUI from 'element-ui';
3
+ Vue.use(ElementUI);
4
+ import 'element-ui/lib/theme-chalk/index.css';
5
+ import App from './App.vue';
6
+
7
+ Vue.config.productionTip = false
8
+
9
+ Vue.prototype.$Components = new Map()
10
+
11
+ new Vue({
12
+ render: h => h(App),
13
+ }).$mount('#app')