快捷入口开发中
This commit is contained in:
@@ -57,12 +57,18 @@
|
||||
<el-table-column label="投诉类型名称" align="center" prop="name" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_repair_project_status" :value="scope.row.status"></dict-tag>
|
||||
<el-switch
|
||||
@change="(val: string) => handleChange(val, scope.row)"
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
<!-- <dict-tag :options="com_repair_project_status" :value="scope.row.status"></dict-tag> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="creaateTime" width="180">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.creaateTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
@@ -157,7 +163,15 @@ const handleAdd = () => {
|
||||
path: '/system/addComplantType'
|
||||
});
|
||||
};
|
||||
|
||||
const handleChange = (val: string, row: ComplaintTypeVO) => {
|
||||
// updateChargeType({
|
||||
// id: row.id,
|
||||
// status: val
|
||||
// }).then(() => {
|
||||
// proxy?.$modal.msgSuccess('操作成功');
|
||||
// getList();
|
||||
// });
|
||||
};
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: ComplaintTypeVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
|
||||
@@ -208,7 +208,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: HouseFacilitiesVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除房屋设施管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除房屋设施管理?').finally(() => (loading.value = false));
|
||||
await delHouseFacilities(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -116,6 +116,7 @@ function init() {
|
||||
...find,
|
||||
projectLevel: find.projectLevel
|
||||
};
|
||||
handleChange(find.parentId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -197,7 +197,7 @@ const data = reactive<PageData<RepairProjectForm, RepairProjectQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 9999999,
|
||||
projectName: undefined,
|
||||
parentId: undefined,
|
||||
projectType: undefined,
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" min-width="120" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" min-width="150" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<div class="actions">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:waterdevice']">充值记录</el-button>
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<el-table-column label="设备分类名称" align="center" prop="categoryName" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<!-- TODO 设备状态开关 -->
|
||||
<el-switch :inactive-value="1" :active-value="0" v-model="scope.row.status"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column fixed="right" label="操作" width="180">
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.roleId !== 1" content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:role:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" fixed="right" width="400">
|
||||
<el-table-column align="center" label="操作" fixed="right" width="200">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.userId !== 1" content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
<div class="quickly_item_content">{{ item.name }}</div>
|
||||
</div>
|
||||
<div class="quickly_item add">
|
||||
<div @click="addQuieckDialog" class="quickly_item add">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span>添加</span>
|
||||
</div>
|
||||
@@ -228,6 +228,38 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 添加快捷入口 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="repairProjectFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="图标" prop="icon">
|
||||
<el-input v-model="form.icon" placeholder="请输入" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="页面" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入" />
|
||||
<el-tree
|
||||
ref="menuRef"
|
||||
class="tree-border"
|
||||
:data="menuOptions"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:check-strictly="false"
|
||||
empty-text="加载中,请稍候"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
>
|
||||
</el-tree>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<!-- <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button> -->
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -236,6 +268,7 @@ import summicon from '@/assets/images/index/summer.png';
|
||||
import repairEcharts from './components/repairEcharts.vue';
|
||||
import { delResident, listResident } from '@/api/system/resident';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { usePermissionStore } from '@/store/modules/permission';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
|
||||
@@ -258,12 +291,14 @@ import info from './assets/info.png';
|
||||
import profile from './assets/profile.png';
|
||||
import star from './assets/star.png';
|
||||
|
||||
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
|
||||
import { UploadUserFile } from 'element-plus';
|
||||
import { getVillageByIdAPI } from '@/api/system/community';
|
||||
import { getLast7Days, numToWeek2 } from '@/utils/time';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { workSpaceIncomeTrendListApi, workSpaceTotalListApi, workSpaceWeatherApi } from '@/api/workflow';
|
||||
import { getWeatherIcon } from '@/utils/weather';
|
||||
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_resident_type } = toRefs<any>(proxy?.useDict('com_resident_type'));
|
||||
@@ -504,6 +539,78 @@ function handleRouter(val: string) {
|
||||
path: val
|
||||
});
|
||||
}
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '添加快捷入口'
|
||||
});
|
||||
const menuOptions = ref<MenuTreeOption[]>([]);
|
||||
const form = ref({
|
||||
name: '',
|
||||
path: '',
|
||||
icon: ''
|
||||
});
|
||||
const rules = {
|
||||
name: [{ required: true, trigger: 'blur', message: '请输入快捷入口名称' }],
|
||||
path: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }]
|
||||
};
|
||||
function addQuieckDialog() {
|
||||
form.value = {
|
||||
name: '',
|
||||
path: '',
|
||||
icon: ''
|
||||
};
|
||||
const permissionStore = usePermissionStore();
|
||||
const routes = permissionStore.getDefaultRoutes();
|
||||
console.log(routes);
|
||||
handleroutestoshowlist(routes);
|
||||
dialog.visible = true;
|
||||
}
|
||||
function handleroutestoshowlist(rotues) {
|
||||
function _hanle(parentRoute, currentroute, level) {
|
||||
console.log(currentroute, level);
|
||||
let obj: {
|
||||
name: string;
|
||||
icon: string;
|
||||
path: string;
|
||||
level: number;
|
||||
children: unknown[];
|
||||
} = {};
|
||||
// 非页面路由和 二级路由
|
||||
if (currentroute.hidden || level === 2) {
|
||||
return null;
|
||||
}
|
||||
if (currentroute.meta) {
|
||||
obj = {
|
||||
name: currentroute.meta.title,
|
||||
icon: currentroute.meta.icon,
|
||||
path: currentroute.path,
|
||||
level: level,
|
||||
children: []
|
||||
};
|
||||
} else if (currentroute.path === '/') {
|
||||
obj = {
|
||||
name: '',
|
||||
icon: currentroute.meta.icon,
|
||||
path: currentroute.path,
|
||||
level: level,
|
||||
children: []
|
||||
};
|
||||
}
|
||||
// 传过来父级path 拼接
|
||||
if (parentRoute) {
|
||||
obj.path = parentRoute.path + '/' + currentroute.path;
|
||||
}
|
||||
// 没有按钮第三级 普遍是 删除按钮操作
|
||||
if (level < 2) {
|
||||
obj.children = currentroute.children.map((item) => _hanle(obj, item, level + 1)).filter((item) => item);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
// const arr = rotues.map((ele) => _hanle(null, ele, 1)).filter((item) => item);
|
||||
// console.log(arr);
|
||||
}
|
||||
// ! 快捷入口
|
||||
|
||||
// ! 创建办事记录
|
||||
|
||||
Reference in New Issue
Block a user