Skip to content

Commit

Permalink
build v3.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
smallweis committed Oct 24, 2024
1 parent 0e64346 commit 5a57638
Show file tree
Hide file tree
Showing 13 changed files with 1,428 additions and 1,901 deletions.
3,244 changes: 1,380 additions & 1,864 deletions lib/avue.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/avue.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smallwei/avue",
"version": "3.5.3",
"version": "3.5.4",
"description": "A Magic Configurable Web Framework",
"main": "lib/avue.min.js",
"unpkg": "lib/avue.min.js",
Expand Down Expand Up @@ -64,7 +64,7 @@
"@element-plus/icons-vue": "^2.0.6",
"countup.js": "^1.9.3",
"dayjs": "^1.10.4",
"loadsh": "^0.0.4"
"lodash": "^4.17.21"
},
"files": [
"lib",
Expand Down
40 changes: 23 additions & 17 deletions packages/core/common/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default function (name) {
mixins: [slot],
emits: ['update:modelValue', 'update:defaults', 'change'],
props: {
tableData: {
type: Object,
default: () => {
return {}
}
},
defaults: {
type: Object,
default () {
Expand All @@ -29,58 +35,58 @@ export default function (name) {
},
watch: {
defaults: {
handler(val) {
handler (val) {
this.objectOption = val;
},
deep: true
},
objectOption: {
handler(val) {
handler (val) {
this.$emit('update:defaults', val)
},
deep: true
},
propOption: {
handler(list) {
handler (list) {
this.objectOption = {};
list.forEach(ele => this.objectOption[ele.prop] = ele);
},
deep: true,
},
option: {
handler() {
handler () {
this.init(false);
},
deep: true,
},
},
data() {
data () {
return {
DIC: {},
cascaderDIC: {},
tableOption: {},
objectOption: {}
};
},
mounted() {
mounted () {
this.init();
},
computed: {
isMobile() {
isMobile () {
return document.body.clientWidth <= 768;
},
resultOption() {
resultOption () {
return {
...this.tableOption,
...{
column: this.propOption || []
}
}
},
rowKey() {
rowKey () {
return this.tableOption.rowKey || DIC_PROPS.rowKey;
},
formRules() {
formRules () {
let result = {};
this.propOption.forEach(ele => {
if (ele.rules && ele.display !== false)
Expand All @@ -90,7 +96,7 @@ export default function (name) {
}
},
methods: {
init(type) {
init (type) {
let globOption = this.deepClone(this.$AVUE[`${name}Option`])
let option = {
...globOption,
Expand All @@ -100,14 +106,14 @@ export default function (name) {
this.handleLocalDic();
if (type !== false) this.handleLoadDic()
},
dicInit(type) {
dicInit (type) {
if (type === 'cascader') {
this.handleLoadCascaderDic()
} else {
this.handleLoadDic();
}
},
updateDic(prop, list) {
updateDic (prop, list) {
let column = this.findObject(this.propOption, prop);
if (this.validatenull(list) && this.validatenull(prop)) {
this.handleLoadDic();
Expand All @@ -121,21 +127,21 @@ export default function (name) {
this.DIC[prop] = list;
}
},
handleSetDic(list, res = {}) {
handleSetDic (list, res = {}) {
Object.keys(res).forEach(ele => {
list[ele] = res[ele]
});
},
//本地字典
handleLocalDic() {
handleLocalDic () {
loadLocalDic(this.resultOption, this)
},
// 网络字典加载
handleLoadDic() {
handleLoadDic () {
loadDic(this.resultOption, this)
},
//级联字典加载
handleLoadCascaderDic() {
handleLoadCascaderDic () {
loadCascaderDic(this.propOption, this)
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/common/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export default function () {
default: ''
},
tableData: {
type: Object
type: Object,
default: () => {
return {}
}
},
modelValue: {},
column: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/components/dialog-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function (_context) {
instance.props.onDestroy = onDestroy;
instance.close = onDestroy;
render(instance, parent)
appendTo.appendChild(parent.firstElementChild);
appendTo.appendChild(parent);
return instance;
}
}
1 change: 0 additions & 1 deletion packages/core/components/dialog-form/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<component :is="dialogType"
v-model="visible"
v-if="visible"
destroy-on-close
class="avue-dialog"
:beforeClose="beforeClose"
Expand Down
1 change: 1 addition & 0 deletions packages/element-ui/dynamic/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
circle></el-button>
<avue-form :key="index"
ref="main"
:table-data="{row:text[index],index}"
:option="option"
v-bind="$uploadFun(null,this)"
v-model="text[index]">
Expand Down
1 change: 1 addition & 0 deletions packages/element-ui/form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
:propsHttp="tableOption.propsHttp"
:render="column.render"
:row="form"
:table-data="tableData"
:readonly="column.readonly || readonly"
v-bind="$uploadFun(column)"
:disabled="getDisabled(column)"
Expand Down
7 changes: 6 additions & 1 deletion packages/element-ui/select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ export default create({
},
props: {
virtualize: Boolean,
emptyValues: Array,
emptyValues: {
type: Array,
default: () => {
return []
}
},
valueOnClear: {
type: [String, Number, Boolean, Function],
default: undefined,
Expand Down
12 changes: 3 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
import {
typeList
} from 'global/variable';
import _get from 'loadsh/get';
import _set from 'loadsh/set';
import _get from 'lodash/get';
import _set from 'lodash/set';
import _cloneDeep from 'lodash/cloneDeep';
export const isMediaType = (url, type) => {
if (validatenull(url)) return;
Expand Down Expand Up @@ -39,6 +39,8 @@ export function getFixed (val = 0, len = 2) {
return Number(val.toFixed(len));
}
export function getAsVal (obj, bind = '') {
let result = deepClone(obj);
if (validatenull(bind)) return result;
return _get(obj, bind);
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '3.5.3'
export const version = '3.5.4'

0 comments on commit 5a57638

Please sign in to comment.