请上传
大小不超过 {{ fileSize }}MB
格式为 {{ fileType.join("/") }}
@@ -26,12 +26,12 @@
-
+
{{ getFileName(file.name) }}
- 删除
+ 删除
@@ -39,21 +39,22 @@
diff --git a/dvadmin-ui/src/components/Hamburger/index.vue b/dvadmin-ui/src/components/Hamburger/index.vue
index 368b002..243e5e9 100755
--- a/dvadmin-ui/src/components/Hamburger/index.vue
+++ b/dvadmin-ui/src/components/Hamburger/index.vue
@@ -15,7 +15,7 @@
\ No newline at end of file
+
diff --git a/dvadmin-ui/src/components/Modal/DetailFormDialog.vue b/dvadmin-ui/src/components/Modal/DetailFormDialog.vue
index 1300f1c..6d63a69 100644
--- a/dvadmin-ui/src/components/Modal/DetailFormDialog.vue
+++ b/dvadmin-ui/src/components/Modal/DetailFormDialog.vue
@@ -1,22 +1,23 @@
-
-
-
-
-
+
+
+
-
+
{{ parseFormItemContent(item) }}
@@ -33,43 +34,43 @@
`
+ `;
}
function buildFormTemplate(conf, child, type) {
- let labelPosition = ''
- if (conf.labelPosition !== 'right') {
- labelPosition = `label-position="${conf.labelPosition}"`
+ let labelPosition = "";
+ if (conf.labelPosition !== "right") {
+ labelPosition = `label-position="${conf.labelPosition}"`;
}
- const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : ''
+ const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : "";
let str = `
${child}
${buildFromBtns(conf, type)}
- `
+ `;
if (someSpanIsNot24) {
str = `
${str}
- `
+ `;
}
- return str
+ return str;
}
function buildFromBtns(conf, type) {
- let str = ''
- if (conf.formBtns && type === 'file') {
+ let str = "";
+ if (conf.formBtns && type === "file") {
str = `
提交
重置
- `
+ `;
if (someSpanIsNot24) {
str = `
${str}
- `
+ `;
}
}
- return str
+ return str;
}
// span不为24的用el-col包裹
@@ -73,287 +73,286 @@ function colWrapper(element, str) {
if (someSpanIsNot24 || element.span !== 24) {
return `
${str}
- `
+ `;
}
- return str
+ return str;
}
const layouts = {
colFormItem(element) {
- let labelWidth = ''
+ let labelWidth = "";
if (element.labelWidth && element.labelWidth !== confGlobal.labelWidth) {
- labelWidth = `label-width="${element.labelWidth}px"`
+ labelWidth = `label-width="${element.labelWidth}px"`;
}
- const required = !trigger[element.tag] && element.required ? 'required' : ''
- const tagDom = tags[element.tag] ? tags[element.tag](element) : null
+ const required = !trigger[element.tag] && element.required ? "required" : "";
+ const tagDom = tags[element.tag] ? tags[element.tag](element) : null;
let str = `
${tagDom}
- `
- str = colWrapper(element, str)
- return str
+ `;
+ str = colWrapper(element, str);
+ return str;
},
rowFormItem(element) {
- const type = element.type === 'default' ? '' : `type="${element.type}"`
- const justify = element.type === 'default' ? '' : `justify="${element.justify}"`
- const align = element.type === 'default' ? '' : `align="${element.align}"`
- const gutter = element.gutter ? `gutter="${element.gutter}"` : ''
- const children = element.children.map(el => layouts[el.layout](el))
+ const type = element.type === "default" ? "" : `type="${element.type}"`;
+ const justify = element.type === "default" ? "" : `justify="${element.justify}"`;
+ const align = element.type === "default" ? "" : `align="${element.align}"`;
+ const gutter = element.gutter ? `gutter="${element.gutter}"` : "";
+ const children = element.children.map(el => layouts[el.layout](el));
let str = `
- ${children.join('\n')}
- `
- str = colWrapper(element, str)
- return str
+ ${children.join("\n")}
+ `;
+ str = colWrapper(element, str);
+ return str;
}
-}
+};
const tags = {
- 'el-button': el => {
+ "el-button": el => {
const {
- tag, disabled
- } = attrBuilder(el)
- const type = el.type ? `type="${el.type}"` : ''
- const icon = el.icon ? `icon="${el.icon}"` : ''
- const size = el.size ? `size="${el.size}"` : ''
- let child = buildElButtonChild(el)
+ disabled
+ } = attrBuilder(el);
+ const type = el.type ? `type="${el.type}"` : "";
+ const icon = el.icon ? `icon="${el.icon}"` : "";
+ const size = el.size ? `size="${el.size}"` : "";
+ let child = buildElButtonChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}${el.tag}>`;
},
- 'el-input': el => {
+ "el-input": el => {
const {
disabled, vModel, clearable, placeholder, width
- } = attrBuilder(el)
- const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : ''
- const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : ''
- const readonly = el.readonly ? 'readonly' : ''
- const prefixIcon = el['prefix-icon'] ? `prefix-icon='${el['prefix-icon']}'` : ''
- const suffixIcon = el['suffix-icon'] ? `suffix-icon='${el['suffix-icon']}'` : ''
- const showPassword = el['show-password'] ? 'show-password' : ''
- const type = el.type ? `type="${el.type}"` : ''
+ } = attrBuilder(el);
+ const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : "";
+ const showWordLimit = el["show-word-limit"] ? "show-word-limit" : "";
+ const readonly = el.readonly ? "readonly" : "";
+ const prefixIcon = el["prefix-icon"] ? `prefix-icon='${el["prefix-icon"]}'` : "";
+ const suffixIcon = el["suffix-icon"] ? `suffix-icon='${el["suffix-icon"]}'` : "";
+ const showPassword = el["show-password"] ? "show-password" : "";
+ const type = el.type ? `type="${el.type}"` : "";
const autosize = el.autosize && el.autosize.minRows
? `:autosize="{minRows: ${el.autosize.minRows}, maxRows: ${el.autosize.maxRows}}"`
- : ''
- let child = buildElInputChild(el)
+ : "";
+ let child = buildElInputChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${vModel} ${type} ${placeholder} ${maxlength} ${showWordLimit} ${readonly} ${disabled} ${clearable} ${prefixIcon} ${suffixIcon} ${showPassword} ${autosize} ${width}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${vModel} ${type} ${placeholder} ${maxlength} ${showWordLimit} ${readonly} ${disabled} ${clearable} ${prefixIcon} ${suffixIcon} ${showPassword} ${autosize} ${width}>${child}${el.tag}>`;
},
- 'el-input-number': el => {
- const { disabled, vModel, placeholder } = attrBuilder(el)
- const controlsPosition = el['controls-position'] ? `controls-position=${el['controls-position']}` : ''
- const min = el.min ? `:min='${el.min}'` : ''
- const max = el.max ? `:max='${el.max}'` : ''
- const step = el.step ? `:step='${el.step}'` : ''
- const stepStrictly = el['step-strictly'] ? 'step-strictly' : ''
- const precision = el.precision ? `:precision='${el.precision}'` : ''
+ "el-input-number": el => {
+ const { disabled, vModel, placeholder } = attrBuilder(el);
+ const controlsPosition = el["controls-position"] ? `controls-position=${el["controls-position"]}` : "";
+ const min = el.min ? `:min='${el.min}'` : "";
+ const max = el.max ? `:max='${el.max}'` : "";
+ const step = el.step ? `:step='${el.step}'` : "";
+ const stepStrictly = el["step-strictly"] ? "step-strictly" : "";
+ const precision = el.precision ? `:precision='${el.precision}'` : "";
- return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}>${el.tag}>`;
},
- 'el-select': el => {
+ "el-select": el => {
const {
disabled, vModel, clearable, placeholder, width
- } = attrBuilder(el)
- const filterable = el.filterable ? 'filterable' : ''
- const multiple = el.multiple ? 'multiple' : ''
- let child = buildElSelectChild(el)
+ } = attrBuilder(el);
+ const filterable = el.filterable ? "filterable" : "";
+ const multiple = el.multiple ? "multiple" : "";
+ let child = buildElSelectChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}${el.tag}>`;
},
- 'el-radio-group': el => {
- const { disabled, vModel } = attrBuilder(el)
- const size = `size="${el.size}"`
- let child = buildElRadioGroupChild(el)
+ "el-radio-group": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const size = `size="${el.size}"`;
+ let child = buildElRadioGroupChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${vModel} ${size} ${disabled}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${vModel} ${size} ${disabled}>${child}${el.tag}>`;
},
- 'el-checkbox-group': el => {
- const { disabled, vModel } = attrBuilder(el)
- const size = `size="${el.size}"`
- const min = el.min ? `:min="${el.min}"` : ''
- const max = el.max ? `:max="${el.max}"` : ''
- let child = buildElCheckboxGroupChild(el)
+ "el-checkbox-group": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const size = `size="${el.size}"`;
+ const min = el.min ? `:min="${el.min}"` : "";
+ const max = el.max ? `:max="${el.max}"` : "";
+ let child = buildElCheckboxGroupChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}${el.tag}>`;
},
- 'el-switch': el => {
- const { disabled, vModel } = attrBuilder(el)
- const activeText = el['active-text'] ? `active-text="${el['active-text']}"` : ''
- const inactiveText = el['inactive-text'] ? `inactive-text="${el['inactive-text']}"` : ''
- const activeColor = el['active-color'] ? `active-color="${el['active-color']}"` : ''
- const inactiveColor = el['inactive-color'] ? `inactive-color="${el['inactive-color']}"` : ''
- const activeValue = el['active-value'] !== true ? `:active-value='${JSON.stringify(el['active-value'])}'` : ''
- const inactiveValue = el['inactive-value'] !== false ? `:inactive-value='${JSON.stringify(el['inactive-value'])}'` : ''
+ "el-switch": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const activeText = el["active-text"] ? `active-text="${el["active-text"]}"` : "";
+ const inactiveText = el["inactive-text"] ? `inactive-text="${el["inactive-text"]}"` : "";
+ const activeColor = el["active-color"] ? `active-color="${el["active-color"]}"` : "";
+ const inactiveColor = el["inactive-color"] ? `inactive-color="${el["inactive-color"]}"` : "";
+ const activeValue = el["active-value"] !== true ? `:active-value='${JSON.stringify(el["active-value"])}'` : "";
+ const inactiveValue = el["inactive-value"] !== false ? `:inactive-value='${JSON.stringify(el["inactive-value"])}'` : "";
- return `<${el.tag} ${vModel} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor} ${activeValue} ${inactiveValue} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor} ${activeValue} ${inactiveValue} ${disabled}>${el.tag}>`;
},
- 'el-cascader': el => {
+ "el-cascader": el => {
const {
disabled, vModel, clearable, placeholder, width
- } = attrBuilder(el)
- const options = el.options ? `:options="${el.vModel}Options"` : ''
- const props = el.props ? `:props="${el.vModel}Props"` : ''
- const showAllLevels = el['show-all-levels'] ? '' : ':show-all-levels="false"'
- const filterable = el.filterable ? 'filterable' : ''
- const separator = el.separator === '/' ? '' : `separator="${el.separator}"`
+ } = attrBuilder(el);
+ const options = el.options ? `:options="${el.vModel}Options"` : "";
+ const props = el.props ? `:props="${el.vModel}Props"` : "";
+ const showAllLevels = el["show-all-levels"] ? "" : ':show-all-levels="false"';
+ const filterable = el.filterable ? "filterable" : "";
+ const separator = el.separator === "/" ? "" : `separator="${el.separator}"`;
- return `<${el.tag} ${vModel} ${options} ${props} ${width} ${showAllLevels} ${placeholder} ${separator} ${filterable} ${clearable} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${options} ${props} ${width} ${showAllLevels} ${placeholder} ${separator} ${filterable} ${clearable} ${disabled}>${el.tag}>`;
},
- 'el-slider': el => {
- const { disabled, vModel } = attrBuilder(el)
- const min = el.min ? `:min='${el.min}'` : ''
- const max = el.max ? `:max='${el.max}'` : ''
- const step = el.step ? `:step='${el.step}'` : ''
- const range = el.range ? 'range' : ''
- const showStops = el['show-stops'] ? `:show-stops="${el['show-stops']}"` : ''
+ "el-slider": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const min = el.min ? `:min='${el.min}'` : "";
+ const max = el.max ? `:max='${el.max}'` : "";
+ const step = el.step ? `:step='${el.step}'` : "";
+ const range = el.range ? "range" : "";
+ const showStops = el["show-stops"] ? `:show-stops="${el["show-stops"]}"` : "";
- return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}>${el.tag}>`;
},
- 'el-time-picker': el => {
+ "el-time-picker": el => {
const {
disabled, vModel, clearable, placeholder, width
- } = attrBuilder(el)
- const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : ''
- const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : ''
- const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : ''
- const isRange = el['is-range'] ? 'is-range' : ''
- const format = el.format ? `format="${el.format}"` : ''
- const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : ''
- const pickerOptions = el['picker-options'] ? `:picker-options='${JSON.stringify(el['picker-options'])}'` : ''
+ } = attrBuilder(el);
+ const startPlaceholder = el["start-placeholder"] ? `start-placeholder="${el["start-placeholder"]}"` : "";
+ const endPlaceholder = el["end-placeholder"] ? `end-placeholder="${el["end-placeholder"]}"` : "";
+ const rangeSeparator = el["range-separator"] ? `range-separator="${el["range-separator"]}"` : "";
+ const isRange = el["is-range"] ? "is-range" : "";
+ const format = el.format ? `format="${el.format}"` : "";
+ const valueFormat = el["value-format"] ? `value-format="${el["value-format"]}"` : "";
+ const pickerOptions = el["picker-options"] ? `:picker-options='${JSON.stringify(el["picker-options"])}'` : "";
- return `<${el.tag} ${vModel} ${isRange} ${format} ${valueFormat} ${pickerOptions} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${isRange} ${format} ${valueFormat} ${pickerOptions} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${disabled}>${el.tag}>`;
},
- 'el-date-picker': el => {
+ "el-date-picker": el => {
const {
disabled, vModel, clearable, placeholder, width
- } = attrBuilder(el)
- const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : ''
- const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : ''
- const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : ''
- const format = el.format ? `format="${el.format}"` : ''
- const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : ''
- const type = el.type === 'date' ? '' : `type="${el.type}"`
- const readonly = el.readonly ? 'readonly' : ''
+ } = attrBuilder(el);
+ const startPlaceholder = el["start-placeholder"] ? `start-placeholder="${el["start-placeholder"]}"` : "";
+ const endPlaceholder = el["end-placeholder"] ? `end-placeholder="${el["end-placeholder"]}"` : "";
+ const rangeSeparator = el["range-separator"] ? `range-separator="${el["range-separator"]}"` : "";
+ const format = el.format ? `format="${el.format}"` : "";
+ const valueFormat = el["value-format"] ? `value-format="${el["value-format"]}"` : "";
+ const type = el.type === "date" ? "" : `type="${el.type}"`;
+ const readonly = el.readonly ? "readonly" : "";
- return `<${el.tag} ${type} ${vModel} ${format} ${valueFormat} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${readonly} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${type} ${vModel} ${format} ${valueFormat} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${readonly} ${disabled}>${el.tag}>`;
},
- 'el-rate': el => {
- const { disabled, vModel } = attrBuilder(el)
- const max = el.max ? `:max='${el.max}'` : ''
- const allowHalf = el['allow-half'] ? 'allow-half' : ''
- const showText = el['show-text'] ? 'show-text' : ''
- const showScore = el['show-score'] ? 'show-score' : ''
+ "el-rate": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const allowHalf = el["allow-half"] ? "allow-half" : "";
+ const showText = el["show-text"] ? "show-text" : "";
+ const showScore = el["show-score"] ? "show-score" : "";
- return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}>${el.tag}>`;
},
- 'el-color-picker': el => {
- const { disabled, vModel } = attrBuilder(el)
- const size = `size="${el.size}"`
- const showAlpha = el['show-alpha'] ? 'show-alpha' : ''
- const colorFormat = el['color-format'] ? `color-format="${el['color-format']}"` : ''
+ "el-color-picker": el => {
+ const { disabled, vModel } = attrBuilder(el);
+ const size = `size="${el.size}"`;
+ const showAlpha = el["show-alpha"] ? "show-alpha" : "";
+ const colorFormat = el["color-format"] ? `color-format="${el["color-format"]}"` : "";
- return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}>${el.tag}>`
+ return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}>${el.tag}>`;
},
- 'el-upload': el => {
- const disabled = el.disabled ? ':disabled=\'true\'' : ''
- const action = el.action ? `:action="${el.vModel}Action"` : ''
- const multiple = el.multiple ? 'multiple' : ''
- const listType = el['list-type'] !== 'text' ? `list-type="${el['list-type']}"` : ''
- const accept = el.accept ? `accept="${el.accept}"` : ''
- const name = el.name !== 'file' ? `name="${el.name}"` : ''
- const autoUpload = el['auto-upload'] === false ? ':auto-upload="false"' : ''
- const beforeUpload = `:before-upload="${el.vModel}BeforeUpload"`
- const fileList = `:file-list="${el.vModel}fileList"`
- const ref = `ref="${el.vModel}"`
- let child = buildElUploadChild(el)
+ "el-upload": el => {
+ const disabled = el.disabled ? ":disabled='true'" : "";
+ const action = el.action ? `:action="${el.vModel}Action"` : "";
+ const multiple = el.multiple ? "multiple" : "";
+ const listType = el["list-type"] !== "text" ? `list-type="${el["list-type"]}"` : "";
+ const accept = el.accept ? `accept="${el.accept}"` : "";
+ const name = el.name !== "file" ? `name="${el.name}"` : "";
+ const autoUpload = el["auto-upload"] === false ? ':auto-upload="false"' : "";
+ const beforeUpload = `:before-upload="${el.vModel}BeforeUpload"`;
+ const fileList = `:file-list="${el.vModel}fileList"`;
+ const ref = `ref="${el.vModel}"`;
+ let child = buildElUploadChild(el);
- if (child) child = `\n${child}\n` // 换行
- return `<${el.tag} ${ref} ${fileList} ${action} ${autoUpload} ${multiple} ${beforeUpload} ${listType} ${accept} ${name} ${disabled}>${child}${el.tag}>`
+ if (child) child = `\n${child}\n`; // 换行
+ return `<${el.tag} ${ref} ${fileList} ${action} ${autoUpload} ${multiple} ${beforeUpload} ${listType} ${accept} ${name} ${disabled}>${child}${el.tag}>`;
}
-}
+};
function attrBuilder(el) {
return {
vModel: `v-model="${confGlobal.formModel}.${el.vModel}"`,
- clearable: el.clearable ? 'clearable' : '',
- placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '',
- width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '',
- disabled: el.disabled ? ':disabled=\'true\'' : ''
- }
+ clearable: el.clearable ? "clearable" : "",
+ placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : "",
+ width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : "",
+ disabled: el.disabled ? ":disabled='true'" : ""
+ };
}
// el-buttin 子级
function buildElButtonChild(conf) {
- const children = []
+ const children = [];
if (conf.default) {
- children.push(conf.default)
+ children.push(conf.default);
}
- return children.join('\n')
+ return children.join("\n");
}
// el-input innerHTML
function buildElInputChild(conf) {
- const children = []
+ const children = [];
if (conf.prepend) {
- children.push(`${conf.prepend}`)
+ children.push(`${conf.prepend}`);
}
if (conf.append) {
- children.push(`${conf.append}`)
+ children.push(`${conf.append}`);
}
- return children.join('\n')
+ return children.join("\n");
}
function buildElSelectChild(conf) {
- const children = []
+ const children = [];
if (conf.options && conf.options.length) {
- children.push(``)
+ children.push(``);
}
- return children.join('\n')
+ return children.join("\n");
}
function buildElRadioGroupChild(conf) {
- const children = []
+ const children = [];
if (conf.options && conf.options.length) {
- const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio'
- const border = conf.border ? 'border' : ''
- children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}${tag}>`)
+ const tag = conf.optionType === "button" ? "el-radio-button" : "el-radio";
+ const border = conf.border ? "border" : "";
+ children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}${tag}>`);
}
- return children.join('\n')
+ return children.join("\n");
}
function buildElCheckboxGroupChild(conf) {
- const children = []
+ const children = [];
if (conf.options && conf.options.length) {
- const tag = conf.optionType === 'button' ? 'el-checkbox-button' : 'el-checkbox'
- const border = conf.border ? 'border' : ''
- children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}${tag}>`)
+ const tag = conf.optionType === "button" ? "el-checkbox-button" : "el-checkbox";
+ const border = conf.border ? "border" : "";
+ children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}${tag}>`);
}
- return children.join('\n')
+ return children.join("\n");
}
function buildElUploadChild(conf) {
- const list = []
- if (conf['list-type'] === 'picture-card') list.push('')
- else list.push(`${conf.buttonText}`)
- if (conf.showTip) list.push(`只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件
`)
- return list.join('\n')
+ const list = [];
+ if (conf["list-type"] === "picture-card") list.push('');
+ else list.push(`${conf.buttonText}`);
+ if (conf.showTip) list.push(`只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件
`);
+ return list.join("\n");
}
export function makeUpHtml(conf, type) {
- const htmlList = []
- confGlobal = conf
- someSpanIsNot24 = conf.fields.some(item => item.span !== 24)
+ const htmlList = [];
+ confGlobal = conf;
+ someSpanIsNot24 = conf.fields.some(item => item.span !== 24);
conf.fields.forEach(el => {
- htmlList.push(layouts[el.layout](el))
- })
- const htmlStr = htmlList.join('\n')
+ htmlList.push(layouts[el.layout](el));
+ });
+ const htmlStr = htmlList.join("\n");
- let temp = buildFormTemplate(conf, htmlStr, type)
- if (type === 'dialog') {
- temp = dialogWrapper(temp)
+ let temp = buildFormTemplate(conf, htmlStr, type);
+ if (type === "dialog") {
+ temp = dialogWrapper(temp);
}
- confGlobal = null
- return temp
+ confGlobal = null;
+ return temp;
}
diff --git a/dvadmin-ui/src/utils/generator/js.js b/dvadmin-ui/src/utils/generator/js.js
index c6c06a9..3d44b29 100755
--- a/dvadmin-ui/src/utils/generator/js.js
+++ b/dvadmin-ui/src/utils/generator/js.js
@@ -1,78 +1,77 @@
-import { isArray } from 'util'
-import { exportDefault, titleCase } from '@/utils/index'
-import { trigger } from './config'
+import { isArray } from "util";
+import { exportDefault, titleCase } from "@/utils/index";
+import { trigger } from "./config";
const units = {
- KB: '1024',
- MB: '1024 / 1024',
- GB: '1024 / 1024 / 1024'
-}
-let confGlobal
+ KB: "1024",
+ MB: "1024 / 1024",
+ GB: "1024 / 1024 / 1024"
+};
+let confGlobal;
const inheritAttrs = {
- file: '',
- dialog: 'inheritAttrs: false,'
-}
-
+ file: "",
+ dialog: "inheritAttrs: false,"
+};
export function makeUpJs(conf, type) {
- confGlobal = conf = JSON.parse(JSON.stringify(conf))
- const dataList = []
- const ruleList = []
- const optionsList = []
- const propsList = []
- const methodList = mixinMethod(type)
- const uploadVarList = []
+ confGlobal = conf = JSON.parse(JSON.stringify(conf));
+ const dataList = [];
+ const ruleList = [];
+ const optionsList = [];
+ const propsList = [];
+ const methodList = mixinMethod(type);
+ const uploadVarList = [];
conf.fields.forEach(el => {
- buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList)
- })
+ buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList);
+ });
const script = buildexport(
conf,
type,
- dataList.join('\n'),
- ruleList.join('\n'),
- optionsList.join('\n'),
- uploadVarList.join('\n'),
- propsList.join('\n'),
- methodList.join('\n')
- )
- confGlobal = null
- return script
+ dataList.join("\n"),
+ ruleList.join("\n"),
+ optionsList.join("\n"),
+ uploadVarList.join("\n"),
+ propsList.join("\n"),
+ methodList.join("\n")
+ );
+ confGlobal = null;
+ return script;
}
function buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) {
- buildData(el, dataList)
- buildRules(el, ruleList)
+ buildData(el, dataList);
+ buildRules(el, ruleList);
if (el.options && el.options.length) {
- buildOptions(el, optionsList)
- if (el.dataType === 'dynamic') {
- const model = `${el.vModel}Options`
- const options = titleCase(model)
- buildOptionMethod(`get${options}`, model, methodList)
+ buildOptions(el, optionsList);
+ if (el.dataType === "dynamic") {
+ const model = `${el.vModel}Options`;
+ const options = titleCase(model);
+ buildOptionMethod(`get${options}`, model, methodList);
}
}
if (el.props && el.props.props) {
- buildProps(el, propsList)
+ buildProps(el, propsList);
}
- if (el.action && el.tag === 'el-upload') {
+ if (el.action && el.tag === "el-upload") {
uploadVarList.push(
`${el.vModel}Action: '${el.action}',
${el.vModel}fileList: [],`
- )
- methodList.push(buildBeforeUpload(el))
- if (!el['auto-upload']) {
- methodList.push(buildSubmitUpload(el))
+ );
+ methodList.push(buildBeforeUpload(el));
+ if (!el["auto-upload"]) {
+ methodList.push(buildSubmitUpload(el));
}
}
if (el.children) {
el.children.forEach(el2 => {
- buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList)
- })
+ buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList);
+ });
}
}
@@ -91,7 +90,7 @@ function mixinMethod(type) {
},`
} : null,
dialog: {
- onOpen: 'onOpen() {},',
+ onOpen: "onOpen() {},",
onClose: `onClose() {
this.$refs['${confGlobal.formRef}'].resetFields()
},`,
@@ -105,105 +104,106 @@ function mixinMethod(type) {
})
},`
}
- }
+ };
- const methods = minxins[type]
+ const methods = minxins[type];
if (methods) {
Object.keys(methods).forEach(key => {
- list.push(methods[key])
- })
+ list.push(methods[key]);
+ });
}
- return list
+ return list;
}
function buildData(conf, dataList) {
- if (conf.vModel === undefined) return
- let defaultValue
- if (typeof (conf.defaultValue) === 'string' && !conf.multiple) {
- defaultValue = `'${conf.defaultValue}'`
+ if (conf.vModel === undefined) return;
+ let defaultValue;
+ if (typeof (conf.defaultValue) === "string" && !conf.multiple) {
+ defaultValue = `'${conf.defaultValue}'`;
} else {
- defaultValue = `${JSON.stringify(conf.defaultValue)}`
+ defaultValue = `${JSON.stringify(conf.defaultValue)}`;
}
- dataList.push(`${conf.vModel}: ${defaultValue},`)
+ dataList.push(`${conf.vModel}: ${defaultValue},`);
}
function buildRules(conf, ruleList) {
- if (conf.vModel === undefined) return
- const rules = []
+ if (conf.vModel === undefined) return;
+ const rules = [];
if (trigger[conf.tag]) {
if (conf.required) {
- const type = isArray(conf.defaultValue) ? 'type: \'array\',' : ''
- let message = isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder
- if (message === undefined) message = `${conf.label}不能为空`
- rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`)
+ const type = isArray(conf.defaultValue) ? "type: 'array'," : "";
+ let message = isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder;
+ if (message === undefined) message = `${conf.label}不能为空`;
+ rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`);
}
if (conf.regList && isArray(conf.regList)) {
conf.regList.forEach(item => {
if (item.pattern) {
- rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`)
+ // eslint-disable-next-line no-eval
+ rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`);
}
- })
+ });
}
- ruleList.push(`${conf.vModel}: [${rules.join(',')}],`)
+ ruleList.push(`${conf.vModel}: [${rules.join(",")}],`);
}
}
function buildOptions(conf, optionsList) {
- if (conf.vModel === undefined) return
- if (conf.dataType === 'dynamic') { conf.options = [] }
- const str = `${conf.vModel}Options: ${JSON.stringify(conf.options)},`
- optionsList.push(str)
+ if (conf.vModel === undefined) return;
+ if (conf.dataType === "dynamic") { conf.options = []; }
+ const str = `${conf.vModel}Options: ${JSON.stringify(conf.options)},`;
+ optionsList.push(str);
}
function buildProps(conf, propsList) {
- if (conf.dataType === 'dynamic') {
- conf.valueKey !== 'value' && (conf.props.props.value = conf.valueKey)
- conf.labelKey !== 'label' && (conf.props.props.label = conf.labelKey)
- conf.childrenKey !== 'children' && (conf.props.props.children = conf.childrenKey)
+ if (conf.dataType === "dynamic") {
+ conf.valueKey !== "value" && (conf.props.props.value = conf.valueKey);
+ conf.labelKey !== "label" && (conf.props.props.label = conf.labelKey);
+ conf.childrenKey !== "children" && (conf.props.props.children = conf.childrenKey);
}
- const str = `${conf.vModel}Props: ${JSON.stringify(conf.props.props)},`
- propsList.push(str)
+ const str = `${conf.vModel}Props: ${JSON.stringify(conf.props.props)},`;
+ propsList.push(str);
}
function buildBeforeUpload(conf) {
- const unitNum = units[conf.sizeUnit]; let rightSizeCode = ''; let acceptCode = ''; const
- returnList = []
+ const unitNum = units[conf.sizeUnit]; let rightSizeCode = ""; let acceptCode = ""; const
+ returnList = [];
if (conf.fileSize) {
rightSizeCode = `let isRightSize = file.size / ${unitNum} < ${conf.fileSize}
if(!isRightSize){
this.$message.error('文件大小超过 ${conf.fileSize}${conf.sizeUnit}')
- }`
- returnList.push('isRightSize')
+ }`;
+ returnList.push("isRightSize");
}
if (conf.accept) {
acceptCode = `let isAccept = new RegExp('${conf.accept}').test(file.type)
if(!isAccept){
this.$message.error('应该选择${conf.accept}类型的文件')
- }`
- returnList.push('isAccept')
+ }`;
+ returnList.push("isAccept");
}
const str = `${conf.vModel}BeforeUpload(file) {
${rightSizeCode}
${acceptCode}
- return ${returnList.join('&&')}
- },`
- return returnList.length ? str : ''
+ return ${returnList.join("&&")}
+ },`;
+ return returnList.length ? str : "";
}
function buildSubmitUpload(conf) {
const str = `submitUpload() {
this.$refs['${conf.vModel}'].submit()
- },`
- return str
+ },`;
+ return str;
}
function buildOptionMethod(methodName, model, methodList) {
const str = `${methodName}() {
// TODO 发起请求获取数据
this.${model}
- },`
- methodList.push(str)
+ },`;
+ methodList.push(str);
}
function buildexport(conf, type, data, rules, selectOptions, uploadVar, props, methods) {
@@ -231,6 +231,6 @@ function buildexport(conf, type, data, rules, selectOptions, uploadVar, props, m
methods: {
${methods}
}
-}`
- return str
+}`;
+ return str;
}
diff --git a/dvadmin-ui/src/utils/generator/render.js b/dvadmin-ui/src/utils/generator/render.js
index e8640f0..ac5e0a3 100755
--- a/dvadmin-ui/src/utils/generator/render.js
+++ b/dvadmin-ui/src/utils/generator/render.js
@@ -1,91 +1,91 @@
-import { makeMap } from '@/utils/index'
+import { makeMap } from "@/utils/index";
// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js
const isAttr = makeMap(
- 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,'
- + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,'
- + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,'
- + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,'
- + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,'
- + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,'
- + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,'
- + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,'
- + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,'
- + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,'
- + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,'
- + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,'
- + 'target,title,type,usemap,value,width,wrap'
-)
+ "accept,accept-charset,accesskey,action,align,alt,async,autocomplete," +
+ "autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset," +
+ "checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv," +
+ "name,contenteditable,contextmenu,controls,coords,data,datetime,default," +
+ "defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for," +
+ "form,formaction,headers,height,hidden,high,href,hreflang,http-equiv," +
+ "icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low," +
+ "manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file," +
+ "muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster," +
+ "preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox," +
+ "scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span," +
+ "spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex," +
+ "target,title,type,usemap,value,width,wrap"
+);
function vModel(self, dataObject, defaultValue) {
- dataObject.props.value = defaultValue
+ dataObject.props.value = defaultValue;
dataObject.on.input = val => {
- self.$emit('input', val)
- }
+ self.$emit("input", val);
+ };
}
const componentChild = {
- 'el-button': {
+ "el-button": {
default(h, conf, key) {
- return conf[key]
- },
+ return conf[key];
+ }
},
- 'el-input': {
+ "el-input": {
prepend(h, conf, key) {
- return {conf[key]}
+ return {conf[key]};
},
append(h, conf, key) {
- return {conf[key]}
+ return {conf[key]};
}
},
- 'el-select': {
+ "el-select": {
options(h, conf, key) {
- const list = []
+ const list = [];
conf.options.forEach(item => {
- list.push()
- })
- return list
+ list.push();
+ });
+ return list;
}
},
- 'el-radio-group': {
+ "el-radio-group": {
options(h, conf, key) {
- const list = []
+ const list = [];
conf.options.forEach(item => {
- if (conf.optionType === 'button') list.push({item.label})
- else list.push({item.label})
- })
- return list
+ if (conf.optionType === "button") list.push({item.label});
+ else list.push({item.label});
+ });
+ return list;
}
},
- 'el-checkbox-group': {
+ "el-checkbox-group": {
options(h, conf, key) {
- const list = []
+ const list = [];
conf.options.forEach(item => {
- if (conf.optionType === 'button') {
- list.push({item.label})
+ if (conf.optionType === "button") {
+ list.push({item.label});
} else {
- list.push({item.label})
+ list.push({item.label});
}
- })
- return list
+ });
+ return list;
}
},
- 'el-upload': {
- 'list-type': (h, conf, key) => {
- const list = []
- if (conf['list-type'] === 'picture-card') {
- list.push()
+ "el-upload": {
+ "list-type": (h, conf, key) => {
+ const list = [];
+ if (conf["list-type"] === "picture-card") {
+ list.push();
} else {
- list.push({conf.buttonText})
+ list.push({conf.buttonText});
}
if (conf.showTip) {
- list.push(只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
)
+ list.push(只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
);
}
- return list
+ return list;
}
}
-}
+};
export default {
render(h) {
@@ -94,33 +94,33 @@ export default {
props: {},
on: {},
style: {}
- }
- const confClone = JSON.parse(JSON.stringify(this.conf))
- const children = []
+ };
+ const confClone = JSON.parse(JSON.stringify(this.conf));
+ const children = [];
- const childObjs = componentChild[confClone.tag]
+ const childObjs = componentChild[confClone.tag];
if (childObjs) {
Object.keys(childObjs).forEach(key => {
- const childFunc = childObjs[key]
+ const childFunc = childObjs[key];
if (confClone[key]) {
- children.push(childFunc(h, confClone, key))
+ children.push(childFunc(h, confClone, key));
}
- })
+ });
}
Object.keys(confClone).forEach(key => {
- const val = confClone[key]
- if (key === 'vModel') {
- vModel(this, dataObject, confClone.defaultValue)
+ const val = confClone[key];
+ if (key === "vModel") {
+ vModel(this, dataObject, confClone.defaultValue);
} else if (dataObject[key]) {
- dataObject[key] = val
+ dataObject[key] = val;
} else if (!isAttr(key)) {
- dataObject.props[key] = val
+ dataObject.props[key] = val;
} else {
- dataObject.attrs[key] = val
+ dataObject.attrs[key] = val;
}
- })
- return h(this.conf.tag, dataObject, children)
+ });
+ return h(this.conf.tag, dataObject, children);
},
- props: ['conf']
-}
+ props: ["conf"]
+};
diff --git a/dvadmin-ui/src/utils/index.js b/dvadmin-ui/src/utils/index.js
index 60fa980..288fb2f 100755
--- a/dvadmin-ui/src/utils/index.js
+++ b/dvadmin-ui/src/utils/index.js
@@ -1,18 +1,18 @@
-import { parseTime } from './ruoyi'
+import { parseTime } from "./ruoyi";
/**
* 表格时间格式化
*/
export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return "";
- var date = new Date(cellValue)
- var year = date.getFullYear()
- var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
- var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
- var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
- var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
- var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
- return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
+ var date = new Date(cellValue);
+ var year = date.getFullYear();
+ var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
+ var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+ var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
+ var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
+ var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
+ return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}
/**
@@ -21,40 +21,40 @@ export function formatDate(cellValue) {
* @returns {string}
*/
export function formatTime(time, option) {
- if (('' + time).length === 10) {
- time = parseInt(time) * 1000
+ if (("" + time).length === 10) {
+ time = parseInt(time) * 1000;
} else {
- time = +time
+ time = +time;
}
- const d = new Date(time)
- const now = Date.now()
+ const d = new Date(time);
+ const now = Date.now();
- const diff = (now - d) / 1000
+ const diff = (now - d) / 1000;
if (diff < 30) {
- return '刚刚'
+ return "刚刚";
} else if (diff < 3600) {
// less 1 hour
- return Math.ceil(diff / 60) + '分钟前'
+ return Math.ceil(diff / 60) + "分钟前";
} else if (diff < 3600 * 24) {
- return Math.ceil(diff / 3600) + '小时前'
+ return Math.ceil(diff / 3600) + "小时前";
} else if (diff < 3600 * 24 * 2) {
- return '1天前'
+ return "1天前";
}
if (option) {
- return parseTime(time, option)
+ return parseTime(time, option);
} else {
return (
d.getMonth() +
1 +
- '月' +
+ "月" +
d.getDate() +
- '日' +
+ "日" +
d.getHours() +
- '时' +
+ "时" +
d.getMinutes() +
- '分'
- )
+ "分"
+ );
}
}
@@ -63,18 +63,18 @@ export function formatTime(time, option) {
* @returns {Object}
*/
export function getQueryObject(url) {
- url = url == null ? window.location.href : url
- const search = url.substring(url.lastIndexOf('?') + 1)
- const obj = {}
- const reg = /([^?&=]+)=([^?&=]*)/g
+ url = url == null ? window.location.href : url;
+ const search = url.substring(url.lastIndexOf("?") + 1);
+ const obj = {};
+ const reg = /([^?&=]+)=([^?&=]*)/g;
search.replace(reg, (rs, $1, $2) => {
- const name = decodeURIComponent($1)
- let val = decodeURIComponent($2)
- val = String(val)
- obj[name] = val
- return rs
- })
- return obj
+ const name = decodeURIComponent($1);
+ let val = decodeURIComponent($2);
+ val = String(val);
+ obj[name] = val;
+ return rs;
+ });
+ return obj;
}
/**
@@ -83,14 +83,14 @@ export function getQueryObject(url) {
*/
export function byteLength(str) {
// returns the byte length of an utf8 string
- let s = str.length
+ let s = str.length;
for (var i = str.length - 1; i >= 0; i--) {
- const code = str.charCodeAt(i)
- if (code > 0x7f && code <= 0x7ff) s++
- else if (code > 0x7ff && code <= 0xffff) s += 2
- if (code >= 0xDC00 && code <= 0xDFFF) i--
+ const code = str.charCodeAt(i);
+ if (code > 0x7f && code <= 0x7ff) s++;
+ else if (code > 0x7ff && code <= 0xffff) s += 2;
+ if (code >= 0xDC00 && code <= 0xDFFF) i--;
}
- return s
+ return s;
}
/**
@@ -98,13 +98,13 @@ export function byteLength(str) {
* @returns {Array}
*/
export function cleanArray(actual) {
- const newArray = []
+ const newArray = [];
for (let i = 0; i < actual.length; i++) {
if (actual[i]) {
- newArray.push(actual[i])
+ newArray.push(actual[i]);
}
}
- return newArray
+ return newArray;
}
/**
@@ -112,13 +112,13 @@ export function cleanArray(actual) {
* @returns {Array}
*/
export function param(json) {
- if (!json) return ''
+ if (!json) return "";
return cleanArray(
Object.keys(json).map(key => {
- if (json[key] === undefined) return ''
- return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
+ if (json[key] === undefined) return "";
+ return encodeURIComponent(key) + "=" + encodeURIComponent(json[key]);
})
- ).join('&')
+ ).join("&");
}
/**
@@ -126,21 +126,21 @@ export function param(json) {
* @returns {Object}
*/
export function param2Obj(url) {
- const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ')
+ const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " ");
if (!search) {
- return {}
+ return {};
}
- const obj = {}
- const searchArr = search.split('&')
+ const obj = {};
+ const searchArr = search.split("&");
searchArr.forEach(v => {
- const index = v.indexOf('=')
+ const index = v.indexOf("=");
if (index !== -1) {
- const name = v.substring(0, index)
- const val = v.substring(index + 1, v.length)
- obj[name] = val
+ const name = v.substring(0, index);
+ const val = v.substring(index + 1, v.length);
+ obj[name] = val;
}
- })
- return obj
+ });
+ return obj;
}
/**
@@ -148,9 +148,9 @@ export function param2Obj(url) {
* @returns {string}
*/
export function html2Text(val) {
- const div = document.createElement('div')
- div.innerHTML = val
- return div.textContent || div.innerText
+ const div = document.createElement("div");
+ div.innerHTML = val;
+ return div.textContent || div.innerText;
}
/**
@@ -160,21 +160,21 @@ export function html2Text(val) {
* @returns {Object}
*/
export function objectMerge(target, source) {
- if (typeof target !== 'object') {
- target = {}
+ if (typeof target !== "object") {
+ target = {};
}
if (Array.isArray(source)) {
- return source.slice()
+ return source.slice();
}
Object.keys(source).forEach(property => {
- const sourceProperty = source[property]
- if (typeof sourceProperty === 'object') {
- target[property] = objectMerge(target[property], sourceProperty)
+ const sourceProperty = source[property];
+ if (typeof sourceProperty === "object") {
+ target[property] = objectMerge(target[property], sourceProperty);
} else {
- target[property] = sourceProperty
+ target[property] = sourceProperty;
}
- })
- return target
+ });
+ return target;
}
/**
@@ -183,18 +183,18 @@ export function objectMerge(target, source) {
*/
export function toggleClass(element, className) {
if (!element || !className) {
- return
+ return;
}
- let classString = element.className
- const nameIndex = classString.indexOf(className)
+ let classString = element.className;
+ const nameIndex = classString.indexOf(className);
if (nameIndex === -1) {
- classString += '' + className
+ classString += "" + className;
} else {
classString =
classString.substr(0, nameIndex) +
- classString.substr(nameIndex + className.length)
+ classString.substr(nameIndex + className.length);
}
- element.className = classString
+ element.className = classString;
}
/**
@@ -202,10 +202,10 @@ export function toggleClass(element, className) {
* @returns {Date}
*/
export function getTime(type) {
- if (type === 'start') {
- return new Date().getTime() - 3600 * 1000 * 24 * 90
+ if (type === "start") {
+ return new Date().getTime() - 3600 * 1000 * 24 * 90;
} else {
- return new Date(new Date().toDateString())
+ return new Date(new Date().toDateString());
}
}
@@ -216,38 +216,38 @@ export function getTime(type) {
* @return {*}
*/
export function debounce(func, wait, immediate) {
- let timeout, args, context, timestamp, result
+ let timeout, args, context, timestamp, result;
const later = function() {
// 据上一次触发时间间隔
- const last = +new Date() - timestamp
+ const last = +new Date() - timestamp;
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
- timeout = setTimeout(later, wait - last)
+ timeout = setTimeout(later, wait - last);
} else {
- timeout = null
+ timeout = null;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) {
- result = func.apply(context, args)
- if (!timeout) context = args = null
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
}
}
- }
+ };
return function(...args) {
- context = this
- timestamp = +new Date()
- const callNow = immediate && !timeout
+ context = this;
+ timestamp = +new Date();
+ const callNow = immediate && !timeout;
// 如果延时不存在,重新设定延时
- if (!timeout) timeout = setTimeout(later, wait)
+ if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
- result = func.apply(context, args)
- context = args = null
+ result = func.apply(context, args);
+ context = args = null;
}
- return result
- }
+ return result;
+ };
}
/**
@@ -258,18 +258,18 @@ export function debounce(func, wait, immediate) {
* @returns {Object}
*/
export function deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'deepClone')
+ if (!source && typeof source !== "object") {
+ throw new Error("error arguments", "deepClone");
}
- const targetObj = source.constructor === Array ? [] : {}
+ const targetObj = source.constructor === Array ? [] : {};
Object.keys(source).forEach(keys => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = deepClone(source[keys])
+ if (source[keys] && typeof source[keys] === "object") {
+ targetObj[keys] = deepClone(source[keys]);
} else {
- targetObj[keys] = source[keys]
+ targetObj[keys] = source[keys];
}
- })
- return targetObj
+ });
+ return targetObj;
}
/**
@@ -277,16 +277,16 @@ export function deepClone(source) {
* @returns {Array}
*/
export function uniqueArr(arr) {
- return Array.from(new Set(arr))
+ return Array.from(new Set(arr));
}
/**
* @returns {string}
*/
export function createUniqueString() {
- const timestamp = +new Date() + ''
- const randomNum = parseInt((1 + Math.random()) * 65536) + ''
- return (+(randomNum + timestamp)).toString(32)
+ const timestamp = +new Date() + "";
+ const randomNum = parseInt((1 + Math.random()) * 65536) + "";
+ return (+(randomNum + timestamp)).toString(32);
}
/**
@@ -296,7 +296,7 @@ export function createUniqueString() {
* @returns {boolean}
*/
export function hasClass(ele, cls) {
- return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'))
+ return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
}
/**
@@ -305,7 +305,7 @@ export function hasClass(ele, cls) {
* @param {string} cls
*/
export function addClass(ele, cls) {
- if (!hasClass(ele, cls)) ele.className += ' ' + cls
+ if (!hasClass(ele, cls)) ele.className += " " + cls;
}
/**
@@ -315,90 +315,90 @@ export function addClass(ele, cls) {
*/
export function removeClass(ele, cls) {
if (hasClass(ele, cls)) {
- const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)')
- ele.className = ele.className.replace(reg, ' ')
+ const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)");
+ ele.className = ele.className.replace(reg, " ");
}
}
export function makeMap(str, expectsLowerCase) {
- const map = Object.create(null)
- const list = str.split(',')
+ const map = Object.create(null);
+ const list = str.split(",");
for (let i = 0; i < list.length; i++) {
- map[list[i]] = true
+ map[list[i]] = true;
}
return expectsLowerCase
? val => map[val.toLowerCase()]
- : val => map[val]
+ : val => map[val];
}
-export const exportDefault = 'export default '
+export const exportDefault = "export default ";
export const beautifierConf = {
html: {
- indent_size: '2',
- indent_char: ' ',
- max_preserve_newlines: '-1',
+ indent_size: "2",
+ indent_char: " ",
+ max_preserve_newlines: "-1",
preserve_newlines: false,
keep_array_indentation: false,
break_chained_methods: false,
- indent_scripts: 'separate',
- brace_style: 'end-expand',
+ indent_scripts: "separate",
+ brace_style: "end-expand",
space_before_conditional: true,
unescape_strings: false,
jslint_happy: false,
end_with_newline: true,
- wrap_line_length: '110',
+ wrap_line_length: "110",
indent_inner_html: true,
comma_first: false,
e4x: true,
indent_empty_lines: true
},
js: {
- indent_size: '2',
- indent_char: ' ',
- max_preserve_newlines: '-1',
+ indent_size: "2",
+ indent_char: " ",
+ max_preserve_newlines: "-1",
preserve_newlines: false,
keep_array_indentation: false,
break_chained_methods: false,
- indent_scripts: 'normal',
- brace_style: 'end-expand',
+ indent_scripts: "normal",
+ brace_style: "end-expand",
space_before_conditional: true,
unescape_strings: false,
jslint_happy: true,
end_with_newline: true,
- wrap_line_length: '110',
+ wrap_line_length: "110",
indent_inner_html: true,
comma_first: false,
e4x: true,
indent_empty_lines: true
}
-}
+};
// 首字母大小
export function titleCase(str) {
- return str.replace(/( |^)[a-z]/g, L => L.toUpperCase())
+ return str.replace(/( |^)[a-z]/g, L => L.toUpperCase());
}
// 下划转驼峰
export function camelCase(str) {
- return str.replace(/-[a-z]/g, str1 => str1.substr(-1).toUpperCase())
+ return str.replace(/-[a-z]/g, str1 => str1.substr(-1).toUpperCase());
}
export function isNumberStr(str) {
- return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
+ return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str);
}
// 是否函数
export const isFunction = (o) => {
- return Object.prototype.toString.call(o).slice(8, -1) === 'Function';
+ return Object.prototype.toString.call(o).slice(8, -1) === "Function";
};
// 是否数组
export const isArray = (o) => {
- return Object.prototype.toString.call(o).slice(8, -1) === 'Array';
+ return Object.prototype.toString.call(o).slice(8, -1) === "Array";
};
// 是否对象
export const isObj = (o) => {
- return Object.prototype.toString.call(o).slice(8, -1) === 'Object';
+ return Object.prototype.toString.call(o).slice(8, -1) === "Object";
};
diff --git a/dvadmin-ui/src/utils/jsencrypt.js b/dvadmin-ui/src/utils/jsencrypt.js
index 78d9523..d720ef4 100755
--- a/dvadmin-ui/src/utils/jsencrypt.js
+++ b/dvadmin-ui/src/utils/jsencrypt.js
@@ -1,30 +1,30 @@
-import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
+import JSEncrypt from "jsencrypt/bin/jsencrypt.min";
// 密钥对生成 http://web.chacuo.net/netrsakeypair
-const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' +
- 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
+const publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n" +
+ "nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==";
-const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' +
- '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' +
- 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' +
- 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' +
- 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' +
- 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' +
- 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' +
- 'UP8iWi1Qw0Y='
+const privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n" +
+ "7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n" +
+ "PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n" +
+ "kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n" +
+ "cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n" +
+ "DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n" +
+ "YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n" +
+ "UP8iWi1Qw0Y=";
// 加密
export function encrypt(txt) {
- const encryptor = new JSEncrypt()
- encryptor.setPublicKey(publicKey) // 设置公钥
- return encryptor.encrypt(txt) // 对数据进行加密
+ const encryptor = new JSEncrypt();
+ encryptor.setPublicKey(publicKey); // 设置公钥
+ return encryptor.encrypt(txt); // 对数据进行加密
}
// 解密
export function decrypt(txt) {
- const encryptor = new JSEncrypt()
- encryptor.setPrivateKey(privateKey) // 设置私钥
- return encryptor.decrypt(txt) // 对数据进行解密
+ const encryptor = new JSEncrypt();
+ encryptor.setPrivateKey(privateKey); // 设置私钥
+ return encryptor.decrypt(txt); // 对数据进行解密
}
diff --git a/dvadmin-ui/src/utils/modelSelect.js b/dvadmin-ui/src/utils/modelSelect.js
index e43c1d6..06e3b22 100644
--- a/dvadmin-ui/src/utils/modelSelect.js
+++ b/dvadmin-ui/src/utils/modelSelect.js
@@ -1,7 +1,7 @@
-import store from '@/store'
+import store from "@/store";
// 获取字典方法 使用示例 this.getModelSelect(this.prop, this.label_name, this.listApi).then(res)
// 或者 async函数下 const res = await this.getModelSelect(this.prop, this.label_name, this.listApi)
-export const getModelSelect = async (modelName, labelName, listApi, params, reset) => {
- await store.dispatch("modelSelect/getModelSelect", {modelName, labelName, listApi, params, reset})
- return store.getters["modelSelect/getModelSelect"][modelName]
-}
+export const getModelSelect = async(modelName, labelName, listApi, params, reset) => {
+ await store.dispatch("modelSelect/getModelSelect", { modelName, labelName, listApi, params, reset });
+ return store.getters["modelSelect/getModelSelect"][modelName];
+};
diff --git a/dvadmin-ui/src/utils/permission.js b/dvadmin-ui/src/utils/permission.js
index 1730e33..08f395b 100755
--- a/dvadmin-ui/src/utils/permission.js
+++ b/dvadmin-ui/src/utils/permission.js
@@ -1,4 +1,4 @@
-import store from '@/store'
+import store from "@/store";
/**
* 字符权限校验
@@ -7,21 +7,21 @@ import store from '@/store'
*/
export function checkPermi(value) {
if (value && value instanceof Array && value.length > 0) {
- const permissions = store.getters && store.getters.permissions
- const permissionDatas = value
+ const permissions = store.getters && store.getters.permissions;
+ const permissionDatas = value;
const all_permission = "*:*:*";
const hasPermission = permissions.some(permission => {
- return all_permission === permission || permissionDatas.includes(permission)
- })
+ return all_permission === permission || permissionDatas.includes(permission);
+ });
if (!hasPermission) {
- return false
+ return false;
}
- return true
+ return true;
} else {
- console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
- return false
+ console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`);
+ return false;
}
}
@@ -32,20 +32,20 @@ export function checkPermi(value) {
*/
export function checkRole(value) {
if (value && value instanceof Array && value.length > 0) {
- const roles = store.getters && store.getters.roles
- const permissionRoles = value
+ const roles = store.getters && store.getters.roles;
+ const permissionRoles = value;
const super_admin = "admin";
const hasRole = roles.some(role => {
- return super_admin === role || permissionRoles.includes(role)
- })
+ return super_admin === role || permissionRoles.includes(role);
+ });
if (!hasRole) {
- return false
+ return false;
}
- return true
+ return true;
} else {
- console.error(`need roles! Like checkRole="['admin','editor']"`)
- return false
+ console.error(`need roles! Like checkRole="['admin','editor']"`);
+ return false;
}
-}
\ No newline at end of file
+}
diff --git a/dvadmin-ui/src/utils/request.js b/dvadmin-ui/src/utils/request.js
index ba8ac75..efa2b1e 100755
--- a/dvadmin-ui/src/utils/request.js
+++ b/dvadmin-ui/src/utils/request.js
@@ -1,34 +1,33 @@
-import axios from 'axios'
-import { Notification, MessageBox, Message } from 'element-ui'
-import store from '@/store'
-import { getToken } from '@/utils/auth'
-import errorCode from '@/utils/errorCode'
+import axios from "axios";
+import { Notification, MessageBox, Message } from "element-ui";
+import { getToken } from "@/utils/auth";
+import errorCode from "@/utils/errorCode";
-axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
+axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: process.env.VUE_APP_BASE_API,
// 超时
timeout: 10000
-})
+});
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
- const isToken = (config.headers || {}).isToken === false
+ const isToken = (config.headers || {}).isToken === false;
if (getToken() && !isToken) {
- config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
+ config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
// get请求映射params参数
- if (config.method === 'get' && config.params) {
- let url = config.url + '?';
+ if (config.method === "get" && config.params) {
+ let url = config.url + "?";
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
- if (value !== null && typeof(value) !== "undefined") {
- if (typeof value === 'object') {
+ if (value !== null && typeof (value) !== "undefined") {
+ if (typeof value === "object") {
for (const key of Object.keys(value)) {
- let params = propName + '[' + key + ']';
+ const params = propName + "[" + key + "]";
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
}
@@ -41,61 +40,59 @@ service.interceptors.request.use(config => {
config.params = {};
config.url = url;
}
- return config
+ return config;
}, error => {
- console.log(error)
- Promise.reject(error)
-})
+ console.log(error);
+ Promise.reject(error);
+});
// 响应拦截器
service.interceptors.response.use(res => {
- // 未设置状态码则默认成功状态
- const code = res.data.code || 200;
- // 获取错误信息
- const msg = errorCode[code] || res.data.msg || errorCode['default']
- if (code === 401) {
- MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
- confirmButtonText: '重新登录',
- cancelButtonText: '取消',
- type: 'warning'
- }
- ).then(() => {
- location.href = '/index';
- })
- } else if (code === 500) {
- Message({
- message: msg,
- type: 'error'
- })
- return Promise.reject(new Error(msg))
- } else if (code !== 200) {
- Notification.error({
- title: msg
- })
- return Promise.reject('error')
- } else {
- return res.data
- }
- },
- error => {
- console.log('err' + error)
- let { message } = error;
- if (message == "Network Error") {
- message = "后端接口连接异常";
- }
- else if (message.includes("timeout")) {
- message = "系统接口请求超时";
- }
- else if (message.includes("Request failed with status code")) {
- message = "系统接口" + message.substr(message.length - 3) + "异常";
+ // 未设置状态码则默认成功状态
+ const code = res.data.code || 200;
+ // 获取错误信息
+ const msg = errorCode[code] || res.data.msg || errorCode["default"];
+ if (code === 401) {
+ MessageBox.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录", "系统提示", {
+ confirmButtonText: "重新登录",
+ cancelButtonText: "取消",
+ type: "warning"
}
+ ).then(() => {
+ location.href = "/index";
+ });
+ } else if (code === 500) {
Message({
- message: message,
- type: 'error',
- duration: 5 * 1000
- })
- return Promise.reject(error)
+ message: msg,
+ type: "error"
+ });
+ return Promise.reject(new Error(msg));
+ } else if (code !== 200) {
+ Notification.error({
+ title: msg
+ });
+ return Promise.reject("error");
+ } else {
+ return res.data;
}
-)
+},
+error => {
+ console.log("err" + error);
+ let { message } = error;
+ if (message == "Network Error") {
+ message = "后端接口连接异常";
+ } else if (message.includes("timeout")) {
+ message = "系统接口请求超时";
+ } else if (message.includes("Request failed with status code")) {
+ message = "系统接口" + message.substr(message.length - 3) + "异常";
+ }
+ Message({
+ message: message,
+ type: "error",
+ duration: 5 * 1000
+ });
+ return Promise.reject(error);
+}
+);
-export default service
+export default service;
diff --git a/dvadmin-ui/src/utils/ruoyi.js b/dvadmin-ui/src/utils/ruoyi.js
index 393c731..14d104b 100755
--- a/dvadmin-ui/src/utils/ruoyi.js
+++ b/dvadmin-ui/src/utils/ruoyi.js
@@ -3,104 +3,102 @@
* Copyright (c) 2019 ruoyi
*/
-const baseURL = process.env.VUE_APP_BASE_API
-
// 日期格式化
export function parseTime(time, pattern) {
- if (arguments.length === 0 || !time) {
- return null
- }
- const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
- let date
- if (typeof time === 'object') {
- date = time
- } else {
- if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
- time = parseInt(time)
- } else if (typeof time === 'string') {
- time = time.replace(new RegExp(/-/gm), '/');
- }
- if ((typeof time === 'number') && (time.toString().length === 10)) {
- time = time * 1000
- }
- date = new Date(time)
- }
- const formatObj = {
- y: date.getFullYear(),
- m: date.getMonth() + 1,
- d: date.getDate(),
- h: date.getHours(),
- i: date.getMinutes(),
- s: date.getSeconds(),
- a: date.getDay()
- }
- const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
- let value = formatObj[key]
- // Note: getDay() returns 0 on Sunday
- if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
- if (result.length > 0 && value < 10) {
- value = '0' + value
- }
- return value || 0
- })
- return time_str
+ if (arguments.length === 0 || !time) {
+ return null;
+ }
+ const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}";
+ let date;
+ if (typeof time === "object") {
+ date = time;
+ } else {
+ if ((typeof time === "string") && (/^[0-9]+$/.test(time))) {
+ time = parseInt(time);
+ } else if (typeof time === "string") {
+ time = time.replace(new RegExp(/-/gm), "/");
+ }
+ if ((typeof time === "number") && (time.toString().length === 10)) {
+ time = time * 1000;
+ }
+ date = new Date(time);
+ }
+ const formatObj = {
+ y: date.getFullYear(),
+ m: date.getMonth() + 1,
+ d: date.getDate(),
+ h: date.getHours(),
+ i: date.getMinutes(),
+ s: date.getSeconds(),
+ a: date.getDay()
+ };
+ const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+ let value = formatObj[key];
+ // Note: getDay() returns 0 on Sunday
+ if (key === "a") { return ["日", "一", "二", "三", "四", "五", "六"][value]; }
+ if (result.length > 0 && value < 10) {
+ value = "0" + value;
+ }
+ return value || 0;
+ });
+ return time_str;
}
// 表单重置
export function resetForm(refName) {
- if (this.$refs[refName]) {
- this.$refs[refName].resetFields();
- }
+ if (this.$refs[refName]) {
+ this.$refs[refName].resetFields();
+ }
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
- let search = JSON.parse(JSON.stringify(params));
- if (null != dateRange && '' !== dateRange && dateRange.length !== 0) {
- search.as = JSON.stringify({create_datetime__range : dateRange});
- }
- return search;
+ const search = JSON.parse(JSON.stringify(params));
+ if (dateRange != null && dateRange !== "" && dateRange.length !== 0) {
+ search.as = JSON.stringify({ create_datetime__range: dateRange });
+ }
+ return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
- var actions = [];
- Object.keys(datas).some((key) => {
- if (String(datas[key].dictValue) === ('' + String(value))) {
- actions.push(datas[key].dictLabel);
- return true;
- }
- })
- return actions.join('');
+ var actions = [];
+ Object.keys(datas).some((key) => {
+ if (String(datas[key].dictValue) === ("" + String(value))) {
+ actions.push(datas[key].dictLabel);
+ return true;
+ }
+ });
+ return actions.join("");
}
// 获取字典默认值
export function selectDictDefault(datas) {
- var actions = [];
- Object.keys(datas).some((key) => {
- if (datas[key].is_default === true) {
- actions.push(datas[key].dictValue);
- return true;
- }
- })
+ var actions = [];
+ Object.keys(datas).some((key) => {
+ if (datas[key].is_default === true) {
+ actions.push(datas[key].dictValue);
+ return true;
+ }
+ });
if (!actions[0] && datas[0]) {
- actions.push(datas[0].dictValue)
+ actions.push(datas[0].dictValue);
}
- return actions.join('');
+ return actions.join("");
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
- var actions = [];
- var currentSeparator = undefined === separator ? "," : separator;
- var temp = value.split(currentSeparator);
- Object.keys(value.split(currentSeparator)).some((val) => {
- Object.keys(datas).some((key) => {
- if (datas[key].dictValue == ('' + temp[val])) {
- actions.push(datas[key].dictLabel + currentSeparator);
- }
- })
- })
- return actions.join('').substring(0, actions.join('').length - 1);
+ var actions = [];
+ var currentSeparator = undefined === separator ? "," : separator;
+ var temp = value.split(currentSeparator);
+ Object.keys(value.split(currentSeparator)).some((val) => {
+ Object.keys(datas).some((key) => {
+ if (datas[key].dictValue == ("" + temp[val])) {
+ actions.push(datas[key].dictLabel + currentSeparator);
+ }
+ });
+ });
+ return actions.join("").substring(0, actions.join("").length - 1);
}
/**
* 保存
@@ -112,21 +110,21 @@ function saveAs(blob, filename) {
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, filename);
} else {
- var link = document.createElement('a');
- var body = document.querySelector('body');
+ var link = document.createElement("a");
+ var body = document.querySelector("body");
link.href = window.URL.createObjectURL(blob);
link.download = filename;
// fix Firefox
- link.style.display = 'none';
+ link.style.display = "none";
body.appendChild(link);
link.click();
body.removeChild(link);
window.URL.revokeObjectURL(link.href);
- };
+ }
}
/**
@@ -136,9 +134,9 @@ function saveAs(blob, filename) {
*/
function getBlob(url, cb) {
var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.responseType = 'blob';
- xhr.onload = function () {
+ xhr.open("GET", url, true);
+ xhr.responseType = "blob";
+ xhr.onload = function() {
if (xhr.status === 200) {
cb(xhr.response);
}
@@ -146,32 +144,32 @@ function getBlob(url, cb) {
xhr.send();
}
// 通用下载方法
-export function download(file_url,fileName) {
- getBlob(process.env.VUE_APP_BASE_API + file_url, function (blob) {
+export function download(file_url, fileName) {
+ getBlob(process.env.VUE_APP_BASE_API + file_url, function(blob) {
saveAs(blob, fileName);
});
}
// 字符串格式化(%s )
export function sprintf(str) {
- var args = arguments, flag = true, i = 1;
- str = str.replace(/%s/g, function () {
- var arg = args[i++];
- if (typeof arg === 'undefined') {
- flag = false;
- return '';
- }
- return arg;
- });
- return flag ? str : '';
+ var args = arguments; var flag = true; var i = 1;
+ str = str.replace(/%s/g, function() {
+ var arg = args[i++];
+ if (typeof arg === "undefined") {
+ flag = false;
+ return "";
+ }
+ return arg;
+ });
+ return flag ? str : "";
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
- if (!str || str == "undefined" || str == "null") {
- return "";
- }
- return str;
+ if (!str || str == "undefined" || str == "null") {
+ return "";
+ }
+ return str;
}
/**
@@ -183,28 +181,28 @@ export function praseStrEmpty(str) {
* @param {*} rootId 根Id 默认 0
*/
export function handleTree(data, id, parentId, children, rootId) {
- id = id || 'id'
- parentId = parentId || 'parentId'
- children = children || 'children'
+ id = id || "id";
+ parentId = parentId || "parentId";
+ children = children || "children";
// 排序
- function NumCompare(a,b){
- //数字比较函数
+ function NumCompare(a, b) {
+ // 数字比较函数
return a.orderNum - b.orderNum;
}
- rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
- //对源数据深度克隆
- const cloneData = JSON.parse(JSON.stringify(data))
- //循环所有项
- const treeData = cloneData.filter(father => {
- let branchArr = cloneData.filter(child => {
- //返回每一项的子级数组
- return father[id] === child[parentId]
- });
- branchArr.sort(NumCompare)
- branchArr.length > 0 ? father.children = branchArr : '';
- //返回第一层
- return father[parentId] === rootId || !father[parentId];
- });
- treeData.sort(NumCompare)
- return treeData != '' ? treeData : data;
+ rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId]; })) || 0;
+ // 对源数据深度克隆
+ const cloneData = JSON.parse(JSON.stringify(data));
+ // 循环所有项
+ const treeData = cloneData.filter(father => {
+ const branchArr = cloneData.filter(child => {
+ // 返回每一项的子级数组
+ return father[id] === child[parentId];
+ });
+ branchArr.sort(NumCompare);
+ branchArr.length > 0 ? father.children = branchArr : "";
+ // 返回第一层
+ return father[parentId] === rootId || !father[parentId];
+ });
+ treeData.sort(NumCompare);
+ return treeData !== "" ? treeData : data;
}
diff --git a/dvadmin-ui/src/utils/scroll-to.js b/dvadmin-ui/src/utils/scroll-to.js
index c5d8e04..9d95fd9 100755
--- a/dvadmin-ui/src/utils/scroll-to.js
+++ b/dvadmin-ui/src/utils/scroll-to.js
@@ -1,29 +1,29 @@
Math.easeInOutQuad = function(t, b, c, d) {
- t /= d / 2
+ t /= d / 2;
if (t < 1) {
- return c / 2 * t * t + b
+ return c / 2 * t * t + b;
}
- t--
- return -c / 2 * (t * (t - 2) - 1) + b
-}
+ t--;
+ return -c / 2 * (t * (t - 2) - 1) + b;
+};
// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
var requestAnimFrame = (function() {
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
-})()
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); };
+})();
/**
* Because it's so fucking difficult to detect the scrolling element, just move them all
* @param {number} amount
*/
function move(amount) {
- document.documentElement.scrollTop = amount
- document.body.parentNode.scrollTop = amount
- document.body.scrollTop = amount
+ document.documentElement.scrollTop = amount;
+ document.body.parentNode.scrollTop = amount;
+ document.body.scrollTop = amount;
}
function position() {
- return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
+ return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;
}
/**
@@ -32,27 +32,27 @@ function position() {
* @param {Function} callback
*/
export function scrollTo(to, duration, callback) {
- const start = position()
- const change = to - start
- const increment = 20
- let currentTime = 0
- duration = (typeof (duration) === 'undefined') ? 500 : duration
+ const start = position();
+ const change = to - start;
+ const increment = 20;
+ let currentTime = 0;
+ duration = (typeof (duration) === "undefined") ? 500 : duration;
var animateScroll = function() {
// increment the time
- currentTime += increment
+ currentTime += increment;
// find the value with the quadratic in-out easing function
- var val = Math.easeInOutQuad(currentTime, start, change, duration)
+ var val = Math.easeInOutQuad(currentTime, start, change, duration);
// move the document.body
- move(val)
+ move(val);
// do the animation unless its over
if (currentTime < duration) {
- requestAnimFrame(animateScroll)
+ requestAnimFrame(animateScroll);
} else {
- if (callback && typeof (callback) === 'function') {
+ if (callback && typeof (callback) === "function") {
// the animation is done so lets callback
- callback()
+ callback();
}
}
- }
- animateScroll()
+ };
+ animateScroll();
}
diff --git a/dvadmin-ui/src/utils/validate.js b/dvadmin-ui/src/utils/validate.js
index 55e35b8..42e420d 100755
--- a/dvadmin-ui/src/utils/validate.js
+++ b/dvadmin-ui/src/utils/validate.js
@@ -3,7 +3,7 @@
* @returns {Boolean}
*/
export function isExternal(path) {
- return /^(https?:|mailto:|tel:)/.test(path)
+ return /^(https?:|mailto:|tel:)/.test(path);
}
/**
@@ -11,8 +11,8 @@ export function isExternal(path) {
* @returns {Boolean}
*/
export function validUsername(str) {
- const valid_map = ['admin', 'editor']
- return valid_map.indexOf(str.trim()) >= 0
+ const valid_map = ["admin", "editor"];
+ return valid_map.indexOf(str.trim()) >= 0;
}
/**
@@ -20,8 +20,8 @@ export function validUsername(str) {
* @returns {Boolean}
*/
export function validURL(url) {
- const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
- return reg.test(url)
+ const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
+ return reg.test(url);
}
/**
@@ -29,8 +29,8 @@ export function validURL(url) {
* @returns {Boolean}
*/
export function validLowerCase(str) {
- const reg = /^[a-z]+$/
- return reg.test(str)
+ const reg = /^[a-z]+$/;
+ return reg.test(str);
}
/**
@@ -38,8 +38,8 @@ export function validLowerCase(str) {
* @returns {Boolean}
*/
export function validUpperCase(str) {
- const reg = /^[A-Z]+$/
- return reg.test(str)
+ const reg = /^[A-Z]+$/;
+ return reg.test(str);
}
/**
@@ -47,8 +47,8 @@ export function validUpperCase(str) {
* @returns {Boolean}
*/
export function validAlphabets(str) {
- const reg = /^[A-Za-z]+$/
- return reg.test(str)
+ const reg = /^[A-Za-z]+$/;
+ return reg.test(str);
}
/**
@@ -56,8 +56,8 @@ export function validAlphabets(str) {
* @returns {Boolean}
*/
export function validEmail(email) {
- const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
- return reg.test(email)
+ const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+ return reg.test(email);
}
/**
@@ -65,10 +65,10 @@ export function validEmail(email) {
* @returns {Boolean}
*/
export function isString(str) {
- if (typeof str === 'string' || str instanceof String) {
- return true
+ if (typeof str === "string" || str instanceof String) {
+ return true;
}
- return false
+ return false;
}
/**
@@ -76,34 +76,34 @@ export function isString(str) {
* @returns {Boolean}
*/
export function isArray(arg) {
- if (typeof Array.isArray === 'undefined') {
- return Object.prototype.toString.call(arg) === '[object Array]'
+ if (typeof Array.isArray === "undefined") {
+ return Object.prototype.toString.call(arg) === "[object Array]";
}
- return Array.isArray(arg)
+ return Array.isArray(arg);
}
export function getCrontabData(val) {
- if (!val || Object.keys(val).length === 0) return '';
- const week = {1: '一', 2: '二', 3: '三', 4: '四', 5: '五', 6: '六', 7: '日'};
- let res = '';
- if (val.month_of_year !== '*') {
+ if (!val || Object.keys(val).length === 0) return "";
+ const week = { 1: "一", 2: "二", 3: "三", 4: "四", 5: "五", 6: "六", 7: "日" };
+ let res = "";
+ if (val.month_of_year !== "*") {
res = `${val.month_of_year} 月 ${val.day_of_month} 日 ${val.hour}点${val.minute}分`;
- } else if (val.day_of_month !== '*') {
+ } else if (val.day_of_month !== "*") {
res = `每月 ${val.day_of_month} 日 ${val.hour}点${val.minute}分`;
- } else if (val.day_of_week !== '*') {
+ } else if (val.day_of_week !== "*") {
res = `每周周${week[val.day_of_week] || val.day_of_week} ${val.hour}点${val.minute}分 `;
- } else if (val.hour !== '*') {
+ } else if (val.hour !== "*") {
res = `每天 ${val.hour}点${val.minute}分`;
- } else if (val.minute !== '*') {
+ } else if (val.minute !== "*") {
res = `每分钟 ${val.minute}秒`;
} else {
res = `${val.month_of_year} 月 ${val.day_of_month} 日 ${val.hour}点${val.minute}分`;
}
- return res.replace(/\*/g, '00');
+ return res.replace(/\*/g, "00");
}
export function getIntervalData(val) {
- if (!val || Object.keys(val).length === 0) return '';
- const lists = {days: '天', hours: '小时', seconds: '秒', minutes: '分钟'};
- return `每${val.every !== 1 ? val.every : ''}${lists[val.period]}`;
+ if (!val || Object.keys(val).length === 0) return "";
+ const lists = { days: "天", hours: "小时", seconds: "秒", minutes: "分钟" };
+ return `每${val.every !== 1 ? val.every : ""}${lists[val.period]}`;
}
diff --git a/dvadmin-ui/src/utils/zipdownload.js b/dvadmin-ui/src/utils/zipdownload.js
index 363c45a..5973978 100755
--- a/dvadmin-ui/src/utils/zipdownload.js
+++ b/dvadmin-ui/src/utils/zipdownload.js
@@ -1,22 +1,22 @@
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
+import axios from "axios";
+import { getToken } from "@/utils/auth";
const mimeMap = {
- xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- zip: 'application/zip'
-}
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ zip: "application/zip"
+};
-const baseUrl = process.env.VUE_APP_BASE_API
+const baseUrl = process.env.VUE_APP_BASE_API;
export function downLoadZip(str, filename) {
- var url = baseUrl + str
+ var url = baseUrl + str;
axios({
- method: 'get',
+ method: "get",
url: url,
- responseType: 'blob',
- headers: { 'Authorization': 'Bearer ' + getToken() }
+ responseType: "blob",
+ headers: { "Authorization": "Bearer " + getToken() }
}).then(res => {
- resolveBlob(res, mimeMap.zip)
- })
+ resolveBlob(res, mimeMap.zip);
+ });
}
/**
* 解析blob响应内容并下载
@@ -24,17 +24,17 @@ export function downLoadZip(str, filename) {
* @param {String} mimeType MIME类型
*/
export function resolveBlob(res, mimeType) {
- const aLink = document.createElement('a')
- var blob = new Blob([res.data], { type: mimeType })
+ const aLink = document.createElement("a");
+ var blob = new Blob([res.data], { type: mimeType });
// //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
- var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
- var contentDisposition = decodeURI(res.headers['content-disposition'])
- var result = patt.exec(contentDisposition)
- var fileName = result[1]
- fileName = fileName.replace(/\"/g, '')
- aLink.href = URL.createObjectURL(blob)
- aLink.setAttribute('download', fileName) // 设置下载文件名称
- document.body.appendChild(aLink)
- aLink.click()
- document.body.appendChild(aLink)
+ var patt = new RegExp("filename=([^;]+\\.[^\\.;]+);*");
+ var contentDisposition = decodeURI(res.headers["content-disposition"]);
+ var result = patt.exec(contentDisposition);
+ var fileName = result[1];
+ fileName = fileName.replace(/\"/g, "");
+ aLink.href = URL.createObjectURL(blob);
+ aLink.setAttribute("download", fileName); // 设置下载文件名称
+ document.body.appendChild(aLink);
+ aLink.click();
+ document.body.appendChild(aLink);
}
diff --git a/dvadmin-ui/src/views/components/icons/element-icons.js b/dvadmin-ui/src/views/components/icons/element-icons.js
index 9ea4d63..50badf8 100755
--- a/dvadmin-ui/src/views/components/icons/element-icons.js
+++ b/dvadmin-ui/src/views/components/icons/element-icons.js
@@ -1,3 +1,3 @@
-const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round']
+const elementIcons = ["platform-eleme", "eleme", "delete-solid", "delete", "s-tools", "setting", "user-solid", "user", "phone", "phone-outline", "more", "more-outline", "star-on", "star-off", "s-goods", "goods", "warning", "warning-outline", "question", "info", "remove", "circle-plus", "success", "error", "zoom-in", "zoom-out", "remove-outline", "circle-plus-outline", "circle-check", "circle-close", "s-help", "help", "minus", "plus", "check", "close", "picture", "picture-outline", "picture-outline-round", "upload", "upload2", "download", "camera-solid", "camera", "video-camera-solid", "video-camera", "message-solid", "bell", "s-cooperation", "s-order", "s-platform", "s-fold", "s-unfold", "s-operation", "s-promotion", "s-home", "s-release", "s-ticket", "s-management", "s-open", "s-shop", "s-marketing", "s-flag", "s-comment", "s-finance", "s-claim", "s-custom", "s-opportunity", "s-data", "s-check", "s-grid", "menu", "share", "d-caret", "caret-left", "caret-right", "caret-bottom", "caret-top", "bottom-left", "bottom-right", "back", "right", "bottom", "top", "top-left", "top-right", "arrow-left", "arrow-right", "arrow-down", "arrow-up", "d-arrow-left", "d-arrow-right", "video-pause", "video-play", "refresh", "refresh-right", "refresh-left", "finished", "sort", "sort-up", "sort-down", "rank", "loading", "view", "c-scale-to-original", "date", "edit", "edit-outline", "folder", "folder-opened", "folder-add", "folder-remove", "folder-delete", "folder-checked", "tickets", "document-remove", "document-delete", "document-copy", "document-checked", "document", "document-add", "printer", "paperclip", "takeaway-box", "search", "monitor", "attract", "mobile", "scissors", "umbrella", "headset", "brush", "mouse", "coordinate", "magic-stick", "reading", "data-line", "data-board", "pie-chart", "data-analysis", "collection-tag", "film", "suitcase", "suitcase-1", "receiving", "collection", "files", "notebook-1", "notebook-2", "toilet-paper", "office-building", "school", "table-lamp", "house", "no-smoking", "smoking", "shopping-cart-full", "shopping-cart-1", "shopping-cart-2", "shopping-bag-1", "shopping-bag-2", "sold-out", "sell", "present", "box", "bank-card", "money", "coin", "wallet", "discount", "price-tag", "news", "guide", "male", "female", "thumb", "cpu", "link", "connection", "open", "turn-off", "set-up", "chat-round", "chat-line-round", "chat-square", "chat-dot-round", "chat-dot-square", "chat-line-square", "message", "postcard", "position", "turn-off-microphone", "microphone", "close-notification", "bangzhu", "time", "odometer", "crop", "aim", "switch-button", "full-screen", "copy-document", "mic", "stopwatch", "medal-1", "medal", "trophy", "trophy-1", "first-aid-kit", "discover", "place", "location", "location-outline", "location-information", "add-location", "delete-location", "map-location", "alarm-clock", "timer", "watch-1", "watch", "lock", "unlock", "key", "service", "mobile-phone", "bicycle", "truck", "ship", "basketball", "football", "soccer", "baseball", "wind-power", "light-rain", "lightning", "heavy-rain", "sunrise", "sunrise-1", "sunset", "sunny", "cloudy", "partly-cloudy", "cloudy-and-sunny", "moon", "moon-night", "dish", "dish-1", "food", "chicken", "fork-spoon", "knife-fork", "burger", "tableware", "sugar", "dessert", "ice-cream", "hot-water", "water-cup", "coffee-cup", "cold-drink", "goblet", "goblet-full", "goblet-square", "goblet-square-full", "refrigerator", "grape", "watermelon", "cherry", "apple", "pear", "orange", "coffee", "ice-tea", "ice-drink", "milk-tea", "potato-strips", "lollipop", "ice-cream-square", "ice-cream-round"];
-export default elementIcons
+export default elementIcons;
diff --git a/dvadmin-ui/src/views/components/icons/index.vue b/dvadmin-ui/src/views/components/icons/index.vue
index d3c9a71..f803235 100755
--- a/dvadmin-ui/src/views/components/icons/index.vue
+++ b/dvadmin-ui/src/views/components/icons/index.vue
@@ -36,26 +36,26 @@