tianheng-ui 0.0.84 → 0.0.85

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.0.84",
4
+ "version": "0.0.85",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -96,6 +96,7 @@ export default {
96
96
  },
97
97
  data() {
98
98
  return {
99
+ id: "",
99
100
  tableJson: {},
100
101
  axios: null,
101
102
  networkConfig: {},
@@ -174,6 +175,8 @@ export default {
174
175
  };
175
176
  },
176
177
  created() {
178
+ const code = this.$route.path.split("/").pop();
179
+ this.id = code;
177
180
  this.initConfig();
178
181
  },
179
182
  mounted() {},
@@ -183,8 +186,7 @@ export default {
183
186
  this.axios = Axios.init(this.config);
184
187
  const info = sessionStorage.getItem("th_oauth_info");
185
188
  if (info) {
186
- const code = this.$route.params.id;
187
- this.requestConfigData(code);
189
+ this.requestConfigData();
188
190
  } else {
189
191
  // 模拟授权认证流程
190
192
  this.axios({
@@ -195,14 +197,13 @@ export default {
195
197
  }).then(res => {
196
198
  const oauthInfo = { token: res.data, baseUrl: "" };
197
199
  sessionStorage.setItem("th_oauth_info", JSON.stringify(oauthInfo));
198
- const code = this.$route.params.id;
199
- this.requestConfigData(code);
200
+ this.requestConfigData();
200
201
  });
201
202
  }
202
203
  },
203
204
  // 获取配置信息
204
205
  requestConfigData(code) {
205
- this.tableJson = tableItemConfig(code);
206
+ this.tableJson = tableItemConfig(this.id);
206
207
  // 网络请求
207
208
  this.networkConfig = this.tableJson.network;
208
209
 
@@ -296,7 +296,7 @@ const tableConfig = {
296
296
  add: { show: true, name: "新增", position: 1, form: { id: "1" } },
297
297
  edit: { show: true, name: "编辑", position: 2, form: { id: "1" } },
298
298
  detail: { show: false, name: "查看", position: 2, form: { id: "1" } },
299
- delete: { show: true, name: "删除", position: 2 },
299
+ delete: { show: false, name: "删除", position: 2 },
300
300
  batchDelete: { show: true, name: "批量删除", position: 1 },
301
301
  export: { show: true, name: "导出", position: 1 },
302
302
  import: { show: true, name: "导入", position: 1 },