Initial commit

This commit is contained in:
danshihao
2024-06-11 15:39:01 +08:00
commit 00acf31aa3
1589 changed files with 520803 additions and 0 deletions
@@ -0,0 +1,103 @@
<template>
<j-modal
:title="title"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.nodeName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
:maxLength="50"
v-decorator="['nodeName', validatorRules.nodeName]" />
</a-form-item>
</a-form>
</j-modal>
</template>
<script>
import { addDomesticSystemTree, editDomesticSystemTree } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'DomesticSystemTreeModal',
data () {
return {
title: this.$t('operation'),
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 节点名称
nodeName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'blur'
}
}
}
},
methods: {
add (parentInfo) {
this.edit(parentInfo)
},
edit (record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
},
close () {
this.visible = false
},
handleOk () {
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
formData.nodeOrder = '0'
let submitFunc
if (this.model.id) {
submitFunc = editDomesticSystemTree
} else {
submitFunc = addDomesticSystemTree
}
submitFunc(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped lang="less">
</style>