form-create-designer-ant
Version:
由@form-create/designer修改而来,基于ant design组件
59 lines (54 loc) • 2.07 kB
JavaScript
import AntFcDesigner from './components/AntFcDesigner.vue';
import DragTool from './components/DragTool.vue';
import Struct from './components/Struct.vue';
import Fetch from './components/Fetch.vue';
import Validate from './components/Validate.vue';
import DragBox from './components/DragBox.vue';
import formCreate from '@form-create/ant-design-vue';
import FcEditor from '@form-create/component-wangeditor';
import './style/index.css';
import './style/iconfont.css';
import draggable from 'vuedraggable';
import unique from '@form-create/utils/lib/unique';
import {makeOptionsRule} from './utils/index.js';
import FormSelect from './components/FormSelect.vue';
import PersonsSelect from './components/PersonsSelect.vue';
import UploadFile from './components/UploadFile.vue';
import Storage from 'vue-ls';
import Vue from 'vue';
Vue.use(Storage, {
namespace: 'pro__', // key prefix
name: 'lsl', // name variable Vue.[ls] or this.[$ls],
storage: 'local', // storage name session, local, memory
});
formCreate.component('draggable', draggable);
formCreate.component('DragTool', DragTool);
formCreate.component('DragBox', DragBox);
formCreate.component('Validate', Validate);
formCreate.component('Struct', Struct);
formCreate.component('Fetch', Fetch);
formCreate.component('FcEditor', FcEditor);
formCreate.component('FormSelect',FormSelect);
formCreate.component('PersonsSelect',PersonsSelect);
formCreate.component('UploadFile',UploadFile);
formCreate.register('_fc', {
init(fc, rule) {
rule.id = unique();
if (!fc.value && rule.field)
rule.field = unique();
if (fc.value) {
rule.effect._fc = false;
}
}
});
formCreate.register('_fc_tool', {
init(_, rule) {
rule.props.unique = unique();
}
});
AntFcDesigner.makeOptionsRule = makeOptionsRule;
AntFcDesigner.install = function (Vue) {
Vue.component('AntFcDesigner', AntFcDesigner);
Vue.component('formCreate', formCreate);
};
export default AntFcDesigner;