Skip to content

Commit

Permalink
fix: update plan
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Jul 23, 2024
1 parent 00068cc commit de3a736
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/manufacture/ItemIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<script>
import Item from "@jx3box/jx3box-editor/src/Item";
// import { get_item } from "../service/item.js";
import { get_item } from "@/service/item.js";
import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
Expand Down
4 changes: 2 additions & 2 deletions src/components/manufacture/Plan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default {
_arr.push(el.id);
});
});
searchItemsID({ ids: _arr, limit: _arr.length }).then((res) => {
searchItemsID({ ids: _arr }).then((res) => {
let items = res.data;
data.relation = data.relation.map((item) => {
Expand All @@ -165,7 +165,7 @@ export default {
for (const key in data.relation) {
_arr.push(...data.relation[key]);
}
searchItemsID({ ids: _arr, limit: _arr.length }).then((res) => {
searchItemsID({ ids: _arr }).then((res) => {
let items = res.data;
for (const key in data.relation) {
data.relation[key] = data.relation[key].map((el) => {
Expand Down
10 changes: 8 additions & 2 deletions src/service/item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $cms, $next } from "@jx3box/jx3box-common/js/https";
import { $cms, $next, $node } from "@jx3box/jx3box-common/js/https";

function getProfile() {
return $cms({ mute: true })
Expand All @@ -14,5 +14,11 @@ function getGoodsData(params) {
});
}

// 获取物品
function get_item(item_id) {
if (!item_id) return;
return $node().get(`/item/${item_id}`);
}


export { getProfile, getGoodsData };
export { getProfile, getGoodsData, get_item };
8 changes: 4 additions & 4 deletions src/service/plan.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $helper, $cms } from "@jx3box/jx3box-common/js/https";
import { $cms, $node } from "@jx3box/jx3box-common/js/https";


// 获取列表
Expand All @@ -24,8 +24,8 @@ function delItemPlan(id) {

// 多个清单搜索
function searchItemsID(params) {
return $helper()
.get(`/api/items`, { params })
return $node()
.get(`/item/list`, { params })
.then((res) => {
return res.data.data;
});
Expand All @@ -48,4 +48,4 @@ function addMyPlan(data) {
return $cms().post(`/api/cms/app/item-plan`, data);
}

export { getItemPlans, getItemPlanID, delItemPlan, searchItemsID, getMyPlans, updatePlan, addMyPlan };
export { getItemPlans, getItemPlanID, delItemPlan, searchItemsID, getMyPlans, updatePlan, addMyPlan };

0 comments on commit de3a736

Please sign in to comment.