Browse Source

fix: [整体样式] 修改整体样式

luojie
memorylkf 2 weeks ago
parent
commit
6c4d56cffa
53 changed files with 443 additions and 352 deletions
  1. +8
    -0
      src/assets/styles/index.scss
  2. +1
    -1
      src/components/Crontab/day.vue
  3. +1
    -1
      src/components/Crontab/hour.vue
  4. +3
    -3
      src/components/Crontab/index.vue
  5. +1
    -1
      src/components/Crontab/min.vue
  6. +1
    -1
      src/components/Crontab/month.vue
  7. +1
    -1
      src/components/Crontab/second.vue
  8. +1
    -1
      src/components/Crontab/week.vue
  9. +1
    -1
      src/components/Crontab/year.vue
  10. +1
    -1
      src/components/FileUpload/index.vue
  11. +0
    -1
      src/components/HeaderSearch/index.vue
  12. +4
    -4
      src/components/RightToolbar/index.vue
  13. +2
    -2
      src/layout/components/Settings/index.vue
  14. +1
    -1
      src/main.js
  15. +125
    -72
      src/utils/generator/html.js
  16. +58
    -27
      src/utils/generator/render.js
  17. +7
    -7
      src/views/business/resource/mjy/comps/ffjlList.vue
  18. +1
    -1
      src/views/business/resource/mjy/comps/mjy/Czrq.vue
  19. +1
    -1
      src/views/business/resource/mjy/comps/mjy/Czyj.vue
  20. +1
    -1
      src/views/business/resource/mjy/comps/mjy/Ff.vue
  21. +15
    -15
      src/views/business/resource/mjy/comps/mjyList.vue
  22. +1
    -1
      src/views/business/resource/sj/comps/CzBatch.vue
  23. +10
    -10
      src/views/business/resource/sj/list.vue
  24. +6
    -6
      src/views/business/resource/yq/list.vue
  25. +3
    -3
      src/views/business/resource/zcg/list.vue
  26. +3
    -3
      src/views/business/template/list.vue
  27. +1
    -1
      src/views/login.vue
  28. +15
    -15
      src/views/monitor/job/index.vue
  29. +9
    -9
      src/views/monitor/job/log.vue
  30. +4
    -4
      src/views/monitor/online/index.vue
  31. +1
    -1
      src/views/register.vue
  32. +10
    -10
      src/views/system/config/index.vue
  33. +9
    -9
      src/views/system/dept/index.vue
  34. +10
    -10
      src/views/system/dict/data.vue
  35. +10
    -10
      src/views/system/dict/index.vue
  36. +7
    -7
      src/views/system/logininfor/index.vue
  37. +8
    -8
      src/views/system/menu/index.vue
  38. +8
    -8
      src/views/system/notice/index.vue
  39. +8
    -8
      src/views/system/operlog/index.vue
  40. +9
    -9
      src/views/system/post/index.vue
  41. +7
    -7
      src/views/system/role/authUser.vue
  42. +17
    -17
      src/views/system/role/index.vue
  43. +3
    -3
      src/views/system/role/selectUser.vue
  44. +16
    -16
      src/views/system/user/index.vue
  45. +2
    -2
      src/views/system/user/profile/resetPwd.vue
  46. +6
    -6
      src/views/system/user/profile/userAvatar.vue
  47. +2
    -2
      src/views/system/user/profile/userInfo.vue
  48. +1
    -1
      src/views/tool/build/CodeTypeDialog.vue
  49. +1
    -1
      src/views/tool/build/IconsDialog.vue
  50. +6
    -6
      src/views/tool/build/RightPanel.vue
  51. +1
    -1
      src/views/tool/build/TreeNodeDialog.vue
  52. +3
    -3
      src/views/tool/gen/importTable.vue
  53. +12
    -12
      src/views/tool/gen/index.vue

+ 8
- 0
src/assets/styles/index.scss View File

@ -179,3 +179,11 @@ aside {
margin-bottom: 10px;
}
}
.vue-treeselect__control{
height: 28px !important;
line-height: 28px !important;
}
.vue-treeselect__placeholder,
.vue-treeselect__single-value{
line-height: 28px !important;
}

