master
e 9 months ago
parent 6d5da189b7
commit e670b074df

@ -0,0 +1,126 @@
<template>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
width: {
type: Number,
default: () => {
return 800
},
},
formItems: {
type: Array,
default: () => {
return []
},
},
labelWidth: {
type: String,
default: () => {
return '100px'
},
},
title: {
type: String,
default: () => {
return '新增'
},
},
},
data() {
return {
confirmLoading: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
model: {},
modelTitle: '',
visible: false,
formDisabled: false, //
isMerge: false, //model
}
},
methods: {
openDialog(opt, data) {
this.visible = true
this.modelTitle = this.title
this.initModel()
if (opt === 'edit') {
//
this.modelTitle = '编辑'
this.mergeModel(data)
}
if (opt === 'detail') {
//
this.modelTitle = '详情'
this.formDisabled = true
this.mergeModel(data)
}
if (opt === 'other') {
this.mergeModel(data)
}
},
//
initModel() {
this.model = {}
this.formItems.forEach((formItem) => {
if (!formItem.attrs || !formItem.attrs.model) return //model()
this.$set(this.model, formItem.attrs.model, formItem.attrs.value ? formItem.attrs.value : '')
})
},
//
mergeModel(data) {
this.model = Object.assign(this.model, data)
},
submitForm() {
//
this.$refs.relForm.validate((valid) => {
if (!valid) {
return
}
this.$emit('dialogSubmit', this.model)
})
},
handleCancel() {
this.visible = false
this.formDisabled = false
this.isMerge = false
},
},
watch: {
/* formItems: {
handler() {
console.log(222)
this.formItems.forEach((formItem) => {
if (!formItem.attrs || !formItem.attrs.model) return //model()
this.$set(
this.model,
formItem.attrs.model,
this.model[formItem.attrs.model] ? this.model[formItem.attrs.model] : formItem.attrs.value
)
})
},
deep: true,
immediate: true,
}, */
},
}
</script>

@ -12,12 +12,20 @@ import Message from './components/message';
import erupload from "./components/upload";
import lkyTable from "./components/publicModule/lkyTable" // 本组件样式包含普通表格、分页
import lkyPagination from "./components/publicModule/lkyPagination" // 本组件单独抽离分页样式
import * as cusRule from '@/loveflow/rules'
import { registerPlugins } from '@/loveflow/plugins/index'
import FormDialog from '@/loveflow/components/modal/formDialog.vue'
Vue.prototype.$rules = cusRule
registerPlugins(Vue)
Vue.use(ElementUI);
Vue.use(Message);
Vue.use(HighchartsVue)
Vue.component('erupload', erupload)
Vue.component('lkyTable', lkyTable)
Vue.component('lkyPagination',lkyPagination)
Vue.component('FormDialog', FormDialog)
const vm = new Vue({
el: '#app',
router,

16560
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save