@@ -1,7 +1,4 @@
import TableOperaionComponent from '@/components/noTemplateComponents/operationComponent'
import TableTextComponent from '@/components/noTemplateComponents/detailComponent'
import StatusComponent from '@/components/noTemplateComponents/statusComponent'
import InputArea from 'code-brick-zj'
export default function ( ) {
@@ -17,16 +14,20 @@ export default function () {
fixed : 'right' ,
width : 120 ,
subcomponent : TableOperaionComponent ,
options : [ 'edit' , { name : 'delete' , permission : '' } ]
options : [ 'edit' , { name : 'delete' , permission : 'pms:workSequence:delete ' } ]
}
]
const headFormFields = [
{
prop : 'key' ,
label : '工序名称/编码' ,
input : true ,
default : { value : '' }
default : { value : '' } ,
bind : { // v-bind keyValues
placeholder : '请输入工序名称或编码'
}
} ,
{
button : {
@@ -38,94 +39,51 @@ export default function () {
button : {
type : 'plain' ,
name : '新增' ,
permission : ''
permission : 'pms:workSequence:save '
}
}
]
const dialogC onfigs = {
menu : [ { name : '混料程序' } , { name : '参数明细' , onlyEditMode : true } ] ,
/**
* dialog c onfig 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
form : {
url : '/pms/blenderStep' ,
rows : [
[
{ input : true , label : '混料程 序名称' , prop : 'name' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入混料程 序名称' } } ,
{ input : true , label : '程 序编码' , prop : 'code' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入混料程 序编码' } } ,
{ input : true , label : '版本号' , prop : 'version' , elparams : { placeholder : '请输入版本号' } } ,
{ input : true , label : '工 序名称' , prop : 'name' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入工 序名称' } } ,
{ input : true , label : '工 序编码' , prop : 'code' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入工 序编码' } } ,
] ,
[
// {
// select: true,
// label: '城市',
// prop: 'city',
// options: [
// { label: '1', value: 1 },
// { label: '2', value: 2 },
// { label: '3', value: 3 },
// ],
// elparams: { placeholder: '请选择城市' }
// },
{
select: true ,
label: '产线' ,
prop: 'prdLineId' ,
options: [
// { label: '1', value: 1 },
// { label: '2', value: 2 },
// { label: '3', value: 3 },
] ,
elparams: { placeholder: '请选择所属产线' } ,
// fetchData api
fetchData : ( ) => {
return this . $http ( '/pms/productionLine/page' , { limit : 999 , page : 1 , key : '' } )
}
} ,
{ input : true , label : '备注' , prop : 'remark' , elparams : { placeholder : '备注' } } ,
// { input: true, label: '程序号', prop: '', rules: { required: true, message: 'not empty', trigger: 'blur' }, elparams: { placeholder: '请输入混料程序号' } },
] ,
// [{ switch: true, label: '状态', prop: 'enabled', default: 0 }],
[ { textarea : true , label : '备注' , prop : 'remark' , elparams : { placeholder : '备注' } } ] ,
] ,
operations : [
{ name : 'add' , label : '保存' , type : 'primary' , permission : 'pms:blenderStep:save' , showOnEdit : false } ,
{ name : 'update' , label : '更新' , type : 'primary' , permission : 'pms:blenderStep:update' , showOnEdit : true } ,
{ name : 'reset' , label : '重置' , type : 'warning' , showAlways : true } ,
// { name: 'cancel', label: '取消', showAlways: true },
] ,
} ,
table : {
// extraParams: ['stepId'],
extraParams : 'stepId' ,
props : [
{ prop : 'sort' , label : '步骤' , isEditField : true } ,
{ prop : 'name' , label : '参数名称' , isEditField : true } ,
{ prop : 'description' , label : '描述' , isEditField : true } ,
{ prop : 'value' , label : '设定值' , isEditField : true } ,
{ prop : 'valueFloor' , label : '值下限' , isEditField : true } ,
{ prop : 'valueTop' , label : '值上限' , isEditField : true } ,
{
prop : 'operations' ,
name : '操作' ,
fixed : 'right' ,
width : 120 ,
subcomponent : TableOperaionComponent ,
options : [
{ name : 'edit' , permission : 'pms:blenderStepParam:update' } ,
{ name : 'delete' , permission : 'pms:blenderStepParam:delete' } ,
]
}
] ,
data : [
// TOOD 暂时用不到,但获取可以考虑把拉取接口数据的函数迁移到此文件(没有太大必要)
] ,
} ,
subDialog : {
extraParam : 'stepId' ,
rows : [
[
{ input : true , label : '步骤 ' , prop : 'sort' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入步骤 ' } } ,
{ input : true , label : '步骤描述' , prop : 'description' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入描述' } } ,
] , [
{ input : true , label : '参数名称' , prop : 'name' , elparams : { placeholder : '请输入参数名称' } } ,
{ input : true , label : '参数编码' , prop : 'code' , rules : { required : true , message : 'not empty' , trigger : 'blur' } , elparams : { placeholder : '请输入描述' } } ,
] , [
{ input : true , label : '参数值上限' , prop : 'valueTop' , elparams : { placeholder : '请输入参数值上限' } } ,
{ input : true , label : '参数值下限' , prop : 'valueFloor' , elparams : { placeholder : '请输入参数值下限' } } ,
{ textarea : true , label : '描述 ' , prop : 'description' , elparams : { placeholder : '描述 ' } } ,
] ,
[
{ input : true , label : '参数值' , prop : 'value' , elparams : { placeholder : '请输入参数值' } } ,
]
] ,
operations : [
{ name : 'add' , label : '保存' , type : 'primary' , permission : 'pms:blenderStepParam :save' , showOnEdit : false } ,
{ name : 'update' , label : '更新' , type : 'primary' , permission : 'pms:blenderStepParam :update' , showOnEdit : true } ,
// { name: 'reset', label: '重置', type: 'warning', showAlways: true },
{ name : 'add' , label : '保存' , type : 'primary' , permission : 'pms:workSequence :save' , showOnEdit : false } ,
{ name : 'update' , label : '更新' , type : 'primary' , permission : 'pms:workSequence :update' , showOnEdit : true } ,
{ name : 'reset' , label : '重置' , type : 'warning', showAlways: true } ,
// { name: 'cancel', label: '取消', showAlways: true },
] ,
} ,
@@ -133,7 +91,7 @@ export default function () {
return {
dialogConfigs ,
dialogConfigs : dialogJustFormConfigs ,
tableConfig : {
table : null , // 此处可省略, el-table 上的配置项
column : tableProps , // el-column-item 上的配置项