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

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

Loading…
Cancel
Save