Merge branch 'dev_2307' of http://182.92.169.222:3000/zhc077/projectManagement into dev_2307
commit
c439ddba35
3 changed files with 861 additions and 444 deletions
@ -1,272 +1,460 @@ |
|||||||
<template> |
<template> |
||||||
<a-spin :spinning="confirmLoading"> |
<a-spin :spinning="confirmLoading"> |
||||||
<j-form-container :disabled="formDisabled"> |
<j-form-container :disabled="formDisabled"> |
||||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
<a-form-model |
||||||
|
ref="form" |
||||||
|
:model="model" |
||||||
|
:rules="validatorRules" |
||||||
|
slot="detail" |
||||||
|
> |
||||||
|
<!-- <a-row style="border-bottom: 1px solid gainsboro">项目描述</a-row> --> |
||||||
<a-row> |
<a-row> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="上级模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid"> |
<a-form-model-item |
||||||
<!-- <a-input v-model="model.pid" placeholder="请输入上级模块id" ></a-input>--> |
label="上级模块" |
||||||
<j-dict-select-tag v-model="model.pid" dict-code="modulex,module_name,id" |
:labelCol="labelCol" |
||||||
placeholder="请输入上级模块" style="width: 100%" /> |
:wrapperCol="wrapperCol" |
||||||
|
prop="pid" |
||||||
|
> |
||||||
|
<!-- <a-input v-model="model.pid" placeholder="请输入上级模块id" ></a-input>--> |
||||||
|
<j-dict-select-tag |
||||||
|
v-model="model.pid" |
||||||
|
dict-code="modulex,module_name,id" |
||||||
|
placeholder="请输入上级模块" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="项目名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectId"> |
<a-form-model-item |
||||||
<!-- <a-input v-model="model.projectId" placeholder="请输入项目id" ></a-input>--> |
label="项目名" |
||||||
<j-dict-select-tag v-model="model.projectId" dict-code="projectx,project_name,id" |
:labelCol="labelCol" |
||||||
placeholder="请输入项目id" style="width: 100%" /> |
:wrapperCol="wrapperCol" |
||||||
|
prop="projectId" |
||||||
|
> |
||||||
|
<!-- <a-input v-model="model.projectId" placeholder="请输入项目id" ></a-input>--> |
||||||
|
<j-dict-select-tag |
||||||
|
v-model="model.projectId" |
||||||
|
dict-code="projectx,project_name,id" |
||||||
|
placeholder="请输入项目id" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleName"> |
<a-form-model-item |
||||||
<a-input v-model="model.moduleName" placeholder="请输入中文名称" ></a-input> |
label="中文名称" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="moduleName" |
||||||
|
> |
||||||
|
<a-input |
||||||
|
v-model="model.moduleName" |
||||||
|
placeholder="请输入中文名称" |
||||||
|
></a-input> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="英文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleEnName"> |
<a-form-model-item |
||||||
<a-input v-model="model.moduleEnName" placeholder="请输入英文名称" ></a-input> |
label="英文名称" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="moduleEnName" |
||||||
|
> |
||||||
|
<a-input |
||||||
|
v-model="model.moduleEnName" |
||||||
|
placeholder="请输入英文名称" |
||||||
|
></a-input> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="模块编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleCode"> |
<a-form-model-item |
||||||
<a-input v-model="model.moduleCode" placeholder="请输入模块编码" ></a-input> |
label="模块编码" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="moduleCode" |
||||||
|
> |
||||||
|
<a-input |
||||||
|
v-model="model.moduleCode" |
||||||
|
placeholder="请输入模块编码" |
||||||
|
></a-input> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="内容描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pmDescribe"> |
<a-form-model-item |
||||||
<a-input v-model="model.pmDescribe" placeholder="请输入内容描述" ></a-input> |
label="任务等级" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="workLevel" |
||||||
|
> |
||||||
|
<!-- <a-input-number v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />--> |
||||||
|
<j-dict-select-tag |
||||||
|
v-model="model.workLevel" |
||||||
|
dict-code="work_level" |
||||||
|
placeholder="请输入任务等级" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers"> |
<a-form-model-item |
||||||
<!-- <a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>--> |
label="用户角色" |
||||||
<j-select-user-by-dep v-model="model.managerUsers" /> |
:labelCol="labelCol" |
||||||
</a-form-model-item> |
:wrapperCol="wrapperCol" |
||||||
</a-col> |
prop="userRole" |
||||||
<a-col :span="24"> |
> |
||||||
<a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel"> |
<!-- <a-input v-model="model.userRole" placeholder="请输入用户角色" ></a-input>--> |
||||||
<!-- <a-input-number v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />--> |
<j-multi-select-tag |
||||||
<j-dict-select-tag v-model="model.workLevel" dict-code="work_level" |
type="list_multi" |
||||||
placeholder="请输入任务等级" style="width: 100%" /> |
v-model="model.userRole" |
||||||
|
dictCode="sys_role,role_name,id" |
||||||
|
placeholder="请选择用户角色" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workStatus"> |
<a-form-model-item |
||||||
<!-- <a-input-number v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />--> |
label="责任人" |
||||||
<j-dict-select-tag v-model="model.workStatus" dict-code="work_status" |
:labelCol="labelCol" |
||||||
placeholder="请输入任务状态" style="width: 100%" /> |
:wrapperCol="wrapperCol" |
||||||
|
prop="managerUsers" |
||||||
|
> |
||||||
|
<!-- <a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>--> |
||||||
|
<j-select-user-by-dep v-model="model.managerUsers" /> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
|
|
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="publishTime"> |
<a-form-model-item |
||||||
<j-date placeholder="请选择发布时间" date-format="YYYY-MM-DD HH:mm:ss" v-model="model.publishTime" style="width: 100%" /> |
label="任务时长" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="duration" |
||||||
|
> |
||||||
|
<a-input-number |
||||||
|
:min="0.1" |
||||||
|
:max="16" |
||||||
|
:precision="1" |
||||||
|
v-model="model.duration" |
||||||
|
placeholder="请输入任务时长" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="任务时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration"> |
<a-form-model-item |
||||||
<a-input-number :min="0.1" :max="16" :precision="1" v-model="model.duration" placeholder="请输入任务时长" style="width: 100%"/> |
label="实际时长" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="realDuration" |
||||||
|
> |
||||||
|
<!-- <a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%" />--> |
||||||
|
<a-input-number |
||||||
|
:min="0.1" |
||||||
|
:max="16" |
||||||
|
:precision="1" |
||||||
|
v-model="model.realDuration" |
||||||
|
placeholder="请输入实际时长" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime"> |
<a-form-model-item |
||||||
<j-date placeholder="请选择开始时间" date-format="YYYY-MM-DD HH:mm:ss" v-model="model.startTime" style="width: 100%" /> |
label="开始时间" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="startTime" |
||||||
|
> |
||||||
|
<j-date |
||||||
|
placeholder="请选择开始时间" |
||||||
|
date-format="YYYY-MM-DD HH:mm:ss" |
||||||
|
v-model="model.startTime" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitTime"> |
<a-form-model-item |
||||||
<j-date placeholder="请选择提交时间" date-format="YYYY-MM-DD HH:mm:ss" v-model="model.submitTime" style="width: 100%" /> |
label="提交时间" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="submitTime" |
||||||
|
> |
||||||
|
<j-date |
||||||
|
placeholder="请选择提交时间" |
||||||
|
date-format="YYYY-MM-DD HH:mm:ss" |
||||||
|
v-model="model.submitTime" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
|
<!-- <a-col :span="24">--> |
||||||
|
<!-- <a-form-model-item label="关联实体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relatedBean">--> |
||||||
|
<!-- <j-dict-select-tag v-model="model.relatedBean" dict-code="tablex,table_name,id"--> |
||||||
|
<!-- placeholder="请输入关联实体" ></j-dict-select-tag>--> |
||||||
|
<!-- </a-form-model-item>--> |
||||||
|
<!-- </a-col>--> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="实际时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realDuration"> |
<a-form-model-item |
||||||
<!-- <a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%" />--> |
label="发布时间" |
||||||
<a-input-number :min="0.1" :max="16" :precision="1" v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%"/> |
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="publishTime" |
||||||
|
> |
||||||
|
<j-date |
||||||
|
placeholder="请选择发布时间" |
||||||
|
date-format="YYYY-MM-DD HH:mm:ss" |
||||||
|
v-model="model.publishTime" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
|
|
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="用户角色" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userRole"> |
<a-form-model-item |
||||||
<!-- <a-input v-model="model.userRole" placeholder="请输入用户角色" ></a-input>--> |
label="版本状态" |
||||||
<j-multi-select-tag type="list_multi" v-model="model.userRole" dictCode="sys_role,role_name,id" placeholder="请选择用户角色" /> |
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="verisonStatus" |
||||||
|
> |
||||||
|
<!-- <a-input-number v-model="model.verisonStatus" placeholder="请输入版本状态" style="width: 100%" />--> |
||||||
|
<j-dict-select-tag |
||||||
|
type="radioButton" |
||||||
|
v-model="model.verisonStatus" |
||||||
|
dict-code="verison_status" |
||||||
|
placeholder="请输入版本状态" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<!-- <a-col :span="24">--> |
<!-- <a-col :span="24">--> |
||||||
<!-- <a-form-model-item label="关联实体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="relatedBean">--> |
<!-- <a-form-model-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verison">--> |
||||||
<!-- <j-dict-select-tag v-model="model.relatedBean" dict-code="tablex,table_name,id"--> |
<!-- <a-input-number v-model="model.verison" placeholder="请输入版本号" style="width: 100%" />--> |
||||||
<!-- placeholder="请输入关联实体" ></j-dict-select-tag>--> |
<!-- </a-form-model-item>--> |
||||||
<!-- </a-form-model-item>--> |
<!-- </a-col>--> |
||||||
<!-- </a-col>--> |
<a-col :span="24" style="height: 3rem"> |
||||||
<a-col :span="24"> |
<a-form-model-item |
||||||
<a-form-model-item label="原型图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="prototypes"> |
label="任务状态" |
||||||
<!-- <a-input v-model="model.prototypes" placeholder="请输入原型图" ></a-input>--> |
:labelCol="labelCol" |
||||||
<j-image-upload isMultiple v-model="model.prototypes" ></j-image-upload> |
:wrapperCol="wrapperCol" |
||||||
|
prop="workStatus" |
||||||
|
> |
||||||
|
<!-- <a-input-number v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />--> |
||||||
|
<j-dict-select-tag |
||||||
|
type="radio" |
||||||
|
v-model="model.workStatus" |
||||||
|
dict-code="work_status" |
||||||
|
placeholder="请输入任务状态" |
||||||
|
style="width: 100%" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
<a-col :span="24"> |
||||||
<a-form-model-item label="分析图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diagrams"> |
<a-form-model-item |
||||||
<!-- <a-input v-model="model.diagrams" placeholder="请输入分析图" ></a-input>--> |
label="模块状态" |
||||||
<j-image-upload isMultiple v-model="model.diagrams" ></j-image-upload> |
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="status" |
||||||
|
> |
||||||
|
<!-- <a-input-number v-model="model.status" placeholder="请输入模块状态" style="width: 100%" />--> |
||||||
|
<j-dict-select-tag |
||||||
|
type="radio" |
||||||
|
v-model="model.status" |
||||||
|
placeholder="请输入模块状态" |
||||||
|
dict-code="a_status" |
||||||
|
/> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
</a-row> |
||||||
<a-form-model-item label="模块状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> |
<a-row> |
||||||
<!-- <a-input-number v-model="model.status" placeholder="请输入模块状态" style="width: 100%" />--> |
<a-col :span="24" class="content_describe"> |
||||||
<j-dict-select-tag type="radio" v-model="model.status" placeholder="请输入模块状态" dict-code="a_status" /> |
<a-form-model-item |
||||||
|
label="内容描述" |
||||||
|
:labelCol="labelCol" |
||||||
|
:wrapperCol="wrapperCol" |
||||||
|
prop="pmDescribe" |
||||||
|
> |
||||||
|
<j-editor v-model="model.pmDescribe"></j-editor> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<a-col :span="24"> |
</a-row> |
||||||
<a-form-model-item label="版本状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verisonStatus"> |
<a-row> |
||||||
<!-- <a-input-number v-model="model.verisonStatus" placeholder="请输入版本状态" style="width: 100%" />--> |
<a-col style="width: 100%"> |
||||||
<j-dict-select-tag type="radioButton" v-model="model.verisonStatus" dict-code="verison_status" |
<a-form-model-item |
||||||
placeholder="请输入版本状态"/> |
label="原型图" |
||||||
|
:labelCol="{ xs: { span: 24 }, sm: { span: 2 } }" |
||||||
|
:wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }" |
||||||
|
prop="prototypes" |
||||||
|
> |
||||||
|
<!-- <a-input v-model="model.prototypes" placeholder="请输入原型图" ></a-input>--> |
||||||
|
<j-image-upload |
||||||
|
isMultiple |
||||||
|
v-model="model.prototypes" |
||||||
|
></j-image-upload> |
||||||
</a-form-model-item> |
</a-form-model-item> |
||||||
</a-col> |
</a-col> |
||||||
<!-- <a-col :span="24">--> |
|
||||||
<!-- <a-form-model-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verison">--> |
|
||||||
<!-- <a-input-number v-model="model.verison" placeholder="请输入版本号" style="width: 100%" />--> |
|
||||||
<!-- </a-form-model-item>--> |
|
||||||
<!-- </a-col>--> |
|
||||||
</a-row> |
</a-row> |
||||||
|
<a-row> |
||||||
|
<a-col style="width: 100%"> |
||||||
|
<a-form-model-item |
||||||
|
label="分析图" |
||||||
|
:labelCol="{ xs: { span: 24 }, sm: { span: 2 } }" |
||||||
|
:wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }" |
||||||
|
prop="diagrams" |
||||||
|
> |
||||||
|
<!-- <a-input v-model="model.diagrams" placeholder="请输入分析图" ></a-input>--> |
||||||
|
<j-image-upload |
||||||
|
isMultiple |
||||||
|
v-model="model.diagrams" |
||||||
|
></j-image-upload> |
||||||
|
</a-form-model-item> </a-col |
||||||
|
></a-row> |
||||||
</a-form-model> |
</a-form-model> |
||||||
</j-form-container> |
</j-form-container> |
||||||
</a-spin> |
</a-spin> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
|
import { httpAction, getAction } from '@api/manage' |
||||||
|
import { validateDuplicateValue } from '@/utils/util' |
||||||
|
import moment from 'dayjs' |
||||||
|
|
||||||
import { httpAction, getAction } from '@api/manage' |
export default { |
||||||
import { validateDuplicateValue } from '@/utils/util' |
name: 'ModulexForm', |
||||||
import moment from "dayjs"; |
components: {}, |
||||||
|
props: { |
||||||
export default { |
//表单禁用 |
||||||
name: 'ModulexForm', |
disabled: { |
||||||
components: { |
type: Boolean, |
||||||
}, |
default: false, |
||||||
props: { |
required: false |
||||||
//表单禁用 |
} |
||||||
disabled: { |
}, |
||||||
type: Boolean, |
data() { |
||||||
default: false, |
return { |
||||||
required: false |
model: { |
||||||
|
workLevel: 2, |
||||||
|
workStatus: 0, |
||||||
|
duration: 1, |
||||||
|
submitTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), |
||||||
|
realDuration: 16, |
||||||
|
status: 1, |
||||||
|
verisonStatus: 1 |
||||||
|
}, |
||||||
|
labelCol: { |
||||||
|
xs: { span: 24 }, |
||||||
|
sm: { span: 5 } |
||||||
|
}, |
||||||
|
wrapperCol: { |
||||||
|
xs: { span: 24 }, |
||||||
|
sm: { span: 16 } |
||||||
|
}, |
||||||
|
confirmLoading: false, |
||||||
|
validatorRules: { |
||||||
|
projectId: [{ required: true, message: '请输入项目id!' }], |
||||||
|
moduleName: [{ required: true, message: '请输入中文名称!' }], |
||||||
|
moduleEnName: [{ required: true, message: '请输入英文名称!' }], |
||||||
|
moduleCode: [{ required: true, message: '请输入模块编码!' }], |
||||||
|
workLevel: [{ required: true, message: '请输入任务等级!' }], |
||||||
|
workStatus: [{ required: true, message: '请输入任务状态!' }], |
||||||
|
duration: [{ required: true, message: '请输入任务时长!' }], |
||||||
|
realDuration: [{ required: true, message: '请输入实际时长!' }], |
||||||
|
status: [{ required: true, message: '请输入模块状态!' }], |
||||||
|
verisonStatus: [{ required: true, message: '请输入版本状态!' }], |
||||||
|
verison: [{ required: true, message: '请输入版本号!' }] |
||||||
|
}, |
||||||
|
url: { |
||||||
|
add: '/modulex/modulex/add', |
||||||
|
edit: '/modulex/modulex/edit', |
||||||
|
queryById: '/modulex/modulex/queryById' |
||||||
} |
} |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
formDisabled() { |
||||||
|
return this.disabled |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
//备份model 原始值 |
||||||
|
this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
add() { |
||||||
|
this.edit(this.modelDefault) |
||||||
}, |
}, |
||||||
data () { |
edit(record) { |
||||||
return { |
this.model = Object.assign({}, record) |
||||||
model:{ |
if (this.model.fuzhi) { |
||||||
workLevel: 2, |
this.model.id = null |
||||||
workStatus: 0, |
this.model.moduleName = this.model.moduleName + '+1' |
||||||
duration: 1, |
this.model.moduleEnName = this.model.moduleEnName + '+1' |
||||||
submitTime: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), |
this.model.moduleCode = this.model.moduleCode + '+1' |
||||||
realDuration: 16, |
this.model.createTime = null |
||||||
status: 1, |
|
||||||
verisonStatus: 1, |
|
||||||
}, |
|
||||||
labelCol: { |
|
||||||
xs: { span: 24 }, |
|
||||||
sm: { span: 5 }, |
|
||||||
}, |
|
||||||
wrapperCol: { |
|
||||||
xs: { span: 24 }, |
|
||||||
sm: { span: 16 }, |
|
||||||
}, |
|
||||||
confirmLoading: false, |
|
||||||
validatorRules: { |
|
||||||
projectId: [ |
|
||||||
{ required: true, message: '请输入项目id!'}, |
|
||||||
], |
|
||||||
moduleName: [ |
|
||||||
{ required: true, message: '请输入中文名称!'}, |
|
||||||
], |
|
||||||
moduleEnName: [ |
|
||||||
{ required: true, message: '请输入英文名称!'}, |
|
||||||
], |
|
||||||
moduleCode: [ |
|
||||||
{ required: true, message: '请输入模块编码!'}, |
|
||||||
], |
|
||||||
workLevel: [ |
|
||||||
{ required: true, message: '请输入任务等级!'}, |
|
||||||
], |
|
||||||
workStatus: [ |
|
||||||
{ required: true, message: '请输入任务状态!'}, |
|
||||||
], |
|
||||||
duration: [ |
|
||||||
{ required: true, message: '请输入任务时长!'}, |
|
||||||
], |
|
||||||
realDuration: [ |
|
||||||
{ required: true, message: '请输入实际时长!'}, |
|
||||||
], |
|
||||||
status: [ |
|
||||||
{ required: true, message: '请输入模块状态!'}, |
|
||||||
], |
|
||||||
verisonStatus: [ |
|
||||||
{ required: true, message: '请输入版本状态!'}, |
|
||||||
], |
|
||||||
verison: [ |
|
||||||
{ required: true, message: '请输入版本号!'}, |
|
||||||
], |
|
||||||
}, |
|
||||||
url: { |
|
||||||
add: "/modulex/modulex/add", |
|
||||||
edit: "/modulex/modulex/edit", |
|
||||||
queryById: "/modulex/modulex/queryById" |
|
||||||
} |
|
||||||
} |
} |
||||||
|
this.visible = true |
||||||
}, |
}, |
||||||
computed: { |
submitForm() { |
||||||
formDisabled(){ |
const that = this |
||||||
return this.disabled |
// 触发表单验证 |
||||||
}, |
this.$refs.form.validate((valid) => { |
||||||
}, |
if (valid) { |
||||||
created () { |
that.confirmLoading = true |
||||||
//备份model 原始值 |
let httpurl = '' |
||||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
let method = '' |
||||||
}, |
if (!this.model.id) { |
||||||
methods: { |
httpurl += this.url.add |
||||||
add () { |
method = 'post' |
||||||
this.edit(this.modelDefault); |
} else { |
||||||
}, |
httpurl += this.url.edit |
||||||
edit (record) { |
method = 'put' |
||||||
this.model = Object.assign({}, record); |
} |
||||||
if (this.model.fuzhi){ |
httpAction(httpurl, this.model, method) |
||||||
|
.then((res) => { |
||||||
this.model.id = null; |
if (res.success) { |
||||||
this.model.moduleName = this.model.moduleName + '+1'; |
that.$message.success(res.message) |
||||||
this.model.moduleEnName = this.model.moduleEnName + '+1'; |
that.$emit('ok') |
||||||
this.model.moduleCode = this.model.moduleCode + '+1'; |
} else { |
||||||
this.model.createTime = null; |
that.$message.warning(res.message) |
||||||
//复制源对象id |
|
||||||
this.model.copyId = record.id; |
|
||||||
} |
|
||||||
this.visible = true; |
|
||||||
}, |
|
||||||
submitForm () { |
|
||||||
const that = this; |
|
||||||
// 触发表单验证 |
|
||||||
this.$refs.form.validate(valid => { |
|
||||||
if (valid) { |
|
||||||
that.confirmLoading = true; |
|
||||||
let httpurl = ''; |
|
||||||
let method = ''; |
|
||||||
if(!this.model.id){ |
|
||||||
httpurl+=this.url.add; |
|
||||||
method = 'post'; |
|
||||||
}else{ |
|
||||||
httpurl+=this.url.edit; |
|
||||||
method = 'put'; |
|
||||||
} |
|
||||||
httpAction(httpurl,this.model,method).then((res)=>{ |
|
||||||
if(res.success){ |
|
||||||
that.$message.success(res.message); |
|
||||||
that.$emit('ok'); |
|
||||||
}else{ |
|
||||||
that.$message.warning(res.message); |
|
||||||
} |
} |
||||||
}).finally(() => { |
|
||||||
that.confirmLoading = false; |
|
||||||
}) |
}) |
||||||
} |
.finally(() => { |
||||||
|
that.confirmLoading = false |
||||||
}) |
}) |
||||||
}, |
} |
||||||
|
}) |
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
} |
||||||
|
</script> |
||||||
|
<style lang="less" scoped> |
||||||
|
.ant-col { |
||||||
|
width: 50%; |
||||||
|
} |
||||||
|
|
||||||
|
/deep/.ant-col-sm-16 { |
||||||
|
width: 70%; |
||||||
|
} |
||||||
|
.ant-col-sm-5 { |
||||||
|
width: 0%; |
||||||
|
} |
||||||
|
.content_describe { |
||||||
|
width: 100%; |
||||||
|
.ant-col-sm-5 { |
||||||
|
width: 10% I; |
||||||
|
} |
||||||
|
/deep/ .ant-col-sm-16 { |
||||||
|
width: 85%; |
||||||
|
} |
||||||
|
} |
||||||
|
/deep/.ant-form-item-label { |
||||||
|
width: 5rem; |
||||||
|
height: 2rem; |
||||||
|
text-align: right; |
||||||
|
// background-color: aquamarine; |
||||||
|
} |
||||||
|
/deep/.ant-radio-wrapper { |
||||||
|
margin-bottom: 0.5rem; |
||||||
|
margin-right: 0.8rem; |
||||||
|
} |
||||||
|
</style> |
||||||
|
Loading…
Reference in new issue