数通互联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
5.3 KiB

1 year ago
<!--
@ 作者: 秦东
@ 时间: 2024-07-20 15:31:12
@ 备注: 应用设置
1 year ago
-->
<script lang='ts' setup>
import { SearchForm,customerFormCont,customerFormConfig } from "@/api/DesignForm/type";
import { customerFormGroupList,editFormGroupState,createApp,gainAppEditPsge } from '@/api/DesignForm/requestapi'
import { Search } from '@element-plus/icons-vue'
1 year ago
//引入页面
import AppCardPage from "@/views/sysworkflow/lowcodepage/appCardPage.vue"
import AppListPage from "@/views/sysworkflow/lowcodepage/appListPage.vue"
1 year ago
const contbody = ref() //实例化内容容器
const carPage = ref()
const appListPage = ref()
const appGroup = ref("1")
1 year ago
const page = ref<number>(1) //页码
const pageSize = ref<number>(12000) //每页显示几个
1 year ago
const pageTotal = ref<number>(0) //总记录数
const groupFormList = ref<any[]>([]) //记录数组
const drawerWith = ref(); //抽屉宽度
const searchQuery = reactive({
page:1,
pagesize:20,
searchWork:""
})
const isClick = ref(1)
1 year ago
/**
@ 作者: 秦东
@ 时间: 2024-03-21 09:30:27
@ 功能: 获取表单分组
*/
const gainFormGroup = () => {
let sendInfo = {
page:page.value,
pagesize:pageSize.value,
state:1
}
customerFormGroupList(sendInfo)
.then((data) =>{
1 year ago
pageTotal.value = data.data.total
// pageTotal.value = 400
1 year ago
groupFormList.value = data.data.list
if(data.data.list&&data.data.list.length > 0){
let otherGroup = true
data.data.list.forEach((item,index)=>{
if(item.isTrue){
appGroup.value = item.idStr.toString()
otherGroup = false
}
})
if(otherGroup){
let lengNum = data.data.list.length
data.data.list.forEach((item,index)=>{
if(lengNum > 1){
if(index == 1){
appGroup.value = item.idStr.toString()
}
}else{
if(index == 0){
appGroup.value = item.idStr.toString()
}
}
})
}
}
1 year ago
})
1 year ago
}
const handleClick = (val:any) => {
console.log("换挡",val,appGroup)
}
1 year ago
/**
@ 作者: 秦东
@ 时间: 2024-07-22 08:50:03
@ 功能: 改变视图展示模式
1 year ago
*/
const viewChannel = (val:number) =>{
isClick.value = val;
1 year ago
}
1 year ago
onMounted(()=>{
drawerWith.value = contbody.value?.clientWidth
gainFormGroup()
})
/**
@ 作者: 秦东
@ 时间: 2024-07-20 16:19:45
@ 功能: 获取表单数据
*/
const handleCurrentChange = (val:any) => {}
/**
@ 作者: 秦东
@ 时间: 2024-07-22 10:08:33
@ 功能: 搜索
*/
const searchSub = () =>{
if(isClick.value == 1){
carPage.value.getFormAppList(searchQuery)
}else{
appListPage.value.getFormAppList(searchQuery)
}
}
/**
@ 作者: 秦东
1 year ago
@ 时间: 2024-04-01 14:27:51
@ 功能: 获取容器宽度
*/
const getRongQiAttr = () => {
drawerWith.value = contbody.value?.clientWidth
}
</script>
<template>
<div ref="contbody" class="tab-box">
<el-tabs v-model="appGroup" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane v-for="item in groupFormList" :key="item.idStr" :label="item.title" :name="item.idStr"></el-tab-pane>
</el-tabs>
<div class="appSubButton">
<el-input
v-model="searchQuery.searchWork"
style="max-width: 150px;margin: 15px 10px 15px 0;"
placeholder="请输入名称"
class="input-with-select"
clearable
>
<template #append>
<el-button :icon="Search" @click="searchSub()" />
1 year ago
</template>
</el-input>
<el-button-group class="butGroup">
<el-button class="fa fa-object-group" :color="isClick==1?'#a0cfff':''" @click="viewChannel(1)" />
<el-button class="fa fa-table" :color="isClick!=1?'#a0cfff':''" @click="viewChannel(2)" />
1 year ago
<el-dropdown>
<el-button class="fa fa-reorder leftLink" />
<template #dropdown>
<el-dropdown-item @click="handleCommand('addFormGroup',appGroup)" >新增分组</el-dropdown-item>
<el-dropdown-item @click="handleCommand('addForm',appGroup)" style="display:none" >添加表单</el-dropdown-item>
<el-dropdown-item @click="handleCommand('addFormApp',appGroup)" >添加应用</el-dropdown-item>
<el-dropdown-item @click="editFormGroup(appGroup)" divided>编辑</el-dropdown-item>
<el-dropdown-item @click="eidtGroupStatus(appGroup,3)">删除</el-dropdown-item>
</template>
</el-dropdown>
</el-button-group>
1 year ago
</div>
</div>
<div class="app-container">
<AppCardPage ref="carPage" v-if="isClick==1" :app-group="appGroup" :search-query="searchQuery" :drawer-with="drawerWith" @getRongQiAttr="getRongQiAttr" />
<AppListPage ref="appListPage" v-else :app-group="appGroup" :search-query="searchQuery" :drawer-with="drawerWith" @getRongQiAttr="getRongQiAttr" />
1 year ago
</div>
</template>
<style lang='scss' scoped>
.app-container {
height: calc(100% - 125px);
width: calc(100% - 40px);
1 year ago
}
.tab-box{
margin: 20px;
height: 63px;
background: #fff;
border-radius: 5px;
padding: 0 20px;
1 year ago
display: flex;
justify-content: space-between;
.appSubButton{
1 year ago
display: flex;
justify-content: space-between;
.butGroup{
margin-top: 15px;
}
.leftLink{
border-left : 1px solid #ccc;
1 year ago
}
}
::v-deep(.el-tabs){
height: 63px;
width: calc(100% - 300px);
}
::v-deep(.el-tabs__nav){
height: 63px;
font-size: 16px;
}
::v-deep(.el-tabs__item){
margin-top: 15px;
font-size: 16px;
}
::v-deep(.el-tabs__nav-prev){
line-height:0px;
margin-top:30px;
}
::v-deep(.el-tabs__nav-next){
line-height:0px;
margin-top:30px;
}
1 year ago
}
.el-dropdown-link{
font-size:30px;
margin-top: 20px;
margin-left: 10px;
1 year ago
}
</style>