Merge branch 'qhw-dev-1010'

# Conflicts:
#	yunxi-ui-admin-vben/.env.development
ysq-dev-0811
qiuhongwu 1 year ago
commit e320886ff7

@ -70,10 +70,14 @@ async function fetchMenuItems() {
async function fetchData() {
try {
const data = await fetchMenuItems()
console.log(data)
// 使
// itemsreactivefetchData使spliceitemsfetchDataitems
items.splice(0, items.length, ...data.map(item => getItem(item.label, item.key, null, item.children)))
// items.value = data.map(item => getItem(item.label, item.key, null, item.children))
title.value.label = data[0].children[0].label
}
catch (error) {
console.error('Error fetching menu items:', error)
@ -367,36 +371,41 @@ const dataSource: any = [
},
]
// //
// function myFunction({ item, key, selectedKeys }) {
// // 使 itemkey selectedKeys
// console.log(item)
// console.log(key)
// console.log(selectedKeys)
// }
// // itemkey selectedKeys
// const data = {
// item: '',
// key: 'someKey',
// selectedKeys: ['key1', 'key2'],
// }
// myFunction(data)
//
const [modal, contextHolder] = Modal.useModal()
function showDeleteConfirm() {
modal.confirm({
title: '操作确认',
icon: h(ExclamationCircleOutlined),
content: '确认删除嘛',
okText: '确认',
okType: 'danger',
cancelText: '取消',
onOk() {
console.log('OK')
},
onCancel() {
console.log('Cancel')
},
})
}
onMounted(() => {
fetchData()
})
const handleClick: MenuProps['onClick'] = (e) => {
console.log(e)
const menusubhandleClick: MenuProps['onClick'] = (e) => {
// console.log('click', JSON.parse(JSON.stringify(e.item.originItemValue)) )
// alert(`${e.key}`)
title.value = JSON.parse(JSON.stringify(e.item.originItemValue))
console.log('click', e)
alert(`当前打开的是${e.key}`)
}
watch(navopenKeys, (val) => {
console.log('navopenKeys', val)
})
// watch(navopenKeys, (val) => {
// console.log('-----------')
// console.log('navopenKeys', val)
// })
</script>
<template>
@ -417,14 +426,14 @@ watch(navopenKeys, (val) => {
style="width: 256px;height: 900px;"
mode="inline"
:items="items"
@click="handleClick"
@click="menusubhandleClick"
/>
</div>
<div class="main">
<div class="designation">
<p>
<span></span>
{{ `车间名称` }}
{{ title.label }}
</p>
</div>
<!-- 表单 -->
@ -513,6 +522,7 @@ watch(navopenKeys, (val) => {
<a-col :span="24">
<a-table
class="ant-table-striped" :data-source="dataSource" :row-selection="rowSelection"
style="width: 1000px;"
:columns="columns"
:row-class-name="(_record, index) => (index % 2 === 1 ? 'table-tr-b' : 'table-tr-a')" :scroll="{ x: 1500, y: 500 }"
>
@ -636,7 +646,10 @@ watch(navopenKeys, (val) => {
</a-row>
</template>
<template v-else-if="column.key === 'key'">
<div><a>详情</a></div>
<div centered style="color: red;cursor:pointer" @click="showDeleteConfirm">
删除
</div>
<contextHolder />
</template>
</template>
</a-table>
@ -650,7 +663,7 @@ watch(navopenKeys, (val) => {
<style scoped lang="less">
.card{
box-sizing: border-box;
width: 90%;
width: 1800px;
margin: 0 auto;
overflow: hidden;
border-radius: 3px;
@ -658,9 +671,8 @@ watch(navopenKeys, (val) => {
.mainbody{
box-sizing: border-box;
display: flex;
width: 100%;
height: 1000px;
width: 1420px;
height: 942px;
.aside{
margin: 50px 0;
@ -678,7 +690,7 @@ watch(navopenKeys, (val) => {
margin: 10px 0 ;
p{
width: 110px;
width: 120px;
height: 24px;
margin-bottom: 15px;
font-family: "AlibabaPuHuiTi_3_55_Regular-55 Regular";

@ -1673,6 +1673,8 @@ const RabbitStyle = [{
.subdivide{
width: 30%;
}
.modaliy{}
}
}

Loading…
Cancel
Save