htui-yllkbz 1.3.93 → 1.3.95

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,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.3.93",
3
+ "version": "1.3.95",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-12-30 14:29:14
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-02-01 16:55:50
7
+ * @LastEditTime: 2023-02-10 14:36:51
8
8
  -->
9
9
  <template>
10
10
  <span v-if="readonly">
@@ -101,15 +101,27 @@ export default class HtSelectUser extends Vue {
101
101
  } else {
102
102
  arr = val.split(',');
103
103
  }
104
+ const sessionDataStr = window.localStorage.getItem('assetCategory');
105
+ let sessionData: any[] = [];
106
+ if (sessionDataStr) {
107
+ sessionData = JSON.parse(sessionDataStr);
108
+ }
104
109
  arr.forEach((item) => {
105
- _axios
106
- .get(`/asset_manage/api/asset-management/asset-categories/${item}`)
107
- .then((res) => {
108
- const data = res.data;
109
- this.state.positionName.push(
110
- `${data.displayName}${data.code ? `(${data.code})` : ''}`
111
- );
112
- });
110
+ if (sessionData.length) {
111
+ const data = sessionData.find((cat) => cat.id === item);
112
+ this.state.positionName.push(
113
+ `${data.displayName}${data.code ? `(${data.code})` : ''}`
114
+ );
115
+ } else {
116
+ _axios
117
+ .get(`/asset_manage/api/asset-management/asset-categories/${item}`)
118
+ .then((res) => {
119
+ const data = res.data;
120
+ this.state.positionName.push(
121
+ `${data.displayName}${data.code ? `(${data.code})` : ''}`
122
+ );
123
+ });
124
+ }
113
125
  });
114
126
  } else {
115
127
  this.state.positionName = [];
@@ -125,6 +137,7 @@ export default class HtSelectUser extends Vue {
125
137
  .then((res) => {
126
138
  const data = res.data.items || [];
127
139
  this.state.dataSource = data;
140
+ // window.localStorage.setItem('assetCategory', JSON.stringify(data));
128
141
  });
129
142
  }
130
143
  /** 方法 */
package/lib/demo.html DELETED
@@ -1,10 +0,0 @@
1
- <meta charset="utf-8">
2
- <title>htui demo</title>
3
- <script src="./htui.umd.js"></script>
4
-
5
- <link rel="stylesheet" href="./htui.css">
6
-
7
-
8
- <script>
9
- console.log(htui)
10
- </script>