diff --git a/ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm.vue b/ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm.vue index e5e655a..9000645 100644 --- a/ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm.vue +++ b/ant-design-vue-jeecg/src/views/functionx/modules/FunctionxForm.vue @@ -515,181 +515,3 @@ export default { margin-right: 15px; } - - - import { httpAction, getAction } from '@/api/manage' - import { validateDuplicateValue1 } from '@/utils/util' - - export default { - name: 'FunctionxForm', - components: { - }, - props: { - //表单禁用 - disabled: { - type: Boolean, - default: false, - required: false - } - }, - data () { - return { - model:{ - workLevel:2, - workStatus:0, - - }, - labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, - }, - confirmLoading: false, - validatorRules: { - moduleId: [ - { required: true, message: '请输入对应模块id!'}, - ], - functionName: [ - { required: true, message: '请输入中文名称!'}, - { validator: (rule, value, callback) => validateDuplicateValue1('functionx', 'function_name', value, this.model.id,this.moduleid, callback)}, - ], - functionEnName: [ - { required: true, message: '请输入英文名称!'}, - { validator: (rule, value, callback) => validateDuplicateValue1('functionx', 'function_en_name', value, this.model.id,this.moduleid, callback)}, - ], - functionCode: [ - { required: true, message: '请输入功能编码!'}, - ], - functionType: [ - { required: true, message: '请输入功能类型!'}, - ], - workLevel: [ - { required: true, message: '请输入任务等级!'}, - ], - workStatus: [ - { required: true, message: '请输入任务状态!'}, - ], - realDuration: [ - { required: true, message: '请输入实际时长!'}, - ], - status: [ - { required: true, message: '请输入功能状态!'}, - ], - verisonStatus: [ - { required: true, message: '请输入版本状态!'}, - ], - verison: [ - { required: true, message: '请输入版本号!'}, - ], - }, - url: { - add: "/functionx/functionx/add", - edit: "/functionx/functionx/edit", - queryById: "/functionx/functionx/queryById", - bianma:'/functionx/functionx/bianma' - }, - moduleid:'', - modulecode:'', - } - }, - computed: { - formDisabled(){ - return this.disabled - }, - }, - created () { - //备份model原始值 - this.moduleid=this.$route.query.moduleid - this.model.moduleId=this.$route.query.moduleid - //获得模块编码 - this.modulebianma(this.moduleid) - this.modelDefault = JSON.parse(JSON.stringify(this.model)); - }, - methods: { - functionxbianma(){ - if(this.model.functionType==0){ - this.model.functionCode=this.modulecode+"列表" - } - else if(this.model.functionType==1){ - this.model.functionCode=this.modulecode+"增加" - } - else if(this.model.functionType==2){ - this.model.functionCode=this.modulecode+"删除" - } - else if(this.model.functionType==3){ - this.model.functionCode=this.modulecode+"修改" - } - else if(this.model.functionType==4){ - this.model.functionCode=this.modulecode+"查看" - } - else if(this.model.functionType==5){ - this.model.functionCode=this.modulecode+"导入" - } - else if(this.model.functionType==6){ - this.model.functionCode=this.modulecode+"导出" - } - else { - this.model.functionCode=this.modulecode+"其他" - } - console.log(this.model.functionCode,"---------") - }, - modulebianma(id){ - getAction(this.url.bianma,{id:id}).then((res)=>{ - if (res.success) { - //重新计算分页问题 - this.modulecode=res.result; - - } - }) - }, - add () { - this.edit(this.modelDefault); - }, - edit (record) { - this.model = Object.assign({}, record); - if(this.model.functionName1!=null){ - this.model.functionName=this.model.functionName1; - } - if(this.model.functionEnName1!=null){ - this.model.functionEnName=this.model.functionEnName1 - } - if(this.model.functionCode1!=null){ - this.model.functionCode=this.model.functionCode1 - } - 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; - }) - } - - }) - }, - } - } - \ No newline at end of file