Commit 4ef8e788 authored by 仇晓婷's avatar 仇晓婷

ting

parent 84b996a9
<template>
<div>
<!-- <grid-layout
:layout="layoutData"
:col-num="12"
:row-height="layoutConfig.height"
:is-draggable="layoutConfig.dialogVisible"
:is-resizable="layoutConfig.dialogVisible"
:is-mirrored="false"
:vertical-compact="true"
:margin="[10, 10]"
:use-css-transforms="true"
>
<grid-item
v-for="(item) in layoutData"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i"
>{{item.i}}</grid-item>
</grid-layout> -->
</div>
</template>
<script>
// import VueGridLayout from "vue-grid-layout";
// const GridLayout = VueGridLayout.GridLayout;
// const GridItem = VueGridLayout.GridItem;
export default {
// props: {
// layoutData: Array
// },
components: {
GridLayout,
GridItem
},
data() {
return {
layoutConfig: {
height: 100,
dialogVisible: true
},
layoutData: [
{
x: 0,
y: 0,
w: 1,
h: 1,
i: "0"
},
{
x: 0,
y: 1,
w: 1,
h: 1,
i: "1"
},
{
x: 0,
y: 2,
w: 1,
h: 1,
i: "2"
},
{
x: 0,
y: 3,
w: 1,
h: 1,
i: "3"
},
{
x: 1,
y: 0,
w: 1,
h: 1,
i: "4"
},
{
x: 1,
y: 1,
w: 1,
h: 1,
i: "5"
},
{
x: 1,
y: 2,
w: 1,
h: 1,
i: "6"
},
{
x: 1,
y: 3,
w: 1,
h: 1,
i: "7"
},
{
x: 2,
y: 0,
w: 1,
h: 1,
i: "8"
},
{
x: 2,
y: 1,
w: 1,
h: 1,
i: "9"
},
{
x: 2,
y: 2,
w: 1,
h: 1,
i: "10"
},
{
x: 2,
y: 3,
w: 1,
h: 1,
i: "11"
},
{
x: 3,
y: 0,
w: 1,
h: 1,
i: "12"
},
{
x: 3,
y: 1,
w: 1,
h: 1,
i: "13"
},
{
x: 3,
y: 2,
w: 1,
h: 1,
i: "14"
},
{
x: 3,
y: 3,
w: 1,
h: 1,
i: "15"
},
{
x: 4,
y: 0,
w: 1,
h: 1,
i: "16"
},
{
x: 4,
y: 1,
w: 1,
h: 1,
i: "17"
},
{
x: 4,
y: 2,
w: 1,
h: 1,
i: "18"
},
{
x: 4,
y: 3,
w: 1,
h: 1,
i: "19"
}
]
};
}
};
</script>
<style lang="less" scoped>
.vue-grid-item {
background: aquamarine;
}
</style>
\ No newline at end of file
<template>
<div class="detail">
<Row>
<grid-layout
:layout="layoutData"
:col-num="12"
:row-height="layoutConfig.height"
:is-draggable="layoutConfig.dialogVisible"
:is-resizable="layoutConfig.dialogVisible"
:is-mirrored="false"
:vertical-compact="true"
:margin="[10, 10]"
:use-css-transforms="true"
>
<grid-item
v-for="(item) in layoutData"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i"
>{{item.i}}</grid-item>
</grid-layout>
<!-- <Row>
<Filed :span="12" :name="l('projectId')">{{entity.projectId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}} </Filed>
<Filed :span="12" :name="l('userId')"><User :value="entity.userId" /></Filed>
......@@ -8,54 +29,241 @@
<Filed :span="24" :name="l('status')"><state code="crm.contract.status" :value="entity.status" type="text"></state></Filed>
<Filed :span="24" :name="l('accessory')"><files ref="refFile" :parms="parms" unClosable style="display:inline" /></Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
</Row>
</Row>-->
</div>
</template>
<script>
import Api from './api'
import Api from "./api";
import VueGridLayout from "vue-grid-layout";
const GridLayout = VueGridLayout.GridLayout;
const GridItem = VueGridLayout.GridItem;
export default {
name: 'Add',
name: "Add",
components: {
GridLayout,
GridItem
},
data() {
return {
layoutConfig: {
height: 100,
dialogVisible: true
},
layoutData: [
{
x: 0,
y: 0,
w: 1,
h: 1,
i: "0"
},
{
x: 0,
y: 1,
w: 1,
h: 1,
i: "1"
},
{
x: 0,
y: 2,
w: 1,
h: 1,
i: "2"
},
{
x: 0,
y: 3,
w: 1,
h: 1,
i: "3"
},
{
x: 1,
y: 0,
w: 1,
h: 1,
i: "4"
},
{
x: 1,
y: 1,
w: 1,
h: 1,
i: "5"
},
{
x: 1,
y: 2,
w: 1,
h: 1,
i: "6"
},
{
x: 1,
y: 3,
w: 1,
h: 1,
i: "7"
},
{
x: 2,
y: 0,
w: 1,
h: 1,
i: "8"
},
{
x: 2,
y: 1,
w: 1,
h: 1,
i: "9"
},
{
x: 2,
y: 2,
w: 1,
h: 1,
i: "10"
},
{
x: 2,
y: 3,
w: 1,
h: 1,
i: "11"
},
{
x: 3,
y: 0,
w: 1,
h: 1,
i: "12"
},
{
x: 3,
y: 1,
w: 1,
h: 1,
i: "13"
},
{
x: 3,
y: 2,
w: 1,
h: 1,
i: "14"
},
{
x: 3,
y: 3,
w: 1,
h: 1,
i: "15"
},
{
x: 4,
y: 0,
w: 1,
h: 1,
i: "16"
},
{
x: 4,
y: 1,
w: 1,
h: 1,
i: "17"
},
{
x: 4,
y: 2,
w: 1,
h: 1,
i: "18"
},
{
x: 4,
y: 3,
w: 1,
h: 1,
i: "19"
}
],
layoutList: [],
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: 'contract',
app: "contract",
eid: null,
name: '',
field: ''
},
}
name: "",
field: ""
}
};
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.parms.eid = r.result.id
this.$refs.refFile.intFiles()
this.$emit('on-load')
})
Api.get({ id: v }).then(r => {
this.entity = r.result;
let list = [
{
x: 0,
y: 0,
w: 1,
h: 1,
i: "akkallf",
label: "销售人员"
},
{
x: 0,
y: 1,
w: 1,
h: 1,
i: "坎坎坷坷",
label: "销售人员"
},
{
x: 0,
y: 2,
w: 1,
h: 1,
i: "H黄金季节",
label: "销售人员"
}
];
this.layoutList = list;
this.parms.eid = r.result.id;
this.$refs.refFile.intFiles();
this.$emit("on-load");
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = 'Contract' + '.' + key
return this.$t(key)
key = "Contract" + "." + key;
return this.$t(key);
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
this.load(v);
}
}
}
}
};
</script>
<style lang="less" scoped>
.vue-grid-item {
background: aquamarine;
}
</style>
......@@ -38,6 +38,7 @@ import FilesList from '@/components/page/filesList.vue'
import DataGrid from '@/components/page/dataGrid.vue'
import TreeGrid from '@/components/page/treeGrid/index.vue'
import Filed from '@/components/page/filed.vue'
// import Layout from '@/components/page/layout.vue'
import User from '@/components/page/user.vue'
import op from '@/components/page/opration.vue'
import ProductNumberSelect from '@/components/page/productNumberSelect.vue'
......@@ -79,6 +80,7 @@ Vue.component("FilesList", FilesList)
Vue.component("DataGrid", DataGrid)
Vue.component("TreeGrid", TreeGrid)
Vue.component("Filed", Filed)
// Vue.component("Layout", Layout)
Vue.component("UserSelect", UserSelect)
Vue.component("RoleSelect", RoleSelect)
Vue.component("UserExamSelect", UserExamSelect)
......@@ -95,8 +97,8 @@ Vue.component("DTSearch", DTSearch)
//注入mock
// require("../mock")
Vue.prototype.$api=request;
Vue.prototype.$http=Api;
Vue.prototype.$api = request;
Vue.prototype.$http = Api;
Vue.prototype.$u = Henq;
export default ({
app,
......@@ -157,19 +159,19 @@ export default ({
})
}
Vue.directive('auth',{
inserted (el, binding, vnode) {
Vue.directive('auth', {
inserted(el, binding, vnode) {
const { value } = binding;
const access = store.state.admin.user.info.access;
if (value && value instanceof Array && value.length && access && access.length) {
const isPermission = includeArray(value, access);
if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el);
}
const isPermission = includeArray(value, access);
if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el);
}
}
}
} )
}
})
Vue.directive('paste', {
bind(el, binding, vnode) {
el.addEventListener('paste', function (event) { //这里直接监听元素的粘贴事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment