提交
取 消
new Vue({
el: '#app',
data: {
fullLoad:'',dialogVisible:false,
jsonData:{"id":"","type":"edit","list":[{"type":"grid","icon":"icon-grid-","columns":[{"span":8,"list":[{"type":"select","icon":"icon-select","options":{"defaultValue":"1","placeholder":"请选择评论状态","width":"","options":[{"label":"未审核","value":"1"},{"label":"审核通过","value":"2"},{"value":"3","label":"审核拒绝"}],"remoteFunc":"func_1600224935000_46847","labelWidth":"60px","remote":false,"checkAble":["clearable","autosize","新选项","showLabel"]},"remoteOptions":{"keyField":"articleId","valueField":"articleName","remote":false,"remoteFunc":"HttpPost","url":"/sysmgr/systype/list","params":"{\"parentTypeCode\": \"aaaa\"}","endEventDo":"upDataSource","dataFiled":""},"name":"状态","key":"1600224935000_46847","model":"state","rules":[]}]},{"span":8,"list":[{"type":"input","icon":"icon-input","rules":[],"options":{"width":"80%","defaultValue":"","required":false,"dataType":"string","pattern":"","placeholder":"","disabled":false,"check":{},"remoteFunc":"func_1596184567000_74838","checkAble":["clearable"],"labelWidth":"100px"},"name":"关键字","key":"1596184567000_74838","model":"commName"}]},{"span":4,"list":[{"type":"button","icon":"icon-diy-com-textarea","options":{"width":"140px","size":"medium","type":"warning","icon":"","placeholder":"搜索","disabled":false,"plain":false,"round":false,"circle":false,"autofocus":false,"remoteFunc":"func_1594536588000_16800","labelWidth":"20px","checkAble":["clearable"]},"actions":{"remoteFunc":"qryCommInfoList","url":"qryCommInfoList","params":"{\"industryId\":10000}","endEventDo":"upPageDataSource","dataFiled":"listData"},"name":"","key":"1600236630000_12867","model":"searchBtn","rules":[]}]},{"span":4,"list":[{"type":"button","icon":"icon-diy-com-textarea","options":{"width":"140px","size":"medium","type":"warning","icon":"","placeholder":"审核","disabled":false,"plain":false,"round":false,"circle":false,"autofocus":false,"remoteFunc":"func_1594536588000_16800","labelWidth":"20px","checkAble":["clearable"]},"actions":{"remoteFunc":"postShInforeloadList","url":"qryCommInfoList","params":"{\"industryId\":10000}","endEventDo":"upPageDataSource","dataFiled":"listData"},"name":"","key":"1594536588000_16800","model":"shBtn","rules":[]}]}],"options":{"gutter":0,"justify":"start","align":"top","remoteFunc":"func_1594535694000_6466","labelWidth":"100px","width":"auto","htmlStyle":"background-color: #fff;padding: 20px;border: solid 1px #f0f0f0;border-radius: 3px;"},"name":"栅格布局","key":"1594535694000_6466","model":"grid_1594535694000_6466","rules":[]},{"type":"table","icon":"icon-table","columns":[{"span":"6","prop":"commentId","label":"评论ID","type":"null","fixed":false,"width":"160","sortable":false,"resizable":true,"align":"left","list":[]},{"span":"6","prop":"code-27","label":"头像","type":"scope","fixed":false,"width":"80","sortable":false,"resizable":true,"align":"center","list":[{"type":"avatar","icon":"icon-tupianyulan","options":{"defaultValue":"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg","customClass":"","remoteFunc":"func_1596091590000_89660","labelWidth":"auto","width":"auto","size":"medium","fit":"fill","shape":"square"},"name":"","key":"1596091590000_89660","model":"USER_AVATAR","rules":[],"input_1593620080000_12696":"用户"}]},{"span":"6","prop":"code-1","label":"商品信息","type":"scope","fixed":false,"width":"300","sortable":false,"resizable":true,"align":"left","list":[{"type":"text","icon":"icon-wenzishezhi-","options":{"defaultValue":" ","customClass":"","remoteFunc":"func_1599729715000_26323"},"name":"评论人","key":"1599729715000_26323","model":"userName","rules":[]},{"type":"text","icon":"icon-wenzishezhi-","options":{"defaultValue":"-","customClass":"","remoteFunc":"func_1596090310000_91074","checkAble":["clearable","autosize"],"labelWidth":"auto"},"name":"商品ID","key":"1596090310000_91074","model":"commId","rules":[]},{"type":"text","icon":"icon-wenzishezhi-","options":{"defaultValue":"-","customClass":"","remoteFunc":"func_1596090313000_49595","checkAble":["clearable","autosize"]},"name":"商品名称","key":"1596090313000_49595","model":"goodsName","rules":[]}]},{"span":"6","prop":"evaluateCon","label":"评论信息","type":"null","fixed":false,"width":"","sortable":false,"resizable":true,"align":"left","list":[]},{"span":"6","prop":"seled","label":"选择","type":"selection","fixed":false,"width":"50","sortable":false,"resizable":true,"align":"left","list":[]}],"options":{"height":"auto","size":"","rowKey":"id","emptyText":"暂无数据","fit":true,"stripe":false,"border":true,"showHeader":true,"defaultExpandAll":false,"showSummary":false,"highlightCurrentRow":true,"remote":false,"remoteOptions":[],"props":{"value":"value","label":"label"},"remoteFunc":"func_1594534425000_9938","width":"auto","checkAble":["clearable","round","remote","fit","showHeader","highlightCurrentRow"],"labelWidth":"100px","htmlStyle":"min-height:400px;border-top:solid 1px #eee;margin-top: 10px;"},"remoteOptions":{"keyField":"commentId","valueField":"commName","remoteFunc":"qryCommInfoList","url":"qryCommInfoList","params":"{\"parentTypeCode\": \"aaaa\"}","endEventDo":"upPageDataSource","children":"children","dataFiled":"listData"},"name":"表格","key":"1594534425000_9938","model":"table_1594534425000_9938","rules":[]},{"type":"pagination","icon":"icon-diy-com-textarea","options":{"width":"auto","size":"medium","type":"primary","placeholder":"分页组件","labelWidth":"auto","pageSize":10,"prevText":"上一页","nextText":"下一页","layout":"total, sizes, prev, pager, next, jumper","checkAble":["clearable","round","hide-on-single-page","small"],"remoteFunc":"func_1596100431000_94157","htmlStyle":"margin:20px 10px;text-align:center"},"actions":{"remoteFunc":"qryCommInfoList","url":"qryCommInfoList","params":"{\"parentTypeCode\": \"aaaa\"}","endEventDo":"upPageDataSource","dataFiled":"listData","remote":true},"name":"","key":"1596100431000_94157","model":"pagination_1596100431000_94157","rules":[],"input_1593620080000_12696":"分页"}],"config":{"labelWidth":"auto","labelPosition":"right","size":"medium","remoteOptions":{"valueField":"articleName","remote":false,"remoteFunc":"HttpPost","url":"/sysmgr/systype/list","params":"{\"parentTypeCode\": \"aaaa\"}","endEventDo":"upDataSource","keyField":"articleId","dataFiled":""},"labelSuffix":":"}},
jsonData2: {"list":[{"type":"radio","icon":"icon-radio-active","options":{"inline":true,"defaultValue":"2","showLabel":true,"options":[{"value":"2","label":"通过"},{"value":"3","label":"不通过"}],"width":"","remote":false,"checkAble":["showLabel"],"remoteFunc":"func_1600228469000_17486"},"remoteOptions":{"keyField":"articleId","valueField":"articleName","remote":false,"remoteFunc":"HttpPost","url":"/sysmgr/systype/list","params":"{\"parentTypeCode\": \"aaaa\"}","endEventDo":"upDataSource","dataFiled":""},"name":"审核状态","key":"1600228469000_17486","model":"state","rules":[]},{"type":"textarea","icon":"icon-diy-com-textarea","options":{"width":"","defaultValue":"","required":false,"disabled":false,"pattern":"","placeholder":"","remoteFunc":"func_1600228476000_90849"},"name":"审核意见","key":"1600228476000_90849","model":"auditRemrk","rules":[]}],"config":{"labelWidth":"100px","labelPosition":"right","size":"small","customClass":""}},
editData: {},editData2: {},
remoteFuncs: {
}
},
created () {
console.info('--------------created' )
this.remoteFuncs.qryCommInfoList=this.qryCommInfoList;
this.remoteFuncs.postShInforeloadList=this.postShInforeloadList;
},
methods: {
/*查询评论列表*/
qryCommInfoList(widget, models, resolve){
let that=this;
console.info('--------------qryCommInfoList:',widget,models,this.editData)
let remoteOptions=widget && (widget.remoteOptions || widget.actions);
if(!remoteOptions ){
return;
}
that.fullLoad= this.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.8)'
});
let postUrl='http://10.81.93.41:8080/cocenter/intf/queryCommentList';
let postData= {"reqHead":{},"reqBody":{}}
if(models.commId){
postData.reqBody.commId=models.commId
}
if(models.commName){
postData.reqBody.commName=models.commName
}
if(models.commCode){
postData.reqBody.commCode=models.commCode
}
postData.reqBody.state= models.state || '1';
postData.reqBody.currPage=1
if(widget.model == "searchBtn"){
postData.reqBody.currPage=1;
}
else if(models.currentPage){
postData.reqBody.currPage=models.currentPage
}
if(models.pageSize){
postData.reqBody.pageSize=models.pageSize
}else {
postData.reqBody.pageSize=10
}
//postData.reqBody=Object.assign({},qryParams)
axios.post(postUrl, postData).then(function(response) {
let rspInfo=response.data ;
console.info('--------------qryCommInfoList rspInfo:',rspInfo)
let rspData=rspInfo.rspData ;
let tableData={};
tableData[remoteOptions.dataFiled]=[];
tableData.pageSize=postData.reqHead.pageSize;
tableData.currentPage=postData.reqHead.currPage;
tableData.total=0;
if(rspData && rspData.total>0){
tableData.total=rspData.total;
rspData.rows.forEach(item=>{
let tempa=Object.assign({},item)
tempa.pCommentId=tempa.commentId;
tempa.commentId="rrrr"+Math.random();
item.children=[];
item.children.push(tempa)
// if(!item.children){
// return;
// }
// rspData.rows.forEach(child2=>{
// child2.pCommentId=child2.commentId;
// child2.commentId=child2.replyId;
// })
})
console.info('----------------table rows ',rspData.rows)
tableData[remoteOptions.dataFiled]=rspData.rows;
}
resolve(tableData)
that.fullLoad.close();
});
},
/*表格的链接按钮事件*/
postShInforeloadList(widget, models, resolve){
console.info('---------------------------postShInforeloadList',widget,models,this.editData )
//window.parent.parentChangeTab(widget.actions.url+"?commId="+models.COMM_ID,"商品修改:"+models.COMM_NAME)
this.dialogVisible =!this.dialogVisible;
//获取是否有选中数据
//this.models['listData']
},
handleSubmit () {
let that=this;
this.$refs.editPage2.getData().then(data => {
for(let p in data){
that.editData2[p]=data[p];
}
that.postSH();
}).catch(e => {
})
},
postdata( ){
let that=this;
console.info('--------------postSH:',that.editData2)
let postUrl='http://10.81.93.41:8080/cocenter/intf/auditCommentList';
let postData= {
reqHead:{},
reqBody:{ }
}
postData.reqBody=Object.assign({},that.editData2) ;
axios.post(postUrl, postData).then(function(response) {
let rspInfo=response.data ;
console.info('--------------queryMerTypePage rspInfo:',rspInfo)
let arr=rspInfo.rspData && rspInfo.rspData.rows;
console.info('--------------queryMerTypePage arr:',arr)
if(arr && arr.length>0){
resolve(arr)
}else {
resolve([])
}
});
},
}
})
.apppanel{
margin:10px 20px;min-width: 700px;
}
.el-form-item {
margin-bottom: 2px;
}
.el-table td, .el-table th {
padding: 1px 0px;
}
.el-table__header th{
height: 50px;background-color: #f9f9f9;
}
.el-table--border td, .el-table--border th, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed {
border-right: dodgerblue;
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史