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