mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud-Vue3.git
synced 2025-09-01 18:34:49 +00:00
优化代码
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
||||||
box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
// reset element-ui css
|
// reset element-ui css
|
||||||
.horizontal-collapse-transition {
|
.horizontal-collapse-transition {
|
||||||
|
@@ -61,22 +61,24 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const fullYear = ref(0)
|
|
||||||
const maxFullYear = ref(0)
|
const fullYear = Number(new Date().getFullYear())
|
||||||
|
const maxFullYear = fullYear + 10
|
||||||
const radioValue = ref(1)
|
const radioValue = ref(1)
|
||||||
const cycle01 = ref(0)
|
const cycle01 = ref(fullYear)
|
||||||
const cycle02 = ref(0)
|
const cycle02 = ref(fullYear + 1)
|
||||||
const average01 = ref(0)
|
const average01 = ref(fullYear)
|
||||||
const average02 = ref(1)
|
const average02 = ref(1)
|
||||||
const checkboxList = ref([])
|
const checkboxList = ref([])
|
||||||
const checkCopy = ref([])
|
const checkCopy = ref([fullYear])
|
||||||
|
|
||||||
const cycleTotal = computed(() => {
|
const cycleTotal = computed(() => {
|
||||||
cycle01.value = props.check(cycle01.value, fullYear.value, maxFullYear.value - 1)
|
cycle01.value = props.check(cycle01.value, fullYear, maxFullYear - 1)
|
||||||
cycle02.value = props.check(cycle02.value, cycle01.value + 1, maxFullYear.value)
|
cycle02.value = props.check(cycle02.value, cycle01.value + 1, maxFullYear)
|
||||||
return cycle01.value + '-' + cycle02.value
|
return cycle01.value + '-' + cycle02.value
|
||||||
})
|
})
|
||||||
const averageTotal = computed(() => {
|
const averageTotal = computed(() => {
|
||||||
average01.value = props.check(average01.value, fullYear.value, maxFullYear.value - 1)
|
average01.value = props.check(average01.value, fullYear, maxFullYear - 1)
|
||||||
average02.value = props.check(average02.value, 1, 10)
|
average02.value = props.check(average02.value, 1, 10)
|
||||||
return average01.value + '/' + average02.value
|
return average01.value + '/' + average02.value
|
||||||
})
|
})
|
||||||
@@ -97,8 +99,8 @@ function changeRadioValue(value) {
|
|||||||
radioValue.value = 3
|
radioValue.value = 3
|
||||||
} else if (value.indexOf("/") > -1) {
|
} else if (value.indexOf("/") > -1) {
|
||||||
const indexArr = value.split('/')
|
const indexArr = value.split('/')
|
||||||
average01.value = Number(indexArr[1])
|
average01.value = Number(indexArr[0])
|
||||||
average02.value = Number(indexArr[0])
|
average02.value = Number(indexArr[1])
|
||||||
radioValue.value = 4
|
radioValue.value = 4
|
||||||
} else {
|
} else {
|
||||||
checkboxList.value = [...new Set(value.split(',').map(item => Number(item)))]
|
checkboxList.value = [...new Set(value.split(',').map(item => Number(item)))]
|
||||||
@@ -129,14 +131,6 @@ function onRadioChange() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
|
||||||
fullYear.value = Number(new Date().getFullYear())
|
|
||||||
maxFullYear.value = fullYear.value + 10
|
|
||||||
cycle01.value = fullYear.value
|
|
||||||
cycle02.value = cycle01.value + 1
|
|
||||||
average01.value = fullYear.value
|
|
||||||
checkCopy.value = [fullYear.value]
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
@input="querySearch"
|
@input="querySearch"
|
||||||
prefix-icon="Search"
|
prefix-icon="Search"
|
||||||
placeholder="菜单搜索,支持标题、URL模糊查询"
|
placeholder="菜单搜索,支持标题、URL模糊查询"
|
||||||
|
clearable
|
||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
|
@@ -63,7 +63,7 @@ const topMenus = computed(() => {
|
|||||||
routers.value.map((menu) => {
|
routers.value.map((menu) => {
|
||||||
if (menu.hidden !== true) {
|
if (menu.hidden !== true) {
|
||||||
// 兼容顶部栏一级菜单内部跳转
|
// 兼容顶部栏一级菜单内部跳转
|
||||||
if (menu.path === "/") {
|
if (menu.path === '/' && menu.children) {
|
||||||
topMenus.push(menu.children[0]);
|
topMenus.push(menu.children[0]);
|
||||||
} else {
|
} else {
|
||||||
topMenus.push(menu);
|
topMenus.push(menu);
|
||||||
|
@@ -22,7 +22,7 @@ onMounted(() => {
|
|||||||
addIframe()
|
addIframe()
|
||||||
})
|
})
|
||||||
|
|
||||||
watch((route) => {
|
watchEffect(() => {
|
||||||
addIframe()
|
addIframe()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -318,7 +318,7 @@ function buildElRadioGroupChild(conf) {
|
|||||||
if (conf.options && conf.options.length) {
|
if (conf.options && conf.options.length) {
|
||||||
const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio'
|
const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio'
|
||||||
const border = conf.border ? 'border' : ''
|
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" :value="item.value" :disabled="item.disabled" ${border}>{{item.label}}</${tag}>`)
|
||||||
}
|
}
|
||||||
return children.join('\n')
|
return children.join('\n')
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ function buildElCheckboxGroupChild(conf) {
|
|||||||
if (conf.options && conf.options.length) {
|
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' : ''
|
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" :value="item.label" :disabled="item.disabled" ${border} />`)
|
||||||
}
|
}
|
||||||
return children.join('\n')
|
return children.join('\n')
|
||||||
}
|
}
|
||||||
|
@@ -183,6 +183,7 @@ getCookie();
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
|
z-index: 1;
|
||||||
.el-input {
|
.el-input {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
input {
|
input {
|
||||||
|
@@ -427,28 +427,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表单尺寸">
|
<el-form-item label="表单尺寸">
|
||||||
<el-radio-group v-model="formConf.size">
|
<el-radio-group v-model="formConf.size">
|
||||||
<el-radio-button label="large">
|
<el-radio-button label="large" value="较大" />
|
||||||
较大
|
<el-radio-button label="default" value="默认" />
|
||||||
</el-radio-button>
|
<el-radio-button label="small" value="较小" />
|
||||||
<el-radio-button label="default">
|
|
||||||
默认
|
|
||||||
</el-radio-button>
|
|
||||||
<el-radio-button label="small">
|
|
||||||
较小
|
|
||||||
</el-radio-button>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标签对齐">
|
<el-form-item label="标签对齐">
|
||||||
<el-radio-group v-model="formConf.labelPosition">
|
<el-radio-group v-model="formConf.labelPosition">
|
||||||
<el-radio-button label="left">
|
<el-radio-button label="left" value="左对齐" />
|
||||||
左对齐
|
<el-radio-button label="right" value="右对齐" />
|
||||||
</el-radio-button>
|
<el-radio-button label="top" value="顶部对齐" />
|
||||||
<el-radio-button label="right">
|
|
||||||
右对齐
|
|
||||||
</el-radio-button>
|
|
||||||
<el-radio-button label="top">
|
|
||||||
顶部对齐
|
|
||||||
</el-radio-button>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标签宽度">
|
<el-form-item label="标签宽度">
|
||||||
|
Reference in New Issue
Block a user