|
@@ -58,41 +58,6 @@ export default {
|
|
|
onUnload() {},
|
|
onUnload() {},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(["getSelectInfo"]),
|
|
...mapGetters(["getSelectInfo"]),
|
|
|
- filterProductInfoxxxx() {
|
|
|
|
|
- let list = copyObject(this.productInfo);
|
|
|
|
|
- if (this.py) {
|
|
|
|
|
- let commonChildList = [];
|
|
|
|
|
- list.forEach(ele => {
|
|
|
|
|
- //过滤常用
|
|
|
|
|
- if(ele.classId != -2){
|
|
|
|
|
- if (!this.$util.isEmpty(ele.child)) {
|
|
|
|
|
- ele.child.forEach(obj => {
|
|
|
|
|
- let hasName = obj.itemName && obj.itemName.indexOf(this.py) >= 0;
|
|
|
|
|
- let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
|
|
|
|
|
- let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
|
|
|
|
|
- if (hasName || hasPy) {
|
|
|
|
|
- if(this.$util.isEmpty(commonChildList)){
|
|
|
|
|
- commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
|
|
|
|
|
- }else{
|
|
|
|
|
- commonChildList.forEach(res => {
|
|
|
|
|
- if(res.classId==ele.classId){
|
|
|
|
|
- res.child.push(obj)
|
|
|
|
|
- }else{
|
|
|
|
|
- commonChildList.push({classId: ele.classId, className: ele.className,child:[obj]});
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- list = this.$util.unique(commonChildList)
|
|
|
|
|
- this.suitClassIndex = 0;
|
|
|
|
|
- }
|
|
|
|
|
- return list;
|
|
|
|
|
- },
|
|
|
|
|
/**
|
|
/**
|
|
|
* 搜索、初始化数据
|
|
* 搜索、初始化数据
|
|
|
* */
|
|
* */
|
|
@@ -1028,6 +993,12 @@ export default {
|
|
|
searchFn() {
|
|
searchFn() {
|
|
|
let list = copyObject(this.productInfo);
|
|
let list = copyObject(this.productInfo);
|
|
|
if(!this.$util.isEmpty(this.py)){
|
|
if(!this.$util.isEmpty(this.py)){
|
|
|
|
|
+
|
|
|
|
|
+ //大于等于2个字符才开始搜索 shish 20210622
|
|
|
|
|
+ if(this.py.length <=1){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
clearInterval(this.timeFun)
|
|
clearInterval(this.timeFun)
|
|
|
let commonChildList = [];
|
|
let commonChildList = [];
|
|
|
list.forEach(ele => {
|
|
list.forEach(ele => {
|
|
@@ -1035,9 +1006,10 @@ export default {
|
|
|
if(ele.classId != -2){
|
|
if(ele.classId != -2){
|
|
|
if (!this.$util.isEmpty(ele.child)) {
|
|
if (!this.$util.isEmpty(ele.child)) {
|
|
|
ele.child.forEach(obj => {
|
|
ele.child.forEach(obj => {
|
|
|
- let hasName = obj.itemName && obj.itemName.indexOf(this.py) >= 0;
|
|
|
|
|
|
|
+ //开头要匹配 shish 20210622
|
|
|
|
|
+ let hasName = obj.itemName && obj.itemName.indexOf(this.py) == 0;
|
|
|
let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
|
|
let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
|
|
|
- let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
|
|
|
|
|
|
|
+ let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) == 0;
|
|
|
if (hasName || hasPy) {
|
|
if (hasName || hasPy) {
|
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
|
commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
|
|
commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
|