+ 1
- 1
src/components/Crontab/day.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size="small">
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * ? / L W]

+ 1
- 1
src/components/Crontab/hour.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size="small">
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
小时允许的通配符[, - * /]

+ 3
- 3
src/components/Crontab/index.vue View File

@ -104,9 +104,9 @@
<CrontabResult :ex="crontabValueString"></CrontabResult>
<div class="pop_btn">
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
<el-button size="small" type="warning" @click="clearCron">重置</el-button>
<el-button size="small" @click="hidePopup">取消</el-button>
<el-button type="primary" @click="submitFill">确定</el-button>
<el-button type="warning" @click="clearCron">重置</el-button>
<el-button @click="hidePopup">取消</el-button>
</div>
</div>
</div>

+ 1
- 1
src/components/Crontab/min.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size="small">
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
分钟允许的通配符[, - * /]

+ 1
- 1
src/components/Crontab/month.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size='small'>
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * /]

+ 1
- 1
src/components/Crontab/second.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size="small">
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * /]

+ 1
- 1
src/components/Crontab/week.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size='small'>
<el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="1">
允许的通配符[, - * ? / L #]

+ 1
- 1
src/components/Crontab/year.vue View File

@ -1,5 +1,5 @@
<template>
<el-form size="small">
<el-form>
<el-form-item>
<el-radio :label="1" v-model='radioValue'>
不填允许的通配符[, - * /]

+ 1
- 1
src/components/FileUpload/index.vue View File

@ -17,7 +17,7 @@
v-if="!disabled"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
<el-button type="primary">选取文件</el-button>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传

+ 0
- 1
src/components/HeaderSearch/index.vue View File

@ -11,7 +11,6 @@
<el-input
v-model="search"
ref="headerSearchSelectRef"
size="large"
@input="querySearch"
prefix-icon="el-icon-search"
placeholder="菜单搜索,支持标题、URL模糊查询"

+ 4
- 4
src/components/RightToolbar/index.vue View File

@ -2,15 +2,15 @@
<div class="top-right-btn" :style="style">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top" v-if="search">
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
<el-button circle icon="el-icon-search" @click="toggleSearch()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
<el-button circle icon="el-icon-refresh" @click="refresh()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="Object.keys(columns).length > 0">
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/>
<el-button circle icon="el-icon-menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/>
<el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'">
<el-button size="mini" circle icon="el-icon-menu" />
<el-button circle icon="el-icon-menu" />
<el-dropdown-menu slot="dropdown">
<!-- 全选/反选 按钮 -->
<el-dropdown-item>

+ 2
- 2
src/layout/components/Settings/index.vue View File

@ -76,8 +76,8 @@
<el-divider/>
<el-button size="small" type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
<el-button size="small" plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
<el-button type="primary" plain icon="el-icon-document-add" @click="saveSetting">保存配置</el-button>
<el-button plain icon="el-icon-refresh" @click="resetSetting">重置配置</el-button>
</div>
</div>
</el-drawer>

+ 1
- 1
src/main.js View File

@ -83,7 +83,7 @@ import _ from 'lodash'
Vue.use(Element, {
i18n: (key, value) => i18n.t(key, value),
size: Cookies.get('size') || 'medium' // set element-ui default size
size: Cookies.get('size') || 'mini' // set element-ui default size
})
Vue.config.productionTip = false

+ 125
- 72
src/utils/generator/html.js View File

@ -39,7 +39,11 @@ function buildFormTemplate(conf, child, type) {
labelPosition = `label-position="${conf.labelPosition}"`
}
const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : ''
let str = `<el-form ref="${conf.formRef}" :model="${conf.formModel}" :rules="${conf.formRules}" size="${conf.size}" ${disabled} label-width="${conf.labelWidth}px" ${labelPosition}>
let str = `<el-form ref="${conf.formRef}" :model="${
conf.formModel
}" :rules="${conf.formRules}" size="${conf.size}" ${disabled} label-width="${
conf.labelWidth
}px" ${labelPosition}>
${child}
${buildFromBtns(conf, type)}
</el-form>`
@ -54,7 +58,7 @@ function buildFormTemplate(conf, child, type) {
function buildFromBtns(conf, type) {
let str = ''
if (conf.formBtns && type === 'file') {
str = `<el-form-item size="large">
str = `<el-form-item>
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>`
@ -93,10 +97,11 @@ const layouts = {
},
rowFormItem(element) {
const type = element.type === 'default' ? '' : `type="${element.type}"`
const justify = element.type === 'default' ? '' : `justify="${element.justify}"`
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 children = element.children.map((el) => layouts[el.layout](el))
let str = `<el-row ${type} ${justify} ${align} ${gutter}>
${children.join('\n')}
</el-row>`
@ -106,10 +111,8 @@ const layouts = {
}
const tags = {
'el-button': el => {
const {
tag, disabled
} = attrBuilder(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}"` : ''
@ -118,28 +121,33 @@ const tags = {
if (child) child = `\n${child}\n` // 换行
return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}</${el.tag}>`
},
'el-input': el => {
const {
disabled, vModel, clearable, placeholder, width
} = attrBuilder(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 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}}"`
: ''
const autosize =
el.autosize && el.autosize.minRows
? `:autosize="{minRows: ${el.autosize.minRows}, maxRows: ${el.autosize.maxRows}}"`
: ''
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}>`
},
'el-input-number': el => {
'el-input-number': (el) => {
const { disabled, vModel, placeholder } = attrBuilder(el)
const controlsPosition = el['controls-position'] ? `controls-position=${el['controls-position']}` : ''
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}'` : ''
@ -148,10 +156,8 @@ const tags = {
return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}></${el.tag}>`
},
'el-select': el => {
const {
disabled, vModel, clearable, placeholder, width
} = attrBuilder(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)
@ -159,7 +165,7 @@ const tags = {
if (child) child = `\n${child}\n` // 换行
return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}</${el.tag}>`
},
'el-radio-group': el => {
'el-radio-group': (el) => {
const { disabled, vModel } = attrBuilder(el)
const size = `size="${el.size}"`
let child = buildElRadioGroupChild(el)
@ -167,7 +173,7 @@ const tags = {
if (child) child = `\n${child}\n` // 换行
return `<${el.tag} ${vModel} ${size} ${disabled}>${child}</${el.tag}>`
},
'el-checkbox-group': el => {
'el-checkbox-group': (el) => {
const { disabled, vModel } = attrBuilder(el)
const size = `size="${el.size}"`
const min = el.min ? `:min="${el.min}"` : ''
@ -177,68 +183,98 @@ const tags = {
if (child) child = `\n${child}\n` // 换行
return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}</${el.tag}>`
},
'el-switch': el => {
'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'])}'` : ''
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}>`
},
'el-cascader': el => {
const {
disabled, vModel, clearable, placeholder, width
} = attrBuilder(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 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}>`
},
'el-slider': el => {
'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']}"` : ''
const showStops = el['show-stops']
? `:show-stops="${el['show-stops']}"`
: ''
return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}></${el.tag}>`
},
'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']}"` : ''
'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'])}'` : ''
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}>`
},
'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']}"` : ''
'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 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}>`
},
'el-rate': el => {
'el-rate': (el) => {
const { disabled, vModel } = attrBuilder(el)
const max = el.max ? `:max='${el.max}'` : ''
const allowHalf = el['allow-half'] ? 'allow-half' : ''
@ -247,19 +283,22 @@ const tags = {
return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}></${el.tag}>`
},
'el-color-picker': el => {
'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']}"` : ''
const colorFormat = el['color-format']
? `color-format="${el['color-format']}"`
: ''
return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}></${el.tag}>`
},
'el-upload': el => {
const disabled = el.disabled ? ':disabled=\'true\'' : ''
'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 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"' : ''
@ -279,7 +318,7 @@ function attrBuilder(el) {
clearable: el.clearable ? 'clearable' : '',
placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '',
width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '',
disabled: el.disabled ? ':disabled=\'true\'' : ''
disabled: el.disabled ? ":disabled='true'" : ''
}
}
@ -307,7 +346,9 @@ function buildElInputChild(conf) {
function buildElSelectChild(conf) {
const children = []
if (conf.options && conf.options.length) {
children.push(`<el-option v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.label" :value="item.value" :disabled="item.disabled"></el-option>`)
children.push(
`<el-option v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.label" :value="item.value" :disabled="item.disabled"></el-option>`
)
}
return children.join('\n')
}
@ -317,7 +358,9 @@ function buildElRadioGroupChild(conf) {
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}>`)
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')
}
@ -325,26 +368,36 @@ function buildElRadioGroupChild(conf) {
function buildElCheckboxGroupChild(conf) {
const children = []
if (conf.options && conf.options.length) {
const tag = conf.optionType === 'button' ? 'el-checkbox-button' : 'el-checkbox'
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}>`)
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')
}
function buildElUploadChild(conf) {
const list = []
if (conf['list-type'] === 'picture-card') list.push('<i class="el-icon-plus"></i>')
else list.push(`<el-button size="small" type="primary" icon="el-icon-upload">${conf.buttonText}</el-button>`)
if (conf.showTip) list.push(`<div slot="tip" class="el-upload__tip">只能上传不超过 ${conf.fileSize}${conf.sizeUnit}${conf.accept}文件</div>`)
if (conf['list-type'] === 'picture-card')
list.push('<i class="el-icon-plus"></i>')
else
list.push(
`<el-button type="primary" icon="el-icon-upload">${conf.buttonText}</el-button>`
)
if (conf.showTip)
list.push(
`<div slot="tip" class="el-upload__tip">只能上传不超过 ${conf.fileSize}${conf.sizeUnit}${conf.accept}文件</div>`
)
return list.join('\n')
}
export function makeUpHtml(conf, type) {
const htmlList = []
confGlobal = conf
someSpanIsNot24 = conf.fields.some(item => item.span !== 24)
conf.fields.forEach(el => {
someSpanIsNot24 = conf.fields.some((item) => item.span !== 24)
conf.fields.forEach((el) => {
htmlList.push(layouts[el.layout](el))
})
const htmlStr = htmlList.join('\n')

+ 58
- 27
src/utils/generator/render.js View File

@ -2,25 +2,25 @@ 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.on.input = val => {
dataObject.on.input = (val) => {
self.$emit('input', val)
}
}
@ -29,7 +29,7 @@ const componentChild = {
'el-button': {
default(h, conf, key) {
return conf[key]
},
}
},
'el-input': {
prepend(h, conf, key) {
@ -42,8 +42,14 @@ const componentChild = {
'el-select': {
options(h, conf, key) {
const list = []
conf.options.forEach(item => {
list.push(<el-option label={item.label} value={item.value} disabled={item.disabled}></el-option>)
conf.options.forEach((item) => {
list.push(
<el-option
label={item.label}
value={item.value}
disabled={item.disabled}
></el-option>
)
})
return list
}
@ -51,9 +57,17 @@ const componentChild = {
'el-radio-group': {
options(h, conf, key) {
const list = []
conf.options.forEach(item => {
if (conf.optionType === 'button') list.push(<el-radio-button label={item.value}>{item.label}</el-radio-button>)
else list.push(<el-radio label={item.value} border={conf.border}>{item.label}</el-radio>)
conf.options.forEach((item) => {
if (conf.optionType === 'button')
list.push(
<el-radio-button label={item.value}>{item.label}</el-radio-button>
)
else
list.push(
<el-radio label={item.value} border={conf.border}>
{item.label}
</el-radio>
)
})
return list
}
@ -61,11 +75,19 @@ const componentChild = {
'el-checkbox-group': {
options(h, conf, key) {
const list = []
conf.options.forEach(item => {
conf.options.forEach((item) => {
if (conf.optionType === 'button') {
list.push(<el-checkbox-button label={item.value}>{item.label}</el-checkbox-button>)
list.push(
<el-checkbox-button label={item.value}>
{item.label}
</el-checkbox-button>
)
} else {
list.push(<el-checkbox label={item.value} border={conf.border}>{item.label}</el-checkbox>)
list.push(
<el-checkbox label={item.value} border={conf.border}>
{item.label}
</el-checkbox>
)
}
})
return list
@ -77,10 +99,19 @@ const componentChild = {
if (conf['list-type'] === 'picture-card') {
list.push(<i class="el-icon-plus"></i>)
} else {
list.push(<el-button size="small" type="primary" icon="el-icon-upload">{conf.buttonText}</el-button>)
list.push(
<el-button type="primary" icon="el-icon-upload">
{conf.buttonText}
</el-button>
)
}
if (conf.showTip) {
list.push(<div slot="tip" class="el-upload__tip">只能上传不超过 {conf.fileSize}{conf.sizeUnit} {conf.accept}文件</div>)
list.push(
<div slot="tip" class="el-upload__tip">
只能上传不超过 {conf.fileSize}
{conf.sizeUnit} {conf.accept}文件
</div>
)
}
return list
}
@ -100,7 +131,7 @@ export default {
const childObjs = componentChild[confClone.tag]
if (childObjs) {
Object.keys(childObjs).forEach(key => {
Object.keys(childObjs).forEach((key) => {
const childFunc = childObjs[key]
if (confClone[key]) {
children.push(childFunc(h, confClone, key))
@ -108,7 +139,7 @@ export default {
})
}
Object.keys(confClone).forEach(key => {
Object.keys(confClone).forEach((key) => {
const val = confClone[key]
if (key === 'vModel') {
vModel(this, dataObject, confClone.defaultValue)

+ 7
- 7
src/views/business/resource/mjy/comps/ffjlList.vue View File

@ -2,7 +2,7 @@
<div>
<!-- 列表 -->
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" class="search-area" size="small" :inline="true" label-width="88px">
<el-form :model="queryParams" ref="queryForm" class="search-area" :inline="true" label-width="88px">
<el-row>
<el-col :span="24">
<!-- 名称 -->
@ -142,7 +142,7 @@
<template slot-scope="scope">
<template v-if="scope.row.jlzt == 1||scope.row.jlzt == 3||scope.row.jlzt == 7">
<!-- 详情 -->
<el-button size="mini" type="text" @click="handleXq(scope.row)"
<el-button type="text" @click="handleXq(scope.row)"
v-hasPermi="['business:resource:mjy:ffjlList']">{{
$t('page.business.zykgl.mjy.detail') }}</el-button>
</template>
@ -150,23 +150,23 @@
<template v-if="scope.row.zjzt == 9"></template>
<!-- 锁定 -->
<el-button size="mini" type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)"
<el-button type="text" v-if="scope.row.jlzt == 1" @click="handleSd(scope.row)"
v-hasPermi="['business:resource:mjy:ffjlsd']">{{
$t('page.business.zykgl.mjy.lock') }}</el-button>
<!-- 解锁 -->
<el-button size="mini" type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)"
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleJs(scope.row)"
v-hasPermi="['business:resource:mjy:ffjljs']">{{
$t('page.business.zykgl.mjy.unlock') }}</el-button>
<!-- 归档 -->
<el-button size="mini" type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)"
<el-button type="text" v-if="scope.row.jlzt == 3" @click="handleGd(scope.row)"
v-hasPermi="['business:resource:mjy:ffjlgd']">{{
$t('page.business.zykgl.mjy.guidang') }}</el-button>
<!-- 解档 -->
<el-button size="mini" type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)"
<el-button type="text" v-if="scope.row.jlzt == 7" @click="handleJd(scope.row)"
v-hasPermi="['business:resource:mjy:ffjljd']">{{
$t('page.business.zykgl.mjy.jiedang') }}</el-button>
<!-- 借阅 -->
<el-button size="mini" type="text" v-if="scope.row.jyzt == 1" @click="handleJy(scope.row)"
<el-button type="text" v-if="scope.row.jyzt == 1" @click="handleJy(scope.row)"
v-hasPermi="['business:resource:mjy:ffjljy']">{{
$t('page.business.zykgl.mjy.jieyue') }}</el-button>
</template>

+ 1
- 1
src/views/business/resource/mjy/comps/mjy/Czrq.vue View File

@ -26,7 +26,7 @@ G