企业中心业务组织配置

qhw-dev-1010
qiuhongwu 1 year ago
parent ba7c34ac0e
commit e955c98eab

@ -7,7 +7,7 @@ VITE_PUBLIC_PATH = /
# 本地开发代理,可以解决跨域及多地址代理 # 本地开发代理,可以解决跨域及多地址代理
# 如果接口地址匹配到则会转发到http://localhost:3000防止本地出现跨域问题 # 如果接口地址匹配到则会转发到http://localhost:3000防止本地出现跨域问题
# 可以有多个,注意多个不能换行,否则代理将会失效 # 可以有多个,注意多个不能换行,否则代理将会失效
VITE_PROXY = [["/dev-api","http://192.168.0.162:8091/admin-api"],["/upload","http://192.168.0.162:8091/admin-api/infra/file/upload"]] VITE_PROXY = [["/dev-api","http://192.168.0.234:8091/admin-api"],["/upload","http://192.168.0.234:8091/admin-api/infra/file/upload"]]
# VITE_PROXY=[["/api","http://vben.xingyuv.com/test"]] # VITE_PROXY=[["/api","http://vben.xingyuv.com/test"]]
# 是否删除Console.log # 是否删除Console.log

@ -1,19 +1,27 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UnwrapRef, VueElement } from 'vue' import type { UnwrapRef, VueElement, nextTick } from 'vue'
import { onMounted, reactive, ref, watch } from 'vue' import { createVNode, getCurrentInstance, h, onMounted, reactive, ref, watch } from 'vue'
import { RedoOutlined, SearchOutlined, UserOutlined } from '@ant-design/icons-vue' import { ExclamationCircleOutlined, RedoOutlined, SearchOutlined, UserOutlined } from '@ant-design/icons-vue'
import type { FormProps, ItemType, MenuProps, SelectProps, TableColumnsType } from 'ant-design-vue' import type { FormProps, ItemType, MenuProps, SelectProps, TableColumnsType } from 'ant-design-vue'
import type { Dayjs } from 'dayjs' import type { Dayjs } from 'dayjs'
import { Modal } from 'ant-design-vue'
// this
// const { proxy }: any = getCurrentInstance
// key // key
const selectedKeys = ref<string[]>(['1']) const selectedKeys = ref<string[]>(['1'])
// //
const navopenKeys = ref<string[]>(['sub1']) const navopenKeys = ref<string[]>(['sub1'])
const title = ref<any>({
label:'',
key: '',
})
const items: any = reactive<ItemType[]>([
const items: any = reactive<ItemType[]>([]) ])
function getItem( function getItem(
label: VueElement | string, label: VueElement | string,
key: string, key: string,
@ -70,10 +78,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 +379,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 +434,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 +530,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 +654,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,7 +671,7 @@ 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;
@ -658,9 +679,8 @@ watch(navopenKeys, (val) => {
.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 +698,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";

@ -6,15 +6,9 @@ import type { SelectProps, UploadChangeParam, UploadProps } from 'ant-design-vue
import type { Rule } from 'ant-design-vue/es/form' import type { Rule } from 'ant-design-vue/es/form'
import type { Dayjs } from 'dayjs' import type { Dayjs } from 'dayjs'
// // //
const values = ref<any>('buyout') const wayvalues = ref<number>(1)
const payvalues = ref<number>(1)
const isVisible = ref(true)
// const isVisible2 = ref(false)
// const toggleBlocks: any = () => {
// isVisible.value = !isVisible.value
// isVisible2.value = !isVisible2.value
// }
type RangeValue = [Dayjs, Dayjs] type RangeValue = [Dayjs, Dayjs]
const dayvalue1 = ref<RangeValue>() const dayvalue1 = ref<RangeValue>()
@ -1546,36 +1540,101 @@ const RabbitStyle = [{
<a-form <a-form
:model="formState" :model="formState"
name="basic" name="basic"
:label-col="{ span: 5 }" :label-col="{ span: 2 }"
:wrapper-col="{ span: 13 }" :wrapper-col="{ span: 13 }"
autocomplete="off"
:rules="rules"
@finish="onFinish"
@finishFailed="onFinishFailed"
> >
<a-form-item <a-form-item
label="合作方式" label="合作方式"
name="username" name="username"
:rules="[{ required: true, message: '选择' }]"
> >
<a-radio-group v-model:value="values"> <a-radio-group v-model:value="wayvalues">
<a-radio :value="buyout"> <!-- 保留 -->
<a-radio class="rabiostyle" :value="1">
买断 买断
</a-radio> </a-radio>
<a-radio :value="joint"> <a-radio class="rabiostyle" :value="2">
联营 联营
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<div v-if="isVisible" class="buyout"> <div v-if="wayvalues === 1" class="buyout">
123 <a-form-item
label="结算方式"
name="username"
>
<a-radio-group v-model:value="payvalues">
<a-radio class="rabiostyle" :value="1">
先贷后款
</a-radio>
<a-radio class="rabiostyle" :value="2">
先款后贷
</a-radio>
</a-radio-group>
</a-form-item>
</div> </div>
<div v-else class="joint"> <div v-if="wayvalues === 2" class="joint">
321 321
</div> </div>
</a-form> </a-form>
</div> </div>
</div> </div>
<!-- 联系人信息 -->
<div class="representativemation">
<div class="moduletop">
<p>
<span></span>
联系人信息
</p>
</div>
<div class="mationtable">
<a-table :columns="mationtablecolumns" :data-source="mationtabledata">
<template #headerCell="{ column }">
<template v-if="column.key === 'type'">
<span>
类型
</span>
</template>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
{{ record.name }}
</template>
<template v-else-if="column.key === 'identificationphoto'">
<a :href="record.identificationphoto">
查看
</a>
</template>
<template v-else-if="column.key === 'Idnumber'">
<span>
{{ record.Idnumber }}
</span>
</template>
<template v-else-if="column.key === 'validity'">
<span>
{{ record.validity }}
</span>
</template>
<template v-else-if="column.key === 'impower'">
<a :hreflang="record.impower">
查看
</a>
</template>
<template v-else-if="column.key === 'turnover'">
<span>
{{ record.turnover }}
</span>
</template>
<template v-else-if="column.key === 'operate'">
<a>
<EditOutlined />
操作
</a>
</template>
</template>
</a-table>
</div>
</div>
</a-form> </a-form>
</div> </div>
</a-card> </a-card>
@ -1673,6 +1732,8 @@ const RabbitStyle = [{
.subdivide{ .subdivide{
width: 30%; width: 30%;
} }
.modaliy{}
} }
} }

Loading…
Cancel
Save