Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Dropdown from 'heyui/src/plugins/dropdown';
import dateBase from 'heyui/src/components/date-picker/datebase';
import Locale from 'heyui/src/mixins/locale';
const prefix = 'h-datetime';
const manbaType = {
year: manba.YEAR,
month: manba.MONTH,
date: manba.DAY,
datetime: manba.MINUTE,
time: manba.MINUTE,
datehour: manba.HOUR
};
const options = config.getOption('datepicker');
export default {
name: 'hDatePicker',
mixins: [Locale],
props: {
disabled: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
type: {
type: [String],
default: 'date' // year, month, week
default: () => config.getOption('datepicker.startWeek')
}
default: () => config.getOption('dict', 'titleName')
},
data() {
let format = config.getOption('datepicker.format');
let defaultType = this.value && this.value.type ? this.value.type : this.defaultType;
return {
allviews: {
year: this.t('h.date.year'),
quarter: this.t('h.date.quarter'),
month: this.t('h.date.month'),
week: this.t('h.date.week'),
date: this.t('h.date.day'),
customize: this.t('h.datepicker.customize')
},
nowFormat: this.hasTime ? format.datetime : format.date,
paramName: config.getOption('datepicker.daterangeOptions.paramName'),
nowDate: {
start: '',
end: ''
},
nowView: {
start: manba(),
end: manba().add(1, manba.MONTH)
},
view: defaultType,
rangeEnd: '',
isShow: false
};
},
beforeMount() {
param() {
if (this.config) {
return utils.extend({}, config.getOption('categoryPicker.default'), config.getOption(
`categoryPicker.configs.${this.config}`), this.option);
} else {
return utils.extend({}, config.getOption('categoryPicker.default'), this.option);
}
},
categoryCls() {
default: () => config.getOption('page.size')
},
import Notify from 'heyui/src/plugins/notify';
import utils from 'heyui/src/utils/utils';
import config from 'heyui/src/utils/config';
const prefixCls = 'h-modal';
const hasDivider = config.getOption('modal', 'hasDivider');
let Vue = null;
let Default = {
middle: false,
hasDivider,
fullScreen: false,
className: ''
};
function Modal(originalParam) {
let cls = prefixCls;
let param = utils.extend({ hasMask: true, closeOnMask: true, buttons: ['cancel'] }, Default, originalParam, true);
if (originalParam.hasDivider || Default.hasDivider) {
param.className += ` h-modal-has-divider`;
param() {
if (this.config) {
return utils.extend({},
config.getOption('tree.default'),
config.getOption(`tree.configs.${this.config}`),
this.option
);
} else {
return utils.extend({}, config.getOption('tree.default'), this.option);
}
},
showCls() {
sizesShow() {
const keyField = config.getOption('dict', 'keyName');
const titleField = config.getOption('dict', 'titleName');
return this.sizes.map(item => {
return {
[keyField]: item,
[titleField]: this.t('h.pagination.sizeOfPage', { size: item })
};
});
},
curNow() {