1 |
- {"remainingRequest":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\boman-framwork\\ruoyi-ui\\src\\components\\FormItemComponent\\index.vue?vue&type=style&index=0&id=2a225fc9&lang=scss&scoped=true&","dependencies":[{"path":"E:\\boman-framwork\\ruoyi-ui\\src\\components\\FormItemComponent\\index.vue","mtime":1620609644448},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\css-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\postcss-loader\\src\\index.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\sass-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg0KLkZvcm1Db21wb25lbnQgew0KICBwYWRkaW5nOiAycHggMTBweCAxMHB4IDEwcHg7DQogIC8vIGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMjI4LCAyMjgsIDIyOCwgMSk7DQp9DQoNCi5Gb3JtQ29tcG9uZW50ID4gcCB7DQogIHBhZGRpbmctbGVmdDogMTA4cHg7DQogIG1hcmdpbi10b3A6IDEwcHg7DQogIGRpc3BsYXk6IGZsZXg7DQogIHdpZHRoOiAzMDBweDsNCg0KICA+IGJ1dHRvbiB7DQogICAgbWFyZ2luLXJpZ2h0OiAxMHB4Ow0KICB9DQp9DQouRm9ybUl0ZW1Db21wb25lbnQgPiBkaXYgew0KICAvKmJvcmRlcjoxcHggc29saWQgI2ZmZjsqLw0KICBib3gtc2l6aW5nOiBib3JkZXItYm94Ow0KfQ0KLkZvcm1JdGVtQ29tcG9uZW50IHsNCiAgZGlzcGxheTogZ3JpZDsNCiAgZ3JpZC10ZW1wbGF0ZS1jb2x1bW5zOiByZXBlYXQoNCwgMjUlKTsNCiAgZ3JpZC1hdXRvLXJvd3M6IG1pbm1heChhdXRvKTsNCn0NCg=="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/components/FormItemComponent","sourcesContent":["<template>\r\n <div class=\"FormComponent\">\r\n <div\r\n class=\"FormItemComponent\"\r\n :style=\"setWidth\"\r\n >\r\n <div\r\n v-for=\"(item,index) in dataColRol\"\r\n :key=\"index\"\r\n class=\"FormItemComponent-item\"\r\n :style=\"setDiv(item)\"\r\n >\r\n <component\r\n :is=\"item.component\"\r\n :ref=\"'component_'+index\"\r\n :index=\"index\"\r\n :items=\"item.item\"\r\n :readonly=\"readonly\"\r\n @inputChange=\"inputChange\"\r\n />\r\n </div>\r\n </div>\r\n <p v-if=\"buttonType\">\r\n <el-button type=\"primary\" plain icon=\"el-icon-search\" @click=\"search\">搜索</el-button>\r\n <el-button icon=\"el-icon-refresh\" size=\"mini\" @click=\"reset\">重置</el-button>\r\n </p>\r\n </div>\r\n</template>\r\n<script>\r\nimport Vue from \"vue\";\r\nimport layoutAlgorithm from \"@/utils/layoutAlgorithm.js\";\r\nexport default {\r\n name: \"FormItemComponent\",\r\n props: {\r\n formItemLists: {\r\n type: Array,\r\n default() {\r\n return [];\r\n }\r\n },\r\n buttonType: {\r\n type: Boolean,\r\n default() {\r\n return true;\r\n }\r\n },\r\n defaultColumn: {\r\n type: Number,\r\n default: 4\r\n },\r\n readonly: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n computed: {\r\n // 通过layoutAlgorithm算法得到对应的位置坐标\r\n dataColRol() {\r\n const list = layoutAlgorithm(this.defaultColumn, this.currentFormList);\r\n let obj = Object.keys(list).reduce((temp, current) => {\r\n // 计算显示行数\r\n list[current].component = Vue.extend(list[current].component);\r\n temp.push(list[current]);\r\n return temp;\r\n }, []);\r\n console.log(obj,98882123)\r\n return obj\r\n },\r\n // 计算属性的 div 的坐标起始点\r\n setDiv() {\r\n return item =>\r\n ` grid-column:${item.x}/${item.col + item.x};grid-row:${\r\n item.y\r\n }/${item.y + item.row};`;\r\n },\r\n // 计算属性的 div的排列格式\r\n setWidth() {\r\n // `this` 指向 vm 实例\r\n const columns = Number(this.defaultColumn) || 4;\r\n return `grid-template-columns: repeat(${columns},${100 / columns}%`;\r\n }\r\n },\r\n watch: {\r\n formItemLists() {\r\n this.currentFormList = this.formItemLists.concat([]);\r\n }\r\n },\r\n data() {\r\n return {\r\n // defaultColumn:4, //默认一行4列\r\n formData: {}, //保存form中输入数据\r\n currentFormList: []\r\n };\r\n },\r\n created() {\r\n this.currentFormList = this.formItemLists.concat([]);\r\n console.log(this.currentFormList,999999999)\r\n },\r\n methods: {\r\n inputChange(value, items, type) {\r\n //有数据改变时\r\n // if(Object.prototype.toString.call(value) === '[object Array]' && (!value[0] || !value[1])){\r\n // delete this.formData[items.filed]\r\n // }else{\r\n // this.formData[items.filed] = value\r\n // }\r\n if (type && type === \"select\") {\r\n this.formData[items.slotfiled] = value;\r\n } else {\r\n this.formData[items.filed] = value;\r\n }\r\n this.$emit(\"formChange\", this.formData);\r\n },\r\n search() {\r\n this.$emit(\"search\", this.formData);\r\n },\r\n reset() {\r\n this.formData = {};\r\n this.currentFormList = this.currentFormList.concat([]);\r\n this.$emit(\"search\", this.formData);\r\n }\r\n }\r\n};\r\n</script>\r\n<style lang=\"scss\" scoped>\r\n.FormComponent {\r\n padding: 2px 10px 10px 10px;\r\n // border: 1px solid rgba(228, 228, 228, 1);\r\n}\r\n\r\n.FormComponent > p {\r\n padding-left: 108px;\r\n margin-top: 10px;\r\n display: flex;\r\n width: 300px;\r\n\r\n > button {\r\n margin-right: 10px;\r\n }\r\n}\r\n.FormItemComponent > div {\r\n /*border:1px solid #fff;*/\r\n box-sizing: border-box;\r\n}\r\n.FormItemComponent {\r\n display: grid;\r\n grid-template-columns: repeat(4, 25%);\r\n grid-auto-rows: minmax(auto);\r\n}\r\n</style>\r\n"]}]}
|