tianheng-ui 0.1.18 → 0.1.20

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.18",
4
+ "version": "0.1.20",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -121,7 +121,7 @@ export default {
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
  },
@@ -292,8 +292,8 @@ 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
299
  config(val) {
@@ -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"
@@ -31,7 +31,7 @@ import WidgetTools from "./WidgetTools.vue";
31
31
  import WidgetTable from "./widgetTable.vue";
32
32
  import WidgetConfig from "./widgetConfig.vue";
33
33
  import { deepClone, deepMerge } from "./util/index";
34
- import { tableConfig } from "./custom/config";
34
+ import { baseConfig } from "./custom/config";
35
35
  export default {
36
36
  name: "ThTableMaking",
37
37
  components: { WidgetTools, WidgetTable, WidgetConfig },
@@ -39,7 +39,7 @@ export default {
39
39
  config: {
40
40
  type: Object,
41
41
  default: () => {
42
- return deepClone(tableConfig);
42
+ return deepClone(baseConfig);
43
43
  }
44
44
  },
45
45
  fields: Array,
@@ -88,19 +88,19 @@ export default {
88
88
  },
89
89
  data() {
90
90
  return {
91
- config: this.data,
91
+ tableConfig: this.config,
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
  );