手动全选/取消全选
*/
selectAll(){
let keyList=[];
let list = [];
let oriList = this.list;
for(let item of oriList){
item.selected = this.tableOption.checkAll;
keyList.push(item.id);
}
},
scroll(){
let {hasMore, onLoading} = this;
if (canLoadMore(event, 150) && hasMore && !onLoading) {
this.page++;
this.loadList();
}
}
},
emits:['ok','hide']
} cannot be parsed!
at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:283:31
at Array.forEach ()
at Object.replaceSelBySel (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:196:22)
at AST.replace (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/Ast.js:421:19)
at appendEmitsProp (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/utils/scriptUtils.js:140:19)
at Object.module.exports [as rule] (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/src/emits-option.js:57:9)
at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:42:28
at Array.reduce ()
at transform (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:37:37)
at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/src/commands/transform.js:194:22
transform in progress: [------------------------------------------------------------------------------------] 3/1250 文件转换异常,规则:emitsOptions,文件:/Users/zhangsan/workspace/MCP_Vue3/src/commonModal/BillModal.vue Error: replace failed: export default {name: "BillModal", components: {BkEmpty}, title: "这里是页面或组件名字", mixins:[commonMixin, searchMixin], props:{ fkCompId:{ type:String, required:true }, single:Boolean, options: { type:Object, default(){ return {}; } }, billType:{//1 卖卡 2 收银 type:Number, default(){ return null; }, validator: function(value) { if(value==null || value ==undefined){ return true; } return [1, 2].includes(value); } } }, data() { return { visibleModel:true, keyword:"", typeId:"", discountTypeId:"", cooperateId:"", empJoinFlag:0, fkMemberId:null, searchObj:{ empJoinFlag:0, keyword:"", typeId:"", discountTypeId:"", cooperateId:"", fkMemberId:null }, page:1, hasMore:true, onLoading:false, list:[], selectedRowId:undefined, selectedRow:undefined, selectedRows:[], selectedRowKeys:[], tableOption:{ indeterminate:false, checkAll:false }, columnObj: { code: {text: "单号", key: "billNo", col:1}, showCreateTime: {text: "单据日期", key: "showCreateTime", col:1}, showStatus: {text: "状态", key: "showStatus", col:1}, name: {text: "项目", key: "projects", col:3}, totalPrice: {text: "金额", key: "totalPrice", align:"right", col:1} } }; }, created() { }, mounted() { this.changeQueryComp(this.fkCompId); let{keyword="", fkMemberId} = this.options; if(!isEmptyStrict(keyword)){ this.searchObj.keyword = keyword; } if(!isEmptyStrict(fkMemberId)){ this.searchObj.fkMemberId = fkMemberId; } this.visibleModel = true; this.search(); }, methods: { /**
加载页码 */ loadList(){ let {onLoading, page:pageNum, keyword, billType, fkCompId, fkMemberId} = this; if(onLoading){ return; } this.onLoading = true; queryBillList({fkCompId, keyword, fkMemberId, billType, pageNum}).then((res)=>{ this.onLoading = false; let{data} = res; if(data && data.success){ let{list, hasNextPage} = data.result;
}, /**
手动全选/取消全选 */ selectAll(){ let keyList=[]; let list = []; let oriList = this.list; for(let item of oriList){ item.selected = this.tableOption.checkAll; keyList.push(item.id); }
}, selectItem(item, type){ type!=="line" && item['selected'] = !item.selected; if(!this.single){ let{selectedRowKeys, selectedRows} = this; let index = selectedRowKeys.indexOf(item.id); if(!item.selected){ item['selected'] = true; selectedRowKeys.push(item.id); selectedRows.push(item); }else{ item['selected'] = false; selectedRowKeys.splice(index, 1); selectedRows.splice(index, 1); } Object.assign(this, {selectedRowKeys, selectedRows}); this.tableOption.indeterminate = selectedRowKeys.length>0 && this.list.length>0 && selectedRowKeys.length!==this.list.length;//重置半选状态 this.tableOption.checkAll = selectedRowKeys.length!==0 && selectedRowKeys.length===this.list.length; }else{ / this.selectedRowId = item.id; this.selectedRow = item; / if(this.selectedRow){ if(this.selectedRow.id===item.id){ item['selected'] = false;
}, scroll(){ let {hasMore, onLoading} = this; if (canLoadMore(event, 150) && hasMore && !onLoading) { this.page++; this.loadList(); } }
}, emits:['ok','hide'] } cannot be parsed! at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:283:31 at Array.forEach ()
at Object.replaceSelBySel (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/js-core/core.js:196:22)
at AST.replace (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/node_modules/gogocode/src/Ast.js:421:19)
at appendEmitsProp (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/utils/scriptUtils.js:140:19)
at Object.module.exports [as rule] (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/src/emits-option.js:57:9)
at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:42:28
at Array.reduce ()
at transform (/Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-plugin-vue/index.js:37:37)
at /Users/zhangsan/.nvm/versions/node/v16.16.0/lib/node_modules/gogocode-cli/src/commands/transform.js:194:22