9 changed files with 786 additions and 219 deletions
-
44src/api/xm/core/xmRptConfig.js
-
171src/views/xm/core/xmRptConfig/XmRptConfigEdit.vue
-
317src/views/xm/core/xmRptConfig/XmRptConfigMng.vue
-
1src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue
-
210src/views/xm/core/xmTestPlan/XmTestPlanRpt.vue
-
14src/views/xm/core/xmTestPlan/rpt/CompsCard.vue
-
10src/views/xm/core/xmTestPlan/rpt/CompsSet.vue
-
159src/views/xm/core/xmTestPlan/rpt/biz/questionAgeDist.vue
-
79src/views/xm/core/xmTestPlan/rpt/index.vue
@ -0,0 +1,44 @@ |
|||
import axios from '@/utils/request' |
|||
|
|||
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//字典表
|
|||
import config from '@/common/config' |
|||
|
|||
let base = config.getCoreBasePath(); |
|||
|
|||
/**-------------------------与后端通讯接口------------------请写在下面-------------------------------------------- */ |
|||
/** |
|||
* 测试报告配置表 |
|||
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {pageNum:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
|||
*2 查询、新增、修改的参数格式 params={id:'报告编号 主键',bizId:'业务编号',name:'报告名称',cuserid:'创建人',cusername:'创建人姓名',ctime:'创建时间',cbranchId:'创建机构',cfg:'报告配置项'} |
|||
**/ |
|||
|
|||
//普通查询 条件之间and关系
|
|||
export const listXmRptConfig = params => { return axios.get(`${base}/xm/core/xmRptConfig/list`, { params: params }); }; |
|||
|
|||
//删除一条测试报告配置表 params={id:'报告编号 主键'}
|
|||
export const delXmRptConfig = params => { return axios.post(`${base}/xm/core/xmRptConfig/del`,params); }; |
|||
|
|||
//批量删除测试报告配置表 params=[{id:'报告编号 主键'}]
|
|||
export const batchDelXmRptConfig = params => { return axios.post(`${base}/xm/core/xmRptConfig/batchDel`, params); }; |
|||
|
|||
//修改一条测试报告配置表记录
|
|||
export const editXmRptConfig = params => { return axios.post(`${base}/xm/core/xmRptConfig/edit`, params); }; |
|||
|
|||
//新增一条测试报告配置表
|
|||
export const addXmRptConfig = params => { return axios.post(`${base}/xm/core/xmRptConfig/add`, params); }; |
|||
|
|||
//批量修改某些字段
|
|||
export const editSomeFieldsXmRptConfig = params => { return axios.post(`${base}/xm/core/xmRptConfig/editSomeFields`, params); }; |
|||
|
|||
|
|||
|
|||
/**-------------------------前端mng|add|edit界面公共函数---------------请写在下面----------------------------------------------- */ |
|||
//初始化页面上的字典
|
|||
export const initDicts = (that) => { |
|||
var itemCodes=[];//在此添加要加载的字典 如['sex','grade','lvl']
|
|||
if(itemCodes.length>0){ |
|||
initSimpleDicts('all',itemCodes).then(res=>{ |
|||
Object.assign(that.dicts,res.data.data) |
|||
}); |
|||
} |
|||
}; |
|||
@ -0,0 +1,171 @@ |
|||
<template> |
|||
<section class="page-container padding"> |
|||
<el-row class="page-header"> |
|||
</el-row> |
|||
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table"> |
|||
<!--编辑界面 XmRptConfig 测试报告配置表--> |
|||
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef"> |
|||
<el-form-item label="业务编号" prop="bizId"> |
|||
<el-input v-model="editForm.bizId" placeholder="业务编号" :maxlength="50" @change="editSomeFields(editForm,'bizId',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报告编号" prop="id"> |
|||
<el-input v-model="editForm.id" placeholder="报告编号" :maxlength="50" @change="editSomeFields(editForm,'id',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报告名称" prop="name"> |
|||
<el-input v-model="editForm.name" placeholder="报告名称" :maxlength="255" @change="editSomeFields(editForm,'name',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="cuserid"> |
|||
<el-input v-model="editForm.cuserid" placeholder="创建人" :maxlength="50" @change="editSomeFields(editForm,'cuserid',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人姓名" prop="cusername"> |
|||
<el-input v-model="editForm.cusername" placeholder="创建人姓名" :maxlength="255" @change="editSomeFields(editForm,'cusername',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="ctime"> |
|||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="创建机构" prop="cbranchId"> |
|||
<el-input v-model="editForm.cbranchId" placeholder="创建机构" :maxlength="50" @change="editSomeFields(editForm,'cbranchId',$event)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="报告配置项" prop="cfg"> |
|||
<el-input v-model="editForm.cfg" placeholder="报告配置项" :maxlength="2147483647" @change="editSomeFields(editForm,'cfg',$event)"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-row> |
|||
|
|||
<el-row v-if="opType=='add'" class="page-bottom bottom-fixed"> |
|||
<el-button @click.native="handleCancel">取消</el-button> |
|||
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from "@/common/config"; //全局公共库import |
|||
import { initDicts, addXmRptConfig,editXmRptConfig,editSomeFieldsXmRptConfig } from '@/api/xm/core/xmRptConfig'; |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name:'xmRptConfigEdit', |
|||
components: { |
|||
|
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['xmRptConfig','visible','opType'], |
|||
|
|||
watch: { |
|||
'xmRptConfig':function( xmRptConfig ) { |
|||
if(xmRptConfig){ |
|||
this.editForm = {...xmRptConfig}; |
|||
} |
|||
|
|||
}, |
|||
'visible':function(visible) { |
|||
if(visible==true){ |
|||
this.initData() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
currOpType:'add',//add/edit |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
|||
editFormRules: { |
|||
id: [ |
|||
//{ required: true, message: '报告编号不能为空', trigger: 'blur' } |
|||
] |
|||
}, |
|||
editForm: { |
|||
bizId:'',id:'',name:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',cfg:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
|
|||
...util, |
|||
|
|||
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
|||
handleCancel:function(){ |
|||
this.$refs['editFormRef'].resetFields(); |
|||
this.$emit('cancel'); |
|||
}, |
|||
//新增、编辑提交XmRptConfig 测试报告配置表父组件监听@submit="afterEditSubmit" |
|||
saveSubmit: function () { |
|||
this.$refs.editFormRef.validate((valid) => { |
|||
if (valid) { |
|||
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
|||
this.load.edit=true |
|||
let params = Object.assign({}, this.editForm); |
|||
var func=addXmRptConfig |
|||
if(this.currOpType=='edit'){ |
|||
func=editXmRptConfig |
|||
} |
|||
func(params).then((res) => { |
|||
this.load.edit=false |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.editForm=res.data.data |
|||
this.initData() |
|||
this.currOpType="edit"; |
|||
this.$emit('submit');// @submit="afterAddSubmit" |
|||
} |
|||
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.edit=false); |
|||
}); |
|||
}else{ |
|||
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
|||
} |
|||
}); |
|||
}, |
|||
initData: function(){ |
|||
this.currOpType=this.opType |
|||
if(this.xmRptConfig){ |
|||
this.editForm = Object.assign({},this.xmRptConfig); |
|||
} |
|||
|
|||
if(this.opType=='edit'){ |
|||
|
|||
}else{ |
|||
|
|||
} |
|||
this.editFormBak={...this.editForm} |
|||
}, |
|||
|
|||
editSomeFields(row,fieldName,$event){ |
|||
if(this.opType=='add'){ |
|||
return; |
|||
} |
|||
let params={}; |
|||
params['ids']=[row].map(i=>i.id) |
|||
params[fieldName]=$event |
|||
var func = editSomeFieldsXmRptConfig |
|||
func(params).then(res=>{ |
|||
let tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
this.editFormBak=[...this.editForm] |
|||
}else{ |
|||
Object.assign(this.editForm,this.editFormBak) |
|||
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
|||
} |
|||
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
|||
}, |
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
initDicts(this); |
|||
this.initData() |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,317 @@ |
|||
<template> |
|||
<section class="page-container border padding"> |
|||
<el-row> |
|||
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input> |
|||
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmRptConfigs" icon="el-icon-search">查询</el-button> |
|||
<span style="float:right;"> |
|||
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button> |
|||
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button> |
|||
</span> |
|||
</el-row> |
|||
<el-row class="padding-top"> |
|||
<!--列表 XmRptConfig 测试报告配置表--> |
|||
<el-table ref="xmRptConfigTable" :data="xmRptConfigs" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|||
<el-table-column type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
|||
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column> |
|||
<!-- |
|||
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left"> |
|||
<span class="cell-text"> {{scope.row.username}}} </span> |
|||
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span> |
|||
</el-table-column> |
|||
--> |
|||
<el-table-column prop="id" label="报告编号" min-width="120" show-overflow-tooltip fixed="left"></el-table-column> |
|||
<el-table-column prop="bizId" label="业务编号" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.bizId}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="报告名称" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.name}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="cuserid" label="创建人" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.cuserid}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="cusername" label="创建人姓名" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.cusername}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="ctime" label="创建时间" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.ctime}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="cbranchId" label="创建机构" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.cbranchId}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="cfg" label="报告配置项" min-width="120" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<span> {{scope.row.cfg}} </span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="操作" width="180" fixed="right"> |
|||
<template scope="scope"> |
|||
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button> |
|||
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination> |
|||
</el-row> |
|||
<el-row> |
|||
<!--编辑 XmRptConfig 测试报告配置表界面--> |
|||
<el-drawer title="编辑测试报告配置表" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-rpt-config-edit op-type="edit" :xm-rpt-config="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-rpt-config-edit> |
|||
</el-drawer> |
|||
|
|||
<!--新增 XmRptConfig 测试报告配置表界面--> |
|||
<el-drawer title="新增测试报告配置表" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|||
<xm-rpt-config-edit op-type="add" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-rpt-config-edit> |
|||
</el-drawer> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from '@/common/config';//全局公共库 |
|||
import { initDicts,listXmRptConfig, delXmRptConfig, batchDelXmRptConfig,editSomeFieldsXmRptConfig } from '@/api/xm/core/xmRptConfig'; |
|||
import XmRptConfigEdit from './XmRptConfigEdit';//新增修改界面 |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name:'xmRptConfigMng', |
|||
components: { |
|||
XmRptConfigEdit, |
|||
}, |
|||
props:['visible'], |
|||
computed: { |
|||
...mapGetters(['userInfo']), |
|||
|
|||
}, |
|||
watch:{ |
|||
visible(val){ |
|||
if(val==true){ |
|||
this.initData(); |
|||
this.searchXmRptConfigs() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters: { |
|||
key: '' |
|||
}, |
|||
xmRptConfigs: [],//查询结果 |
|||
pageInfo:{//分页数据 |
|||
total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 |
|||
pageSize:10,//每页数据 |
|||
count:false,//是否需要重新计算总记录数 |
|||
pageNum:1,//当前页码、从1开始计算 |
|||
orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 |
|||
orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] |
|||
}, |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
sels: [],//列表选中数据 |
|||
dicts:{ |
|||
//sex: [{id:'1',name:'男'},{id:'2',name:'女'}] |
|||
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
|||
addFormVisible: false,//新增xmRptConfig界面是否显示 |
|||
addForm: { |
|||
bizId:'',id:'',name:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',cfg:'' |
|||
}, |
|||
|
|||
editFormVisible: false,//编辑界面是否显示 |
|||
editForm: { |
|||
bizId:'',id:'',name:'',cuserid:'',cusername:'',ctime:'',cbranchId:'',cfg:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
|
|||
...util, |
|||
|
|||
handleSizeChange(pageSize) { |
|||
this.pageInfo.pageSize=pageSize; |
|||
this.getXmRptConfigs(); |
|||
}, |
|||
handleCurrentChange(pageNum) { |
|||
this.pageInfo.pageNum = pageNum; |
|||
this.getXmRptConfigs(); |
|||
}, |
|||
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
|||
sortChange( obj ){ |
|||
if(obj.order==null){ |
|||
this.pageInfo.orderFields=[]; |
|||
this.pageInfo.orderDirs=[]; |
|||
}else{ |
|||
var dir='asc'; |
|||
if(obj.order=='ascending'){ |
|||
dir='asc' |
|||
}else{ |
|||
dir='desc'; |
|||
} |
|||
|
|||
this.pageInfo.orderFields=[util.toLine(obj.prop)]; |
|||
this.pageInfo.orderDirs=[dir]; |
|||
} |
|||
this.getXmRptConfigs(); |
|||
}, |
|||
searchXmRptConfigs(){ |
|||
this.pageInfo.count=true; |
|||
this.getXmRptConfigs(); |
|||
}, |
|||
//获取列表 XmRptConfig 测试报告配置表 |
|||
getXmRptConfigs() { |
|||
let params = { |
|||
pageSize: this.pageInfo.pageSize, |
|||
pageNum: this.pageInfo.pageNum, |
|||
total: this.pageInfo.total, |
|||
count:this.pageInfo.count |
|||
}; |
|||
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
|||
let orderBys=[]; |
|||
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
|||
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i]) |
|||
} |
|||
params.orderBy= orderBys.join(",") |
|||
} |
|||
if(this.filters.key){ |
|||
params.key=this.filters.key |
|||
} |
|||
|
|||
this.load.list = true; |
|||
listXmRptConfig(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.pageInfo.total = res.data.total; |
|||
this.pageInfo.count=false; |
|||
this.xmRptConfigs = res.data.data; |
|||
}else{ |
|||
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' }); |
|||
} |
|||
this.load.list = false; |
|||
}).catch( err => this.load.list = false ); |
|||
}, |
|||
|
|||
//显示编辑界面 XmRptConfig 测试报告配置表 |
|||
showEdit: function ( row,index ) { |
|||
this.editFormVisible = true; |
|||
this.editForm = Object.assign({}, row); |
|||
}, |
|||
//显示新增界面 XmRptConfig 测试报告配置表 |
|||
showAdd: function () { |
|||
this.addFormVisible = true; |
|||
//this.addForm=Object.assign({}, this.editForm); |
|||
}, |
|||
afterAddSubmit(){ |
|||
this.addFormVisible=false; |
|||
this.pageInfo.count=true; |
|||
this.getXmRptConfigs(); |
|||
}, |
|||
afterEditSubmit(){ |
|||
this.editFormVisible=false; |
|||
}, |
|||
//选择行xmRptConfig |
|||
selsChange: function (sels) { |
|||
this.sels = sels; |
|||
}, |
|||
//删除xmRptConfig |
|||
handleDel: function (row,index) { |
|||
this.$confirm('确认删除该记录吗?', '提示', { |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.load.del=true; |
|||
let params = { id:row.id }; |
|||
delXmRptConfig(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.searchXmRptConfigs(); |
|||
} |
|||
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err => this.load.del=false ); |
|||
}); |
|||
}, |
|||
//批量删除xmRptConfig |
|||
batchDel: function () { |
|||
if(this.sels.length<=0){ |
|||
return; |
|||
} |
|||
var params=this.sels.map(i=>{ |
|||
return { id:i.id} |
|||
}) |
|||
this.$confirm('确认删除选中记录吗?', '提示', { |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.load.del=true; |
|||
batchDelXmRptConfig(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if( tips.isOk ){ |
|||
this.searchXmRptConfigs(); |
|||
} |
|||
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'}); |
|||
}).catch( err => this.load.del=false ); |
|||
}); |
|||
}, |
|||
editSomeFields(row,fieldName,$event){ |
|||
let params={}; |
|||
if(this.sels.length>0){ |
|||
if(!this.sels.some(k=> k.id==row.id)){ |
|||
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'}) |
|||
Object.assign(this.editForm,this.editFormBak) |
|||
return; |
|||
} |
|||
params['ids']=this.sels.map(i=>i.id) |
|||
}else{ |
|||
params['ids']=[row].map(i=>i.id) |
|||
} |
|||
params[fieldName]=$event |
|||
var func = editSomeFieldsXmRptConfig |
|||
func(params).then(res=>{ |
|||
let tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
if(this.sels.length>0){ |
|||
this.searchXmRptConfigs(); |
|||
} |
|||
this.editFormBak=[...this.editForm] |
|||
}else{ |
|||
Object.assign(this.editForm,this.editFormBak) |
|||
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
|||
} |
|||
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
|||
}, |
|||
rowClick: function(row, event, column){ |
|||
this.editForm=row |
|||
this.editFormBak={...row}; |
|||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|||
}, |
|||
initData: function(){ |
|||
|
|||
}, |
|||
|
|||
},//end methods |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
initDicts(this); |
|||
this.initData() |
|||
this.searchXmRptConfigs(); |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmRptConfigTable.$el) |
|||
|
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
@ -1,210 +0,0 @@ |
|||
<template> |
|||
<section class="padding"> |
|||
<el-row ref="table"> |
|||
<!--编辑界面 XmTestPlan 测试计划--> |
|||
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef" label-position="left"> |
|||
|
|||
<el-form-item label="归属项目" prop="projectId"> |
|||
|
|||
<span v-if="opType=='add'"> |
|||
<xm-project-select v-if="!selProject || !selProject.id" ref="xmProjectSelect" :link-product-id="xmTestCasedb? xmTestCasedb.productId:null" @row-click="onPorjectConfirm" :auto-select="false"> |
|||
<span slot="title">选择项目</span> |
|||
</xm-project-select> |
|||
<div v-else>{{editForm.projectName}}</div> |
|||
</span> |
|||
<div v-else>{{editForm.projectName}}</div> |
|||
</el-form-item> |
|||
<el-form-item prop="name" label-width="0px"> |
|||
<el-row class="padding-bottom"> |
|||
<my-input v-model="editForm.name" placeholder="计划名称" :maxlength="255" @change="editSomeFields(editForm,'name',$event)"></my-input> |
|||
</el-row> |
|||
</el-form-item> |
|||
<el-row class="padding"> |
|||
<el-col :span="8"> |
|||
<mdp-select-user-xm label="负责人" userid-key="cuserid" username-key="cusername" v-model="editForm" @change="editSomeFields(editForm,'cuserid',$event)"></mdp-select-user-xm> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<mdp-select-dict-x label="状态" :dict="dicts['testPlanStatus']" v-model="editForm.status" @change="editSomeFields(editForm,'status',$event)"></mdp-select-dict-x> |
|||
</el-col> |
|||
|
|||
<el-col :span="8"> |
|||
<mdp-select-dict-x label="测试结果" :dict="dicts['testPlanTcode']" v-model="editForm.tcode" @change="editSomeFields(editForm,'tcode',$event)"></mdp-select-dict-x> |
|||
</el-col> |
|||
</el-row> |
|||
<el-form-item label="归属测试库" prop="casedbName"> |
|||
{{editForm.casedbName}} |
|||
</el-form-item> |
|||
<el-form-item label="归属产品" prop="productName"> |
|||
{{editForm.productName}} |
|||
</el-form-item> |
|||
|
|||
<el-form-item label="起止时间" prop="stime"> |
|||
<mdp-date-range :auto-default="false" placeholder="选择日期" v-model="editForm" start-key="stime" end-key="etime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd" @change="editSomeFields(editForm,'stime',editForm)"></mdp-date-range> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-row> |
|||
|
|||
<el-row v-if="opType=='add'" > |
|||
<span style="float:right;"> |
|||
<el-button @click.native="handleCancel">取消</el-button> |
|||
<el-button v-loading="load.edit" type="primary" @click.native="saveSubmit" :disabled="load.edit==true">提交</el-button> |
|||
</span> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from "@/common/config"; //全局公共库import |
|||
import { initDicts, addXmTestPlan,editXmTestPlan,editSomeFieldsXmTestPlan } from '@/api/xm/core/xmTestPlan'; |
|||
import { mapGetters } from 'vuex' |
|||
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect'; |
|||
|
|||
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//修改界面 |
|||
export default { |
|||
name:'xmTestPlanEdit', |
|||
components: { |
|||
XmProjectSelect,MdpSelectUserXm, |
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['xmTestPlan','visible','opType','selProject','xmTestCasedb'], |
|||
|
|||
watch: { |
|||
'xmTestPlan':function( xmTestPlan ) { |
|||
if(xmTestPlan){ |
|||
this.editForm = {...xmTestPlan}; |
|||
} |
|||
|
|||
}, |
|||
'visible':function(visible) { |
|||
if(visible==true){ |
|||
this.initData() |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
currOpType:'add',//add/edit |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
dicts:{ |
|||
testPlanStatus:[], |
|||
testPlanTcode:[], |
|||
|
|||
},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
|||
editFormRules: { |
|||
name: [ |
|||
{ required: true, message: '测试计划名称不能为空', trigger: 'change' }, |
|||
{ min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'change' },//长度 |
|||
], |
|||
projectId: [ |
|||
{ required: true, message: '项目不能为空', trigger: 'change' }, |
|||
], |
|||
}, |
|||
editForm: { |
|||
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'' |
|||
}, |
|||
maxTableHeight:300, |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
|
|||
...util, |
|||
|
|||
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
|||
handleCancel:function(){ |
|||
this.$refs['editFormRef'].resetFields(); |
|||
this.$emit('cancel'); |
|||
}, |
|||
//新增、编辑提交XmTestPlan 测试计划父组件监听@submit="afterEditSubmit" |
|||
saveSubmit: function () { |
|||
this.$refs.editFormRef.validate((valid) => { |
|||
if (valid) { |
|||
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
|||
this.load.edit=true |
|||
let params = Object.assign({}, this.editForm); |
|||
var func=addXmTestPlan |
|||
if(this.currOpType=='edit'){ |
|||
func=editXmTestPlan |
|||
} |
|||
func(params).then((res) => { |
|||
this.load.edit=false |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.editForm=res.data.data |
|||
this.initData() |
|||
this.currOpType="edit"; |
|||
this.$emit('submit');// @submit="afterAddSubmit" |
|||
} |
|||
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.edit=false); |
|||
}); |
|||
}else{ |
|||
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' }); |
|||
} |
|||
}); |
|||
}, |
|||
initData: function(){ |
|||
this.currOpType=this.opType |
|||
if(this.xmTestPlan){ |
|||
this.editForm = Object.assign({},this.xmTestPlan); |
|||
} |
|||
|
|||
if(this.opType=='edit'){ |
|||
|
|||
}else{ |
|||
|
|||
} |
|||
this.editFormBak={...this.editForm} |
|||
}, |
|||
|
|||
editSomeFields(row,fieldName,$event){ |
|||
if(this.opType=='add'){ |
|||
return; |
|||
} |
|||
let params={}; |
|||
params['ids']=[row].map(i=>i.id) |
|||
|
|||
if(fieldName=='stime'){ |
|||
params[fieldName]=$event.stime |
|||
params.etime=$event.etime |
|||
}else if(fieldName=='cuserid'){ |
|||
params[fieldName]=$event[0].userid |
|||
params.cusername=$event[0].username |
|||
}else{ |
|||
params[fieldName]=$event |
|||
} |
|||
var func = editSomeFieldsXmTestPlan |
|||
func(params).then(res=>{ |
|||
let tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
this.editFormBak=[...this.editForm] |
|||
this.$emit('edit-fields',params) |
|||
}else{ |
|||
Object.assign(this.editForm,this.editFormBak) |
|||
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) |
|||
} |
|||
}).catch((e)=>Object.assign(this.editForm,this.editFormBak)) |
|||
}, |
|||
onPorjectConfirm(row){ |
|||
this.editForm.projectId=row.id |
|||
this.editForm.projectName=row.name |
|||
this.editForm.name=this.editForm.projectName+'-测试计划-V1.0' |
|||
} |
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
initDicts(this); |
|||
this.initData() |
|||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el) |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,159 @@ |
|||
<template> |
|||
<section> |
|||
<div> |
|||
<div class="main" id="xmQuestionAgeDist" |
|||
style="width:100%;height:600px;margin:0 auto;"></div> |
|||
<div class="progress"></div> |
|||
</div> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
import { getXmQuestionAgeDist } from '@/api/xm/core/xmQuestion'; |
|||
|
|||
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//修改界面 |
|||
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//新增界面 |
|||
|
|||
export default { |
|||
|
|||
components: { |
|||
XmIterationSelect,XmProductSelect, |
|||
}, |
|||
props:['xmTestPlan'], |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
xmQuestionAgeDistsCpd(){ |
|||
if(this.xmQuestionAgeDists.length==0){ |
|||
return [] |
|||
}else{ |
|||
var datas=[] |
|||
this.xmQuestionAgeDists.forEach(i=>{ |
|||
var data={...i} |
|||
data.name=this.legendCpd[i.name] |
|||
datas.push(data) |
|||
}) |
|||
return datas; |
|||
} |
|||
}, |
|||
title(){ |
|||
return '缺陷年龄数量分布' |
|||
}, |
|||
legendCpd(){ |
|||
return ['0-2天','3-5天','6-7天','8-15天','16-30天','30天以上'] |
|||
} |
|||
|
|||
}, |
|||
watch: { |
|||
xmQuestionAgeDistsCpd(){ |
|||
this.drawCharts(); |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
filters:{ |
|||
product:null, |
|||
iteration:null, |
|||
}, |
|||
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
dateRanger:[], |
|||
maxTableHeight:300, |
|||
visible:false, |
|||
xmQuestionAgeDists:[], |
|||
|
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
drawCharts() { |
|||
this.myChart = this.$echarts.init(document.getElementById("xmQuestionAgeDist")); |
|||
this.myChart.setOption( |
|||
{ |
|||
title: { |
|||
text: this.title, |
|||
left: 'center' |
|||
}, |
|||
tooltip: { |
|||
trigger: 'item' |
|||
}, |
|||
legend: { |
|||
top:'5%', |
|||
left: 'center', |
|||
data:this.legendCpd, |
|||
}, |
|||
series: [ |
|||
{ |
|||
type: 'pie', |
|||
radius: '50%', |
|||
data: this.xmQuestionAgeDistsCpd, |
|||
emphasis: { |
|||
itemStyle: { |
|||
shadowBlur: 10, |
|||
shadowOffsetX: 0, |
|||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
|||
} |
|||
}, |
|||
|
|||
label: { |
|||
show: true, |
|||
position: 'center' |
|||
}, |
|||
} |
|||
] |
|||
} |
|||
) |
|||
}, |
|||
onXmQuestionSomeFieldsChange(fieldName,$event){ |
|||
this.xmQuestionAgeDists=[] |
|||
}, |
|||
searchXmQuestionAgeDist(){ |
|||
var params={} |
|||
if(this.xmTestPlan && this.xmTestPlan.id){ |
|||
params.planId=this.xmTestPlan.id |
|||
} |
|||
getXmQuestionAgeDist(params).then(res=>{ |
|||
this.xmQuestionAgeDists=res.data.data |
|||
}) |
|||
|
|||
}, |
|||
onProductSelected(product){ |
|||
this.filters.product=product |
|||
}, |
|||
|
|||
onProductClear(){ |
|||
this.filters.product=null |
|||
|
|||
}, |
|||
|
|||
onIterationSelected(iteration){ |
|||
this.filters.iteration=iteration |
|||
}, |
|||
|
|||
onIterationClear(){ |
|||
this.filters.iteration=null |
|||
} |
|||
},//end method |
|||
mounted() { |
|||
initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate','bugReason'] ).then(res=>{ |
|||
this.dicts=res.data.data; |
|||
}) |
|||
this.searchXmQuestionAgeDist(); |
|||
//this.charts(); |
|||
//this.drawCharts(); |
|||
|
|||
}//end mounted |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
.image { |
|||
width: 100%; |
|||
display: block; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,79 @@ |
|||
<template> |
|||
<div class="m_container"> |
|||
<div class="m_content"> |
|||
<div class="m_top"> |
|||
<el-button class="m_btn" type="primary" @click="compsSetVisible = true">模块编辑</el-button> |
|||
</div> |
|||
<comps-card ref="compsCard" /> |
|||
</div> |
|||
<comps-set v-model="compsSetVisible" @submit="onCompsSet"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import NProgress from 'nprogress' // progress bar |
|||
|
|||
import compsCard from './CompsCard' |
|||
import compsSet from './CompsSet' |
|||
import { mapGetters } from 'vuex' |
|||
import dayjs from 'dayjs' |
|||
|
|||
export default { |
|||
components: {compsSet, compsCard}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo' |
|||
]), |
|||
getDate() { |
|||
return dayjs().format('YYYY/M/D'); |
|||
}, |
|||
getTimeStatus() { |
|||
let hour = dayjs().hour(); |
|||
let msg = '早上好'; |
|||
if(hour >= 13 || hour <= 18) { |
|||
msg = '下午好'; |
|||
}else if (hour >= 19 || hour <= 24){ |
|||
msg = '晚上好'; |
|||
} |
|||
return msg; |
|||
} |
|||
}, |
|||
|
|||
watch: { |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
compsSetVisible: false |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
gotolink(context,path) { |
|||
if(context==process.env.CONTEXT){ |
|||
this.$router.push({path:path}); |
|||
}else{ |
|||
var prefixUrl=window.location.protocol+"//"+window.location.host+"/"+context+"/"+process.env.VERSION+"/#"; // 返回https://mp.csdn.net |
|||
window.open(prefixUrl+path) |
|||
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it |
|||
} |
|||
|
|||
}, |
|||
onCompsSet(){ |
|||
this.$refs.compsCard.getFMenus(); |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
mounted() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import './common.scss'; |
|||
@import './index.scss'; |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue