tianheng-ui 0.1.17 → 0.1.19

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": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.1.17",
4
+ "version": "0.1.19",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -73,7 +73,7 @@ export default {
73
73
  return {};
74
74
  }
75
75
  },
76
- data: {
76
+ config: {
77
77
  type: Object,
78
78
  default: () => {
79
79
  return {};
@@ -101,7 +101,7 @@ export default {
101
101
  },
102
102
  data() {
103
103
  return {
104
- formJson: this.data,
104
+ formJson: this.config,
105
105
  models: {},
106
106
  componentsData: [],
107
107
  axios: null
@@ -116,12 +116,12 @@ export default {
116
116
  }
117
117
  },
118
118
  watch: {
119
- data(val) {
119
+ config(val) {
120
120
  this.setJSON(val);
121
121
  },
122
122
  formJson: {
123
123
  handler(val) {
124
- this.$emit("update:data", val);
124
+ this.$emit("update:config", val);
125
125
  },
126
126
  deep: true
127
127
  },
@@ -118,9 +118,7 @@ export default {
118
118
  },
119
119
  props: {},
120
120
  mixins: [configComponent],
121
- mounted() {
122
- console.log(this.widget);
123
- },
121
+ mounted() {},
124
122
  methods: {
125
123
  handleAddImage() {
126
124
  const obj = {
@@ -194,7 +194,7 @@ export default {
194
194
  GenerateForm
195
195
  },
196
196
  props: {
197
- data: {
197
+ config: {
198
198
  type: Object,
199
199
  default: () => {
200
200
  return { config: {}, list: [] };
@@ -261,7 +261,7 @@ export default {
261
261
  this.layoutComponents = layoutComponents;
262
262
  this.baseConfig = deepClone(baseConfig);
263
263
  return {
264
- widgetFormData: this.data,
264
+ widgetFormData: this.config,
265
265
  widgetFormSelect: {},
266
266
  widgetValue: {},
267
267
  configTab: "widget",
@@ -292,11 +292,11 @@ export default {
292
292
  widgetFormData: {
293
293
  deep: true,
294
294
  handler: function(val) {
295
- this.$emit("update:data", val);
296
- this.$emit("on-change", val);
295
+ this.$emit("update:config", val);
296
+ // this.$emit("on-change", val);
297
297
  }
298
298
  },
299
- data(val) {
299
+ config(val) {
300
300
  if (val && val.config) {
301
301
  val.config = Object.assign(this.baseConfig, val.config);
302
302
  }
@@ -2,7 +2,7 @@
2
2
  <div class="th-table-making th-flex_box">
3
3
  <div class="th-fiex_content">
4
4
  <widget-tools
5
- :config="config"
5
+ :config="tableConfig"
6
6
  :client="client"
7
7
  :permissions="permissions"
8
8
  @click="handleToolsClick"
@@ -11,12 +11,12 @@
11
11
  </widget-tools>
12
12
  <widget-table
13
13
  style="height:calc(100% - 45px)"
14
- :config="config"
14
+ :config="tableConfig"
15
15
  ></widget-table>
16
16
  </div>
17
17
  <div class="th-flex_aside th-is_border_left" style="width:300px">
18
18
  <widget-config
19
- :config="config"
19
+ :config="tableConfig"
20
20
  :fields.sync="fields"
21
21
  :formOptions="formOptions"
22
22
  :apiOptions="apiOptions"
@@ -36,7 +36,7 @@ export default {
36
36
  name: "ThTableMaking",
37
37
  components: { WidgetTools, WidgetTable, WidgetConfig },
38
38
  props: {
39
- data: {
39
+ config: {
40
40
  type: Object,
41
41
  default: () => {
42
42
  return deepClone(tableConfig);
@@ -88,19 +88,19 @@ export default {
88
88
  },
89
89
  data() {
90
90
  return {
91
- config: this.data,
91
+ tableConfig: this.data,
92
92
  client: "monitor"
93
93
  };
94
94
  },
95
95
  watch: {
96
- config: {
96
+ tableConfig: {
97
97
  deep: true,
98
98
  handler: function(val) {
99
- this.$emit("update:data", val);
99
+ this.$emit("update:config", val);
100
100
  }
101
101
  },
102
- data(val) {
103
- this.config = val;
102
+ config(val) {
103
+ this.tableConfig = val;
104
104
  this.handleNetwork();
105
105
  },
106
106
  apiOptions(val) {
@@ -114,12 +114,12 @@ export default {
114
114
  this.apiOptions.map(item => {
115
115
  network[item.id] = item;
116
116
  });
117
- this.config.network = network;
117
+ this.tableConfig.network = network;
118
118
  },
119
119
  handleToolsClick(action, data) {
120
120
  switch (action) {
121
121
  case "import-json":
122
- this.config = data;
122
+ this.tableConfig = data;
123
123
  break;
124
124
 
125
125
  default:
@@ -132,22 +132,22 @@ export default {
132
132
  .handleFormValidate()
133
133
  .then(res => {
134
134
  if (res) {
135
- const data = deepClone(this.config);
135
+ const data = deepClone(this.tableConfig);
136
136
  resolve(data);
137
137
  } else {
138
138
  reject();
139
139
  }
140
140
  })
141
141
  .catch(err => {
142
- if (!this.config.table.title) {
142
+ if (!this.tableConfig.table.title) {
143
143
  this.$message.warning("请选择列表名称");
144
144
  return reject();
145
145
  }
146
- if (!this.config.table.mounted.api) {
146
+ if (!this.tableConfig.table.mounted.api) {
147
147
  this.$message.warning("请选择列表接口");
148
148
  return reject();
149
149
  }
150
- const data = deepClone(this.config);
150
+ const data = deepClone(this.tableConfig);
151
151
  resolve(data);
152
152
  })
153
153
  );