天梦星服务平台 (tmxkj.top)https://tmxkj.top/#/
1.第一步 需要一个数组数据
{
"week": "全部",
"hOutName": null,
"weekendPrice": null,
"channel": "门市价",
"hOutId": 98,
"cTime": "2024-03-18 15:42:07",
"weekdayPrice": 120.00,
"arithmeticType": null,
"sId": 1,
"pOutId": null,
"pOutName": null,
"changePriceType": "指定金额",
"holidayPrice": null,
"startTime": "2024-03-20",
"endTime": "2024-03-20",
"id": 34,
"cUserCode": "19969123206",
"changePriceRule": null
},
{
"week": "全部",
"hOutName": null,
"weekendPrice": null,
"channel": "门市价",
"hOutId": 98,
"cTime": "2024-03-18 15:40:41",
"weekdayPrice": 12.00,
"arithmeticType": null,
"sId": 1,
"pOutId": null,
"pOutName": null,
"changePriceType": "指定金额",
"holidayPrice": null,
"startTime": "2024-03-20",
"endTime": "2024-03-21",
"id": 33,
"cUserCode": "19969123206",
"changePriceRule": null
},
2.第二步 需要一个程序员把以下方法复制进去
const data = [{
"week": "全部",
"hOutName": null,
"weekendPrice": null,
"channel": "门市价",
"hOutId": 98,
"cTime": "2024-03-18 15:42:07",
"weekdayPrice": 120.00,
"arithmeticType": null,
"sId": 1,
"pOutId": null,
"pOutName": null,
"changePriceType": "指定金额",
"holidayPrice": null,
"startTime": "2024-03-20",
"endTime": "2024-03-20",
"id": 34,
"cUserCode": "19969123206",
"changePriceRule": null
}];
const valueToMatch = "门市价"; // 需要匹配的值
const result = data.filter(item => {
return Object.values(item).some(val => val?.toString().includes(valueToMatch));
});
console.log(result);
3.第三步 你可以关闭页面了
好孩子 加油!