选择菜单图标
This commit is contained in:
parent
a23fe978a2
commit
2796c3d64e
|
|
@ -34,7 +34,7 @@ export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const { store, router } = useAdmin()
|
const { store, router } = useAdmin()
|
||||||
const userInfo = computed(() => store.getters.userInfo)
|
const userInfo = computed(() => store.getters.userInfo)
|
||||||
console.log(userInfo, 'userInfo')
|
console.log(userInfo, 'userInfo____')
|
||||||
|
|
||||||
const handleCommand = (command: string) => {
|
const handleCommand = (command: string) => {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,13 @@
|
||||||
v-for="(item, index) in roleList"
|
v-for="(item, index) in roleList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id + ''"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 密码输入框 -->
|
<!-- 密码输入框 -->
|
||||||
<el-form-item label="密码:" prop="password" required>
|
<el-form-item label="密码:" prop="password">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.password"
|
v-model="formData.password"
|
||||||
show-password
|
show-password
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 确认密码输入框 -->
|
<!-- 确认密码输入框 -->
|
||||||
<el-form-item label="确认密码:" prop="password_confirm" required>
|
<el-form-item label="确认密码:" prop="password_confirm">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="formData.password_confirm"
|
v-model="formData.password_confirm"
|
||||||
show-password
|
show-password
|
||||||
|
|
@ -132,8 +132,29 @@ export default defineComponent({
|
||||||
trigger: ['blur']
|
trigger: ['blur']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
password: [] as any[],
|
password: [
|
||||||
password_confirm: [] as any[]
|
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
validator: (rule: object, value: string, callback: any) => {
|
||||||
|
!value ? callback(new Error('请输入密码')) : callback()
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
] as any[],
|
||||||
|
password_confirm: [
|
||||||
|
{ required: true, message: '请再次输入密码', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
validator: (rule: object, value: string, callback: any) => {
|
||||||
|
if (formData.value.password) {
|
||||||
|
if (!value) callback(new Error('请再次输入密码'))
|
||||||
|
if (value !== formData.value.password)
|
||||||
|
callback(new Error('两次输入密码不一致!'))
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
] as any[]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
@ -143,31 +164,13 @@ export default defineComponent({
|
||||||
page_type: 1
|
page_type: 1
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
roleList.value = res.lists
|
roleList.value = res.lists
|
||||||
|
console.log('roleList.value', roleList.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getAdminDetail = () => {
|
const getAdminDetail = () => {
|
||||||
if (!id.value) {
|
if (!id.value) {
|
||||||
rules.value.password = [
|
rules.value.password
|
||||||
{
|
rules.value.password_confirm
|
||||||
required: true,
|
|
||||||
message: '请输入密码',
|
|
||||||
trigger: ['blur']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
rules.value.password_confirm = [
|
|
||||||
{ required: true, message: '请再次输入密码', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (rule, value, callback) => {
|
|
||||||
if (formData.value.password) {
|
|
||||||
if (!value) callback(new Error('请再次输入密码'))
|
|
||||||
if (value !== formData.value.password)
|
|
||||||
callback(new Error('两次输入密码不一致!'))
|
|
||||||
}
|
|
||||||
callback()
|
|
||||||
},
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-input> -->
|
</el-input> -->
|
||||||
|
|
||||||
<select-icon :icon="formData.menuIcon"></select-icon>
|
<select-icon v-model:icon="formData.menuIcon"></select-icon>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="select-icon">
|
<div class="select-icon">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="show-icon">
|
<div class="show-icon">
|
||||||
<i class="iconfont" :class="iconItemValue"></i>
|
<i class="iconfont" :class="icon"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-popover placement="bottom" :width="400" trigger="click">
|
<el-popover placement="bottom" :width="400" trigger="click">
|
||||||
|
|
@ -117,11 +117,9 @@ const selectIcon = ref<any>([
|
||||||
'icon_gongyingshang'
|
'icon_gongyingshang'
|
||||||
])
|
])
|
||||||
|
|
||||||
const iconItemValue = ref<any>([])
|
|
||||||
|
|
||||||
const selectIconItem = (item: string) => {
|
const selectIconItem = (item: string) => {
|
||||||
console.log(item, 'item____')
|
console.log(item, 'item____')
|
||||||
iconItemValue.value = item
|
emit('update:icon', item)
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['update:icon'])
|
const emit = defineEmits(['update:icon'])
|
||||||
|
|
@ -134,16 +132,6 @@ const props = withDefaults(
|
||||||
icon: ''
|
icon: ''
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const iconValue = computed({
|
|
||||||
get: () => {
|
|
||||||
return [props.icon]
|
|
||||||
},
|
|
||||||
set: (value: any) => {
|
|
||||||
emit('update:icon', selectIconItem)
|
|
||||||
console.log(selectIconItem, 'selectIconItem______')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
</div>
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<router-link to="/setting/website/environment">
|
<router-link to="/setting/system/environment">
|
||||||
<div class="nav-item flex-col m-t-10">
|
<div class="nav-item flex-col m-t-10">
|
||||||
<view class="flex flex-center">
|
<view class="flex flex-center">
|
||||||
<img
|
<img
|
||||||
|
|
@ -216,7 +216,7 @@ export default defineComponent({
|
||||||
res.visitor.date.reverse().forEach((item: any) => {
|
res.visitor.date.reverse().forEach((item: any) => {
|
||||||
workbenchData.visitorOption.xAxis.data.push(item)
|
workbenchData.visitorOption.xAxis.data.push(item)
|
||||||
})
|
})
|
||||||
res.visitor.list[0].data.forEach((item: any) => {
|
res.visitor.list[0].forEach((item: any) => {
|
||||||
workbenchData.visitorOption.series[0].data.push(item)
|
workbenchData.visitorOption.series[0].data.push(item)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue